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

Asciidoc markdown block #572

Merged
merged 3 commits into from
Jun 17, 2022
Merged

Conversation

osfameron
Copy link
Collaborator

Block extension to filter text like:

[markdown]
--
Filter some text with [Markdown](https://commonmark.org/help/) syntax.
--

This is not implemented with a full Markdown parser.
See asciidoctor/kramdown-asciidoc#7
with a link to the "naive series of regexes" used as starting point.

(And note that we use Open structural context
https://docs.asciidoctor.org/asciidoc/latest/blocks/delimited/#summary-of-structural-containers
with -- delimiters, and headings don’t work inside these.)

This feature is intended for handling OpenAPI specs, which can contain Markdown,
however openapi-generator has poor Asciidoc handling
OpenAPITools/openapi-generator#11396
so instead we add the block delimiters in the template, and let the block filter handle it.

Block extension to filter text like:

    [markdown]
    --
    Filter some text with [Markdown](https://commonmark.org/help/) syntax.
    --

This is not implemented with a full Markdown parser.
See asciidoctor/kramdown-asciidoc#7
with a link to the "naive series of regexes" used as starting point.

(And note that we use Open structural context
https://docs.asciidoctor.org/asciidoc/latest/blocks/delimited/#summary-of-structural-containers
with `--` delimiters, and headings don’t work inside these.)

This feature is intended for handling OpenAPI specs, which can contain Markdown,
however openapi-generator has poor Asciidoc handling
OpenAPITools/openapi-generator#11396
so instead we add the block delimiters in the template, and let the block filter handle it.
@osfameron osfameron requested a review from a team June 14, 2022 09:30
Copy link
Contributor

@RayOffiah RayOffiah left a comment

Choose a reason for hiding this comment

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

Hah! Wow!

Okay, the module registration looks good to me, and the mdtoac.js test seems to do the business, so I'm good with it.

Create a block with potentially multiple lines (sub-paragraphs)
@osfameron osfameron merged commit 383fb95 into couchbase:staging Jun 17, 2022
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 this pull request may close these issues.

None yet

2 participants