-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Support creating highlighting for Typst output document #201
Comments
What this is requesting, if I understand correctly, is a new package |
Yes exactly. |
Now that I've implemented this, I am perplexed about how to integrate it into pandoc. The natural thing to do would be (as with other writers) having it trigger when optHighlightStyle is a Just value. When optHighlightStyle is Nothing, it would behave as it does now and just use the native typst format for highlighting. The problem I see is this: pandoc's default is to set optHighlightStyle to |
With LaTeX output, Pandoc will by default highlight code block using So we don't want the same behavior for typst ? Or is it because Typst has it own highlighting system by default and it would be better for it to be the default ? Just sharing some more thoughts here - I think I see this as : Typst has its own highlighting system by default (https://typst.app/docs/reference/text/raw/) with a default theme (which can be customized at typst level using So maybe this means that different default could be used by format ? Is that something conceivable ? I draw a parallel with the citation support, for which specific Typst consideration to use Pandoc feature. If So maybe this would mean a new flag or option / extensions needs to be added for selecting Highlighting System ?
This probably is quite similar to defaulting to |
That's the relevant difference. There's already a built-in, idiomatic way to highlight code in typst, which results in clean and editable source. I suspect most users who are generating typst that they'll edit would prefer this to pandoc-highlighted code. Pandoc-highlighted typst output would be useful mainly for people who are using pandoc to produce a pdf via typst. Typst has its own highlighting system by default (https://typst.app/docs/reference/text/raw/) with a default theme (which can be customized at typst level using thTheme format). It would be best for Typst document produced with Pandoc to use this own system by default. One option we could explore is providing a way to export a skylighting style in the thTheme format so it could be used with typst. I'm not sure if that's what you're suggesting here. But it looks like this has to be a separate file so it wouldn't give you a one-step conversion, and it wouldn't exactly match pandoc's tokenization since it wouldn't use skylighting for that. Other options:
Maybe there are others? @tarleb @silby do you have thoughts about this? |
Thinking out loud: the problem is also at the heart of the |
Or, |
Or instead of |
I think this is a good idea too. This is similar to what I meant by adding a flag to select Highlighting System.
If I understand correctly proposal, Regarding Typst idiomatic support for |
The proposal is that To summarize, the proposal would be: In T.P.Options, replace data HighlightOption =
Skylighting Style
| DefaultHighlighting
| NoHighlighting In command line options, add About |
I've created an open pandoc issue to track this |
This is different than the other issue which is about the highlighting syntax support for typst block
Here I am thinking it would be great to have Syntax Highlighting Pandoc's feature be supported for Typst output so that we could get the same highlighting and theme than in other format (e.g. setting
--highlight-style pygments
)Opening the issue here to discuss as this is relevant to https://pandoc.org/MANUAL.html#syntax-highlighting provided by skylighting
It seems Typst uses its own logic though with
So maybe it is matter of just provided same themes for typst or syntax closer to XML KDE (which would require a conversion to sublime-syntax file I guess).
Anyhow, opening for discussion after a first talk with @tarleb
The text was updated successfully, but these errors were encountered: