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

Option to generate AsciiDoc output #44

Open
djencks opened this issue Jan 30, 2022 · 0 comments
Open

Option to generate AsciiDoc output #44

djencks opened this issue Jan 30, 2022 · 0 comments

Comments

@djencks
Copy link

djencks commented Jan 30, 2022

For Apache Camel-K I've modified this project, adding an option to generate AsciiDoc output rather than html. The current results can be seen here:

https://camel.apache.org/camel-k/next/apis/camel-k.html
https://camel.apache.org/camel-k/next/apis/kamelets.html

The code modifications are:

  • a config flag to indicate AsciiDoc output
  • some escaping of comment content to avoid interference with Asciidoc table syntax, attribute syntax, and highlighting syntax
  • more AsciiDoc-friendly ID names (this is currently always-on, not under control of the flag)
  • a method to escape link text, that can be called from templates
  • use of text/Template rather than html/Template, controlled by the flag. There is probably a better way than I found to implement this, but as a Go beginner I wasn't able to find it. Advice here would be greatly appreciated.

I also have two sets of templates:

  • one is pretty much a translation of the html template to AsciiDoc
  • one (used for camel-k) is adapted for use in Antora, with one package per page.

If there's interest in bringing these capabilities into the project, I'd like to start discussing what would be needed to do so. In particular...

  • What testing against existing uses would be appropriate?
  • Where could one or both sets of AsciiDoc templates go?

Note that #11 includes a separate function that can be called from a template that also produces more AsciiDoc-friendly IDs.

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

1 participant