WIP: Try wrapping section content in html classes #147
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.
Trying to make sections stylable (i.e. putting them in HTML elements with specified classes, like
numpydoc-section
andnumpydoc-{parameters,attributes,...}
) turns out to be quite hard:.. rst-class::
works sometimes, but labels every paragraph in an unstructured section, and does not wrap autosummary tables.. container::
(the right way to do it) adds the classcontainer
to the HTML div (this is hard-wired into docutils), which interacts with bootstrap.css.. raw:: html \n\n <div class="....">
sometimes works, sometimes doesn't. It seems that docutils sometimes closes the opened<div>
automatically before the following content (this happens for definition lists, but not for an autosummary table). Looks like a bug, but I've not yet understood where it's coming from.This PR uses
rst-class
to add a class to parameter listings, as a proof of concept. Better would be to use.. container::
or equivalent (I've tried creating my own directive, but copying the existing container class doesn't help because all the writing logic is hardwired in docutils), but we need to work out a way to disable default.container
styling from bootstrap, which in scipy central's theme setswidth: 80%
.I thought this would be more straightforward. I'm not convinced anything in reST is straightforward.
Related: #88