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

enhance: add mldoc ast schema #8829

Merged
merged 7 commits into from Mar 20, 2023
Merged

Conversation

RCmerci
Copy link
Contributor

@RCmerci RCmerci commented Mar 15, 2023

  • add mldoc ast schema: ns logseq.graph-parser.schema
  • fix a potential bug in export with the support of this ast-schema

We may be able to use schema to reduce some prewalk/postwalk on ast. @cldwalker @tiensonqin

@github-actions github-actions bot added the :type/enhancement Enhancement to product. Does not affect the overall basic use. label Mar 15, 2023
@logseq-cldwalker
Copy link
Collaborator

logseq-cldwalker commented Mar 15, 2023

@RCmerci Nice! Could you put this in a graph-parser-fn with :malli/schema? If worried about dev performance with :malli/schema, you could also confirm it works in logseq.graph-parser.cli-test. Without exercising the schema in some way, we won't know how correct it is

@RCmerci
Copy link
Contributor Author

RCmerci commented Mar 16, 2023

@logseq-cldwalker good suggestions! I have moved this schema to ns logseq.graph-parser.schema, and added :malli/schema to logseq.graph-parser.mldoc/->edn.
And verified with docs graph and internal lambda graph

Copy link
Collaborator

@logseq-cldwalker logseq-cldwalker left a comment

Choose a reason for hiding this comment

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

@RCmerci Thanks! 👍 ❤️ Looking forward to using this schema. Hope you don't mind I renamed the schema ns to make room for other schemas. Feel to rename to another schema.* if you'd like. I also added a bb task to validate a file's ast or several from logseq-graph-ast. Could be useful for regression testing. Example:

$ logseq-graph-ast /path/to/docs -o asts.edn
$ bb dev:validate-ast asts.edn

Also move mldoc schema to make room for other schemas
Copy link
Contributor

@tiensonqin tiensonqin left a comment

Choose a reason for hiding this comment

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

LGTM

@tiensonqin tiensonqin merged commit c3f7417 into master Mar 20, 2023
7 checks passed
@tiensonqin tiensonqin deleted the enhance/add-mldoc-ast-schema branch March 20, 2023 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:type/enhancement Enhancement to product. Does not affect the overall basic use.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants