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 support #230

Open
pinpox opened this issue Oct 17, 2024 · 4 comments
Open

Typst support #230

pinpox opened this issue Oct 17, 2024 · 4 comments
Assignees

Comments

@pinpox
Copy link

pinpox commented Oct 17, 2024

Similar to #56, I would like to propose support for typst.
There is a pretty good working languageserver for it, in case that helps with implementation.

@elijah-potter
Copy link
Collaborator

Since the Typst parser is actually written in Rust, it should be relatively straightforward to make this happen. It's relatively low priority at the moment though, so unless someone else decides to pick this up, I can't give you a time estimate.

@pinpox
Copy link
Author

pinpox commented Oct 19, 2024

unless someone else decides to pick this up, I can't give you a time estimate.

Would you be able to provide some guidance? I might find the time to submit a PR but don't really know where to start. Maybe there is some similar example ?

@elijah-potter
Copy link
Collaborator

You'll want to look at harper-core/src/parsers/Markdown. That's the implementation that wraps pulldown-cmark. You'll likely want to make a copy and swap out the innards for the Typst parser (which I believe is just a crate).

@grantlemons grantlemons self-assigned this Nov 25, 2024
grantlemons added a commit that referenced this issue Nov 26, 2024
grantlemons added a commit that referenced this issue Nov 27, 2024
@grantlemons grantlemons linked a pull request Nov 28, 2024 that will close this issue
grantlemons added a commit that referenced this issue Nov 29, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 4, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 4, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 4, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 4, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 4, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 4, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 4, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 4, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 4, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 4, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 9, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 9, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 9, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 9, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 9, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 9, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 20, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 20, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 27, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 27, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 27, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 27, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 27, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 29, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 29, 2024
…non-mut

The parser trait's parse method took an &mut, but it wasn't used
anywhere and was causing significant problems interacting with closures.

If it is needed in the future, I would suggest creating a seperate
mutable parse method.
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 29, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 29, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 29, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 29, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 29, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 30, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 30, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 30, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 31, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 31, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Dec 31, 2024
grantlemons added a commit to grantlemons/harper that referenced this issue Jan 10, 2025
grantlemons added a commit to grantlemons/harper that referenced this issue Jan 10, 2025
@quachpas
Copy link

Thanks for the great work on Typst support @grantlemons! Since this issue hasn't been closed, I'll use it.

= This is a test for Harper

We have a #figure([here]) <labelled>.

We can reference the @labelled figure.

Harper raises concern with the reference, which by looking at the parser is not supported yet.

{
	"resource": "/home/quachpas/test.typ",
	"owner": "_generated_diagnostic_collection_name_#0",
	"severity": 2,
	"message": "Did you mean to spell “@labelled” this way?",
	"source": "Harper",
	"startLineNumber": 5,
	"startColumn": 22,
	"endLineNumber": 5,
	"endColumn": 31
}

I think, references should probably be altogether ignored. What do you think?

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 a pull request may close this issue.

4 participants