Skip to content

Commit

Permalink
docs: Use the sphinx_material theme for html docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdouSeck committed Dec 29, 2023
1 parent 5ccb99e commit a48225a
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 21 deletions.
25 changes: 24 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,32 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "alabaster"
html_theme = "sphinx_material"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

# Material theme options (see theme.conf for more information)
html_theme_options = {
# Set the name of the project to appear in the navigation.
"nav_title": "simeon",
# Set you GA account ID to enable tracking
# 'google_analytics_account': 'UA-XXXXX',
# Specify a base_url used to generate sitemap.xml. If not
# specified, then no sitemap will be built.
"base_url": "https://mit-it.github.io/simeon",
# Set the color and the accent color
"color_primary": "blue",
"color_accent": "light-blue",
# Set the repo location to get a badge with stats
"repo_url": "https://github.com/MIT-IR/simeon/",
"repo_name": "simeon",
# Visible levels of the global TOC; -1 means unlimited
"globaltoc_depth": 3,
# If False, expand all TOC entries
"globaltoc_collapse": False,
# If True, show hidden TOC entries
"globaltoc_includehidden": False,
}
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ dynamic = ["version"]

[project.optional-dependencies]
geoip = ["geoip2"]
test = ["black", "isort", "pip-tools", "sphinx", "tox"]
dev = ["black", "isort", "pip-tools", "sphinx", "tox"]
test = ["black", "isort", "pip-tools", "sphinx", "sphinx-material", "tox"]
dev = ["black", "isort", "pip-tools", "sphinx", "sphinx-material", "tox"]

[tool.setuptools.package-data]
"simeon.upload" = ["schemas/*.json"]
Expand Down
1 change: 1 addition & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
black
isort
Sphinx>=3.4.3
sphinx-material
tox>=3.21.2
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
],
extras_require={
"geoip": ["geoip2"],
"test": ["black", "isort", "pip-tools", "sphinx", "tox"],
"dev": ["black", "isort", "pip-tools", "sphinx", "tox"],
"test": ["black", "isort", "pip-tools", "sphinx", "sphinx-material", "tox"],
"dev": ["black", "isort", "pip-tools", "sphinx", "sphinx-material", "tox"],
},
package_data={
"simeon.upload": ["schemas/*.json"],
Expand Down
2 changes: 1 addition & 1 deletion simeon/download/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def process_line(
try:
date = parse_date(record.get("time", ""))
outfile = utils.make_tracklog_path(course_id, date.strftime("%Y-%m-%d"), is_gzip)
except Exception as e:
except Exception:
ext = ".gz" if is_gzip else ""
outfile = os.path.join(
course_id.replace(".", "_").replace("/", "__") or "dead_letters",
Expand Down
12 changes: 3 additions & 9 deletions simeon/scripts/simeon.py
Original file line number Diff line number Diff line change
Expand Up @@ -1423,9 +1423,7 @@ def main():
cpgroup.add_argument(
"--no-courses",
"-V",
help=(
"DO NOT try to limit the loaded files to only some course IDs. Therefore, simeon will push everything."
),
help=("DO NOT try to limit the loaded files to only some course IDs. Therefore, simeon will push everything."),
action="store_true",
)
cpgroup.add_argument(
Expand Down Expand Up @@ -1536,17 +1534,13 @@ def main():
reporter.add_argument(
"--wait-for-loads",
"-w",
help=(
"Wait for asynchronous BigQuery query jobs to finish. Otherwise, simeon creates query jobs and exits."
),
help=("Wait for asynchronous BigQuery query jobs to finish. Otherwise, simeon creates query jobs and exits."),
action="store_true",
)
reporter.add_argument(
"--in-files",
"-i",
help=(
"Whether the provided course ID arguments are text files that contain the course IDs. One ID per line"
),
help=("Whether the provided course ID arguments are text files that contain the course IDs. One ID per line"),
action="store_true",
)
reporter.add_argument(
Expand Down
4 changes: 1 addition & 3 deletions simeon/scripts/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,7 @@ def main():
merger = subparsers.add_parser(
"merge",
help="Merge the data file generated from simeon-youtube extract to the given target BigQuery table.",
description=(
"Merge the data file generated from simeon-youtube extract to the given target BigQuery table."
),
description=("Merge the data file generated from simeon-youtube extract to the given target BigQuery table."),
allow_abbrev=False,
)
merger.add_argument("youtube_file", help="A .json.gz file generated from the extract command")
Expand Down
4 changes: 1 addition & 3 deletions simeon/tests/test_download_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ def setUp(self):
{
"event": {},
"event_type": "",
"context": {
"path": "/courses/course-v1:ORGx+Course1x+4T2099/xblock/block-v1:a+a+a+type@foo+block@bar"
},
"context": {"path": "/courses/course-v1:ORGx+Course1x+4T2099/xblock/block-v1:a+a+a+type@foo+block@bar"},
},
{
"event": {"id": "block-v1:ORGx+Course1x+4T2099+type@foo+block@bar"},
Expand Down

0 comments on commit a48225a

Please sign in to comment.