typst.ts icon indicating copy to clipboard operation
typst.ts copied to clipboard

Implement a remark plugin to embed typst in markdown documents

Open quank123wip opened this issue 11 months ago • 4 comments

Since several markdown renders supports using MathJax or KaTeX to render math contents, it's a good idea to make typst an alternative option.

And, of course, markdown-it is a good option too, but I'm not going to work on it.😮‍💨

I'm going to work on this months later, just regard this issue as a reminder here. Of course, volunteers are welcomed.

quank123wip avatar Mar 24 '24 13:03 quank123wip

You can check it https://github.com/Myriad-Dreamin/typst.ts/tree/main/projects/rehype-typst, which renders typst math block in HTML.

Myriad-Dreamin avatar Mar 24 '24 17:03 Myriad-Dreamin

combine remark-math and rehype-typst you can already do that. Demo here https://github.com/Myriad-Dreamin/typst.ts/blob/main/projects/rehype-typst/test.js#L28

Enter-tainer avatar Mar 25 '24 08:03 Enter-tainer

I was going to try the rehype-typst package, but I can't install it.

https://github.com/Myriad-Dreamin/typst.ts/blob/main/projects/rehype-typst/README.md?plain=1#L37

Is it published on npm?

I was also trying to install it directly from the git repo, but I couldn't immediately figure out how to install a package from a subfolder of a git repo.

EDIT: I used this app to install rehype-typst from a subfolder of this git repo: https://gitpkg.vercel.app/about Add the following url in the app: https://github.com/Myriad-Dreamin/typst.ts/tree/main/projects/rehype-typst

Loosetooth avatar Mar 25 '24 17:03 Loosetooth

I was going to try the rehype-typst package, but I can't install it.

https://github.com/Myriad-Dreamin/typst.ts/blob/main/projects/rehype-typst/README.md?plain=1#L37

Is it published on npm?

I was also trying to install it directly from the git repo, but I couldn't immediately figure out how to install a package from a subfolder of a git repo.

EDIT: I used this app to install rehype-typst from a subfolder of this git repo: https://gitpkg.vercel.app/about Add the following url in the app: https://github.com/Myriad-Dreamin/typst.ts/tree/main/projects/rehype-typst

It's my missing that it is not published. I'll test it again and publish it then in this week.

Myriad-Dreamin avatar Mar 26 '24 11:03 Myriad-Dreamin

Working on a markdown preset now, I'm intereseted in supporting both LaTeX and Typst, maybe we can make a api to specific a mode let rehype-typst use alternative patterns like typst or math-typst and give typst a special token in markdown.

quank123wip avatar Jul 12 '24 06:07 quank123wip

I think rehype-typst already satisfies the requirement of this issue. Feel free to open new issues and focus new problem when using rehype-typst.

Myriad-Dreamin avatar Jul 16 '24 01:07 Myriad-Dreamin