Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More generic handling of code blocks, divs, etc. #112

Merged
merged 12 commits into from
Feb 28, 2024
Merged

Conversation

Omikhleia
Copy link
Owner

@Omikhleia Omikhleia commented Feb 11, 2024

Features

  • feat: Generic rendered code blocks based on raw handlers and embedders.
    This removes the hard-coded class specifiers, allowing any existing SILE raw handler or any embedder to be used.
    If the piecharts package is available (for instance), we can render blocks marked as piechart since the package provides a raw handler by that name.
  • feat: (Djot extension) caption on Div blocks.
    We already added caption support on block quotes earlier. This adds it too for divs, interpreted as captioned figures.
  • feat: A CSV file as image source is interpreted as a pie chart.
    In addition to the generic processing on code blocks.
  • feat: Add a better fallback support for highlighted content (a.k.a. "mark")
  • feat: Customizable strike, underline, insertion, deletion and mark
    It offers an exact parity between these inline elements (from Djot and Markdown) with spans with a similar class, so both syntaxes are strictly equivalent. When resilient styles are used, this also offers the possibility to fully customize the appearance of these spans.

Documentation

Complete overhaul of the manual

  • Go through each topic from the Djot specification, ensure it's covered with examples and it documents our specific items and extensions (incl. the above features)
  • Re-order all these topics in a more user-friendly manner ('cause the Djot specification is not very good at this, e.g. verbatim as one of the first items, before emphasis, is dubious, or at best targeted to a specialized audience)
  • Move Djot first and explain why
  • Redo all other parts on Markdown etc. based on that

Closes #111

Closes #107

Closes #110

@Omikhleia Omikhleia added documentation Improvements or additions to documentation enhancement New feature or request refactor Something needs to be refactored labels Feb 11, 2024
@Omikhleia Omikhleia added this to the 1.6.0 milestone Feb 11, 2024
This removes the hard-coded class specifiers, allowing any existing
SILE raw handler or any embedder to be used.
If the piecharts package is available (for instance), we can render
blocks marked as `piechart` since the package provides a raw handler
by that name.
We already added caption support on block quotes earlier.
This adds it too for divs, interpreted as captioned figures.
@Omikhleia Omikhleia marked this pull request as draft February 12, 2024 18:52
Delegate the logic in a parent package class, as a better abstraction
so we can focus separately on commands.
@Omikhleia Omikhleia force-pushed the more-generic-logic branch 3 times, most recently from 0ff8cdd to 798d8e9 Compare February 13, 2024 20:04
If we have liners (SILE 0.15 or resilient with sile-x compatibility
layer) use them. Otherwise, fallback to an even simpler hbox, though
this is not fully satisfying (as it cannot be broken across lines).
First, make all these inline elements from Djot or Markdown all
equivalent to a corresponding span with certain classes, so both
cases are implemented identically. We thus have a consistent
mapping in all cases.
Then, use styles, if available, to render them. So for instance,
Markdown ~~xxx~~ is strictly equivalent to [xxx]{.strike}, and
to [xxx]{custom-style=md-strikethrough} in resilient context if
that style exists, for complete customization.
@Omikhleia Omikhleia force-pushed the more-generic-logic branch 3 times, most recently from ce30aef to 5bafb01 Compare February 25, 2024 12:33
Opinionated, for sure. Wrong? It's up to you.
@Omikhleia
Copy link
Owner Author

OMG, did I just rewrite the full manual?

@Omikhleia Omikhleia marked this pull request as ready for review February 28, 2024 23:48
@Omikhleia Omikhleia merged commit 45b99ea into main Feb 28, 2024
2 checks passed
@Omikhleia Omikhleia deleted the more-generic-logic branch February 28, 2024 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request refactor Something needs to be refactored
Projects
None yet
1 participant