Skip to content
Snippets Groups Projects
Commit 67cd4253 authored by Karim Ahmed's avatar Karim Ahmed Committed by Karim Ahmed
Browse files

improve code reference

parent 2c2f5dbb
1 merge request!820[Documentation] Introduce mkdocs and add new documentation pages
# Calibration tools
::: cal_tools.gotthard2.gotthard2lib
::: cal_tools.epix100.epix100lib
::: cal_tools.tools
\ No newline at end of file
# CalCAT Interface
??? Note "This module help in skipping calibrationDBRemote"
![Calibration DB Remote avoided](static/../../static/xfel_calibrate_diagrams/xfel-calibrate_cli_process_no_caldbremote.png)
::: cal_tools.calcat_interface
\ No newline at end of file
......@@ -7,7 +7,8 @@ import mkdocs_gen_files
nav = mkdocs_gen_files.Nav()
for path in sorted(Path("src").rglob("*.py")):
for path in sorted(Path("src").rglob("*.py")):
module_path = path.relative_to("src").with_suffix("")
doc_path = path.relative_to("src").with_suffix(".md")
......@@ -19,7 +20,7 @@ for path in sorted(Path("src").rglob("*.py")):
if parts[-1] == "__init__":
parts = parts[:-1]
print("init parts:", parts)
if parts[-1] in ["notebooks", "settings", "calcat_interface", "restful_config", "__main__"]:
if parts[-1] in ["notebooks", "settings", "restful_config", "__main__"]:
continue
nav[parts] = doc_path.as_posix()
......@@ -27,9 +28,16 @@ for path in sorted(Path("src").rglob("*.py")):
with mkdocs_gen_files.open(full_doc_path, "w") as fd:
identifier = ".".join(parts)
print("::: " + identifier, file=fd)
if "calcat_interface" == full_doc_path.stem:
print(
"""
??? Note "This module help in skipping calibrationDBRemote"
![Calibration DB Remote avoided](../xfel-calibrate_cli_process_no_caldbremote.png)
""",
file=fd)
print("::: " + "src." + identifier, file=fd)
mkdocs_gen_files.set_edit_path(full_doc_path, path)
with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file:
nav_file.writelines(nav.build_literate_nav())
with mkdocs_gen_files.open(f"reference/summary.md", "w") as nav_file:
nav_file.writelines(nav.build_literate_nav())
mkdocs>=1.4.0
mkdocs-material~=9.0.0
mkdocstrings[python]>=0.18
mkdocs==1.4.2
mkdocs-material==9.0.15
mkdocstrings[python]==0.19
mkdocs-glightbox
mkdocs-section-index~=0.3.4
mkdocs-literate-nav~=0.5.0
mkdocs-redirects~=1.2.0
mkdocs-jupyter~=0.24.0
mkdocs-gen-files~=0.4.0
\ No newline at end of file
mkdocs-section-index==0.3.5
mkdocs-literate-nav==0.5.0
mkdocs-redirects==1.2.0
mkdocs-jupyter==0.24.0
mkdocs-gen-files==0.4.0
\ No newline at end of file
......@@ -46,13 +46,6 @@ markdown_extensions:
- tables
- codehilite
mkdocstrings.extension:
default_handler: python
handlers:
python:
selector: "python"
syntax: sphinx
extra_css:
- css/custom.css
......@@ -61,20 +54,14 @@ plugins:
- literate-nav:
nav_file: SUMMARY.md
- mkdocstrings:
default_handler: python
handlers:
python:
selector: "python"
syntax: sphinx
# default_handler: python
# handlers:
# python:
# selection:
# docstring_style: sphinx
# line_length: 81
# merge_init_into_class: true
# show_if_no_docstring: true
# docstring_section_style: list
import:
- https://docs.python-requests.org/en/master/objects.inv
paths: [../src]
synatx: sphinx
docstring_section_style: list
docstring_style: sphinx
- search
- autorefs
- mkdocs-jupyter:
......@@ -102,9 +89,7 @@ nav:
- How to write a notebook: development/how_to_write_xfel_calibrate_notebook_NBC.ipynb
- Configuration: development/configuration.md
- Advanced topics: development/advanced.md
- Code Reference:
- CALCAT Interface: code_reference/calcat_interface.md
- Code Reference: reference/
- Code Reference: reference/
- Reference:
- FAQ: references/faq.md
- Changelog: references/changelog.md
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment