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

API documentation is missing an explanation of CMARK_NODE_CUSTOM_BLOCK and CMARK_NODE_CUSTOM_INLINE #441

Open
arranstewart opened this issue Mar 16, 2022 · 2 comments

Comments

@arranstewart
Copy link

The API documentation for cmark (e.g. in the cmark.3 man page) does not explain the
purpose or proper use of the CMARK_NODE_CUSTOM_BLOCK and CMARK_NODE_HTML_INLINE constants from the cmark_node_type enum. (Actually, it does not explain the purpose or use of any of the cmark_node_type constants; but all the others correspond fairly obviously to blocks or inlines in the CommonMark spec.)

I see that the changelog contains some description of them:

  • [API change] Added CUSTOM_BLOCK and CUSTOM_INLINE node types.
    They are never generated by the parser, and do not correspond
    to CommonMark elements. They are designed to be inserted by
    filters that postprocess the AST. For example, a filter might
    convert specially marked code blocks to svg diagrams in HTML
    and tikz diagrams in LaTeX, passing these through to the renderer
    as a CUSTOM_BLOCK. These nodes can have children, but they
    also have literal text to be printed by the renderer "on enter"
    and "on exit." Added cmark_node_get_on_enter,
    cmark_node_set_on_enter, cmark_node_get_on_exit,
    cmark_node_set_on_exit to API.

But that information really should be in the API documentation, not in the changelog - without it, the API documentation cannot be understood. And because the changelog uses the abbreviation CUSTOM_BLOCK instead of spelling out CMARK_NODE_CUSTOM_BLOCK in full, searching for CMARK_NODE_CUSTOM_BLOCK in the repository will never bring up that changelog entry, making it difficult for developers to work out what it was intended to do.

If the man page is the only place that would need updating, then I'd be happy to create a PR to add the changelog information to the man page, if desired.

@jgm
Copy link
Member

jgm commented Mar 16, 2022

Agreed, this should be in the docs.
Note that the man page is autogenerated from comments in the source (see the cmark.3 target in the Makefile). So you'd need to add comments to the source (cmark.h).

@arranstewart
Copy link
Author

No worries - yes, I just now saw the make_man_page.py script as I was poking around. I'll let you know once I've got something. Cheers!

admbanking1 referenced this issue Jun 14, 2022
Also clean up CMakeLists considerably.
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