-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from Electa-Git/fix-docs
Fix docs
- Loading branch information
Showing
7 changed files
with
68 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
name: Documentation | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
branches: | ||
- master | ||
tags: '*' | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
schedule: | ||
- cron: '0,5,10 13 * * *' | ||
|
||
jobs: | ||
docs: | ||
if: "!contains(github.event.head_commit.message, 'skip ci')" | ||
name: Documentation | ||
build: | ||
permissions: | ||
contents: write | ||
statuses: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@latest | ||
- uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@v1 | ||
with: | ||
version: '1' | ||
- name: Install Dependencies | ||
run: julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' | ||
- name: Build and Deploy | ||
- name: Install dependencies | ||
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' | ||
- name: Build and deploy | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} | ||
run: julia --project=docs docs/make.jl | ||
run: julia --project=docs/ docs/make.jl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,36 @@ | ||
# Building the Documentation for PowerModels.jl | ||
# Documentation for PowerModelsACDC.jl | ||
|
||
## Installation | ||
We rely on [Documenter.jl](https://github.com/JuliaDocs/Documenter.jl). To install it, run the following command in a julia session: | ||
You can read this documentation online at | ||
<https://electa-git.github.io/PowerModelsACDC.jl/dev/>. | ||
|
||
```julia | ||
Pkg.add("Documenter") | ||
``` | ||
## Preview the documentation (for developers) | ||
|
||
## Building the Docs | ||
To preview the html output of the documents, run the following command: | ||
While developing PowerModelsACDC.jl, you can preview the documentation locally in your | ||
browser with live-reload capability. | ||
In other words, when you modify a file, every browser tab that is currently displaying the | ||
corresponding page is automatically refreshed. | ||
|
||
```julia | ||
julia --color=yes make.jl | ||
``` | ||
### Instructions for *nix | ||
|
||
You can then view the documents in `build/index.html`. | ||
1. Copy the following zsh/Julia code snippet: | ||
|
||
**Warning**: Do not `git commit` the contents of build (or any other content generated by Documenter) to your repository's master branch. This helps to avoid including unnessesary changes for anyone reviewing commits that happen to include documentation changes. | ||
```julia | ||
#!/bin/zsh | ||
#= # The following line is zsh code | ||
julia -i $0:a # The string `$0:a` represents this file in zsh | ||
=# # Following lines are Julia code | ||
import Pkg | ||
Pkg.activate(; temp=true) | ||
Pkg.develop("PowerModelsACDC") | ||
Pkg.add("Documenter") | ||
Pkg.add("LiveServer") | ||
using PowerModelsACDC, LiveServer | ||
cd(dirname(dirname(pathof(PowerModelsACDC)))) | ||
servedocs() | ||
exit() | ||
``` | ||
|
||
For further details, please read the [documentation for Documenter.jl](https://juliadocs.github.io/Documenter.jl/stable/). | ||
2. Save it as a zsh script (name it like `preview_powermodelsacdc_docs.sh`). | ||
3. Assign execute permission to the script: `chmod u+x preview_powermodelsacdc_docs.sh`. | ||
4. Run the script. | ||
5. Open your favorite web browser and navigate to `http://localhost:8000`. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
using Documenter, PowerModelsACDC | ||
|
||
Documenter.makedocs( | ||
modules = PowerModelsACDC, | ||
format = Documenter.HTML(), | ||
makedocs( | ||
modules = [PowerModelsACDC], | ||
sitename = "PowerModelsACDC", | ||
authors = "Frederik Geth, Hakan Ergun", | ||
warnonly = :missing_docs, | ||
pages = [ | ||
"Home" => "index.md", | ||
"Home" => "index.md" | ||
"Manual" => [ | ||
"Getting Started" => "quickguide.md", | ||
"Results" => "result-data.md", | ||
], | ||
"Getting Started" => "quickguide.md" | ||
"Results" => "result-data.md" | ||
] | ||
"Library" => [ | ||
"Network Formulations" => "formulations.md", | ||
"Problem Specifications" => "specifications.md", | ||
"Problem Types" => "problems.md", | ||
"Network Formulations" => "formulations.md" | ||
"Problem Specifications" => "specifications.md" | ||
"Problem Types" => "problems.md" | ||
"Modeling Components" => [ | ||
"Objective" => "objective.md", | ||
"Variables" => "variables.md", | ||
"Constraints" => "constraints.md", | ||
], | ||
"Objective" => "objective.md" | ||
"Variables" => "variables.md" | ||
"Constraints" => "constraints.md" | ||
] | ||
"File IO" => "parser.md" | ||
], | ||
] | ||
] | ||
) | ||
|
||
Documenter.deploydocs( | ||
deploydocs( | ||
repo = "github.com/Electa-Git/PowerModelsACDC.jl.git" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters