Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds git history to pages. Since I'm also adding in a little js to handle some clicks, I also added configs for
prettier
andeslint
. To build we now needpandas
(for rendering tables of git data) andgitpython
(for fetching git history).The git history button is in the right hand sidebar. It opens up a modal with a table of edits to the current page; git history is fetched at build time.
The way it works is that the "Show article history" button is actually a checkbox which toggles its state. When it's checked, the modal is shown with a CSS rule; otherwise the modal is hidden.
Changes
prettier
andeslint
configspandas
andgitpython
dependenciesNotes
I considered using the bootstrap.js modal, but to be honest I was never able to get this to render properly (always showed up underneath the top nav bar), and the modal background itself always appeared above the dialog box, so you could never close it. Generally speaking the bootstrap.js components haven't been very easy to use with
sphinx
/pydata-sphinx-theme
, and this was definitely a case where it was easier to roll my own modal.Here's what it looks like:
Resolves #21.