Skip to content

Commit

Permalink
Merge pull request #41 from lsst-sqre/tickets/DM-42142
Browse files Browse the repository at this point in the history
DM-42142: Update pygments extension to work with linkcheck builder
  • Loading branch information
jonathansick authored Dec 15, 2023
2 parents 7a862e3 + 44b24af commit b440eaa
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

<!-- scriv-insert-here -->

<a id='changelog-0.6.2'></a>
## 0.6.2 (2023-12-14)

### Bug fixes

- Fix the `technote.ext.pygmentsscss` extension to handle cases where the HTML builder isn't being run.

<a id='changelog-0.6.1'></a>
## 0.6.1 (2023-12-14)

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10385500.svg)](https://doi.org/10.5281/zenodo.10385500)
[![Python CI](https://github.com/lsst-sqre/technote/actions/workflows/ci.yaml/badge.svg)](https://github.com/lsst-sqre/technote/actions/workflows/ci.yaml)

# Technote

Rubin Observatory's framework for Sphinx-based technote documents.
Expand Down
8 changes: 8 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ technote is developed on GitHub at https://github.com/lsst-sqre/technote.

View a demo technote page

Cite Technote
=============

You can cite the latest Technote release if you mention Technote in a publication:

.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.10385500.svg
:target: https://doi.org/10.5281/zenodo.10385500

.. toctree::
:hidden:

Expand Down
3 changes: 3 additions & 0 deletions src/technote/ext/pygmentscss.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def overwrite_pygments_css(
return

pygment_css_path = Path(app.builder.outdir) / "_static" / "pygments.css"
if not pygment_css_path.is_file():
# Handles cases where the html builder isn't running (e.g. link check)
return
pygments_css = _create_pygments_css()
pygment_css_path.write_text(pygments_css)

Expand Down

0 comments on commit b440eaa

Please sign in to comment.