diff --git a/.github/workflows/gh-ci.yaml b/.github/workflows/gh-ci.yaml index 795f368d..68239a15 100644 --- a/.github/workflows/gh-ci.yaml +++ b/.github/workflows/gh-ci.yaml @@ -72,7 +72,7 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' }} uses: ./.github/actions/run-cookie-ci with: - source-directory: ${{ env.OUTPUT_DIRECTORY }}/TestMDAKit_with_condaforge-deps_and_ReadTheDocs/mdakit-cookie + source-directory: ${{ env.OUTPUT_DIRECTORY }}/TestMDAKit_with_host_MDAnalysis_condaforge-deps_and_ReadTheDocs/mdakit-cookie - name: Upload artifact if: ${{ matrix.os == 'ubuntu-latest' && matrix.last-n-minor-python-release == 0 }} diff --git a/docs/requirements.yaml b/docs/requirements.yaml index 5f66ebde..c92a034b 100644 --- a/docs/requirements.yaml +++ b/docs/requirements.yaml @@ -6,9 +6,7 @@ dependencies: - python - pip - - sphinx<7.0 - - sphinx_rtd_theme - + - mdanalysis-sphinx-theme >=1.0.1 - tree # Pip-only installs diff --git a/docs/source/_static/custom.css b/docs/source/_static/custom.css deleted file mode 100644 index de8d2e67..00000000 --- a/docs/source/_static/custom.css +++ /dev/null @@ -1,225 +0,0 @@ -/* override css for readable.css */ - -/* styles/fonts to match http://mdanalysis.org (see public/css) */ -/* MDAnalysis orange: #FF9200 */ -/* MDAnalysis gray: #808080 */ -/* MDAnalysis white: #FFFFFF */ -/* MDAnalysis black: #000000 */ -/* Very light orange: #FFEBD0 */ -/* Code orange: #ca6500 */ -/* RTD dark grey: #343131 */ -/* RTD light grey: #e6e6e6 */ - -/* -- page layout --------------------------------------------------------- */ - -body { - font-family: 'PT Sans', Helvetica, Arial, 'sans-serif'; - font-size: 17px; -} - -div.body { - color: #000000; -} - -div.sphinxsidebar a:hover { - text-decoration: none !important; -} - -div.sphinxsidebar p { - color: #808080; -} - -/* Home MDAnalysis colour */ -.wy-side-nav-search > a { - color: #343131; -} - -/* Side MDAnalysis version colour */ -.wy-side-nav-search > div.version { - color: #808080; -} - -/* Menubar caption colour */ -div.wy-menu-vertical span.caption-text { - color: #FF9200; -} - -/* Mobile layout menubar option */ -nav.wy-nav-top { - background: #343131; -} - -/* Menu search bar outline (default blue) */ -.wy-side-nav-search input[type="text"] { - border-color: #808080; -} - - -/* -- body styles --------------------------------------------------------- */ - -/* Different coloured links for sidebar vs body) */ -div.rst-content a { - color: #FF9200; - text-decoration: none; -} - -div.rst-content a:visited { - color: #FF9200; -} - -a:hover { - color: #FF9200 !important; - text-decoration: underline; -} - - -pre, tt, code { - font-family: Menlo, Monaco, 'Courier New', monospace -} - - -div.body h1 { - font-weight: bolder; -} - -a.headerlink { - color: #808080; - font-size: 0.8em; - padding: 0 4px 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - background-color: #808080; - color: #fff; -} - -/* ------- admonition boxes ------- */ - -div.admonition { - margin: 10px 0px; - padding: 10px 10px; -} - -div.admonition p.admonition-title { - font-size: 100%; - font-weight: bolder; -} - -/* ----- Tables ----- */ - -/* override table width restrictions */ -/* wrap tables instead of scrolling */ -@media screen and (min-width: 767px) { - - .wy-table-responsive table td, .wy-table-responsive table th { - /* !important prevents the common CSS stylesheets from overriding - this as on RTD they are loaded after this stylesheet */ - white-space: normal !important; - } - - .wy-table-responsive { - overflow: visible !important; - max-width: 100% !important; - } - } - -/* ----- Field lists ------ */ - -.section > dl.field-list { - display: flex; - flex-wrap: wrap; - margin: 0; - padding: 0; -} - -dl.field-list > dt::after { - content: ":"; -} - -.rst-content dl:not(.docutils) dt { - background: none; - color: #000000; - border-top: none; -} - -.section > dl.field-list dt { - margin: 0; - padding: 0; - flex-basis: 20%; - display: block; -} - -.section > dl.field-list > dd { - flex-basis: 70%; - margin: 0; -} - -.section > dl.field-list > dd p { - margin: 0; -} - -/* ----- MDAnalysis coloured elements ------ */ - -.rst-content dl.class dt, .rst-content dl.function dt { - color: #ca6500; - background: #FFEBD0; - border-top: solid 3px #FF9200; -} - -.rst-content .viewcode-link, .rst-content .viewcode-back { - color: #808080; -} - -.rst-content .guilabel { - background: #efefef; - border: 1px solid #808080; -} - - -.rst-content .seealso p.admonition-title { - background: #808080; -} - -.rst-content .seealso { - background: #e3e3e3; -} - -.rst-content .error p.admonition-title, .rst-content .warning p.admonition-title { - background: #F45F4B; -} - -.rst-content .error, .rst-content .warning { - background: #FFEEED; -} - -.rst-content .caution p.admonition-title, .rst-content .note p.admonition-title, .rst-content .important p.admonition-title { - background: #FF9200; -} - -.rst-content .caution, .rst-content .note, .rst-content .important { - background: #FFEBD0; -} - -.rst-content code:not(.xref).literal { - color: #ca6500; -} -/* override table width restrictions */ -@media screen and (min-width: 767px) { - - .wy-table-responsive table td, .wy-table-responsive table th { - /* !important prevents the common CSS stylesheets from overriding - this as on RTD they are loaded after this stylesheet */ - white-space: normal !important; - } - - .wy-table-responsive { - overflow: visible !important; - max-width: 100% !important; - } - } - -dl.footnote p { - font-weight: lighter; - font-size: 14px -} \ No newline at end of file diff --git a/docs/source/_static/logos/AUTHOR b/docs/source/_static/logos/AUTHOR deleted file mode 100644 index 790ced65..00000000 --- a/docs/source/_static/logos/AUTHOR +++ /dev/null @@ -1,16 +0,0 @@ -The MDAnalysis 'Atom' logo was created by Christian Beckstein and is - -Copyright (c) 2011 Christian Beckstein - -MDAnalysis Logo 'Atom' by Christian Beckstein is licensed under a -Creative Commons Attribution-NoDerivs 3.0 Unported License. -To view a copy of this license, visit -http://creativecommons.org/licenses/by-nd/3.0/ or send a letter to Creative -Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA. - -The logo is contained in the file 'mdanalysis-logo.png'. - -Derivatives in the files 'mdanalysis-logo-127x55.png', -'mdanalysis-logo-200x150.png', 'mdanalysis-logo.ico' were created for -inclusion in MDAnalysis and on websites related to MDAnalysis. They -are distributed under the same license as the 'Atom' logo. diff --git a/docs/source/_static/logos/mdanalysis-logo-127x55.png b/docs/source/_static/logos/mdanalysis-logo-127x55.png deleted file mode 100644 index 237f8c61..00000000 Binary files a/docs/source/_static/logos/mdanalysis-logo-127x55.png and /dev/null differ diff --git a/docs/source/_static/logos/mdanalysis-logo-200x150.png b/docs/source/_static/logos/mdanalysis-logo-200x150.png deleted file mode 100644 index 4246d67a..00000000 Binary files a/docs/source/_static/logos/mdanalysis-logo-200x150.png and /dev/null differ diff --git a/docs/source/_static/logos/mdanalysis-logo.ico b/docs/source/_static/logos/mdanalysis-logo.ico deleted file mode 100644 index 3c102d08..00000000 Binary files a/docs/source/_static/logos/mdanalysis-logo.ico and /dev/null differ diff --git a/docs/source/_static/logos/mdanalysis-logo.png b/docs/source/_static/logos/mdanalysis-logo.png deleted file mode 100644 index 774e2ea2..00000000 Binary files a/docs/source/_static/logos/mdanalysis-logo.png and /dev/null differ diff --git a/docs/source/_static/readable.css b/docs/source/_static/readable.css deleted file mode 100644 index 1d170214..00000000 --- a/docs/source/_static/readable.css +++ /dev/null @@ -1,463 +0,0 @@ -/* - * Adapted for combining with alabaster for MDAnalysis. - * To be used as a custom CSS - * - * based on: - * - * readable.css_t - * ~~~~~~~~~~~~~~ - * - * Sphinx stylesheet -- readable theme. - * - * :copyright: Copyright 2013 by Ignacy Sokolowski. - * :license: MIT, see LICENSE for details. - * - */ - - -/* -- page layout --------------------------------------------------------- */ - -body { - font-family: 'Georgia', serif; - font-size: 17px; - margin: 0; - padding: 0; -} - -div.document { - margin: 10px auto 0 auto; - /* max-width: {{ page_width }}; */ -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - /* margin: 0 0 0 {{ theme_sidebarwidth|toint }}px; */ -} - -div.body { - background-color: #ffffff; - color: #3e4349; - padding: 0 30px 30px 30px; -} - -div.footer { - color: #555; - font-size: 14px; - margin: 20px auto 30px auto; - text-align: right; - max-width: 880px; -} - -div.footer a { - color: #444; - text-decoration: underline; -} - -div.related { - padding: 10px 10px; - width: auto; -} - -div.sphinxsidebar { - float: left; - font-size: 14px; - line-height: 1.5em; - margin-left: -100%; - /* width: {{ theme_sidebarwidth|toint }}px; */ -} - -div.sphinxsidebarwrapper { - font-size: 14px; - line-height: 1.5em; - padding: 10px 0 10px 10px; -} - -div.sphinxsidebar h3, -div.sphinxsidebar h4 { - color: #333; - font-size: 24px; - font-weight: normal; - margin: 0 0 5px 0; - padding: 0; -} - -div.sphinxsidebar h4 { - font-size: 1.1em; -} - -div.sphinxsidebar h3 a { - color: #333; -} - -div.sphinxsidebar p { - color: #888; -} - -div.sphinxsidebar p.searchtip { - line-height: 1.4em; -} - -div.sphinxsidebar ul { - color: #000; - margin: 10px 0 20px; - padding: 0; -} - -div.sphinxsidebar a { - color: #444; -} - -div.sphinxsidebar a:hover { - color: #d00; -} - -div.sphinxsidebar input { - border: 1px solid #ccc; - font-family: sans-serif; - font-size: 1em; -} - -/* -- body styles --------------------------------------------------------- */ - -a { - color: #900; - text-decoration: none; -} - -a:visited { - color: #700; -} - -a:hover { - color: #d00; - text-decoration: underline; -} - -hr { - border: 1px solid #b1b4b6; -} - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { font-weight: normal; } - -div.body h1, -div.body h2, -div.body h3, -div.body h4 { color: #212224; } -div.body h5 { color: #000; } -div.body h6 { color: #777; } - -div.body h1 { margin: 0 0 10px 0; } -div.body h2, -div.body h3 { margin: 30px 0px 10px 0px; } -div.body h4, -div.body h5, -div.body h6 { margin: 20px 0px 10px 0px; } - -div.body h1 { padding: 0 0 10px 0; } -div.body h2, -div.body h3 { padding: 10px 0 10px 0; } -div.body h4 { padding: 10px 0 10px 0; } -div.body h5, -div.body h6 { padding: 10px 0 0 0; } - -div.body h1, -div.body h2, -div.body h3 { border-bottom: 1px solid #ddd; } -div.body h4 { border-bottom: 1px solid #e5e5e5; } - -div.body h1 { font-size: 230%; } -div.body h2 { font-size: 180%; } -div.body h3 { font-size: 130%; } -div.body h4 { font-size: 110%; } -div.body h5 { font-size: 105%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #c60f0f; - font-size: 0.8em; - padding: 0 4px 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - background-color: #c60f0f; - color: #fff; -} - -div.body ul { - list-style: disc; - margin: 1em 0; - padding-left: 1.3em; -} - -div.body ul ul, div.body ol ul { - margin: .2em 0; - padding-left: 1.2em; -} - -div.body ul li { - padding: 2px 0; -} - -div.body ul.search li { - padding: 5px 0 5px 20px; -} - -div.body ol { - counter-reset: li; - margin-left: 0; - padding-left: 0; -} - -div.body ol ol { - margin: .2em 0; -} - -div.body ol > li { - list-style: none; - margin: 0 0 0 1.9em; - padding: 2px 1px; - position: relative; -} - -div.body ol > li:before { - content: counter(li) "."; - counter-increment: li; - top: -2px; - left: -1.9em; - width: 1.9em; - padding: 4px 0; - position: absolute; - text-align: left; -} - -div.body p, -div.body dd, -div.body li { - line-height: 1.4em; -} - -div.admonition p.admonition-title + p { - display: inline; -} - -div.highlight { - background-color: #fff; -} - -div.important, div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.attention, div.caution, div.hint, div.seealso, div.tip { - background-color: #fef9e9; - border: 1px solid #fbe091; -} - -div.topic { - background-color: #eee; -} - -div.danger, div.error, div.warning { - background-color: #ffe4e4; - border: 1px solid #f66; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ':'; -} - -pre { - background-color: #f5f5f5; - border: 1px solid #C6C9CB; - color: #222; - font-size: 0.75em; - line-height: 1.5em; - margin: 1.5em 0 1.5em 0; - padding: 10px; - box-shadow: 1px 1px 1px #d8d8d8; - -webkit-box-shadow: 1px 1px 1px #d8d8d8; - -moz-box-shadow: 1px 1px 1px #d8d8d8; -} - -pre, tt, code { - font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; -} - -tt, code { - background-color: #ecf0f3; - font-size: 0.85em; -} - -tt.descname, code.descname { - font-size: 0.95em; -} - -tt.xref, a tt, code.xref, a code { - font-weight: normal; -} - -span.pre { - padding: 0 2px; -} - -dl.class, dl.function { - margin-bottom: 50px; -} - -dl.function > dt, -dl.attribute > dt, -dl.classmethod > dt, -dl.method > dt, -dl.class > dt, -dl.exception > dt { - background-color: #f5f5f5; - margin: 25px 0 10px 0; - padding: 1px 10px; -} - -table.docutils { - width: 100%; -} - -table.docutils.footnote { - width: auto; -} - -table.docutils thead, -table.docutils tfoot { - background: #f5f5f5; -} - -table.docutils thead tr th { - color: #000; - font-weight: normal; - padding: 7px 5px; - vertical-align: middle; -} - -table.docutils tbody tr th, -table.docutils tbody tr td { - border-bottom: 0; - border-top: solid 1px #ddd; - padding: 7px 5px; - vertical-align: top; -} -table.docutils tbody tr:last-child th, -table.docutils tbody tr:last-child td { - border-bottom: solid 1px #ddd; -} - -table.docutils thead tr td p, -table.docutils tfoot tr td p, -table.docutils tbody tr td p, -table.docutils thead tr td ul, -table.docutils tfoot tr td ul, -table.docutils tbody tr td ul, -table.docutils thead tr td ol, -table.docutils tfoot tr td ol, -table.docutils tbody tr td ol { - margin: 0 0 .5em; -} -table.docutils thead tr td p.last, -table.docutils tfoot tr td p.last, -table.docutils tbody tr td p.last, -table.docutils thead tr td ul.last, -table.docutils tfoot tr td ul.last, -table.docutils tbody tr td ul.last, -table.docutils thead tr td ol.last, -table.docutils tfoot tr td ol.last, -table.docutils tbody tr td ol.last { - margin-bottom: 0; -} - -.viewcode-back { - font-family: Arial, sans-serif; -} - -div.viewcode-block:target { - background-color: #fef9e9; - border-top: 1px solid #fbe091; - border-bottom: 1px solid #fbe091; -} - -@media screen and (max-width: 870px) { - - div.document { - width: auto; - margin: 0; - } - - div.documentwrapper { - float: none; - } - - div.bodywrapper { - margin: 0; - } - - div.body { - min-height: 0; - padding: 0 20px 30px 20px; - } - - div.footer { - background-color: #333; - color: #888; - margin: 0; - padding: 10px 20px 20px; - text-align: left; - width: auto; - } - - div.footer a { - color: #bbb; - } - - div.footer a:hover { - color: #fff; - } - - div.sphinxsidebar { - background-color: #333; - color: #fff; - float: none; - margin: 0; - padding: 10px 20px; - width: auto; - } - - div.sphinxsidebar h3, - div.sphinxsidebar h4, - div.sphinxsidebar p, - div.sphinxsidebar h3 a { - color: #fff; - } - - div.sphinxsidebar ul { - color: #999; - } - - div.sphinxsidebar a { - color: #aaa; - } - - div.sphinxsidebar a:hover { - color: #fff; - } - -} diff --git a/docs/source/_templates/footer.html b/docs/source/_templates/footer.html deleted file mode 100644 index 5fd6ad48..00000000 --- a/docs/source/_templates/footer.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends "!footer.html" %} - -{% block extrafooter %} -{{ super() }} - -{% endblock %} diff --git a/docs/source/conf.py b/docs/source/conf.py index ade20957..75a081f6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -29,44 +29,45 @@ # -- Project information ----------------------------------------------------- -project = 'MDAKit Cookiecutter' -# author = 'MDAnalysis' +project = "MDAKit Cookiecutter" +# author = "MDAnalysis" # The short X.Y version -version = '0.1' +version = "0.1" # The full version, including alpha/beta/rc tags -release = '0.1.0b' +release = "0.1.0b" author = ", ".join(parse_authors(sort_alphabetically=True)) now = datetime.datetime.now() -copyright = f'2022-{now.year}, {author}' +copyright = f"2022-{now.year}, {author}" # -- General configuration --------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. # -# needs_sphinx = '1.0' +needs_sphinx = "6.2.1" # Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# extensions coming with Sphinx (named "sphinx.ext.*") or your custom # ones. extensions = [ - 'sphinx.ext.mathjax', - 'sphinx.ext.autosummary', + "sphinx.ext.mathjax", + "sphinx.ext.autosummary", + "mdanalysis_sphinx_theme", ] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # -# source_suffix = ['.rst', '.md'] -source_suffix = '.rst' +# source_suffix = [".rst", ".md"] +source_suffix = ".rst" # The master toctree document. -master_doc = 'index' +master_doc = "index" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -78,11 +79,11 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path . -exclude_patterns = ['_build', 'Thumbs.db', - '.DS_Store', 'generated/example-repository/*'] +exclude_patterns = ["_build", "Thumbs.db", + ".DS_Store", "generated/example-repository/*"] # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "sphinx" # -- Options for HTML output ------------------------------------------------- @@ -90,72 +91,65 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'sphinx_rtd_theme' +html_theme = "mdanalysis_sphinx_theme" # 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 # documentation. -color = {'orange': '#FF9200', - 'gray': '#808080', - 'white': '#FFFFFF', - 'black': '#000000', } html_theme_options = { - 'canonical_url': '', - 'logo_only': True, - 'display_version': True, - 'prev_next_buttons_location': 'bottom', - 'style_external_links': False, - 'style_nav_header_background': 'white', # '#e76900', # dark orange - # Toc options - 'collapse_navigation': True, - 'sticky_navigation': True, - 'navigation_depth': 4, - 'includehidden': True, - 'titles_only': False, + "mda_official": True } # 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'] -html_css_files = ['custom.css'] +html_static_path = [] +html_css_files = [] # Custom sidebar templates, must be a dictionary that maps document names # to template names. # # The default sidebars (for documents that don't match any pattern) are # defined by theme itself. Builtin themes are using these templates by -# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', -# 'searchbox.html']``. +# default: ``["localtoc.html", "relations.html", "sourcelink.html", +# "searchbox.html"]``. # -# html_sidebars = {'**': ['globaltoc.html', 'localtoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html']} +# html_sidebars = { +# "**": [ +# "globaltoc.html", +# "localtoc.html", +# "relations.html", +# "sourcelink.html", +# "searchbox.html" +# ] +# } # -- Options for HTMLHelp output --------------------------------------------- # Output file base name for HTML help builder. -htmlhelp_basename = 'MDAKitCookiecutterdoc' +htmlhelp_basename = "MDAKitCookiecutterdoc" # -- Options for LaTeX output ------------------------------------------------ latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). + # The paper size ("letterpaper" or "a4paper"). # - # 'papersize': 'letterpaper', + # "papersize": "letterpaper", - # The font size ('10pt', '11pt' or '12pt'). + # The font size ("10pt", "11pt" or "12pt"). # - # 'pointsize': '10pt', + # "pointsize": "10pt", # Additional stuff for the LaTeX preamble. # - # 'preamble': '', + # "preamble": "", # Latex figure (float) alignment # - # 'figure_align': 'htbp', + # "figure_align": "htbp", } # Grouping the document tree into LaTeX files. List of tuples @@ -163,9 +157,9 @@ # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, - 'MDAKitCookiecutter.tex', - 'MDAKit Cookiecutter Documentation', - 'MDAnalysis', 'manual'), + "MDAKitCookiecutter.tex", + "MDAKit Cookiecutter Documentation", + "MDAnalysis", "manual"), ] @@ -174,8 +168,8 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, 'mdakitcookiecutter', - 'MDAKit Cookiecutter Documentation', + (master_doc, "mdakitcookiecutter", + "MDAKit Cookiecutter Documentation", [author], 1) ] @@ -186,11 +180,11 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'MDAKitCookiecutter', - 'MDAKit Cookiecutter Documentation', - author, 'MDAKitCookiecutter', - 'A Cookiecutter which provides a template for packages based on MDAnalysis.', - 'Miscellaneous'), + (master_doc, "MDAKitCookiecutter", + "MDAKit Cookiecutter Documentation", + author, "MDAKitCookiecutter", + "A Cookiecutter which provides a template for packages based on MDAnalysis.", + "Miscellaneous"), ] diff --git a/docs/source/options.rst b/docs/source/options.rst index 02b48e96..157d4ba3 100644 --- a/docs/source/options.rst +++ b/docs/source/options.rst @@ -12,6 +12,7 @@ project_name This is the name of the project you would use when writing about it in the documentation. +This can be anything, e.g. have spaces and hyphens. repo_name --------- @@ -58,8 +59,24 @@ account name. This value is used to generate the URL to the project on GitHub (i.e. ``github.com//``). +If you set this to ``MDAnalysis``, +we will set some options for you. +For example, the default logo and favicon +will be the MDAnalysis logo and favicon. +You will also have a footer detailing our +privacy policy. + +If you set this to another value, +there will be entries in the documentation +`conf.py` that use a placeholder logo and favicon. + +Please see our `mdanalysis-sphinx-theme`_ +documentation for more information. + **Default value:** the ``github_username``. +.. _`mdanalysis-sphinx-theme`: https://mdanalysis-sphinx-theme.readthedocs.io/en/latest/ + author_name ----------- diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 4de00c54..8023786b 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -95,8 +95,17 @@ def remove_analysis(): "{{ cookiecutter.package_name }}/tests/analysis" ) -remove_rtd() -remove_analysis() +def remove_placeholder_icons(): + """Remove placeholder logos if unnecessary.""" + host_account = '{{ cookiecutter.github_host_account }}' + if host_account.lower() == "mdanalysis": + remove_files("docs/source/_static/logo") -git_init_and_tag() + +if __name__ == "__main__": + remove_rtd() + remove_analysis() + remove_placeholder_icons() + + git_init_and_tag() diff --git a/tests/test_options.py b/tests/test_options.py index 04f8cbac..047042cd 100644 --- a/tests/test_options.py +++ b/tests/test_options.py @@ -26,3 +26,35 @@ def test_analysis(self, tmpdir): ): assert kit.cookie_package_path_exists(file) assert clsname in kit.get_classes_from_package_file(file) + + +class TestGitHubHostAccount: + def test_official_mda_theme(self, tmpdir): + with tmpdir.as_cwd(): + kit = CookiecutterMDAKit(github_host_account="MDAnalysis") + kit.run() + + conf = kit.cookie_directory / "docs/source/conf.py" + assert conf.is_file() + + text = conf.read_text() + assert '"mda_official": True,' in text + assert "html_logo" not in text + assert "html_favicon" not in text + + def test_non_official_mda_theme(self, tmpdir): + with tmpdir.as_cwd(): + kit = CookiecutterMDAKit(github_host_account="other") + kit.run() + + conf = kit.cookie_directory / "docs/source/conf.py" + assert conf.is_file() + + text = conf.read_text() + patterns = [ + '"mda_official": False,', + 'html_logo = "_static/logo/placeholder_logo.png"', + 'html_favicon = "_static/logo/placeholder_favicon.svg"', + ] + for pattern in patterns: + assert pattern in text, f"{pattern} not found" diff --git a/tests/test_output.py b/tests/test_output.py index b530df19..21a57910 100644 --- a/tests/test_output.py +++ b/tests/test_output.py @@ -32,10 +32,12 @@ def test_analysis(self, tmpdir): @pytest.mark.parametrize("dependency_source", DependencyType) @pytest.mark.parametrize("include_ReadTheDocs", ["y", "n"]) +@pytest.mark.parametrize("github_host_account", ["MDAnalysis", "other"]) def test_write_outputs( test_output_directory, dependency_source, - include_ReadTheDocs + include_ReadTheDocs, + github_host_account, ): if include_ReadTheDocs == "y": rtd_name = "ReadTheDocs" @@ -43,7 +45,10 @@ def test_write_outputs( rtd_name = "no-ReadTheDocs" dep_name = f"{dependency_source.name.lower()}-deps" - project_name = f"TestMDAKit_with_{dep_name}_and_{rtd_name}" + project_name = ( + "TestMDAKit_with_host_" + f"{github_host_account}_{dep_name}_and_{rtd_name}" + ) description = ( "Test MDAKit Project with " f"dependencies using {dependency_source.name.lower()} " @@ -57,7 +62,7 @@ def test_write_outputs( repo_name="mdakit-cookie", package_name="mdakit_cookie", github_username="test-user-account", - github_host_account="MDAnalysis", + github_host_account=github_host_account, description=description, dependency_source=dependency_source, include_ReadTheDocs=include_ReadTheDocs, diff --git a/{{cookiecutter.repo_name}}/README.md b/{{cookiecutter.repo_name}}/README.md index fa798b38..e66821d3 100644 --- a/{{cookiecutter.repo_name}}/README.md +++ b/{{cookiecutter.repo_name}}/README.md @@ -19,7 +19,9 @@ [url_docs]: https://{{cookiecutter.repo_name}}.readthedocs.io/en/latest/?badge=latest [url_latest_release]: https://github.com/{{cookiecutter.github_url}}/releases [url_license]: https://www.gnu.org/licenses/gpl-2.0 -[url_mda]: https://www.mdanalysis.org{{cookiecutter.description}} +[url_mda]: https://www.mdanalysis.org + +{{cookiecutter.description}} {{cookiecutter.project_name}} is bound by a [Code of Conduct](https://github.com/{{cookiecutter.github_url}}/blob/{{cookiecutter._central_branch_name}}/CODE_OF_CONDUCT.md). diff --git a/{{cookiecutter.repo_name}}/docs/requirements.yaml b/{{cookiecutter.repo_name}}/docs/requirements.yaml index b37826b9..051920e1 100644 --- a/{{cookiecutter.repo_name}}/docs/requirements.yaml +++ b/{{cookiecutter.repo_name}}/docs/requirements.yaml @@ -10,14 +10,6 @@ dependencies: - python - pip - - sphinx<7.0 -{% if cookiecutter.dependency_source == 'Prefer default anaconda channel with pip fallback' %} - # Pip-only installs - - pip: - - sphinx_rtd_theme -{% else %} - - sphinx_rtd_theme - + - mdanalysis-sphinx-theme >=1.0.1 # Pip-only installs #- pip: -{% endif %} diff --git a/{{cookiecutter.repo_name}}/docs/source/_static/README.md b/{{cookiecutter.repo_name}}/docs/source/_static/README.md index 2f0cf843..8d30b2b4 100644 --- a/{{cookiecutter.repo_name}}/docs/source/_static/README.md +++ b/{{cookiecutter.repo_name}}/docs/source/_static/README.md @@ -7,7 +7,7 @@ so a file named "default.css" will overwrite the builtin "default.css". The path to this folder is set in the Sphinx `conf.py` file in the line: ```python -templates_path = ['_static'] +html_static_path = ['_static'] ``` ## Examples of file to add to this directory diff --git a/{{cookiecutter.repo_name}}/docs/source/_static/logo/placeholder_favicon.svg b/{{cookiecutter.repo_name}}/docs/source/_static/logo/placeholder_favicon.svg new file mode 100644 index 00000000..cf62228b --- /dev/null +++ b/{{cookiecutter.repo_name}}/docs/source/_static/logo/placeholder_favicon.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + diff --git a/{{cookiecutter.repo_name}}/docs/source/_static/logo/placeholder_logo.png b/{{cookiecutter.repo_name}}/docs/source/_static/logo/placeholder_logo.png new file mode 100644 index 00000000..77e9056e Binary files /dev/null and b/{{cookiecutter.repo_name}}/docs/source/_static/logo/placeholder_logo.png differ diff --git a/{{cookiecutter.repo_name}}/docs/source/_templates/README.md b/{{cookiecutter.repo_name}}/docs/source/_templates/README.md index 3f4f8043..e8e210a8 100644 --- a/{{cookiecutter.repo_name}}/docs/source/_templates/README.md +++ b/{{cookiecutter.repo_name}}/docs/source/_templates/README.md @@ -7,7 +7,7 @@ so a file named "page.html" will overwrite the builtin "page.html". The path to this folder is set in the Sphinx `conf.py` file in the line: ```python -html_static_path = ['_templates'] +templates_path = ['_templates'] ``` ## Examples of file to add to this directory diff --git a/{{cookiecutter.repo_name}}/docs/source/conf.py b/{{cookiecutter.repo_name}}/docs/source/conf.py index 27bee066..7223f5a3 100644 --- a/{{cookiecutter.repo_name}}/docs/source/conf.py +++ b/{{cookiecutter.repo_name}}/docs/source/conf.py @@ -12,47 +12,48 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -# Incase the project was not installed +# In case the project was not installed import os import sys -sys.path.insert(0, os.path.abspath('../..')) -import {{cookiecutter.repo_name}} # noqa +sys.path.insert(0, os.path.abspath("../..")) +import {{cookiecutter.package_name}} # noqa # -- Project information ----------------------------------------------------- -project = '{{cookiecutter.project_name}}' +project = "{{cookiecutter.project_name}}" copyright = ( - "{% now 'utc', '%Y' %}, {{cookiecutter.author_name}}. " + "{% now "utc", "%Y" %}, {{cookiecutter.author_name}}. " "Project structure based on the " "MDAnalysis Cookiecutter version {{cookiecutter._mda_cc_version}}" ) -author = '{{cookiecutter.author_name}}' +author = "{{cookiecutter.author_name}}" # The short X.Y version -version = '' +version = "" # The full version, including alpha/beta/rc tags -release = '' +release = "" # -- General configuration --------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. # -# needs_sphinx = '1.0' +needs_sphinx = "6.2.1" # Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# extensions coming with Sphinx (named "sphinx.ext.*") or your custom # ones. extensions = [ - 'sphinx.ext.autosummary', - 'sphinx.ext.autodoc', - 'sphinx.ext.mathjax', - 'sphinx.ext.viewcode', - 'sphinx.ext.napoleon', - 'sphinx.ext.intersphinx', - 'sphinx.ext.extlinks', + "sphinx.ext.autosummary", + "sphinx.ext.autodoc", + "sphinx.ext.mathjax", + "sphinx.ext.viewcode", + "sphinx.ext.napoleon", + "sphinx.ext.intersphinx", + "sphinx.ext.extlinks", + "mdanalysis_sphinx_theme", ] autosummary_generate = True @@ -67,16 +68,16 @@ napoleon_use_ivar = True # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # -# source_suffix = ['.rst', '.md'] -source_suffix = '.rst' +# source_suffix = [".rst", ".md"] +source_suffix = ".rst" # The master toctree document. -master_doc = 'index' +master_doc = "index" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -88,10 +89,10 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path . -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'default' +pygments_style = "default" # -- Options for HTML output ------------------------------------------------- @@ -99,26 +100,38 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'sphinx_rtd_theme' +html_theme = "mdanalysis_sphinx_theme" # 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 # documentation. # -# html_theme_options = {} +html_theme_options = { +{% if cookiecutter.github_host_account == "MDAnalysis" %} + "mda_official": True, +{% else %} + "mda_official": False, +{% endif %} +} + +{%- if cookiecutter.github_host_account != "MDAnalysis" %} +# Set your logo and favicon here -- replace the placeholders! +html_logo = "_static/logo/placeholder_logo.png" +html_favicon = "_static/logo/placeholder_favicon.svg" +{% endif %} # 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'] +html_static_path = ["_static"] # Custom sidebar templates, must be a dictionary that maps document names # to template names. # # The default sidebars (for documents that don't match any pattern) are # defined by theme itself. Builtin themes are using these templates by -# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', -# 'searchbox.html']``. +# default: ``["localtoc.html", "relations.html", "sourcelink.html", +# "searchbox.html"]``. # # html_sidebars = {} @@ -126,35 +139,35 @@ # -- Options for HTMLHelp output --------------------------------------------- # Output file base name for HTML help builder. -htmlhelp_basename = '{{cookiecutter.repo_name}}doc' +htmlhelp_basename = "{{cookiecutter.repo_name}}doc" # -- Options for LaTeX output ------------------------------------------------ latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). + # The paper size ("letterpaper" or "a4paper"). # - # 'papersize': 'letterpaper', + # "papersize": "letterpaper", - # The font size ('10pt', '11pt' or '12pt'). + # The font size ("10pt", "11pt" or "12pt"). # - # 'pointsize': '10pt', + # "pointsize": "10pt", # Additional stuff for the LaTeX preamble. # - # 'preamble': '', + # "preamble": "", # Latex figure (float) alignment # - # 'figure_align': 'htbp', + # "figure_align": "htbp", } # 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 = [ - (master_doc, '{{cookiecutter.repo_name}}.tex', '{{cookiecutter.project_name}} Documentation', - '{{cookiecutter.repo_name}}', 'manual'), + (master_doc, "{{cookiecutter.repo_name}}.tex", "{{cookiecutter.project_name}} Documentation", + "{{cookiecutter.repo_name}}", "manual"), ] @@ -163,7 +176,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, '{{cookiecutter.repo_name}}', '{{cookiecutter.project_name}} Documentation', + (master_doc, "{{cookiecutter.repo_name}}", "{{cookiecutter.project_name}} Documentation", [author], 1) ] @@ -174,14 +187,14 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, '{{cookiecutter.repo_name}}', '{{cookiecutter.project_name}} Documentation', - author, '{{cookiecutter.repo_name}}', '{{cookiecutter.description}}', - 'Miscellaneous'), + (master_doc, "{{cookiecutter.repo_name}}", "{{cookiecutter.project_name}} Documentation", + author, "{{cookiecutter.repo_name}}", "{{cookiecutter.description}}", + "Miscellaneous"), ] # -- Extension configuration ------------------------------------------------- intersphinx_mapping = { - 'python': ('https://docs.python.org/3/', None), - 'mdanalysis': ('https://docs.mdanalysis.org/stable/', None), + "python": ("https://docs.python.org/3/", None), + "mdanalysis": ("https://docs.mdanalysis.org/stable/", None), }