PreTeXtBook / pretext

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

Slideshow styling update #2225

Closed ascholerChemeketa closed 4 months ago

ascholerChemeketa commented 4 months ago

Fixes to revealjs styling.

Changed the container for sagecell-sage elements. Having them as pre was causing all kinds of slideshow styling issues. The sage examples show a div for that container. Tested this against sample-article - does not appear to adversely affect HTML builds.

Added Prism highlighting for code and a code sample.

Pushed this PR independent of ongoing CSS bundling as I know others are working on slides. Bundling will slightly change how the CSS gets written but can be done independently of this.

I think this is ready, but happy to tweak anything.

sean-fitzpatrick commented 4 months ago

I have some image examples ready for you to use in testing, but the PR is still in progress.

Perhaps the easiest way to test image generation would be to use the CLI with pretext-new-slideshow and then copy the contents of sample-slideshow.xml in #2223 into main.ptx, and do pretext build web.

There's some weirdness with Asymptote that needs to be figured out.

ascholerChemeketa commented 4 months ago

@sean-fitzpatrick I added some rules that should target the Asymptote images.

@rbeezer The more features that get added that require duplicating code from the HTML stylesheets, the more it becomes clear that reuse via bundling is going to make this cleaner. Styles will need to move to a separate CSS file or if there is a strong desire for a one file solution, we would have to add something to dump the content of a known CSS file into a <style> element in the document.

sean-fitzpatrick commented 4 months ago

Thanks! I made some progress on getting pretext/pretext to build slides but I'm missing something since I still don't get an output file.

Images are copied correctly and the reveal stylesheet is applied, but I'm not getting an html file.

My flight connection is a little shorter than I thought so I don't think I'll figure it out today

rbeezer commented 4 months ago

Thanks very much! I tend to remove the "extended" commits in the commit message - if the rationale/commentary is important I think it is better as code comments to be read in context.

rbeezer commented 4 months ago

Forgot to say: yes, moving into a file is fine! Whatever you think is best.