-
Notifications
You must be signed in to change notification settings - Fork 48
[Typst] Add TypstCaption type for improved legends, disambiguate text attributes, and support table-level parameters
#295
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Ronan Arraes Jardim Chagas <[email protected]>
Co-authored-by: Ronan Arraes Jardim Chagas <[email protected]>
Co-authored-by: Ronan Arraes Jardim Chagas <[email protected]>
Co-authored-by: Ronan Arraes Jardim Chagas <[email protected]>
…c23-sudo/PrettyTables.jl into tests/enhance-coverage
Tests/enhance coverage
remove temporary test string
1. Add a space between comma and pareters 2. Add `max_num_char_line` * break function calls in multiple lines
| end | ||
|
|
||
| """ | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add documentation for the function or remove this docstring.
| struct Percent <: TypstRelativeLengthKind end | ||
| struct Auto end | ||
|
|
||
| Base.show(io::IO,::Auto) = print(io,"auto") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always add space after comma in function declaration and function calling.
| position:: Union{Nothing,String} | ||
| end | ||
|
|
||
| function TypstCaption(caption; kind=Auto(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is not following the Blue Style convention.
| il -= 1 | ||
|
|
||
| if !isnothing(caption) | ||
| if !isnothing(caption) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the trailing space.
| # ---------------------------------------------------------------------------- | ||
| # 1) Text attribute filter: only keeps `text-*` keys that map to _TYPST__TEXT_ATTRIBUTES | ||
| # ---------------------------------------------------------------------------- | ||
| @testset "_typst__filter_text_atributes" verbose=true begin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation must always use 4 spaces in Julia code.
|
Thanks @gustavohtc23-sudo ! I completed the review with just a few formatting issues. |
Description
This PR introduces a set of improvements to the Typst backend aimed at clarity, expressiveness, and better alignment with Typst’s table API.
Main changes
Add
TypstCaptiontype to enable more explicit and semantically meaningful legends, improving readability and extensibility.Disambiguate text-related attributes by prefixing all attributes that apply exclusively to text with text-, eliminating ambiguity with table- or cell-level attributes.
Add support for table-level parameters accepted by Typst table, allowing structured configuration at the table level instead of relying on implicit or cell-scoped settings.
Motivation
Explicit legend kinds make the output easier to integrate with another sources of tables and images.
The text-* prefix clarifies intent and reduces naming conflicts in styling options.
Exposing Typst table parameters at the table level improves ergonomics and feature parity with Typst.
Compatibility notes
Attribute renaming to text-* may affect existing code; this PR updates internal usage accordingly.
If desired, deprecations or aliases for previous attribute names can be added in a follow-up.
Tests and documentation
Tests were updated/added to cover the new Kind field, text-* attributes, and table-level parameters.
Examples were adjusted to reflect the new API where applicable.
Feedback on naming, scope, or compatibility strategy is very welcome.
Closes #293
Closes #294