Repository navigation
Add --pretty CLI flag and minify HTML and SVG by default - #8371
Conversation
|
I understand how the affects HTML and SVG outputs. But how does it affect PDF output? Does PDF use a text format under the hood? Also, do you know how much this reduces SVG size when enabled? |
Yeah PDF is mostly human readable. To make it smaller the content portions of it are flate encoded and in the future with object streams maybe even more. The current version of PDF writer uses extraneous whitespace to make it easier to read. This is nice for development and inspecting PDFs, but arguable a waste of storage space. So we'll opt to produce the smallest documents by default and allow making documents pretty on demand. This is already implemented in pdf-writer and krilla, so just waiting for the bump PR.
I haven't checked yet :) |
4e7d30c to
e603a19
Compare
|
Rebased onto |
--pretty CLI flag--pretty CLI flag and change default output of HTML, SVG, and PDF
Changes the default SVG and HTML output to be non-pretty (minimized)
--pretty CLI flag and change default output of HTML, SVG, and PDF--pretty CLI flag and minify HTML and SVG by default
Part of the Typst 0.15 cleanup stack. This slice covers export option changes across PNG, SVG, PDF, HTML, CLI rendering, and typlite fixtures. ## Upstream Typst Changes - [`typst/typst#6357`](typst/typst#6357) changes page export and render option handling. Tinymist updates PNG/SVG page export and CLI render option plumbing. - [`typst/typst#8370`](typst/typst#8370) changes merged SVG options. Tinymist updates merged SVG export construction. - [`typst/typst#8371`](typst/typst#8371) changes generic export options and remaining HTML export paths. Tinymist updates export computations and HTML export callers to the new option shape. - [`typst/typst#8294`](typst/typst#8294) changes PDF standards error handling. Tinymist updates PDF export error conversion for the new result type. ## Tinymist Changes - Updates `tinymist-task` PNG, SVG, PDF, and HTML export computations to the Typst 0.15 option APIs. - Updates CLI render option forwarding for the new page/export option surface. - Updates typlite export tests affected by the Typst 0.15 export option behavior. --------- Co-authored-by: paran3xus <[email protected]>
Part of the Typst 0.15 cleanup stack. This slice covers export option changes across PNG, SVG, PDF, HTML, CLI rendering, and typlite fixtures. ## Upstream Typst Changes - [`typst/typst#6357`](typst/typst#6357) changes page export and render option handling. Tinymist updates PNG/SVG page export and CLI render option plumbing. - [`typst/typst#8370`](typst/typst#8370) changes merged SVG options. Tinymist updates merged SVG export construction. - [`typst/typst#8371`](typst/typst#8371) changes generic export options and remaining HTML export paths. Tinymist updates export computations and HTML export callers to the new option shape. - [`typst/typst#8294`](typst/typst#8294) changes PDF standards error handling. Tinymist updates PDF export error conversion for the new result type. ## Tinymist Changes - Updates `tinymist-task` PNG, SVG, PDF, and HTML export computations to the Typst 0.15 option APIs. - Updates CLI render option forwarding for the new page/export option surface. - Updates typlite export tests affected by the Typst 0.15 export option behavior. --------- Co-authored-by: paran3xus <[email protected]>
Part of the Typst 0.15 cleanup stack. This slice covers export option changes across PNG, SVG, PDF, HTML, CLI rendering, and typlite fixtures. ## Upstream Typst Changes - [`typst/typst#6357`](typst/typst#6357) changes page export and render option handling. Tinymist updates PNG/SVG page export and CLI render option plumbing. - [`typst/typst#8370`](typst/typst#8370) changes merged SVG options. Tinymist updates merged SVG export construction. - [`typst/typst#8371`](typst/typst#8371) changes generic export options and remaining HTML export paths. Tinymist updates export computations and HTML export callers to the new option shape. - [`typst/typst#8294`](typst/typst#8294) changes PDF standards error handling. Tinymist updates PDF export error conversion for the new result type. ## Tinymist Changes - Updates `tinymist-task` PNG, SVG, PDF, and HTML export computations to the Typst 0.15 option APIs. - Updates CLI render option forwarding for the new page/export option surface. - Updates typlite export tests affected by the Typst 0.15 export option behavior. --------- Co-authored-by: paran3xus <[email protected]>
…ied SVG export](typst/typst#8371) (reduced gallery size by `200K`).
Based on #8370
This changes the default output to be non-pretty (minimized).
The test suite still produces pretty output, which may be undesirable, we probably want to test a mix of both, but I don't wan to add more special cased test suite options like
pdf-standard. Once the format options are settable we can also get rid of that one, and easily test format options in the test suite.Also interacts with #8294, so either this PR needs to be updated to change PDF output to be
prettyor the other one.