From 6682fedc7abd0ab4922c6a1d2b94259af97b806e Mon Sep 17 00:00:00 2001 From: Lambert Theisen <lambert.theisen@rwth-aachen.de> Date: Tue, 21 Nov 2023 17:00:49 +0100 Subject: [PATCH] add more stuff --- README.md | 80 ++++++++++++++++++- docs/make.jl | 4 +- docs/src/api.md | 14 ++++ docs/src/index.md | 7 +- docs/src/lecture/1-git.md | 5 +- docs/src/lecture/2-julia_project_structure.md | 2 +- docs/src/lecture/3-julia_documentation.md | 2 +- docs/src/lecture/4-julia_testing.md | 2 +- src/Addition.jl | 9 ++- 9 files changed, 112 insertions(+), 13 deletions(-) create mode 100644 docs/src/api.md diff --git a/README.md b/README.md index 7963650..fde7f04 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,81 @@ # Sustainable Software Engineering -TODO -Link to lecture material +## Installation + +1. **Clone the Repository:** + ``` + git clone https://github.com/username/project-name.git + ``` +2. **Navigate to the Project Directory:** + ``` + cd project-name + ``` + +## Running the Project + +1. **Start Julia:** + Open Julia REPL by running `julia` in your terminal. + +2. **Activate and Instantiate the Project:** + ```julia + using Pkg + Pkg.activate(".") + Pkg.instantiate() + ``` + +3. **Run the Project:** + ```julia + using SustainableSoftwareEngineering + add(1,2) + # 3 + ``` + +## Test the Project + +1. **Start Julia:** + Open Julia REPL by running `julia` in your terminal. + +2. **Activate, Instantiate and Test the Project:** + ```julia + using Pkg + Pkg.activate(".") + Pkg.instantiate() + Pkg.test() + ``` + +## Build Documentation of Project + +1. **Start Julia:** + Open Julia REPL by running `julia` in your terminal. + +2. **Activate, Instantiate and Test the Project:** + ```julia + using Pkg + Pkg.activate(".") + Pkg.instantiate() + include("docs/make.jl") + ``` + +3. **Open in browser** + ```bash + # e.g. + firefox docs/build/index.html + ``` + +## Troubleshooting + +- Note that the following throws an error: +```julia +using SustainableSoftwareEngineering +add("a","b") +# ERROR: ... +``` + +## Example Files + +- See [`examples` Folder](./examples) + +## Contact +- Lambert Theisen +- `lambert.theisen@ians.uni-stuttgart.de` diff --git a/docs/make.jl b/docs/make.jl index 56ac095..bf7ef2f 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,13 +1,15 @@ push!(LOAD_PATH,"../src/") push!(LOAD_PATH,"src/") -using Documenter, SustainableSoftwareEngineering +using SustainableSoftwareEngineering +using Documenter makedocs( sitename="SustainableSoftwareEngineering.jl", remotes = nothing, pages = Any[ "Home" => "index.md", + "API" => "api.md", # add all lecture material joinpath.( "lecture", diff --git a/docs/src/api.md b/docs/src/api.md new file mode 100644 index 0000000..25b5750 --- /dev/null +++ b/docs/src/api.md @@ -0,0 +1,14 @@ +# Developer Documentation + +## API + +```@autodocs +Modules = [SustainableSoftwareEngineering] +Private = true +Order = [:function, :type] +``` + +## Index + +```@index +``` diff --git a/docs/src/index.md b/docs/src/index.md index 1c01412..05f94e1 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,3 +1,6 @@ -# Example.jl Documentation +# SustainableSoftwareEngineering.jl -Hi +## Table of Contents + +```@contents +``` diff --git a/docs/src/lecture/1-git.md b/docs/src/lecture/1-git.md index 1bee4a9..77a6eae 100644 --- a/docs/src/lecture/1-git.md +++ b/docs/src/lecture/1-git.md @@ -1,4 +1,4 @@ -# Introduction to Git +# Version Control: Introduction to Git ## What is Git? @@ -37,7 +37,4 @@ git config --global user.email "your.email@example.com" - https://aeturrell.github.io/coding-for-economists/wrkflow-version-control.html - https://merely-useful.tech/py-rse/git-cmdline.html -TODO -Addd some images to visualize -Add further reading Explain gitignore and make example diff --git a/docs/src/lecture/2-julia_project_structure.md b/docs/src/lecture/2-julia_project_structure.md index d2127f2..e37c03b 100644 --- a/docs/src/lecture/2-julia_project_structure.md +++ b/docs/src/lecture/2-julia_project_structure.md @@ -1,4 +1,4 @@ -# Julia Project Structure +# Julia: Project Structure This lecture focuses on the structure and management of Julia-specific projects. We will cover how to create a project using the Package Manager, the purpose of various directories and files, and best practices for maintaining a Julia project. diff --git a/docs/src/lecture/3-julia_documentation.md b/docs/src/lecture/3-julia_documentation.md index aa18fdb..6395d47 100644 --- a/docs/src/lecture/3-julia_documentation.md +++ b/docs/src/lecture/3-julia_documentation.md @@ -1,4 +1,4 @@ -# Julia Documentation +# Julia: Documentation In this lecture, we'll explore how to effectively document Julia code. We'll cover the use of doc strings, introduce Documenter.jl for creating comprehensive documentation, and discuss how to build and host a documentation website. diff --git a/docs/src/lecture/4-julia_testing.md b/docs/src/lecture/4-julia_testing.md index e928b93..35af662 100644 --- a/docs/src/lecture/4-julia_testing.md +++ b/docs/src/lecture/4-julia_testing.md @@ -1,5 +1,5 @@ -# Testing in Julia +# Julia: Testing This lecture aims to provide a comprehensive guide on testing practices in Julia. We will explore the importance of unit tests, delve into coverage aspects, and discuss the integration of automatic testing using continuous integration (CI) tools. diff --git a/src/Addition.jl b/src/Addition.jl index 20515a3..9d748b1 100644 --- a/src/Addition.jl +++ b/src/Addition.jl @@ -1,7 +1,7 @@ export add """ -add(x, y) + add(x, y) Compute the sum of `x` and `y`. @@ -9,10 +9,17 @@ Compute the sum of `x` and `y`. - `x::Int`: The first integer - `y::Int`: The second integer +## Mathematical formula + +```math + (x,y) \\mapsto x+y +``` + # Examples ```julia julia> add(2, 3) 5 +``` """ function add(x::Int, y::Int) return x + y -- GitLab