Skip to content

Commit

Permalink
Add CSS to make all :term: links bold
Browse files Browse the repository at this point in the history
- Perhaps useful if we are using glossaries now
  • Loading branch information
rkdarst committed Mar 7, 2024
1 parent 920dac9 commit cf9071f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions content/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Adding ``sphinx_lesson`` as an extension adds these sub-extensions:
* ``sphinx_lesson.directives`` - see :doc:`directives`.
* ``sphinx_lesson.md_transforms`` - see :doc:`md-transforms`.
* ``sphinx_lesson.exerciselist`` - see :doc:`exercise-list`.
* ``sphinx_lesson.term_role_formatting`` - makes glossary term
references bold
* Enables the `myst_notebook extension
<https://myst-nb.readthedocs.io/en/latest/>`__, which also enables
`myst_parser
Expand Down
1 change: 1 addition & 0 deletions sphinx_lesson/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def setup(app):
app.setup_extension(__name__+'.directives')
app.setup_extension(__name__+'.md_transforms')
app.setup_extension(__name__+'.exerciselist')
app.setup_extension(__name__+'.term_role_formatting')

return {
'version': __version__,
Expand Down
4 changes: 4 additions & 0 deletions sphinx_lesson/_static/term_role_formatting.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* Make terms bold */
a.reference span.std-term {
font-weight: bold;
}
14 changes: 14 additions & 0 deletions sphinx_lesson/term_role_formatting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""Make term definition links bold
"""

from . import __version__

def setup(app):
"Sphinx extension setup"
app.add_css_file("term_role_formatting.css")

return {
'version': __version__,
'parallel_read_safe': True,
'parallel_write_safe': True,
}

0 comments on commit cf9071f

Please sign in to comment.