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

Implements cetz diagrams #37 #38

Merged
merged 1 commit into from
Sep 29, 2024
Merged

Implements cetz diagrams #37 #38

merged 1 commit into from
Sep 29, 2024

Conversation

benabel
Copy link
Contributor

@benabel benabel commented Sep 26, 2024

This is a basic implementation using typst to compile cetz code to svg, png or pdf.

@benabel
Copy link
Contributor Author

benabel commented Sep 26, 2024

The filter works with pandoc, but recent changes in the filter makes it fail with quarto see #39.

Copy link
Member

@tarleb tarleb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks! The only request I have is about something minor in the docs 😅

@@ -80,6 +80,7 @@ that can be used to specify a specific executable.
| [Mermaid] | `mermaid` | `mmdc` | `MERMAID_BIN` |
| [PlantUML] | `plantuml` | `plantuml` | `PLANTUML_BIN` |
| [Ti*k*Z] | `tikz` | `pdflatex` | `PDFLATEX_BIN` |
| [cetz] | `cetz` | `typst` | `TYPST_BIN` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package itself seems to use the capitalization CeTZ.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, done.

@tarleb
Copy link
Member

tarleb commented Sep 26, 2024

Oh, and running the test during CI would be good, too. There seems to be a typst package available on Alpine, so using pandoc/minimal:latest-alpine as base image should work well. See .github/workflows/ci.yaml.

@benabel benabel force-pushed the main branch 2 times, most recently from c2d80b2 to 6c207dc Compare September 28, 2024 11:52
@benabel
Copy link
Contributor Author

benabel commented Sep 28, 2024

I've added the CI action using quarto image to use their built-in typst program.

@benabel benabel force-pushed the main branch 4 times, most recently from 9874a49 to 2c90f08 Compare September 28, 2024 12:33
@tarleb
Copy link
Member

tarleb commented Sep 28, 2024

oh, that's a neat approach! It should be possible to set the executable in the metadata, something along the lines of

diagram:
  engines:
    cetz:
      execpath: quarto typst

Then we won't have to do the "create executables" step that seems to cause issues on the GitHub workflow runners.

Let me know if that doesn't work, then I'll try to make it work somehow.

@benabel
Copy link
Contributor Author

benabel commented Sep 28, 2024

This approach do not work:

diagram/diagram.lua: quarto typst: createProcess: posix_spawnp: does not exist (No such file or directory

@tarleb
Copy link
Member

tarleb commented Sep 28, 2024

OK, I'll try to implement a fix. One moment.

@tarleb
Copy link
Member

tarleb commented Sep 28, 2024

Please rebase to the current main and try with execpath: ['quarto', 'typst']

@benabel
Copy link
Contributor Author

benabel commented Sep 28, 2024

Ok I try that.

@benabel
Copy link
Contributor Author

benabel commented Sep 28, 2024

I fixed the arguments list to use quarto typst command and changed pandoc command to use quarto's pandoc in makefile. This should be OK now.

@tarleb
Copy link
Member

tarleb commented Sep 29, 2024

Thank you! I'll add the missing make install step.

@tarleb tarleb merged commit de8f0da into pandoc-ext:main Sep 29, 2024
8 of 9 checks passed
@tarleb
Copy link
Member

tarleb commented Sep 29, 2024

Works beautifully! I'll make a new release within the next days.

@benabel
Copy link
Contributor Author

benabel commented Sep 30, 2024

@tarleb Thanks for your feedbacks during the pr. And again thanks for sharing this handful extension open source.

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