PreTeXtBook / pretext

PreTeXt: an authoring and publishing system for scholarly documents
https://pretextbook.org
Other
266 stars 209 forks source link

Nicely formatted HTML output #1654

Open rbeezer opened 2 years ago

rbeezer commented 2 years ago

Compare HTML output, from

a9497fac87eee4589da9540d1a92d58c8cd35e39 to adacc14861e75074f06e2fba562b292cbb405039

a sample below. Hard to read/parse/understand formatting, to nice crisp clear newlines. Hmmm.

 </h5></a></article><div class="hidden-content tex2jax_ignore" id="hk-example-structured"><article class="example example-like"><p id="p-61">This is an example of an example with a bit more structure.  Specifically, the example has a <code class="code-inline tex2jax_ignore">title</code>, as usual, but then has a <code class="code-inline tex2jax_ignore">statement</code>, which is separate from the <code class="code-inline tex2jax_ignore">solution</code>.  Why did we implement an example in two ways?</p>
-<div class="solutions">
-<a href="" data-knowl="" class="id-ref solution-knowl original" data-refid="hk-solution-1" id="solution-1"><span class="type">Solution</span><span class="period">.</span></a><div class="hidden-content tex2jax_ignore" id="hk-solution-1"><div class="solution solution-like"><p id="p-62">Authors asked for it and it seemed a very natural thing to do, even if we only had an unstructured version for a long time.</p></div></div>
+<div class="solution solution-like" id="solution-1">
+<h5 class="heading">
+<span class="type">Solution</span><span class="period">.</span>
+</h5>
+<p id="p-62">Authors asked for it and it seemed a very natural thing to do, even if we only had an unstructured version for a long time.</p>
 </div></article></div>

Unclear if there is a good solution for this.

siefkenj commented 2 years ago

Is running the produced code through a pretty-printer an option? Or are you really hoping to have xsltproc doing the pretty printing?

rbeezer commented 2 years ago

Yes, a linter that comes with xsltproc will do this. But <xsl:output> has an @indent option, so it should be possible to get it done there?

Anyway, I'm as much interested in understanding what is going on as I am in the actual practical matter. ;-)