Skip to content
Snippets Groups Projects
Commit 42d3733d authored by Karim Ahmed's avatar Karim Ahmed
Browse files

Remove troubleshooting pages and fix code documentation generation

parent cd50c82e
No related branches found
No related tags found
1 merge request!820[Documentation] Introduce mkdocs and add new documentation pages
...@@ -5,40 +5,33 @@ from pathlib import Path ...@@ -5,40 +5,33 @@ from pathlib import Path
import mkdocs_gen_files import mkdocs_gen_files
nav = mkdocs_gen_files.Nav() src = Path(__file__).parent.parent / "src"
for directory in ["src"]:
for path in sorted(Path(directory).rglob("*.py")):
module_path = path.relative_to(directory).with_suffix("")
doc_path = path.relative_to(directory).with_suffix(".md") nav = mkdocs_gen_files.Nav()
full_doc_path = Path("reference", doc_path)
parts = list(module_path.parts) for path in sorted(src.rglob("*.py")):
if parts[-1] in [ module_path = path.relative_to(src).with_suffix("")
"notebooks", "settings", doc_path = path.relative_to(src).with_suffix(".md")
"restful_config", "__main__", full_doc_path = Path("reference", doc_path)
"__init__", "listen_kafka", parts = list(module_path.parts)
"sqlite_view", "manual_launch"
"messages",
]:
continue
nav[parts] = doc_path.as_posix() if parts[-1] in [
"notebooks", "settings",
"restful_config", "__main__",
"__init__", "listen_kafka",
"sqlite_view", "manual_launch"
"messages",
]:
continue
with mkdocs_gen_files.open(full_doc_path, "w") as fd: nav[parts] = doc_path.as_posix()
identifier = ".".join(parts) with mkdocs_gen_files.open(full_doc_path, "w") as fd:
if "calcat_interface" == full_doc_path.stem: ident = ".".join(parts)
# adding an note and image for calcat_interface.py fd.write(f"::: {ident}")
print("""??? Note "This module help in skipping calibrationDBRemote"\n\t[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) mkdocs_gen_files.set_edit_path(full_doc_path, path)
with mkdocs_gen_files.open(f"reference/SUMMARY.md", "w") as nav_file: with mkdocs_gen_files.open(f"reference/SUMMARY.md", "w") as nav_file:
nav_file.writelines(nav.build_literate_nav()) nav_file.writelines(nav.build_literate_nav())
# Troubleshooting Calibration constants generation
\ No newline at end of file
# Troubleshooting correction
\ No newline at end of file
...@@ -65,20 +65,20 @@ plugins: ...@@ -65,20 +65,20 @@ plugins:
- glightbox - glightbox
- search - search
- autorefs - autorefs
# - gen-files: - gen-files:
# scripts: scripts:
# - docs/gen_ref_pages.py - docs/gen_ref_pages.py
- literate-nav: - literate-nav:
nav_file: SUMMARY.md nav_file: SUMMARY.md
- section-index - section-index
# - mkdocstrings: - mkdocstrings:
# handlers: handlers:
# python: python:
# import: import:
# - https://docs.python-requests.org/en/master/objects.inv - https://docs.python-requests.org/en/master/objects.inv
# paths: [src] # paths: [src/cal_tools]
# docstring_style: "sphinx" docstring_style: "sphinx"
# docstring_section_style: "list" docstring_section_style: "list"
repo_url: https://git.xfel.eu/calibration/pycalibration repo_url: https://git.xfel.eu/calibration/pycalibration
...@@ -92,9 +92,6 @@ nav: ...@@ -92,9 +92,6 @@ nav:
- Calibration webservice: - Calibration webservice:
- The webservice: operation/webservice.md - The webservice: operation/webservice.md
- Calibration Configuration: operation/calibration_configurations.md - Calibration Configuration: operation/calibration_configurations.md
- Troubleshooting:
- Correcting detector RAW data: operation/troubleshooting_correction.md
- Calibration constant generation: operation/troubleshooting_calibration_generation.md
- Development: - Development:
- Installation: development/installation.md - Installation: development/installation.md
- Workflow: development/workflow.md - Workflow: development/workflow.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