chirun-ncl / chirun

A Python package providing the command line interface for building flexible and accessible content with Chirun.
https://chirun.org.uk/
Other
29 stars 4 forks source link

Style <blockquote> so quotes look distinct from normal paragraph text in HTML #99

Closed prowlett closed 3 years ago

prowlett commented 3 years ago

Please will you put some style on <blockquote>?

When I write this in Markdown

A wise man once said:

> In a hole in the ground there lived a hobbit.

it looks like this in my Markdown editor.

Blockquote is indented, grey text preceded by a thick vertical bar

In the PDF output it looks like this. I find the box a bit weird but okay, at least it stands out.

Blockquote is inside a box

Whereas in the HTML output it just looks like a normal paragraph.

Blockquote appears as normal text

The quote is inside a <blockquote>, so presumably some style could be attached to that?

<p>A wise man once said:</p>
<blockquote>
<p>In a hole in the ground there lived a hobbit.</p>
</blockquote>

In LaTeX, using

\begin{quote}
In a hole in the ground there lived a hobbit.
\end{quote}

looks like this in the PDF

Blockquote is indented

but still looks like normal text in the HTML

<p>
 A wise man once said: 
</p>
<blockquote class="quote"> In a hole in the ground there lived a hobbit. </blockquote>

Meanwhile, using

\begin{quotation}
In a hole in the ground there lived a hobbit.
\end{quotation}

looks like this

Blockquote is indented a bit more

(I don't really understand quote vs. quotation, but I think it's indented the same and also the first line is indented further)

and produces this HTML:

<p>
 A wise man once said: 
</p>
<blockquote class="quotation"> In a hole in the ground there lived a hobbit. </blockquote>

I'm not sure I would need a difference in style between <blockquote>, <blockquote class="quote"> and <blockquote class="quotation">, but there may be some subtlety I'm missing.

georgestagg commented 3 years ago

I've added a CSS style for blockquote in the default theme in commit 6a9b37b.

Output from pdflatex will be as before, but HTML and markdown PDF output should now look something like this:

Screenshot 2021-09-20 at 13 51 31

I've not styled based on the quote or quotation class, so both should pick it up.

prowlett commented 3 years ago

Brilliant, thanks!

I first upgraded and it didn't work. I noticed that all the files in build/default/static, and indeed their counterparts in coursebuilder_env/lib/python3.9/site-packages/makeCourse/themes/default/static were last modified in May. So I ran the upgrade with --force-reinstall and now it works fine.