diff --git a/docs/gen_ref_pages.py b/docs/gen_ref_pages.py index 7d0e882..5d8a896 100644 --- a/docs/gen_ref_pages.py +++ b/docs/gen_ref_pages.py @@ -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()) \ No newline at end of file +with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file: + nav_file.writelines(nav.build_literate_nav()) \ No newline at end of file diff --git a/docs/reference/SUMMARY.md b/docs/reference/SUMMARY.md deleted file mode 100644 index 9669f85..0000000 --- a/docs/reference/SUMMARY.md +++ /dev/null @@ -1,15 +0,0 @@ -* src - * [sawmill](src/sawmill/index.md) - * aggimp - * [agg_funcs](src/sawmill/aggimp/agg_funcs.md) - * [imp_funcs](src/sawmill/aggimp/imp_funcs.md) - * [drain](src/sawmill/drain.md) - * [graph_renderer](src/sawmill/graph_renderer.md) - * [pickler](src/sawmill/pickler.md) - * [printer](src/sawmill/printer.md) - * [regression](src/sawmill/regression.md) - * [sawmill](src/sawmill/sawmill.md) - * [tag_utils](src/sawmill/tag_utils.md) - * variable_name - * [parsed_variable_name](src/sawmill/variable_name/parsed_variable_name.md) - * [prepared_variable_name](src/sawmill/variable_name/prepared_variable_name.md) diff --git a/docs/reference/src/sawmill/aggimp/agg_funcs.md b/docs/reference/src/sawmill/aggimp/agg_funcs.md deleted file mode 100644 index 70384ac..0000000 --- a/docs/reference/src/sawmill/aggimp/agg_funcs.md +++ /dev/null @@ -1 +0,0 @@ -::: src.sawmill.aggimp.agg_funcs \ No newline at end of file diff --git a/docs/reference/src/sawmill/aggimp/imp_funcs.md b/docs/reference/src/sawmill/aggimp/imp_funcs.md deleted file mode 100644 index 0627a76..0000000 --- a/docs/reference/src/sawmill/aggimp/imp_funcs.md +++ /dev/null @@ -1 +0,0 @@ -::: src.sawmill.aggimp.imp_funcs \ No newline at end of file diff --git a/docs/reference/src/sawmill/drain.md b/docs/reference/src/sawmill/drain.md deleted file mode 100644 index e8e37d7..0000000 --- a/docs/reference/src/sawmill/drain.md +++ /dev/null @@ -1 +0,0 @@ -::: src.sawmill.drain \ No newline at end of file diff --git a/docs/reference/src/sawmill/graph_renderer.md b/docs/reference/src/sawmill/graph_renderer.md deleted file mode 100644 index 25f0d1b..0000000 --- a/docs/reference/src/sawmill/graph_renderer.md +++ /dev/null @@ -1 +0,0 @@ -::: src.sawmill.graph_renderer \ No newline at end of file diff --git a/docs/reference/src/sawmill/index.md b/docs/reference/src/sawmill/index.md deleted file mode 100644 index 6154652..0000000 --- a/docs/reference/src/sawmill/index.md +++ /dev/null @@ -1 +0,0 @@ -::: src.sawmill \ No newline at end of file diff --git a/docs/reference/src/sawmill/pickler.md b/docs/reference/src/sawmill/pickler.md deleted file mode 100644 index eefee84..0000000 --- a/docs/reference/src/sawmill/pickler.md +++ /dev/null @@ -1 +0,0 @@ -::: src.sawmill.pickler \ No newline at end of file diff --git a/docs/reference/src/sawmill/printer.md b/docs/reference/src/sawmill/printer.md deleted file mode 100644 index f371f73..0000000 --- a/docs/reference/src/sawmill/printer.md +++ /dev/null @@ -1 +0,0 @@ -::: src.sawmill.printer \ No newline at end of file diff --git a/docs/reference/src/sawmill/regression.md b/docs/reference/src/sawmill/regression.md deleted file mode 100644 index 03668b9..0000000 --- a/docs/reference/src/sawmill/regression.md +++ /dev/null @@ -1 +0,0 @@ -::: src.sawmill.regression \ No newline at end of file diff --git a/docs/reference/src/sawmill/sawmill.md b/docs/reference/src/sawmill/sawmill.md deleted file mode 100644 index c7e1215..0000000 --- a/docs/reference/src/sawmill/sawmill.md +++ /dev/null @@ -1 +0,0 @@ -::: src.sawmill.sawmill \ No newline at end of file diff --git a/docs/reference/src/sawmill/tag_utils.md b/docs/reference/src/sawmill/tag_utils.md deleted file mode 100644 index 0626ac5..0000000 --- a/docs/reference/src/sawmill/tag_utils.md +++ /dev/null @@ -1 +0,0 @@ -::: src.sawmill.tag_utils \ No newline at end of file diff --git a/docs/reference/src/sawmill/variable_name/parsed_variable_name.md b/docs/reference/src/sawmill/variable_name/parsed_variable_name.md deleted file mode 100644 index f0aaccc..0000000 --- a/docs/reference/src/sawmill/variable_name/parsed_variable_name.md +++ /dev/null @@ -1 +0,0 @@ -::: src.sawmill.variable_name.parsed_variable_name \ No newline at end of file diff --git a/docs/reference/src/sawmill/variable_name/prepared_variable_name.md b/docs/reference/src/sawmill/variable_name/prepared_variable_name.md deleted file mode 100644 index 9e16ecf..0000000 --- a/docs/reference/src/sawmill/variable_name/prepared_variable_name.md +++ /dev/null @@ -1 +0,0 @@ -::: src.sawmill.variable_name.prepared_variable_name \ No newline at end of file diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css new file mode 100644 index 0000000..9c2ee7f --- /dev/null +++ b/docs/stylesheets/extra.css @@ -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; +} \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 44b54a0..885e7a6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Sawmill +site_name: LOGos theme: name: material @@ -19,7 +19,7 @@ theme: # Palette toggle for light mode - scheme: default - primary: green + primary: light-blue accent: amber toggle: icon: material/weather-night @@ -27,7 +27,7 @@ theme: # Palette toggle for dark mode - scheme: slate - primary: green + primary: light-blue accent: amber toggle: icon: material/weather-sunny @@ -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: diff --git a/site/404.html b/site/404.html index 8b41143..e1d9118 100644 --- a/site/404.html +++ b/site/404.html @@ -12,18 +12,18 @@ - + -