strictdoc-project / strictdoc

Software for technical documentation and requirements management.
https://strictdoc.readthedocs.io/en/stable/
Other
151 stars 24 forks source link

Support AsciiDoc #1337

Open fniu opened 11 months ago

fniu commented 11 months ago

We use asciidoc a lot for various documents. I haven't seen the support of asciidoc on your roadmap. Do you have any plan for this? Thanks!

stanislaw commented 11 months ago

Hi @fniu,

Thanks for asking! It is the first time that I hear someone bringing up AsciiDoc. I have not considered implementing it before, and the Markdown support is on the roadmap with a very low priority.

A similar question about Markdown was asked by @villanella here: https://github.com/strictdoc-project/strictdoc/issues/1321. In my answer there, I outline what has to be done to implement the Markdown support, and the instructions should be pretty similar to AsciiDoc.

Here are some additions to my Markdown answer, and I should probably include them to a general FAQ about implementing a "format X in StrictDoc".

To summarize the above, I don't say No to AsciiDoc, but a good Yes would need a strong commitment from whoever wants to have it implemented in StrictDoc.

fniu commented 11 months ago

Thanks for the thorough response! Much food for thought.

stanislaw commented 11 months ago

@fniu @villanella, in case you do not have resources for implementing AsciiDoc/Markdown yourself, I could think of an intermediate compromise solution which may work or not, depending on your use cases.

For both of these formats, StrictDoc could simply implement export functions so that the SDoc/RST content could be exported/converted to AsciiDoc/Markdown. One would still have to work inside StrictDoc files and use its default RST markup, but the SDoc/RST content could be exported as AsciiDoc/Markdown and be integrated to whatever target documentation environments you maintain. For this task, the good RST to Markdown and RST to AsciiDoc Python/Pip converters would have to be found.

villanella commented 11 months ago

@stanislaw I usually convert markdown <-> RST by Pandoc converter. It also works with AsciiDoc.

Export .sdoc to .md and to AsciiDос is good idea. Titles and statements/freetext I think could be converted easy.

If we have to convert grammar fields, we can use yaml frontmatter or xml in case of markdown. For example, Writerside (IntellijIdea new plugin) uses xml injections in markdown to define meta-information.

stanislaw commented 11 months ago

@fniu some follow-up thoughts on AsciiDoc. In the comment above, @villanella literally means replacing SDoc with AsciiDoc or Markdown completely.

One intermediate option would be: keep the SDoc files but inside the text blocks (i.e., FREETEXT or STATEMENT) write AsciiDoc instead of RST. Then a converter to AsciiDoc would generate all SDoc contents as AsciiDoc contents pretty much the same like the existing RSTWriter does it. The same could be arranged easier for Markdown if that was needed. Is this something that you asked for or you wanted a complete replacement of SDoc like the comment above by @villanella means it?

fniu commented 11 months ago

Both options are valuable to me. I am familiar with AsciiDoc syntax so being able to write that inside text blocks are certanly nice to me. In the meantime, we also want to covert the entire SDoc documents to AsciiDoc because we have our own compiler to produce PDF (still via pdflatex but with many customizations on format and style). Currently I am experimenting with the solution using pandoc: SDoc -> .rst --pandoc--> .adoc -> .pdf.