Skip to content

Commit 614114e

Browse files
Merge pull request #146 from alliander-opensource/feature/doc-os-move
OS docs move and fix links
2 parents 1ef2652 + e61e353 commit 614114e

File tree

18 files changed

+67
-80
lines changed

18 files changed

+67
-80
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,3 +506,7 @@ cpp_coverage.xml
506506

507507
# generated version file
508508
PYPI_VERSION
509+
510+
# docs builds
511+
docs/make.bat
512+
docs/Makefile

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ SPDX-License-Identifier headers are used to show which license is applicable.
6060
The concerning license files can be found in the [LICENSES](LICENSES) directory.
6161

6262
# Contributing
63-
Please read [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) and [CONTRIBUTING](CONTRIBUTING.md) for details on the process
63+
Please read [CODE_OF_CONDUCT](docs/CODE_OF_CONDUCT.md), [CONTRIBUTING](docs/CONTRIBUTING.md), [PROJECT GOVERNANCE](docs/PROJECT_GOVERNANCE.md) and [RELEASE](docs/release_and_support/RELEASE.md) for details on the process
6464
for submitting pull requests to us.
6565

6666
# Contact
67-
Please read [SUPPORT](SUPPORT.md) for how to connect and get into contact with the Power Gird Model project.
67+
Please read [SUPPORT](docs/release_and_support/SUPPORT.md) for how to connect and get into contact with the Power Gird Model project.

CODE_OF_CONDUCT.md renamed to docs/CODE_OF_CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai
6969

7070
This Code of Conduct is adapted from the Contributor Covenant, version 1.4,
7171
available at
72-
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
[](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html)

CONTRIBUTING.md renamed to docs/CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ We recognize different levels of contributions as shown below in increasing orde
2727

2828
The repository folder structure is as follows. The `examples`, `docs` and `scripts` folders are self-explanatory.
2929

30-
- The C++ calculation core is inside [include/power-grid-model](include/power-grid-model).
31-
- The python interface code is in [src/power_grid_model](src/power_grid_model)
32-
- The code for validation of input data is in [validation](src/power_grid_model/validation) folder.
33-
- The [tests](tests) folder is divided in the following way:
30+
- The C++ calculation core is inside {{ "[include/power-grid-model]({}/include/power-grid-model)".format(gh_link_head_tree) }}.
31+
- The python interface code is in {{ "[src/power_grid_model]({}/src/power_grid_model)".format(gh_link_head_tree) }}
32+
- The code for validation of input data is in {{ "[validation]({}/src/power_grid_model/validation)".format(gh_link_head_tree) }} folder.
33+
- The [tests]({{ gh_link_head}}tests) folder is divided in the following way:
3434
- `cpp_unit_tests` contains the tests for the C++ calculation core.
3535
- `benchmark_cpp` contains a benchmark test case generator in C++.
3636
- `unit` folder contains tests for the python code.
@@ -77,7 +77,7 @@ Tip: Use [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to format
7777
This project uses [pre-commit](https://pre-commit.com/) to run a list of checks (and perform some automatic
7878
corrections) to your code (style) before each commit. It is up to the developer to choose whether you would like to
7979
use this tool or not. The goal is to make sure that each commit will pass the quality checks in the github actions
80-
workflow. Currently, these hooks are defined in [`.pre-commit-config.yaml`](.pre-commit-config.yaml):
80+
workflow. Currently, these hooks are defined in {{ "[`.pre-commit-config.yaml`]({}/.pre-commit-config.yaml)".format(gh_link_head_blob) }}:
8181
* **reuse**: check if all licence headers and files are in place
8282
* **isort**: group and sort import statements
8383
* **black**: check and correct code style in a very strict manner
File renamed without changes.

docs/advanced_documentation/build-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ pytest
174174
### Build CMake Project
175175

176176
There is a convenient shell script to build the cmake project:
177-
[`build.sh`](../build.sh). You can study the file and write your own build script. Four configurations are pre-defined
177+
{{ "[`build.sh`]({}/build.sh)".format(gh_link_head_blob) }}. You can study the file and write your own build script. Four configurations are pre-defined
178178
for two input arguments, which will be passed into `cmake`. It includes debug or release build, as well as the option to
179179
build test coverage or not.
180180

docs/conf.py

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,23 @@
1111
copyright = "2022, alliander-opensource"
1212
author = "alliander-opensource"
1313

14+
# -- Setup
15+
16+
import os
17+
18+
# Fix linking in github and rtd
19+
link_head_gh = "https://github.com/alliander-opensource/power-grid-model/"
20+
if "READTHEDOCS" in os.environ:
21+
import git
22+
23+
commit_version = git.Repo(search_parent_directories=True).head.object.hexsha
24+
link_head_gh_blob = link_head_gh + "blob/" + commit_version
25+
link_head_gh_tree = link_head_gh + "tree/" + commit_version
26+
else:
27+
link_head_gh_blob = ""
28+
link_head_gh_tree = ""
29+
30+
1431
# -- General configuration ---------------------------------------------------
1532
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
1633

@@ -37,9 +54,22 @@
3754
"*/.ipynb_checkpoints/*",
3855
]
3956

40-
# -- myst parser config ------------------------------------------------------
57+
# -- myst parser and myst_nb config ------------------------------------------------------
4158
# label references for depth of headers: label name in anchor slug structure
4259
myst_heading_anchors = 3
60+
# execute jupter notebooks output before building webpage
61+
jupyter_execute_notebooks = "off"
62+
# Extentions in myst
63+
myst_enable_extensions = [
64+
"dollarmath",
65+
"substitution",
66+
]
67+
# Global substitutions
68+
myst_substitutions = {
69+
"gh_link_head_blob": link_head_gh_blob,
70+
"gh_link_head_tree": link_head_gh_tree,
71+
}
72+
4373

4474
# -- hoverxref config --------------------------------------------------------
4575
# hover tooltip on python classes
@@ -69,7 +99,3 @@
6999

70100
# -- sphinx.autosectionlabel config -------------------------------------------
71101
autosectionlabel_prefix_document = True
72-
73-
# -- myst_parser or myst_nb -------------------------------------------------
74-
# markdown links [](relative_path\file.ext#section-in-slug)
75-
myst_heading_anchors = 3

docs/contribution/CODE_OF_CONDUCT.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/contribution/CONTRIBUTING.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/contribution/PROJECT_GOVERNANCE.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)