Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarkakis committed Aug 1, 2024
1 parent 180bcfa commit 5ad3e75
Show file tree
Hide file tree
Showing 66 changed files with 32,951 additions and 27,850 deletions.
39 changes: 27 additions & 12 deletions docs/gen_ref_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,49 @@
Script was taken from
https://mkdocstrings.github.io/recipes/#automatic-code-reference-pages
"""
"""Generate the code reference pages and navigation."""

"""Generate the code reference pages."""

from pathlib import Path

import mkdocs_gen_files


# Replace the file docs/index.md with a copy of README.md
with mkdocs_gen_files.open("index.md", "w") as fd:
with open("README.md") as readme:
fd.write(readme.read())


nav = mkdocs_gen_files.Nav()

for path in sorted(Path(".").rglob("logos/**/*.py")):
module_path = path.relative_to(".").with_suffix("")
doc_path = path.relative_to(".").with_suffix(".md")
full_doc_path = Path("reference", doc_path)
root = Path(__file__).parent.parent
src = root / "src"

for path in sorted(src.rglob("*/*.py")):
module_path = path.relative_to(src).with_suffix("")
doc_path = path.relative_to(src).with_suffix(".md")
full_doc_path = Path("reference", doc_path)

parts = tuple(module_path.parts)

if parts[-1] == "__init__":
if parts[-1] == "__init__":
parts = parts[:-1]
doc_path = doc_path.with_name("index.md")
full_doc_path = full_doc_path.with_name("index.md")
elif parts[-1] == "__main__":
continue

print(doc_path.as_posix())

nav[parts] = doc_path.as_posix() #
nav[parts] = doc_path.as_posix()

with mkdocs_gen_files.open(full_doc_path, "w") as fd:
ident = ".".join(parts)
fd.write(f"::: {ident}")
with mkdocs_gen_files.open(full_doc_path, "w") as fd:
identifier = ".".join(parts)
print("::: " + identifier, file=fd)

mkdocs_gen_files.set_edit_path(full_doc_path, path)
mkdocs_gen_files.set_edit_path(full_doc_path, path.relative_to(root))

with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file:
nav_file.writelines(nav.build_literate_nav())
with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file:
nav_file.writelines(nav.build_literate_nav())
15 changes: 0 additions & 15 deletions docs/reference/SUMMARY.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/reference/src/sawmill/aggimp/agg_funcs.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/reference/src/sawmill/aggimp/imp_funcs.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/reference/src/sawmill/drain.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/reference/src/sawmill/graph_renderer.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/reference/src/sawmill/index.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/reference/src/sawmill/pickler.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/reference/src/sawmill/printer.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/reference/src/sawmill/regression.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/reference/src/sawmill/sawmill.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/reference/src/sawmill/tag_utils.md

This file was deleted.

This file was deleted.

This file was deleted.

9 changes: 9 additions & 0 deletions docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[data-md-color-scheme="logos-light"] {
--md-primary-fg-color: #7F9FBA;
--md-default-bg-color: #FFFFFF;
}

[data-md-color-scheme="logos-dark"] {
--md-primary-fg-color: #7F9FBA;
--md-default-bg-color: #394853;
}
49 changes: 26 additions & 23 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
site_name: Sawmill
site_name: LOGos

theme:
name: material
Expand All @@ -19,15 +19,15 @@ theme:

# Palette toggle for light mode
- scheme: default
primary: green
primary: light-blue
accent: amber
toggle:
icon: material/weather-night
name: Switch to dark mode

# Palette toggle for dark mode
- scheme: slate
primary: green
primary: light-blue
accent: amber
toggle:
icon: material/weather-sunny
Expand Down Expand Up @@ -59,29 +59,32 @@ plugins:
show_type_annotations: true

nav:
- Home: reference/src/sawmill/index.md
- Home: index.md
- Docs:
- "Sawmill": reference/src/sawmill/sawmill.md
- "Drain": reference/src/sawmill/drain.md
- "TagUtils": reference/src/sawmill/tag_utils.md
- "CausalUnitSuggester": reference/src/sawmill/causal_unit_suggester.md
- "AggregateSelector": reference/src/sawmill/aggregate_selector.md
- "CausalDiscoverer": reference/src/sawmill/causal_discoverer.md
- "EdgeStateMatrix": reference/src/sawmill/edge_state_matrix.md
- "Regression": reference/src/sawmill/regression.md
- "GraphRenderer": reference/src/sawmill/graph_renderer.md
- "ATE": reference/src/sawmill/ate.md
- "ClusteringParams": reference/src/sawmill/clustering_params.md
- "EdgeOccurrenceTree": reference/src/sawmill/edge_occurrence_tree.md
- "Pickler": reference/src/sawmill/pickler.md
- "Printer": reference/src/sawmill/printer.md
- "Types": reference/src/sawmill/types.md
- "LOGos": reference/logos/logos.md
- "Drain": reference/logos/drain.md
- "TagUtils": reference/logos/tag_utils.md
- "CausalUnitSuggester": reference/logos/causal_unit_suggester.md
- "AggregateSelector": reference/logos/aggregate_selector.md
- "CausalDiscoverer": reference/logos/causal_discoverer.md
- "EdgeStateMatrix": reference/logos/edge_state_matrix.md
- "CandidateCauseRanker": reference/logos/candidate_cause_ranker.md
- "Pruner": reference/logos/pruner.md
- "Regression": reference/logos/regression.md
- "GraphRenderer": reference/logos/graph_renderer.md
- "ATECalculator": reference/logos/ate_calculator.md
- "InteractiveCausalGraphRefiner": reference/logos/interactive_causal_graph_refiner.md
- "ClusteringParams": reference/logos/clustering_params.md
- "EdgeOccurrenceTree": reference/logos/edge_occurrence_tree.md
- "Pickler": reference/logos/pickler.md
- "Printer": reference/logos/printer.md
- "Types": reference/logos/types.md
- Variable Names:
- "ParsedVariableName": reference/src/sawmill/variable_name/parsed_variable_name.md
- "PreparedVariableName": reference/src/sawmill/variable_name/prepared_variable_name.md
- "ParsedVariableName": reference/logos/variable_name/parsed_variable_name.md
- "PreparedVariableName": reference/logos/variable_name/prepared_variable_name.md
- Aggregation/Imputation Functions:
- "Aggregation Functions": reference/src/sawmill/aggimp/agg_funcs.md
- "Imputation Functions": reference/src/sawmill/aggimp/imp_funcs.md
- "Aggregation Functions": reference/logos/aggimp/agg_funcs.md
- "Imputation Functions": reference/logos/aggimp/imp_funcs.md


markdown_extensions:
Expand Down
Loading

0 comments on commit 5ad3e75

Please sign in to comment.