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

Typst CSS #9619

Merged
merged 1 commit into from
May 15, 2024
Merged

Typst CSS #9619

merged 1 commit into from
May 15, 2024

Conversation

gordonwoodhull
Copy link
Contributor

@gordonwoodhull gordonwoodhull commented May 8, 2024

This is about ready to merge, once there is a new Pandoc release.

With full CSS rgb and named color support and the border shorthands, the Lua script to do CSS->Typst translation is about 4x as long as it was (now ~900 lines).

Posting the PR for review tomorrow as well as to see how the tests do.

Will follow up with open questions & areas to review, or bring those tomorrow.

This subsumes #9500.

@gordonwoodhull gordonwoodhull requested review from cderv and cscheid May 8, 2024 17:27
@gordonwoodhull
Copy link
Contributor Author

Ah yes, will need Pandoc 3.1.14 to run the tests in CI

@gordonwoodhull
Copy link
Contributor Author

gordonwoodhull commented May 9, 2024

gt and Great Tables get some nice effects out of putting borders on spans.

See Time and Measurement in this gt screenshot:

image

It is also possible to put borders on a Typst #highlight() but it would take a lot more styling for it to look good, so I've disabled it.

Naive Typst #highlight with border (and transparent color 😮) looks like this:

image

gt is using width: 100% and display: inline-block, along with judicious padding on both th and span, so it's not exactly obvious how to map this automatically.

thspan
image image

@gordonwoodhull gordonwoodhull marked this pull request as ready for review May 13, 2024 21:18
@gordonwoodhull
Copy link
Contributor Author

gordonwoodhull commented May 13, 2024

Pandoc 3.2 doesn't seem to cause any failures.

Rough edges we should probably handle before merging:

@cscheid
Copy link
Collaborator

cscheid commented May 13, 2024

I wonder if this is because we're hammering placeholder.co and we should use some other solution instead.

@gordonwoodhull
Copy link
Contributor Author

gordonwoodhull commented May 14, 2024

  1. I thought the globstar feature (eg qmd-files/**/*./qmd) seemed like a relatively "new" Unix feature (c2010 😉).
    Turning it on with shopt -s globstar && ..., all ff matrix tests are running.

  2. I can repro the mediabag error locally with

quarto render document.qmd -t pdf -M keep-tex:true

Kind of weird, maybe coincidental.

  • Does not happen without keep-tex
  • File does not have any pdf options
  • Don't think tests in CI run with keep-tex

@gordonwoodhull
Copy link
Contributor Author

Okay, this is only blocked by mediabag issues on both platforms. It's weird that it's always the same file, and I can repro the error locally, but I am giving up on it for the moment.

I have some hardening to do on Typst CSS inputs and need to test malformed input, which I can do before or after merge.

@cscheid
Copy link
Collaborator

cscheid commented May 14, 2024

2. I can repro the mediabag error locally with

quarto render document.qmd -t pdf -M keep-tex:true

Can you just clarify which document.qmd this is referring to?

@gordonwoodhull
Copy link
Contributor Author

Can you just clarify which document.qmd this is referring to?

dev-docs/feature-format-matrix/qmd-files/crossref/float/figure/document.qmd

@cscheid
Copy link
Collaborator

cscheid commented May 14, 2024

Ok - I think that failure is placeholder.co etc no longer being reliable.

@gordonwoodhull gordonwoodhull force-pushed the feature/typst-css branch 3 times, most recently from 9612dd6 to 8734f9f Compare May 15, 2024 06:07
and html-pre-tag-processing
@gordonwoodhull
Copy link
Contributor Author

There are very occasional mermaid timeouts, but everything else is running well.

Ok to merge?

@cscheid
Copy link
Collaborator

cscheid commented May 15, 2024

Let's do it!

@cscheid cscheid merged commit b6bd017 into main May 15, 2024
49 checks passed
@cscheid cscheid deleted the feature/typst-css branch May 15, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants