diff options
| author | Adam Janovsky | 2022-05-21 09:41:28 +0200 |
|---|---|---|
| committer | Adam Janovsky | 2022-05-21 09:41:28 +0200 |
| commit | b01f20c1b219199ab4e1369c8cfa47c1409ba443 (patch) | |
| tree | 990004636dbeaaeb320fdb438896062dd5769d06 /docs | |
| parent | 4fe5372ec385c3662a7a05d75ec40922d40c414e (diff) | |
| download | sec-certs-b01f20c1b219199ab4e1369c8cfa47c1409ba443.tar.gz sec-certs-b01f20c1b219199ab4e1369c8cfa47c1409ba443.tar.zst sec-certs-b01f20c1b219199ab4e1369c8cfa47c1409ba443.zip | |
Docs: configuratiom.md without editing makefile
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/Makefile | 7 | ||||
| -rw-r--r-- | docs/configuration.md | 26 | ||||
| -rwxr-xr-x | docs/generate_config_page.py | 20 |
3 files changed, 26 insertions, 27 deletions
diff --git a/docs/Makefile b/docs/Makefile index 0405fafe..d4bb2cbb 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -17,11 +17,4 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @if [ "$@" = "html" ]; then \ - chmod +x ./generate_config_page.py ;\ - python3 ./generate_config_page.py ;\ - fi @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - @if [ "$@" = "html" ]; then \ - rm ./configuration.md ;\ - fi
\ No newline at end of file diff --git a/docs/configuration.md b/docs/configuration.md new file mode 100644 index 00000000..27d07760 --- /dev/null +++ b/docs/configuration.md @@ -0,0 +1,26 @@ +--- +file_format: mystnb +mystnb: + remove_code_source: true + execution_mode: 'force' +--- +# Configuration + +The configuration is stored in yaml file `settings.yaml` at `sec_certs.config`. These are the supported options, descriptions and default values. + + +```{code-cell} python +from sec_certs.config import configuration +from myst_nb import glue +from IPython.display import Markdown + +cfg = configuration.config +text = "" +for key in cfg.__dict__: + text += f"`{key}`\n\n- Description: {cfg.get_desription(key)}\n" + text += f"- Default value: `{cfg.__getattribute__(key)}`\n\n" +glue("text", Markdown(text)) +``` +```{glue:md} text +:format: myst +``` diff --git a/docs/generate_config_page.py b/docs/generate_config_page.py deleted file mode 100755 index d928c178..00000000 --- a/docs/generate_config_page.py +++ /dev/null @@ -1,20 +0,0 @@ -# This will generate configuration.md page from `settings.yaml` in sec_certs.configuration file - -from sec_certs.config import configuration - - -def main(): - cfg = configuration.config - - with open("./configuration.md", "w") as handle: - handle.write("# Configuration\n\n") - handle.write( - "The configuration is stored in yaml file `settings.yaml` at `sec_certs.config`. These are the supported options, descriptions and default values.\n\n" - ) - for key in cfg.__dict__: - handle.write(f"`{key}`\n\n- Description: {cfg.get_desription(key)}\n") - handle.write(f"- Default value: `{cfg.__getattribute__(key)}`\n\n") - - -if __name__ == "__main__": - main() |
