From 350f7d492c082b2cbf631e2e2941b877bb449296 Mon Sep 17 00:00:00 2001 From: "kujiu (@ciredutemps)" Date: Sun, 31 May 2020 01:12:11 +0200 Subject: [PATCH] No more need of ABlog --- CHANGES | 8 ++++ demo/conf.py | 16 +++++-- demo/source/domain.rst | 2 +- docs/source/about.rst | 27 ++++------- docs/source/conf.py | 18 +++---- docs/source/configuration.rst | 60 +++++++++++++++++++++--- docs/source/index.rst | 7 ++- docs/source/who.rst | 14 ------ setup.py | 4 +- sphinx_nervproject_theme/__init__.py | 6 +-- sphinx_nervproject_theme/archives.html | 2 +- sphinx_nervproject_theme/authors.html | 2 +- sphinx_nervproject_theme/categories.html | 2 +- sphinx_nervproject_theme/collection.html | 2 +- sphinx_nervproject_theme/languages.html | 2 +- sphinx_nervproject_theme/locations.html | 2 +- sphinx_nervproject_theme/page.html | 14 ++---- sphinx_nervproject_theme/postcard.html | 2 +- sphinx_nervproject_theme/tagcloud.html | 2 +- 19 files changed, 110 insertions(+), 82 deletions(-) delete mode 100644 docs/source/who.rst diff --git a/CHANGES b/CHANGES index 28cfc5a..08209b2 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,14 @@ Changes ======= +1.0.3 (*2020-05-31*) +==================== + +- ABlog is no more needed to build simple site +- Fix some futurewarning +- Fix documentation +- Fix demo site + 1.0.2 (*2020-05-27*) ==================== diff --git a/demo/conf.py b/demo/conf.py index 176c41a..3231fdd 100644 --- a/demo/conf.py +++ b/demo/conf.py @@ -18,8 +18,8 @@ # -- Project information ----------------------------------------------------- project = 'demo' -copyright = '2019, Eduardo' -author = 'Eduardo' +copyright = '2020, kujiu' +author = 'Kujiu' # The full version, including alpha/beta/rc tags release = '0.1' @@ -35,7 +35,6 @@ master_doc = 'source/index' extensions = [ 'sphinx.ext.mathjax', 'sphinx.ext.autodoc', - 'ablog', ] # Add any paths that contain templates here, relative to this directory. @@ -53,6 +52,17 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # a list of builtin themes. # html_theme = 'nervproject' +html_theme_options = { + "logoalt": project, + "social": [ + ], + "license": { + 'type': 'CC', + 'subtype': 'BY-SA', + 'version': '4.0', + 'url': 'https://creativecommons.org/licenses/by-sa/4.0/legalcode' + } +} # 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, diff --git a/demo/source/domain.rst b/demo/source/domain.rst index e961d55..873d756 100644 --- a/demo/source/domain.rst +++ b/demo/source/domain.rst @@ -20,7 +20,7 @@ Python autofunction ------------ -.. autofunction:: sphinx_press_theme.add_toctree_data +.. autofunction:: sphinx_nervproject_theme.add_toctree_data autoclass --------- diff --git a/docs/source/about.rst b/docs/source/about.rst index db1e995..134c8a2 100644 --- a/docs/source/about.rst +++ b/docs/source/about.rst @@ -2,16 +2,13 @@ About ===== -Sphinx Press is a modern responsive theme for python's -`Sphinx docs `_. +A modern responsive theme for python's `Sphinx `_ documentation generator based on +sphinx_press_theme and ablog. + This theme is based on `VuePress `_. -It uses `Vue.js `_ & -`Stylus `_ managed by -`webpack `_ -(through `vue-cli `_). - - +It uses `Vue.js `_ and LessCSS managed by +`webpack `_ through `vue-cli `_. Usage ===== @@ -21,22 +18,14 @@ First install the theme: .. code-block:: console - $ pip install sphinx_press_theme + $ pip install sphinx_nervproject_theme -On Sphinx project's ``conf.py``: set the theme name to ``press``. +On Sphinx project's ``conf.py``: set the theme name to ``nervproject``. .. code-block:: python - html_theme = "press" + html_theme = "nervproject" See details on `Sphinx theming docs `_. - - -Status -====== - -**Press** theme is still in **BETA**. - -Contributions are welcome. diff --git a/docs/source/conf.py b/docs/source/conf.py index 0dfd0b4..bcf39e6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -19,9 +19,9 @@ # -- Project information ----------------------------------------------------- -project = 'sphinx_press_theme' -copyright = '2018, Eduardo Naufel Schettino' -author = 'Eduardo Naufel Schettino' +project = 'sphinx_nervproject_theme' +copyright = '2020, kujiu' +author = 'kujiu' # The short X.Y version version = '' @@ -79,7 +79,7 @@ pygments_style = None # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'press' +html_theme = 'nervproject' # 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 @@ -106,7 +106,7 @@ html_static_path = ['_static'] # -- Options for HTMLHelp output --------------------------------------------- # Output file base name for HTML help builder. -htmlhelp_basename = 'sphinx_press_themedoc' +htmlhelp_basename = 'sphinx_nervproject_themedoc' # -- Options for LaTeX output ------------------------------------------------ @@ -133,7 +133,7 @@ latex_elements = { # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'sphinx_press_theme.tex', 'sphinx\\_press\\_theme Documentation', + (master_doc, 'sphinx_nervproject_theme.tex', 'sphinx\\_press\\_theme Documentation', 'Eduardo Naufel Schettino', 'manual'), ] @@ -143,7 +143,7 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, 'sphinx_press_theme', 'sphinx_press_theme Documentation', + (master_doc, 'sphinx_nervproject_theme', 'sphinx_nervproject_theme Documentation', [author], 1) ] @@ -154,8 +154,8 @@ man_pages = [ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'sphinx_press_theme', 'sphinx_press_theme Documentation', - author, 'sphinx_press_theme', 'One line description of project.', + (master_doc, 'sphinx_nervproject_theme', 'sphinx_nervproject_theme Documentation', + author, 'sphinx_nervproject_theme', 'One line description of project.', 'Miscellaneous'), ] diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index 2b908cc..2bdbefe 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -2,7 +2,7 @@ Configuration ============= -The Press theme webpage is composed of a fixed header, a sidebar and main content area. +The NervProject theme webpage is composed of a fixed header, a sidebar and main content area. The ``util`` folder contains Jinja2 snippets to be *included*, from main templates. Those can be easily replaced by theme users. @@ -54,12 +54,51 @@ If provided, creates external links (e.g. Github) in the top right corner: .. code-block:: python - html_theme_options = { - "external_links": [ - ("Github", "https://github.com/username/repo"), - ("Other", "https://bla.com") - ] - } + html_theme_options = { + "logoalt": project, + "social": [ + ('iconset', 'icon', 'text', 'link'), + ], + "twitter_user": "", + "mastodon_user": "@user@instance", + "fathom": { + 'url': 'example.org', + 'id': 'FATHOM', + }, + 'isso': { + 'prefix': '/isso', + 'url': baseurl + '/isso', + 'require_author': "true", + 'lang': 'fr', + 'reply_to_self': "true", + 'require_author': "true", + 'require_email': "false", + 'reply_notif': "true", + 'max_comments_top': 20, + 'max_comments_nested': 20, + 'reveal_on_click': 20, + 'avatar': "true", + 'vote': "false", + 'vote_levels': "", + 'feed': "true", + }, + "license": { + 'type': 'CC', + 'subtype': 'BY-SA', + 'version': '4.0', + 'url': 'https://creativecommons.org/licenses/by-sa/4.0/legalcode' + } + } + html_sidebars = { + '**': [ + 'about.html', + 'postcard.html', 'util/sidetoc.html', + 'recentposts.html', 'tagcloud.html', + 'categories.html', 'archives.html', + 'social.html', + 'util/searchbox.html', + ], + } Templates ========= @@ -143,3 +182,10 @@ Links for previous/next page. Copyright information. +``ui/src/vuepress/styles/config.less`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This file contains the four sub-themes color schemes. +You can fork and rebuild a theme from scratch changing +this file, or using CSS priority rules to override +values. diff --git a/docs/source/index.rst b/docs/source/index.rst index 7b03a29..41983f1 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,10 +1,10 @@ -.. sphinx_press_theme documentation master file, created by +.. sphinx_nervproject_theme documentation master file, created by sphinx-quickstart on Mon Jul 30 11:44:38 2018. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -sphinx_press_theme -================== +sphinx_nervproject_theme +======================== .. toctree:: :maxdepth: 2 @@ -12,7 +12,6 @@ sphinx_press_theme about configuration - who changes .. toctree:: diff --git a/docs/source/who.rst b/docs/source/who.rst deleted file mode 100644 index 964ee63..0000000 --- a/docs/source/who.rst +++ /dev/null @@ -1,14 +0,0 @@ -Who is using **Press** Theme -============================ - -If you this theme please add your site below: - - -- `doit `_ -- `Crudcast `_ -- `Friendly ML Tutorial `_ -- `Kube Control `_ -- `Butter MAS Python API `_ -- `trcls `_ -- `bedshape `_ -- `DNA Chisel `_ diff --git a/setup.py b/setup.py index f8ebdf9..0f97435 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ with open("README.rst", "r") as fh: setup( name="sphinx_nervproject_theme", - version="1.0.2", + version="1.0.3", url="https://procrastinator.nerv-project.eu/nerv-project/communication/sphinx_nervproject_theme", license="EUPL 1.2", author="Kujiu", @@ -58,8 +58,6 @@ setup( entry_points={"sphinx.html_themes": ["nervproject = sphinx_nervproject_theme"]}, install_requires=[ "sphinx>=3.0.0", - "reportlab", - "ablog", "sphinx-fasvg" ], classifiers=[ diff --git a/sphinx_nervproject_theme/__init__.py b/sphinx_nervproject_theme/__init__.py index 603858d..9a9e9b8 100644 --- a/sphinx_nervproject_theme/__init__.py +++ b/sphinx_nervproject_theme/__init__.py @@ -98,10 +98,8 @@ def add_toctree_data(app, pagename, templatename, context, doctree): entry_docname = tree['entries'][0][1] toctrees = app.env.toc_dict[entry_docname]['toctrees'] - if toctrees: - # FIXME - assert len(toctrees) == 1, "Press: Not supported more then one toctree on nested toctree" - tree = toctrees[0] + for tree in toctrees: + pass current0 = False # same page might have multiple tocs diff --git a/sphinx_nervproject_theme/archives.html b/sphinx_nervproject_theme/archives.html index 879e3dc..9454fd6 100644 --- a/sphinx_nervproject_theme/archives.html +++ b/sphinx_nervproject_theme/archives.html @@ -1,4 +1,4 @@ -{% if ablog.archive %} +{% if ablog and ablog.archive %}