PreTeXtBook / pretext

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

Audit and remove inline style elements in HTML output #732

Open rbeezer opened 7 years ago

rbeezer commented 7 years ago

Rough survey indicates about 50 uses in the HTML XSLT. A few are necessary for computed widths, such as for sidebyside panels. But most are old or were quick hacks.

poem and SVG image placement are two big offenders.

See https://github.com/rbeezer/mathbook/issues/713 for related poem work.

rbeezer commented 7 years ago

As part of #713, some inline style/CSS for poems had to migrate to some unlikely locations. Three places, though one may never be executed. You can find them all within 6011c3662367bb143fb438e1d69304354fa9b6d8

rbeezer commented 7 years ago

A little bit of low-hanging fruit at b3499282b635489bc16c1e1add74a81c0a018d28. Not pushed yet.

Some easy ones follow.

  1. Notation table: table with th and td are all text-align: left. Six total. Would table.notation-table be enough of a replacement?

Example: http://mathbook.pugetsound.edu/examples/sample-article/html/appendix-1.html

  1. XSLT that produces primary-navbar also produces an empty style="". Is that necessary?

  2. Poems: I could make an example with natural class names coming from PTX elements poem, stanza and line. Line alignment and tabs for multiple indents needs collaboration.

  3. SVG video: we should see what Alex decides about this.

  4. Lists: use property list-style-type. Maybe we need class names for the nine types? If so, I can make a list.

  5. Videos: I have "hidden" YouTube videos (obscured by big red button) and pop-out videos with text to click to pop-out. These get centered below the video. And a popped-out video has a message about reloading to reset start/stop parameters. How should we center these bits of text?

Example: bottom of http://mathbook.pugetsound.edu/examples/sample-article/html/section-video.html

rbeezer commented 6 years ago

See item 2 just above. The XSLT just issues an empty style and I do not know why. Straight from the XSLT:

<nav id="primary-navbar" class="navbar" style="">

Can it be removed?

davidfarmer commented 6 years ago

You should be able to remove the style=""

It is possible that it is there as a placeholder for responsive javascript. So do a reality check when resizing the browser.

But if that causes a problem, I should improve the javascript.

On Fri, 2 Feb 2018, Rob Beezer wrote:

See item 2 just above. The XSLT just issues an empty style and I do not know why. Straight from the XSLT:

rbeezer commented 6 years ago

Done, at 2487b15f45dd20eaefe40d2c3fb3e40913a610ce

Seems to have no ill effect. Website will update soon (tomorrow?).

Seems like the auto-scrolling sidebar is much improved of late, no?

davidfarmer commented 6 years ago

Seems like the auto-scrolling sidebar is much improved of late, no?

Should not be any change.

rbeezer commented 6 years ago

Should not be any change.

Must be a different (newer?) browser I have here. At home (about 1.5 years lag on OS update, the sidebar jumps around a lot). Cannot demo until I go home. ;-)

rbeezer commented 6 years ago

That's all folks. Well, some necessary hard-coding remains, like for variable-width side-by-side panels. And a few other low-value places that need an overhaul (or deletion!) anyway.

So for me, this is a complete audit of the inline style that really needs to change.