tomtom-international / asciidoxy

AsciiDoxy generates API documentation from Doxygen XML output to AsciiDoc.
Apache License 2.0
31 stars 10 forks source link

Feature Request: Asciidoc output format #30

Closed jenswet closed 2 years ago

jenswet commented 3 years ago

Hello!

I am currently using asciidoxy for a university project. We don't have the possibility to host an API reference as html page somewhere. We can only publish it to the Gitlab Wiki. While looking for a way to convert Doxygen to Markdown or Asciidoc I found your project. It's great to fit most of our usecase.

Currently we take the .asciidoxy.XXX.adoc files from the intermediate folder and publish them to Gitlab. With a few hacks that works quite well.

We do the following:

  1. Preprocess the Asciidoc files to merge all includes to get rid of the fragments folder:
    
    require 'asciidoctor'

source_file = ARGV[0] if !source_file warn 'You must provide a source file' exit 1 end output_file = source_file.sub(/.adoc$/, '-preprocessed.adoc') source = File.read source_file doc = Asciidoctor.load_file ARGV[0], :safe => :unsafe, :parse_header_only => true reader = Asciidoctor::PreprocessorReader.new doc, source preprocessed_source = reader.read.gsub(/^include::/, '\include::') File.open(output_file, 'w') {|f| f.write preprocessed_source }


2. Make all anchors used to link from the "class diagram" to the method documentations anchors without an empty headline. Asciidoxy creates them as headline like `= [[cpp-class-someclass1_1,someMethod]]`. The `=` adds these lines to the Gitlab generated TOC which we don't want.
3. Somehow the preprocessed file breaks the `leveloffset` by generating too many `:leveloffset!:`. We replace them all by `:leveloffset: -1` which fixes the headline levels.

Except these modifications it works already very well and can easily be executed from the CI of the master branch.

It would be great if you can add a "preprocessed" Asciidoc as output format like HTML. 

I've also found a few minor issues #27 #28, #29 where you might have a look.

And maybe another feature to think of: Include the doxygen class hierarchy diagrams. Currently we copy them from the doxygen generated html and link them from our adoc files processed by asciidoxy.

Thanks a lot for the tool and best regards!
hellgheast commented 3 years ago

Also interested in the asciidoc output format (by only giving the xml folder as source)

silvester747 commented 3 years ago

The next version of AsciiDoxy will already get rid of the fragments folder.

silvester747 commented 2 years ago

The next version of AsciiDoxy will support --backend adoc to skip running AsciiDoctor and instead copy the generated AsciiDoc files to the output directory.