Skip to content

Commit

Permalink
more config messing around
Browse files Browse the repository at this point in the history
  • Loading branch information
bsweger committed Oct 11, 2024
1 parent 5e159ee commit 102f6fa
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
22 changes: 17 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# -- General configuration

extensions = [
"myst_parser",
"sphinx.ext.autodoc",
"sphinx_copybutton",
"sphinx.ext.doctest",
Expand All @@ -37,8 +38,13 @@
}
intersphinx_disabled_domains = ["std"]

copybutton_prompt_text = r">>> |\$ "
copybutton_only_copy_prompt_lines = True
# Copied these settings from the copybutton's config
# https://github.com/executablebooks/sphinx-copybutton/blob/master/docs/conf.py
copybutton_prompt_text = r">>> |\.\.\. |\$ |In \[\d*\]: | {2,5}\.\.\.: | {5,8}: "
copybutton_prompt_is_regexp = True
copybutton_line_continuation_character = "\\"
copybutton_here_doc_delimiter = "EOT"
copybutton_selector = "div:not(.no-copybutton) > div.highlight > pre"

templates_path = ["_templates"]

Expand All @@ -48,9 +54,6 @@
# Test code blocks only when explicitly specified
doctest_test_doctest_blocks = ""

# Only look for source files in the docs directory
# include_patterns = ["**/docs"]

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_static_path = ["_static"]
Expand All @@ -74,6 +77,15 @@
"light_logo": "cladetime_logo_light_mode.png",
"dark_logo": "cladetime_logo_dark_mode.png",
"navigation_with_keys": True,
"source_repository": "https://github.com/reichlab/cladetime/",
}

html_context = {
# Enable the "Edit in GitHub link within the header of each page.
"display_github": True,
"github_user": "reichlab",
"github_repo": "cladetime",
"github_version": "main/source/",
}

# from https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
Expand Down
16 changes: 8 additions & 8 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ daily workflow pipeline.
>>> ct = CladeTime()
>>> filtered_sequence_metadata = (
ct.sequence_metadata.select(["country", "division", "date", "host", "clade_nextstrain"])
.filter(
pl.col("country") == "USA",
pl.col("date").is_not_null(),
pl.col("host") == "Homo sapiens",
)
.cast({"date": pl.Date}, strict=False)
)
... ct.sequence_metadata.select(["country", "division", "date", "host", "clade_nextstrain"])
... .filter(
... pl.col("country") == "USA",
... pl.col("date").is_not_null(),
... pl.col("host") == "Homo sapiens",
... )
... .cast({"date": pl.Date}, strict=False)
...)
>>> filtered_sequence_metadata.head(5).collect()
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ a Python datetime object. Both will be treated as UTC dates/times.
# ct operations now reference the version of the sequence metadata
# that was available at midnight UTC on August 2, 2024.
>>> ct.sequence_metadata \
.cast({"date": pl.Date}, strict=False) \
.select(pl.max("date")).collect()
... .cast({"date": pl.Date}, strict=False) \
... .select(pl.max("date")).collect()
shape: (1, 1)
┌────────────┐
Expand Down

0 comments on commit 102f6fa

Please sign in to comment.