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

To/from jotdown events #1

Open
clbarnes opened this issue Oct 27, 2024 · 2 comments
Open

To/from jotdown events #1

clbarnes opened this issue Oct 27, 2024 · 2 comments

Comments

@clbarnes
Copy link
Owner

See hellux/jotdown#17

Building an AST from an iterator of jotdown events would give us parsing; converting to a stream of jotdown events would give us rendering, thereby allowing a full rusty roundtrip. Note that until then, you can always use the typescript impl to emit JSON and then render it, using this library just to operate on the JSON in the middle.

@not-my-profile
Copy link

I think this should ideally be implemented in Jotdown and not here. (It's nicer for a parser to depend on an AST crate than an AST crate to depend on a parser).

Furthermore I think when writing this crate you made a bit of an oversight in making all the block and inline types unconstructable for API users because they all have private fields ... (mostly the meta field ... in same cases like BulletList all fields are private). For an AST library I don't see any reason for any fields to be private.

@clbarnes
Copy link
Owner Author

clbarnes commented Jan 6, 2025

Yes it's a pretty rough draft and those kinds of issues will spring up if/when it's actually used! Thanks for noting it.

I was thinking the to/from would be behind a feature anyway.

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

No branches or pull requests

2 participants