PreTeXtBook / pretext

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

CSS for hidden knowl opening location #774

Closed rbeezer closed 6 years ago

rbeezer commented 6 years ago

A place to discuss this CSS work, maybe some commits when all done.

rbeezer commented 6 years ago

Sample article, with "kohere" work rebased on dev. I have not investigated questions, and can refresh if there are obvious shortcomings when I do.

http://mathbook.pugetsound.edu/beta/20171116-kohere

rbeezer commented 6 years ago

Coming from discussion at:

https://groups.google.com/d/msg/pretext-support/B2Cp5IV5M8I/LxL9e7VWAQAJ

davidfarmer commented 6 years ago

I made a lot of CSS changes, and the styling of hidden knowls should look okay now, except for the Hint/Answer/Solution, as at the end of Sample Article section 16.

Note that the new CSS makes use of .hiddenproof, but not of .knowl-container, and not of .kohere . I could make use of .knowl-container to style the Hint/Answer/Solution, but I think I prefer something like the old way where the div surrounding H/A/S had class="solutions", and each of the a's in it had class="solution". If you wanted to be less heavy-handed, I guess the outer .solutions would be the one to keep.

I can imagine that the .knowl-container around hints and answers will be useful some day, so we should keep it, but it does not seem like we will use it now.

We will use .kohere when we find a place that the knowl is inline, yet we still want to open immediately after that.

To slightly change the subject, can you enlighten me about the use of "header"? Some places we have .heading as a child of a header element, and others not. Does that only happen for sections? For all sections? When is a case where we actually need the header surrounding the .heading?

rbeezer commented 6 years ago

To slightly change the subject, can you enlighten me about the use of "header"? Some places we have .heading as a child of a header element, and others not. Does that only happen for sections? For all sections? When is a case where we actually need the header surrounding the .heading?

"heading" occurs 267 times in mathbook-html.xsl in a variety of non-CSS uses. So nothing here is set in stone. Much dates to Michael DuBois' time, so I have no good reasons, except mimicry. Doubt anything I write if it seems wrong.

header.heading seems exclusively for divisions: chapter, etc, introduction/conclusion as children of divisions, preface, index, etc Can often have optional .hide-type.

There are plain header in the masthead, etc, surrounding content. Perhaps explains the necessity of the .heading class?

exercises/h1.heading in backmatter looks clearly wrong.

h6.heading is on lots of blocks: theorem, example, etc. h5 for paragraphs, I think. Probably inside an article most of the time.

A single side-by-side is 3 rows: heading, panel, caption. In other each panel can be surmounted by some text (a title usually, like a poem), and below has a caption. Possible some .heading crept in here.

rbeezer commented 6 years ago

Progress. Sample for review, discussion.

http://mathbook.pugetsound.edu/beta/20171216-hidden-knowl

You asked for class="solution" on the a for the solution hidden knowls. That would be an exception to my general scheme, and thus lead to messy code. Two alternatives to propose.

A. Handle hidden knowls as current changes implement. B. Move class information onto every hidden knowl a element, and drop surrounding element/class. This would lead to cleaner HTML, and maybe make styling easier?

I might be able to mockup (B) on a branch of a branch (which becomes complicated fast).

davidfarmer commented 6 years ago

I adjusted the CSS and it looks and behaves okay now.

http://mathbook.pugetsound.edu/beta/20171216-hidden-knowl

You asked for class="solution" on the a for the solution hidden knowls. That would be an exception to my general scheme, and thus lead to messy code. Two alternatives to propose.

A. Handle hidden knowls as current changes implement.

B. Move class information onto every hidden knowl a element, and drop surrounding element/class. This would lead to cleaner HTML, and maybe make styling easier?

Things seem to be working properly, so let's not do anything else unless we find an actual problem.

Can close now?

rbeezer commented 6 years ago

Changes at 12cc513934e51d5b91e3cdb54b6446c1eb6053f4

Some of the CSS changes had not made it into the knowl content itself (in particular, a knowl inside a knowl). I've got that straight so everything is consistent. So yes, we can (finally!) close this one. Much better - and should encourage further improvements (once I find the time). Thanks.