From 9ce642a79bab678ef429f84bcdbdf83682c17974 Mon Sep 17 00:00:00 2001 From: kazewong Date: Tue, 30 Apr 2024 16:48:12 -0400 Subject: [PATCH 1/5] Add Skeleton --- docs/gen_ref_pages.py | 33 ++++++++++++++++ docs/index.md | 6 +++ docs/requirements.txt | 14 +++++++ docs/stylesheets/extra.css | 5 +++ mkdocs.yml | 79 ++++++++++++++++++++++++++++++++++++++ readthedocs.yml | 13 +++++++ 6 files changed, 150 insertions(+) create mode 100644 docs/gen_ref_pages.py create mode 100644 docs/index.md create mode 100644 docs/requirements.txt create mode 100644 docs/stylesheets/extra.css create mode 100644 mkdocs.yml create mode 100644 readthedocs.yml diff --git a/docs/gen_ref_pages.py b/docs/gen_ref_pages.py new file mode 100644 index 0000000..487c9e3 --- /dev/null +++ b/docs/gen_ref_pages.py @@ -0,0 +1,33 @@ +"""Generate the code reference pages.""" + +from pathlib import Path + +import mkdocs_gen_files + +nav = mkdocs_gen_files.Nav() + + +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") # + full_doc_path = Path("api", doc_path) # + + parts = list(module_path.parts) + + if parts[-1] == "__init__": # + continue + elif parts[-1] == "__main__": + continue + + nav[parts] = doc_path.as_posix() + + print(full_doc_path) + + 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) # + + with mkdocs_gen_files.open("api/summary.md", "w") as nav_file: # + nav_file.writelines(nav.build_literate_nav()) diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..9d1e459 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,6 @@ +ripple +====== + +**A light weight jax package for differentiable and fast gravitational wave data analysis** + +This is a sick package, install it now \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..e230b7f --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,14 @@ +flowMC +jax>=0.4.12 +jaxlib>=0.4.12 +equinox>=0.10.6 +optax>=0.1.5 +evosax>=0.1.4 +tqdm +mkdocs==1.4.3 # Main documentation generator. +mkdocs-material==9.1.18 # Theme +pymdown-extensions==10.1 # Markdown extensions e.g. to handle LaTeX. +mkdocstrings[python]==0.22.0 # Autogenerate documentation from docstrings. +mkdocs-jupyter==0.24.2 # Turn Jupyter Lab notebooks into webpages. +mkdocs-gen-files==0.5.0 +mkdocs-literate-nav==0.6.0 diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css new file mode 100644 index 0000000..c1619ad --- /dev/null +++ b/docs/stylesheets/extra.css @@ -0,0 +1,5 @@ +:root { + --md-primary-fg-color: #200f80; + --md-primary-fg-color--light: #6cb8bb; + --md-primary-fg-color--dark: #6cb8bb; + } \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..06e20e2 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,79 @@ +site_name: ripple +site_description: A light weight jax package for differentiable and fast gravitational wave data analysis. +site_author: Thomas Edwards, Kaze Wong +repo_url: https://github.com/tedwards2412/ripple +repo_name: tedwards2412/ripple + +theme: + name: material + features: + - navigation # Sections are included in the navigation on the left. + - toc # Table of contents is integrated on the left; does not appear separately on the right. + - header.autohide # header disappears as you scroll + palette: + # Light mode / dark mode + # We deliberately don't automatically use `media` to check a user's preferences. We default to light mode as + # (a) it looks more professional, and (b) is more obvious about the fact that it offers a (dark mode) toggle. + - scheme: default + primary: cyan + accent: deep purple + toggle: + icon: material/brightness-5 + name: Dark mode + - scheme: slate + primary: custom + accent: purple + toggle: + icon: material/brightness-2 + name: Light mode + + twitter_name: "@physicskaze" + twitter_url: "https://twitter.com/physicskaze" + +markdown_extensions: + - pymdownx.arithmatex: # Render LaTeX via MathJax + generic: true + - pymdownx.superfences # Seems to enable syntax highlighting when used with the Material theme. + - pymdownx.details + - pymdownx.snippets: # Include one Markdown file into another + base_path: docs + - admonition + - toc: + permalink: "ยค" # Adds a clickable permalink to each section heading + toc_depth: 4 + +plugins: + - search # default search plugin; needs manually re-enabling when using any other plugins + - autorefs # Cross-links to headings + - mkdocs-jupyter: # Jupyter notebook support + # show_input: False + - gen-files: + scripts: + - docs/gen_ref_pages.py + - literate-nav: + nav_file: SUMMARY.md + - mkdocstrings: + handlers: + python: + setup_commands: + - import pytkdocs_tweaks + - pytkdocs_tweaks.main() + - import jaxtyping + - jaxtyping.set_array_name_format("array") + + optional: + inherited_members: true # Allow looking up inherited methods + show_root_heading: true # actually display anything at all... + show_root_full_path: true # display "diffrax.asdf" not just "asdf" + show_if_no_docstring: true + show_signature_annotations: true + show_source: false # don't include source code + members_order: source # order methods according to their order of definition in the source code, not alphabetical order + heading_level: 4 + +extra_css: + - stylesheets/extra.css + +nav: + - Home: index.md + - API: api/ripple/* \ No newline at end of file diff --git a/readthedocs.yml b/readthedocs.yml new file mode 100644 index 0000000..e4c2d80 --- /dev/null +++ b/readthedocs.yml @@ -0,0 +1,13 @@ +version: 2 + +python: + install: + - requirements: docs/requirements.txt + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +mkdocs: + configuration: mkdocs.yml \ No newline at end of file From 5646baeb67189dc3d47544896b7f93b5c517f1b1 Mon Sep 17 00:00:00 2001 From: kazewong Date: Tue, 30 Apr 2024 16:57:56 -0400 Subject: [PATCH 2/5] Add .gitattributes file for linguist-vendored paths --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..ad0ffe0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +docs/** linguist-vendored +example/** linguist-vendored \ No newline at end of file From 93c3f79813d04d2471104b49c5b23de59afbd43a Mon Sep 17 00:00:00 2001 From: kazewong Date: Tue, 30 Apr 2024 17:00:37 -0400 Subject: [PATCH 3/5] Add linguist-vendored paths to .gitattributes --- .gitattributes | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index ad0ffe0..70aab1b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ docs/** linguist-vendored -example/** linguist-vendored \ No newline at end of file +example/** linguist-vendored +notebooks/** linguist-vendored \ No newline at end of file From 5616f66629d2d685fd6929feff008a362719954e Mon Sep 17 00:00:00 2001 From: kazewong Date: Tue, 30 Apr 2024 17:04:35 -0400 Subject: [PATCH 4/5] Add notebooks directory and update mkdocs.yml --- docs/notebooks | 1 + mkdocs.yml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 120000 docs/notebooks diff --git a/docs/notebooks b/docs/notebooks new file mode 120000 index 0000000..edb8f02 --- /dev/null +++ b/docs/notebooks @@ -0,0 +1 @@ +../notebooks/ \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 06e20e2..3f8d84d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -76,4 +76,5 @@ extra_css: nav: - Home: index.md - - API: api/ripple/* \ No newline at end of file + - API: api/ripple/* + - Tutorial: notebooks/* \ No newline at end of file From 9ba6ce7668f247a0598414ec8b37906c6d7d4a53 Mon Sep 17 00:00:00 2001 From: kazewong Date: Tue, 30 Apr 2024 17:06:53 -0400 Subject: [PATCH 5/5] Update .gitattributes to include example directory as linguist-vendored --- .gitattributes | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 70aab1b..0e1a35c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,2 @@ docs/** linguist-vendored -example/** linguist-vendored notebooks/** linguist-vendored \ No newline at end of file