Skip to content

Commit

Permalink
html, css: Remove the -output-sticky-wrapper class to save space
Browse files Browse the repository at this point in the history
  • Loading branch information
cpitclaudel committed Jul 15, 2021
1 parent 2b1bfa4 commit dc4b128
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Unreleased
Breaking changes
----------------

- Alectryon now generates simpler HTML markup for hypothesis blocks (may affect third-party stylesheets). [59563f1]
- The HTML markup for ``alectryon-io`` blocks has been simplified to save space in generated files (may affect third-party stylesheets). [59563f1]

- ``json.Cache`` in module ``alectryon.json`` now takes arbitrary ``metadata`` instead of ``sertop_args``. [56ca103]

Expand Down
14 changes: 7 additions & 7 deletions alectryon/assets/alectryon.css
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ In any case, make an exception for comments:
justify-content: flex-start;
}

.alectryon-toggle:checked + label + .alectryon-container .alectryon-sentence .alectryon-output > .alectryon-output-sticky-wrapper,
.alectryon-io .alectryon-sentence .alectryon-toggle:checked ~ .alectryon-output > .alectryon-output-sticky-wrapper {
.alectryon-toggle:checked + label + .alectryon-container .alectryon-sentence .alectryon-output > div,
.alectryon-io .alectryon-sentence > .alectryon-toggle:checked ~ .alectryon-output > div {
display: block;
}

Expand Down Expand Up @@ -472,15 +472,15 @@ In any case, make an exception for comments:
.alectryon-output to a reasonable size (100%, through top = bottom = 0).
See also https://stackoverflow.com/questions/43909940/. */
/* See note on specificity above */
.alectryon-floating .alectryon-sentence.alectryon-target /* .alectryon-toggle ~ */ .alectryon-output .alectryon-output-sticky-wrapper,
.alectryon-floating .alectryon-sentence:hover .alectryon-output-sticky-wrapper {
.alectryon-floating .alectryon-sentence.alectryon-target /* > .alectryon-toggle ~ */ .alectryon-output > div,
.alectryon-floating .alectryon-sentence:hover .alectryon-output > div {
margin-bottom: -200%;
position: sticky;
top: 0;
}

.alectryon-floating .alectryon-toggle:checked + label + .alectryon-container .alectryon-sentence .alectryon-output > .alectryon-output-sticky-wrapper,
.alectryon-floating .alectryon-io .alectryon-sentence .alectryon-toggle:checked ~ .alectryon-output > .alectryon-output-sticky-wrapper {
.alectryon-floating .alectryon-toggle:checked + label + .alectryon-container .alectryon-sentence .alectryon-output > div,
.alectryon-floating .alectryon-io .alectryon-sentence > .alectryon-toggle:checked ~ .alectryon-output > div {
margin-bottom: unset; /* Undo the margin */
}

Expand Down Expand Up @@ -536,7 +536,7 @@ In any case, make an exception for comments:
overflow-y: unset;
}

.alectryon-windowed .alectryon-output-sticky-wrapper {
.alectryon-windowed .alectryon-output > div {
display: flex; /* Put messages after goals */
flex-direction: column-reverse;
}
Expand Down
4 changes: 2 additions & 2 deletions alectryon/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ def gen_input(self, fr, toggle):

def gen_output(self, fr):
# Using <small> improves rendering in RSS feeds
wrapper = tags.div(cls="alectryon-output-sticky-wrapper")
with tags.small(cls="alectryon-output").add(wrapper):
sticky_wrapper = tags.div()
with tags.small(cls="alectryon-output").add(sticky_wrapper):
for output in fr.outputs:
if isinstance(output, Messages):
assert output.messages, "transforms.commit_io_annotations"
Expand Down
2 changes: 1 addition & 1 deletion recipes/sphinx/_build/html/math.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h1>MathJax in Sphinx<a class="headerlink" href="#mathjax-in-sphinx" title="Perm
<p>Using any math on a page causes Sphinx to automatically load MathJax: <span class="math notranslate nohighlight">\(e^{i\pi} = -1\)</span>.</p>
<p>If you want to highlight pieces of code with MathJax, too, then see <code class="docutils literal notranslate"><span class="pre">README.rst</span></code> and the implementation of <code class="docutils literal notranslate"><span class="pre">_static/mathjax_config.js</span></code>:</p>
<div class="coq-math"><pre class="alectryon-io"><!-- Generator: Alectryon --><span class="alectryon-sentence"><span class="alectryon-input"><span class="highlight"><span class="kn">Notation</span> <span class="s2">&quot;\mathbb{N}&quot;</span> := nat.</span></span><span class="alectryon-wsp">
</span></span><span class="alectryon-sentence"><input checked="checked" class="alectryon-toggle" id="math-rst-chk0" style="display: none" type="checkbox"><label class="alectryon-input" for="math-rst-chk0"><span class="highlight"><span class="kn">Print</span> nat.</span></label><small class="alectryon-output"><div class="alectryon-output-sticky-wrapper"><div class="alectryon-messages"><blockquote class="alectryon-message"><span class="highlight"><span class="kn">Inductive</span> <span class="nf">nat</span> : <span class="kt">Set</span> :=
</span></span><span class="alectryon-sentence"><input checked="checked" class="alectryon-toggle" id="math-rst-chk0" style="display: none" type="checkbox"><label class="alectryon-input" for="math-rst-chk0"><span class="highlight"><span class="kn">Print</span> nat.</span></label><small class="alectryon-output"><div><div class="alectryon-messages"><blockquote class="alectryon-message"><span class="highlight"><span class="kn">Inductive</span> <span class="nf">nat</span> : <span class="kt">Set</span> :=
O : \mathbb{N} | S : \mathbb{N} -&gt; \mathbb{N}

<span class="kn">Arguments</span> S _%nat_scope</span></blockquote></div></div></small></span></pre></div></div>
Expand Down

0 comments on commit dc4b128

Please sign in to comment.