Repository navigation
Set rules for default document format options - #8496
Conversation
f71c785 to
f238dba
Compare
c02a52c to
0620724
Compare
c9fbc15 to
5b2ef2d
Compare
dd0700c to
dbf3f45
Compare
00049c9 to
10623db
Compare
10623db to
440528d
Compare
440528d to
c4a1149
Compare
c4a1149 to
72c60f5
Compare
7178a2d to
b1b88f3
Compare
…aryExt::builder()`
Move export docs into the format category and make formats sub-categories
|
I was wondering whether But it may also create false expectations that custom formats could be used there while in reality typst-bundle very much hardcodes support for the 4 well-known single-file formats. |
Yeah, I think I agree. If at some point the export mechanism has been generalized this would make sense. And nice API for |
|
I'm sorry if this has been mentioned somewhere above but this thread is very long and difficult to browse. Does this also add the capability of accessing these options, like |
Since |
|
I could sort of see making this work (not too concerned with caching) and it would be in line with the idea that floated around of replacing However, there is at least one challenge: I the CLI styles are just added to the style chain, they are the outermost styles by default. So a However, this is counter-intuitive, too, since we want the set rules to represent defaults overridable via CLI, not final, untouchable values. To make this work, we could probably give priority to CLI styles and just ignore the set rules. This would be another special case though. |
|
I see. I think it would be very beneficial to be able to determine whether a document is compiled for accessibility for two reasons:
|
|
I can definitely see situations where this would be useful, but I wanted to emphasize that the compiler always tries to produce accessible output. With UA-1, it just ensures that its potentially stricter requirements are met and writes additional metadata. Accessibility not being required due to a submission or institution guideline does not mean that there isn't a benefit for some consumers of the PDF in having better accessibility. In that same spirit, I am of the opinion that packages should generate descriptions whenever they can (it's hard for me to imagine a situation where that's prohibitively expensive unless you are embedding an LLM via WebAssembly). When the improved accessibility information cannot be auto-generated, it's a different story and that's were the context lookup would come in handy. |
Based on #8535, #8571, #8599
This allows specifying the default options for a specific output format, for example the PDF standard using
Options specified by the CLI, the web-app, or another external way will take precedence and override the defaults set by the document.
It's nice to be able to specify default options for single documents, but the main use case is bundle export, where currently there are limited configuration options.
Internal changes
typst-html,typst-pdf,typst-svg,typst-render, andtypst-bundle.Library.LibraryExt::default()has been renamed toLibraryExt::new()LibraryExt::builder()as well asLibraryExt::new()require a list of formats to be passed in.typst-libraryformatmodule.User facing changes
formatmodule has been addedhtml,pdf,svg,png, andbundle. Thoughbundlecurrently has no options.pdfandhtmlmodules have become (format) elements, which support set rules, but are still available in the global prelude.--no-pdf-tagshas been deprecated, use--pdf-taggedinstead, which takes an optional boolean value that has to be specified with an=due to parsing ambiguities. This allows the CLI to either explicitly disable or enable tagged PDF, which was is not possible with a single negated flag.--pdf-taggedand--no-pdf-taggedflags. Vim has a similar mechanism for boolean flags withnoprefixes.--prettytakes an optional boolean value (=required). This allows explicitly disablingprettyoutput.TODO
AttachElemintotypst_pdf, because it needs to beLocatable.HashforConfigurationandPdfVersionLaurenzV/krilla#414bundleformat element (options could for example betarorziparchives)--pdf-taggedand--no-pdf-tagsbundleexportformatcategory