From 4401e9c2c53adb46609930b872b5da27b5af58fe Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Fri, 19 Jan 2024 15:25:18 +0100 Subject: [PATCH] docs: use sphinxawesome-theme instead of lutra --- docs/_static/custom.css | 14 +++++ docs/_static/theme.css | 7 --- docs/conf.py | 133 +++++++++++++++++++++++++--------------- docs/requirements.txt | 2 +- 4 files changed, 100 insertions(+), 56 deletions(-) create mode 100644 docs/_static/custom.css delete mode 100644 docs/_static/theme.css diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 000000000..eed169e71 --- /dev/null +++ b/docs/_static/custom.css @@ -0,0 +1,14 @@ +.image-reference img { + display: inline; + background: none !important; +} + +.image-reference { + border-bottom: none !important; +} + +:root { + --primary: #047857; + --color-brand: #047857; + } + \ No newline at end of file diff --git a/docs/_static/theme.css b/docs/_static/theme.css deleted file mode 100644 index 05653f3d2..000000000 --- a/docs/_static/theme.css +++ /dev/null @@ -1,7 +0,0 @@ -.image-reference img { - display: inline; -} - -.image-reference { - border-bottom: none !important; -} \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index f43d4dc4c..9cbef57ed 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,6 +16,7 @@ import sys import os from datetime import datetime +from sphinxawesome_theme.postprocess import Icons # If extensions (or modules to document with autodoc) are in another directory, @@ -38,9 +39,10 @@ "sphinxarg.ext", "sphinx.ext.autosectionlabel", "myst_parser", + "sphinxawesome_theme.highlighting", ] -html_css_files = ["theme.css"] +html_css_files = ["custom.css"] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -119,31 +121,66 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = "lutra" +html_theme = "sphinxawesome_theme" html_theme_options = { - "primary_color": "emerald", - "secondary_color": "emerald", - "dark_logo": "logo-snake.svg", - "light_logo": "logo-snake.svg", - "navigation_style": "plain", - "sidebar_links": [ - { - "text": "Snakemake plugin catalog", - "alt": "Snakemake plugin catalog", - "href": "https://snakemake.github.io/snakemake-plugin-catalog", - }, - { - "text": "Snakemake workflow catalog", - "alt": "Snakemake workflow catalog", - "href": "https://snakemake.github.io/snakemake-workflow-catalog", - }, - { - "text": "Snakemake wrappers", - "alt": "Snakemake wrappers", - "href": "https://snakemake-wrappers.readthedocs.io", - }, - ], + "logo_light": "logo-snake.svg", + "logo_dark": "logo-snake.svg", + "main_nav_links": { + "Homepage": "https://snakemake.github.io", + "Plugin catalog": "https://snakemake.github.io/snakemake-plugin-catalog", + "Workflow catalog": "https://snakemake.github.io/snakemake-workflow-catalog", + "Wrappers": "https://snakemake-wrappers.readthedocs.io", + }, + "awesome_external_links": True, + "awesome_headerlinks": True, + "show_prev_next": False, } +html_permalinks_icon = Icons.permalinks_icon +# html_theme_options = { +# "show_nav_level": 2, +# "header_links_before_dropdown": 0, +# "external_links": [ +# { +# "text": "Snakemake plugin catalog", +# "alt": "Snakemake plugin catalog", +# "href": "https://snakemake.github.io/snakemake-plugin-catalog", +# }, +# { +# "text": "Snakemake workflow catalog", +# "alt": "Snakemake workflow catalog", +# "href": "https://snakemake.github.io/snakemake-workflow-catalog", +# }, +# { +# "text": "Snakemake wrappers", +# "alt": "Snakemake wrappers", +# "href": "https://snakemake-wrappers.readthedocs.io", +# }, +# ], +# } +# html_theme_options = { +# "primary_color": "emerald", +# "secondary_color": "emerald", +# "dark_logo": "logo-snake.svg", +# "light_logo": "logo-snake.svg", +# "navigation_style": "plain", +# "sidebar_links": [ +# { +# "text": "Snakemake plugin catalog", +# "alt": "Snakemake plugin catalog", +# "href": "https://snakemake.github.io/snakemake-plugin-catalog", +# }, +# { +# "text": "Snakemake workflow catalog", +# "alt": "Snakemake workflow catalog", +# "href": "https://snakemake.github.io/snakemake-workflow-catalog", +# }, +# { +# "text": "Snakemake wrappers", +# "alt": "Snakemake wrappers", +# "href": "https://snakemake-wrappers.readthedocs.io", +# }, +# ], +# } # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -221,26 +258,26 @@ # html_file_suffix = None # Output file base name for HTML help builder. -htmlhelp_basename = "Snakemakedoc" +# htmlhelp_basename = "Snakemakedoc" # -- Options for LaTeX output --------------------------------------------- -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', -} +# latex_elements = { +# # The paper size ('letterpaper' or 'a4paper'). +# #'papersize': 'letterpaper', +# # The font size ('10pt', '11pt' or '12pt'). +# #'pointsize': '10pt', +# # Additional stuff for the LaTeX preamble. +# #'preamble': '', +# } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). -latex_documents = [ - ("index", "Snakemake.tex", "Snakemake Documentation", "Johannes Koester", "manual"), -] +# latex_documents = [ +# ("index", "Snakemake.tex", "Snakemake Documentation", "Johannes Koester", "manual"), +# ] # The name of an image file (relative to this directory) to place at the top of # the title page. @@ -267,7 +304,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [("index", "snakemake", "Snakemake Documentation", ["Johannes Koester"], 1)] +# man_pages = [("index", "snakemake", "Snakemake Documentation", ["Johannes Koester"], 1)] # If true, show URL addresses after external links. # man_show_urls = False @@ -278,17 +315,17 @@ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) -texinfo_documents = [ - ( - "index", - "Snakemake", - "Snakemake Documentation", - "Johannes Koester", - "Snakemake", - "One line description of project.", - "Miscellaneous", - ), -] +# texinfo_documents = [ +# ( +# "index", +# "Snakemake", +# "Snakemake Documentation", +# "Johannes Koester", +# "Snakemake", +# "One line description of project.", +# "Miscellaneous", +# ), +# ] # Documents to append as an appendix to all manuals. # texinfo_appendices = [] diff --git a/docs/requirements.txt b/docs/requirements.txt index c329f389e..639402e55 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -6,7 +6,7 @@ myst-parser configargparse appdirs immutables -lutra @ git+http://github.com/pradyunsg/lutra@8f61563 +sphinxawesome-theme snakemake-interface-common snakemake-interface-executor-plugins snakemake-interface-storage-plugins \ No newline at end of file