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

Generate title pages without the YAML file? #106

Open
davidchisnall opened this issue Dec 3, 2024 · 4 comments
Open

Generate title pages without the YAML file? #106

davidchisnall opened this issue Dec 3, 2024 · 4 comments
Labels
question Further information is requested

Comments

@davidchisnall
Copy link

I'm using SILE on the back end of a flow that can generate HTML and PDFs. I'd like to be able to use the resilient.book title and half-title pages, but these don't seem to be documented for use except via a YAML. It looks as if these come from the resilient.bookmatters packages, but the commands there aren't documented.

@Omikhleia
Copy link
Owner

As of yet, package resilient.bookmatters is considered an internal component, with unstable commands (hence undocumented and subject to change). It's just the bare support for some of the things needed by the "master document" (expressed in YAML indeed).
What's the rationale for not using a master document? (It would be possible to parse it even for HTML generation, and even without using SILE at all here -- I have a yet unreleased (and uncompleted / poorly coded) experimenal workflow for HTML/ePub where I just do this.)

@Omikhleia
Copy link
Owner

and uncompleted / poorly coded

Just to give more context: One of the points left aside for the future in that dirty experiment was a transpiler for the resilient style file to CSS. The idea being that most of my usual content being in Djot/Markdown, I would have a SILE path for nice PDF generation, and a (mostly) non-SILE one for direct HTML conversion.

@davidchisnall
Copy link
Author

I have a flow that parses some semantic markup and produces a document tree that I can then run transforms over. For HTML output, the resulting tree is modified until it's valid HTML and emitted (and split into multiple files, one per chapter), for PDF I'm generating an XML file that's consumable by SILE. The transforms are different for the two kinds of output, but the document structure is the same.

I could generate an additional file for the SILE output, but the internal document model maps trivially to XML and so it's easy to just generate more XML commands inline, whereas generating YAML requires creating a new kind of serialiser to some internal state and that's more work.

This is mostly a C++/Lua reimplementation of something I built for ePub + LaTeX typesetting of my third book after seeing how badly the publisher's PDF->ePub flow mangled my second book. I really want four outputs:

  • HTML for online reading.
  • ePub for eBook readers.
  • Online PDF (colours, cross references as links)
  • Print PDF (black and white, cross references as page numbers)

The first two are small tweaks of each other, as are the last two. They're generated from the same semantic markup, but in the ePub / HTML flows most of that is preserved as div and span classes, whereas in the SILE flow a lot of it gets lowered to presentation markup. I don't need resilient to be involved in the HTML flow at all - I don't want the same visual style for both because things that have fixed layout and things with variable layouts are quite different, but I can generate both from the same semantic markup.

@Omikhleia
Copy link
Owner

Ah I see. Well, even if they were documented, the commands from bookmatters.resilient as of now cannot be expressed intuitively directly in SIL (XML) -- they have structured options (attributes).

@Omikhleia Omikhleia added the question Further information is requested label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants