Skip to content

Commit

Permalink
Prepare release 0.4.0 (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirus authored Aug 5, 2024
1 parent 1f44ff0 commit 865f04f
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 60 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
90 changes: 49 additions & 41 deletions docs/source/users-guide/customization/pygments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
# <other options here>
"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:

Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
5 changes: 3 additions & 2 deletions scss/components/_docutils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

.nftt-table {
width: 100%;
margin-bottom: $spacer;
overflow-x: auto;
}

Expand All @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions scss/components/_images.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ figure {
figcaption {
margin: 1rem auto .5rem;
}

p {
text-align: center;
}
}

&.align-left {
Expand All @@ -51,5 +55,9 @@ figure {
&.align-right {
float: right;
margin: .4rem 0 .4rem 1.8rem;

p {
text-align: right;
}
}
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion sphinx_nefertiti/pygments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
]

Expand Down
4 changes: 2 additions & 2 deletions sphinx_nefertiti/theme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion sphinx_nefertiti/utils.py
Original file line number Diff line number Diff line change
@@ -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():
Expand Down

0 comments on commit 865f04f

Please sign in to comment.