diff --git a/ChangeLog.md b/ChangeLog.md index b5c75b1..1f138cf 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,11 @@ # Change Log +## [0.4.0] - 2024-08-05 + +- Move `pygments_light_style` and `pygments_dark_style` options inside theme options (`html_theme_options`), as `pygments_dark_style` is no longer a valid config setting in `app.config` by Sphinx. Update docs accordingly. +- Change CSS margins for table element. +- Use text-align in paragraphs included inside figures, so that they are aligned conform to the figure alignment. + ## [0.3.7] - 2024-08-02 - Fix highlighting foldable items in the left-side TOC when they are the current selected item. diff --git a/docs/source/conf.py b/docs/source/conf.py index 873f622..27c1b19 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -70,8 +70,6 @@ html_style = ["custom.css", "nftt-pygments.min.css"] -pygments_style = "pastie" -pygments_dark_style = "dracula" html_theme_options = { "documentation_font": "Open Sans", @@ -80,6 +78,8 @@ "monospace_font_size": "1.1rem", "style": "orange", + "pygments_light_style": "pastie", + "pygments_dark_style": "dracula", "logo": "img/nefertiti.svg", "logo_alt": "Nefertiti-for-Sphinx", diff --git a/docs/source/users-guide/customization/pygments.rst b/docs/source/users-guide/customization/pygments.rst index 498e066..9926be5 100644 --- a/docs/source/users-guide/customization/pygments.rst +++ b/docs/source/users-guide/customization/pygments.rst @@ -34,74 +34,82 @@ List all available Pygments styles using the following code (extracted from `her .. note:: - The following code uses Pygments version 2.13.0. + The following code uses Pygments version 2.18.0. .. code-block:: python + import pprint from pygments.styles import get_all_styles styles = list(get_all_styles()) - print(styles) - + pprint.pprint(styles) [ + 'abap', + 'algol', + 'algol_nu', + 'arduino', + 'autumn', + 'bw', + 'borland', + 'coffee', + 'colorful', 'default', + 'dracula', 'emacs', - 'friendly', 'friendly_grayscale', - 'colorful', - 'autumn', - 'murphy', + 'friendly', + 'fruity', + 'github-dark', + 'gruvbox-dark', + 'gruvbox-light', + 'igor', + 'inkpot', + 'lightbulb', + 'lilypond', + 'lovelace', 'manni', 'material', 'monokai', - 'perldoc', - 'pastie', - 'borland', - 'trac', + 'murphy', 'native', - 'fruity', - 'bw', - 'vim', - 'vs', - 'tango', - 'rrt', - 'xcode', - 'igor', - 'paraiso-light', + 'nord-darker', + 'nord', + 'one-dark', 'paraiso-dark', - 'lovelace', - 'algol', - 'algol_nu', - 'arduino', + 'paraiso-light', + 'pastie', + 'perldoc', 'rainbow_dash', - 'abap', + 'rrt', + 'sas', 'solarized-dark', 'solarized-light', - 'sas', 'staroffice', - 'stata', - 'stata-light', 'stata-dark', - 'inkpot', - 'zenburn', - 'gruvbox-dark', - 'gruvbox-light', - 'dracula', - 'one-dark', - 'lilypond', - 'nord', - 'nord-darker', - 'github-dark' + 'stata-light', + 'tango', + 'trac', + 'vim', + 'vs', + 'xcode', + 'zenburn' ] Customize Pygments ================== -Change the default Pygments styles by modifying the ``pygments_style`` and ``pygments_dark_style`` settings in your **conf.py** module. They are global settings like ``html_theme`` (they do not go inside ``html_theme_options``): +.. versionchanged:: 0.4.0 + +Customize Pygments styles by modifying the ``pygments_light_style`` and ``pygments_dark_style`` settings in your **conf.py** module, in your ``html_theme_options``: .. code-block:: python - pygments_style = "pastie" - pygments_dark_style = "dracula" + html_theme_options = { + # + "pygments_light_style": "pastie", + "pygments_dark_style": "dracula", + } + +Should your ``conf.py`` provide the global setting ``pygments_style``, it will be overrided by this configuration. Then save the changes and rebuild your Sphinx site: diff --git a/package-lock.json b/package-lock.json index f8d01ae..0802624 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "sphinx-nefertiti", - "version": "0.3.3", + "version": "0.4.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sphinx-nefertiti", - "version": "0.3.3", + "version": "0.4.0", "license": "MIT", "dependencies": { "@octokit/rest": "^19.0.5", - "bootstrap": "5.3.2" + "bootstrap": "5.3.3" }, "devDependencies": { "@babel/cli": "^7.21.0", @@ -2692,9 +2692,9 @@ "dev": true }, "node_modules/bootstrap": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.2.tgz", - "integrity": "sha512-D32nmNWiQHo94BKHLmOrdjlL05q1c8oxbtBphQFb9Z5to6eGRDCm0QgeaZ4zFBHzfg2++rqa2JkqCcxDy0sH0g==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.3.tgz", + "integrity": "sha512-8HLCdWgyoMguSO9o+aH+iuZ+aht+mzW0u3HIMzVu7Srrpv7EBBxTnrFlSCskwdY1+EOFQSm7uMJhNQHkdPcmjg==", "funding": [ { "type": "github", @@ -10870,9 +10870,9 @@ } }, "bootstrap": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.2.tgz", - "integrity": "sha512-D32nmNWiQHo94BKHLmOrdjlL05q1c8oxbtBphQFb9Z5to6eGRDCm0QgeaZ4zFBHzfg2++rqa2JkqCcxDy0sH0g==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.3.tgz", + "integrity": "sha512-8HLCdWgyoMguSO9o+aH+iuZ+aht+mzW0u3HIMzVu7Srrpv7EBBxTnrFlSCskwdY1+EOFQSm7uMJhNQHkdPcmjg==", "requires": {} }, "brace-expansion": { diff --git a/package.json b/package.json index ba2c441..6665e84 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sphinx-nefertiti", - "version": "0.3.7", + "version": "0.4.0", "private": true, "description": "Nefertiti is a theme for the Sphinx Documentation Generator.", "engines": { diff --git a/scss/components/_docutils.scss b/scss/components/_docutils.scss index 72de9f5..46996ba 100644 --- a/scss/components/_docutils.scss +++ b/scss/components/_docutils.scss @@ -26,6 +26,7 @@ .nftt-table { width: 100%; + margin-bottom: $spacer; overflow-x: auto; } @@ -37,10 +38,10 @@ table td p:last-child { table.docutils { &:not(.field-list) { - width: 96%; + width: 100%; margin-top: $spacer; margin-right: auto; - margin-bottom: $spacer * 1.5; + margin-bottom: $spacer; margin-left: auto; border: 0; border-color: var(--#{$prefix}pre-border-color); diff --git a/scss/components/_images.scss b/scss/components/_images.scss index cef8843..90b1acd 100644 --- a/scss/components/_images.scss +++ b/scss/components/_images.scss @@ -41,6 +41,10 @@ figure { figcaption { margin: 1rem auto .5rem; } + + p { + text-align: center; + } } &.align-left { @@ -51,5 +55,9 @@ figure { &.align-right { float: right; margin: .4rem 0 .4rem 1.8rem; + + p { + text-align: right; + } } } diff --git a/setup.py b/setup.py index ee9a8ba..a8f6b18 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ setup( name="sphinx-nefertiti", - version="0.3.7", + version="0.4.0", packages=find_packages(), include_package_data=True, license="MIT", diff --git a/sphinx_nefertiti/pygments.py b/sphinx_nefertiti/pygments.py index 51d2ddb..7531bb4 100644 --- a/sphinx_nefertiti/pygments.py +++ b/sphinx_nefertiti/pygments.py @@ -5,7 +5,7 @@ # To keep the name used in the Sphinx sources. pygments_options = [ - ("pygments_style", "pygments.css", ".light"), + ("pygments_light_style", "pygments.css", ".light"), ("pygments_dark_style", "pygments_dark.css", ".dark"), ] diff --git a/sphinx_nefertiti/theme.conf b/sphinx_nefertiti/theme.conf index c080629..56f79d6 100644 --- a/sphinx_nefertiti/theme.conf +++ b/sphinx_nefertiti/theme.conf @@ -2,11 +2,11 @@ inherit = basic sidebars = globaltoc.html # stylesheet = dist/theme.css -pygments_style = emacs -pygments_dark_style = monokai [options] style = default +pygments_light_style = emacs +pygments_dark_style = monokai sans_serif_font = Nunito monospace_font = Red Hat Mono monospace_font_size = diff --git a/sphinx_nefertiti/utils.py b/sphinx_nefertiti/utils.py index e743c89..0a1a0e7 100644 --- a/sphinx_nefertiti/utils.py +++ b/sphinx_nefertiti/utils.py @@ -1,4 +1,4 @@ -_CURRENT_VERSION = (0, 3, 7, "f", 0) # following PEP 440 +_CURRENT_VERSION = (0, 4, 0, "f", 0) # following PEP 440 def get_version():