-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
add list of valid context names to findBy docs #1414
base: main
Are you sure you want to change the base?
add list of valid context names to findBy docs #1414
Conversation
@mojavelinux What do you think? Should we link to the documentation https://docs.asciidoctor.org/asciidoc/latest/blocks/#summary-of-built-in-contexts? It might be confusing since Asciidoctor is using keyword Thoughts? 🤔 |
Yes, I think we should link to the official list. As for the type (symbol or string) I think that can be clarified on both ends. I keep thinking to myself that that list should show strings, not symbols. Then we can explain elsewhere (such as in Asciidoctor) when a symbol is required. If you have suggestions for where to make those changes, I'm prepared to apply them. |
@mojavelinux Yes, that's a good idea. The implementation (Ruby) should state that context names should be passed as symbol. We could add a reference here: https://docs.asciidoctor.org/asciidoctor/latest/convert/templates/#backing-data-model Although, this information is also useful when developping an extension, for instance here: https://docs.asciidoctor.org/asciidoctor/latest/extensions/block-processor/ on_context :paragraph Or when using the Anyway, I think the "Backing data model" section is where we could introduce this concept.
|
I agree that when we're talking about the Ruby API, it should say there that the context must be passed as a symbol. We could also state on the Convertible Context page that whenever the context is used in the Ruby API, it must be a symbol, but AsciidoctorJ and Asciidoctor.js expect a string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@StarfallProjects I left a comment and we should also update the documentation of findBy
for the TypeScript types definition in:
asciidoctor.js/packages/core/types/index.d.ts
Line 2132 in 041e98e
findBy(selector: Selector | ((block: AbstractBlock) => boolean | string)): AbstractBlock[]; |
Proposal: add a list of valid context names to the findBy docs. I've added all the names I've found so far. However, if this docs repo PR is accepted (asciidoctor/asciidoc-docs#90), it might be nicer to just add a link to the docs, rather than maintain the list in two places.
2259c61
to
c207e31
Compare
Proposal: add a list of valid context names to the findBy docs. I've added all the names I've found so far. However, if this docs repo PR is accepted (asciidoctor/asciidoc-docs#90), it might be nicer to just add a link to the docs, rather than maintain the list in two places.