Generate PDF/HTML from Doxygen's Docbook Output - pdf

Doxygen 1.8.4 included a patch which adds Docbook support. This can be enabled via GENERATE_DOCBOOK. I've tried it with an existing code base and I am able to generate a docbook directory containing xml files.
How can I generate a PDF file from that output?
How can I view the docbook output in a web browser? This question may not be relevant if the content will be identical to the standard doxygen output, but I'm curious.

The Dockbook specialization contains many XSL conversions including HTML and XSL FO to obtain PDF. I would suggest searching Docbook and download these.

A simple way:
Install Eclipse
Go to Eclipse Marketplace, search for docbook and install DEP4E from there
Create DocBook project
Replace the existing docbook with yours
Run build.xml - Ant will ask you in which formats to publish the book. Choose PDF.

Related

How to format markdown and all code in it?

I have a bunch of markdown files in my github repo. As there are many members in the team, the syntax of markdown and code in markdown files are hard to be standardised.
What I want is:
Create a github action that modify those files automatically when there is a push.
I can't find a markdown prettifier that format the code as well. (e.g. putting spaces around '=')
The solutions that I can think out of are:
Use a CLI tool that can do all the stuff
Use a tool for markdown, use a script to filter all code in it and parse it to anther tool
Send http requests to those online prettifier if such CLI tools do not exist
Note: I have Java, Cpp, Swift and more in my markdown.
Any solution for this? I will be appreciated if the script could be provided (if needed).
Thanks.
If those markdown files are located in a java project, you may try spotless.
For example, if you have a maven project, with spotless, just run mvn spotless:apply, it could fix all the styles / formatting issues of your markdown files automatically.

Understanding PDFBox jar files

I am attempting to install PDFBox on my system in order to create PDF files, but am unsure which jar files I need. If I go to https://pdfbox.apache.org/download.cgi
I see command line tools as follows:
pdfbox-app (9.1MB)
preflight-app (9.2MB)
debugger-app (9.0MB)
I also see "Libraries of each subproject" as follows:
pdfbox (2.6MB)
fontbox (1.6MB)
preflight (248KB)
xmpbox (132KB)
pdfbox-tools (77KB)
pdfbox-debugger (245KB)
What is meant by "each subproject"? Is it talking about the command line tools or something different?
I am planning to use java from the command line rather than in an IDE. Does this mean that I just need the Command line tools or do I need the "Libraries of each Subproject" as well? What does the "-app" indicated in the command line tools vs the related libraries?
Is there a page on apache.org that mentions the differences between all of these?
To create PDF files should I be using the preflight and debugger files as well or are those optional?
Summarizing the comments: you want to create a PDF from scratch and access your development over ssh so you can't use an IDE and have to use javac. For that you could use pdfbox-app jar file, but this would be huge. Instead, use the pdfbox, fontbox and commons-log jar files. See also here for additional dependencies if you want to do more advanced stuff (read / render (= convert to image) / decrypt / sign).

How can I convert specific web page to markdown or asciidoc with pandoc?

I want to convert java specification documentation to easily editable formats(markdown or asciidoc) and upload GitHub Gist and customize(adding my code experiences and notes.)
I want to convert to something like this
I use a tool called pandoc that allows us to convert from HTML to markdown.
I tried followings:
Technique 1
I tried to convert all table of components of java specification on index.html
pandoc -f html -t markdown -o test2.md
https://docs.orac le.com/javase/specs/jls/se10/html/index.html`
I got this:tes2.md
(I did not upload here because the file of contents is too long)
Problem 1:
This markdown file does not have contents of java specification documentation. I expected that I got markdown toc(table of components) and java specification documentation contents in markdown file like this`
Problem 2:
When click the links on this markdown file then I get 404 error page.
Technique 2(Better than technique 1)
I downloaded all HTML files of TOC with HTTrack and try to convert all files separately.
pandoc -f html-native_divs-native_spans -i jls-1.html -t markdown -o test2.md
Problem 1:
I got following markdown file which have the table of components links that cannot redirect to another section of the same document. When I click on this links, they return external GitHub page like that:https://gist.github.com/lostdinar2/jls-1.html#jls-1.1
which is not available.
test3.md
A demonstration of problem 1:
1)I want to convert this HTML internal id link(#) to the markdown internal link that redirects to another section of the same document
<dt><span class="section">2.2. The Lexical Grammar</span></dt>
[link text](#abcd)
2)But pandoc cannot convert this links to the markdown internal link.Pandoc create an external link like this:https://gist.github.com/lostdinar2/jls-1.html#jls-1.1
Is there a pandoc parameter to fix this? I make a search on pandoc documentation but I cannot do this feature.

How to Export Swagger documentation in PDF and XML files

I have generated swagger document for web api using below link:
http://wmpratt.com/swagger-and-asp-net-web-api-part-1/
Need to export document in PDF or XML file to send across handy.
Its .NET WEB API.
How to export swagger documentation ?
Thanks
Here's what I did today, since many of these other projects require laborious workarounds or extra libraries or some completely separate language.
Go to https://editor.swagger.io/ (Make sure it's the HTTPS version)
At the top, click File => Import File.
Select your Swagger JSON file.
At the top, click Generate Client => HTML2 and download the ZIP file.
This yields a static HTML page that you can then print (via the browser) to PDF using the built-in Microsoft Print to PDF printer, or Adobe Acrobat, or whatever else you might want to use.
You can use Swagger2Markup and AsciiDoc docker images:
docker run --rm -v $(pwd):/opt swagger2markup/swagger2markup convert -i "https://api.example.org/api/doc/swagger.json" -f /opt/swagger-doc
Creates asciidoc file named 'swagger-doc.adoc' in current folder.
docker run -it -v $(pwd):/documents/ asciidoctor/docker-asciidoctor asciidoctor-pdf swagger-doc.adoc
Creates a PDF file named 'swagger-doc.pdf' in current folder.
The Swagger2Markup project is on GitHub and some more information you'll find by using Google too.
Swagger2Markup converts a Swagger JSON or YAML file into several AsciiDoc or GitHub Flavored Markdown documents which can be combined with hand-written documentation.
AsciiDoc is preferable to Markdown as it has more features. AsciiDoc is a text document format for writing documentation, articles, books, ebooks, slideshows, web pages and blogs. AsciiDoc files can be converted to HTML, PDF and EPUB. AsciiDoc is much better suited for describing public APIs than JavaDoc or Annotations.
You can generate your HTML5, PDF and EPUB documentation via asciidoctorj or even better via the asciidoctor-gradle-plugin or asciidoctor-maven-plugin.
The project requires at least JDK 8.
See also RESTful API Documentation with Swagger and AsciiDoc
Their is no such tool or functionality to export swagger documentation into PDF or any other doc. You need to convert your swagger.json file to yaml file then u can get swagger as html doc form http://editor.swagger.io/.

Tool to generate CHM and PDF documentation from Markdown on Windows

Is there a tool that generates both PDF and CHM documentation from Markdown (or similar, such as RST) on Windows.
We are currently using Sphinx, but have been unable to get the PDF generation working on Windows (this guy has the same issue). It's a pain to have to generate the CHM on Windows and the PDF version on Linux (and I do need to generate both versions).
Is there an alternative tool (free or inexpensive commercial) that could do this task?
The source format must be in a plain-text-like format for version control, of which Markdown and RST are examples.
The Free Pascal distribution holds a CHM compiler called chmcmd. Some people with documentation tools report success with it (like the Preshrunk-cotton python package)
Some Linux distros also pack the chm compiler independently from the main FPC distribution. (since it only is a 700k binary without dependencies).
On Windows you can use the same (the windows version of chmcmd), or Microsoft Help Workshop, the default CHM generator from MS.
That's the CHM compiler part, now the input:
A CHM project before compilation is basically just html with a couple of XML indexes (TOC and master keyword based index) and a project file that is an INI file.
Usually the HTML generator backend of a documentation tool is tweaked to generate it as a special case. From what I read in your "this guy" link, sphinx can do that.
I was able to fulfil this need using Sphinx after all. I used MiKTeX to generate the PDF on Windows.
Install MiKTeX (< 200mb)
wget -nv -N http://mirrors.ctan.org/systems/win32/miktex/setup/miktex-portable-2.9.4757.exe
7z.exe x -y miktex-portable-2.9.4757.exe -o"miktex"
Add the bin directory to your path
SET Path=%Path%;%CD%\miktex\miktex\bin
Run Sphinx's "make.bat" to generate the .tex file.
SET SPHINXOPTS=-W -E
make.bat latex
Invoke MiKTeX's pdflatex:
cd build/latex
pdflatex.exe YOUR_PROJECT_NAME.tex
The resultant PDF will be in your build/latex directory