Features

What Tools Do You Use to Produce API Documentation?

By Anita Andrew | Senior Member

Over the years the IT industry has seen a significant growth in APIs that are available as free and paid services. Clearly, it is imperative to have good API documentation for developers to be able to use these APIs to develop their application, and there is a need for good documentation tools to create good API documentation.

Just like the documentation tools for any GUI-based product documentation, there is a plethora of tools available for creating API documentation as well. API documentation tools come in different flavors—automatic vs. manual, free vs. commercial, etc. This article provides an overview of some of the commonly used tools to create API documentation and also lists the criteria that can help in deciding on an API documentation tool.

Which Tool Is Suitable for My API Project?

There is no direct answer for this question as each API project differs based on the technology and language used for creating the API. Some of the criteria that can be considered for deciding the API documentation tool that suits your API project are as follows:

  • Language support
  • Output formats supported
  • Automatic vs. manual
  • Support and maintenance
Language Support

Since APIs are developed using different programming languages, the tool used for creating API documentation must support the programming language of your API project.

For example, the tool used for documenting APIs written in Java code is different from the tool used to document APIs written in .NET, PHP, or Ruby. Although there are tools such as Doxygen, NaturalDocs, HeaderDoc, Dexy, Document!X, Doc-O-Matic, etc., which support multiple programming languages and technologies, some tools support only a specific programming language or technology. For example, ApiGen supports PHP, Epydoc supports Python, Javadoc supports Java, JSDoc supports Javascript, Sandcastle supports .NET, and YARD supports Ruby, etc.

For a comprehensive list of API documentation tools and the languages they support, see Tables 2 and 3.

Output Formats

Because API users prefer documentation to be accessible easily as an on online help, the most preferred output format is HTML. However, depending on how the API documentation is used, other output formats, such as CHM, PDF, RTF, XML, Unix-Man Pages, LaTeX, etc., are also popular. Simply pick out the API documentation tool that generates your required output format. For a comprehensive list of API documentation tools and the output formats they support, see Tables 2 and 3.

Automatic Vs. Manual

Ideally, API documentation consists of an API Reference section and several conceptual sections. The conceptual sections include an introduction to the APIs, usage scenarios, example code, and other relevant conceptual topics.

Most of the API documentation tools such as Javadoc, Sandcastle, and Doxygen automatically generate the API reference section by extracting comments added to the source code. However, conceptual topics have to be created manually and later linked with the API reference section.

Some tools, such as API Blueprint from Apiary, automatically generate a template and allow you to preview the API documentation while the API is being developed. There are other tools such as I/O docs from Mashery that allow the creation of interactive API documentation, with embedded code samples and live API calls from within the API documentation.

Support and Maintenance

To leverage the features of any API documentation tool, it is essential to have good customer support for the tool in the form of user communities, discussion forums, and maintenance support in addition to good user documentation. Regular updates and releases of the API documentation tools that provide new features to support emerging technologies and fixes for issues should also be available.

A Comparison of Tools to Create API Documentation for .NET, Java, and REST APIs

The following topics provide an overview of some of the most commonly used tools to generate API documentation for .NET, Java, and REST APIs. Due to space constraints, I have limited the number of tools for each technology to a maximum of four. You can refer to Tables 2 and 3 for a comprehensive list of tools and the languages they support.

Tools for Generating .NET API documentation: Sandcastle, Document!X, Doc-O-Matic, VSDocman
  • All four tools parse the XML comments added to the source code of the .NET APIs and generate API reference documentation in MSDN style format.
  • Document!X, VSDocman, and Doc-o-matic can generate the API reference documentation directly from the source code, but Sandcastle needs compiled .NET assemblies for generating the API reference documentation.
  • All four tools have a GUI interface that provides several customization options and also allows you to filter the members that must be visible in the final help output. For example, using the Document!X tool you can author content outside of the code and choose to override the source code comments while generating the API documentation.
  • All four tools allow you to add conceptual topics such as overview, code examples, usage scenarios, etc.
Tools for Generating API documentation for Java Code: Javadoc, Doxygen
  • Both Javadoc and Doxygen parse the documentation comments from a set of Java source files to produce API documentation that describe classes, interfaces, constructors, methods, and fields.
  • Both tools have plugins for NetBeans and Eclipse that make it faster to generate the documentation.
  • Both tools use Javadoc style comments; however, Doxygen’s comment style is more flexible as it is not heavily dependent on HTML tags for formatting the content like Javadoc is. For example, Javadoc expects the HTML tag <p> in the comments to detect paragraphs whereas Doxygen automatically detects the start of an empty line as a new paragraph.
  • The Javadoc tool supports only HTML output format whereas Doxygen supports multiple output formats such as HTML, CHM, PDF, XML, RTF, and Latex.
Tools for Generating API Documentation for RESTful APIs: Swagger, I/O Docs
  • The Swagger tool by Wordnik and the I/O Docs tool by Mashery are two of the most commonly used tools for documenting RESTful APIs.
  • Swagger is a specification for documenting RESTful Web APIs and is language agnostic. I/O Docs is a live interactive documentation system for RESTful Web APIs and uses a JSON schema to describe APIs resources, methods, and parameters.
  • The Swagger UI framework allows both developers and non-developers to interact with the API in a sandbox UI. This gives clear insight into how the API responds to parameters and options. In contrast, I/O Docs allows the user to execute API calls directly from the documentation interface, which are proxied through the I/O Docs server, producing formatted responses.

The following table lists additional tools that are available for documenting REST APIs:

Table 1. Additional tools for Documenting REST APIs

API Tools Description of the tools and their URLs
API Blueprint from Apiary http://apiary.io/blueprint“API Blueprint is a Markdown-based DSL for describing HTTP APIs.”
APIgee Console to go http://apigee.com/docs/console-go/content/whats-api-console“Apigee API Consoles provide a GUI for exploring an API’s resources and executing its methods.”
Dexy http://dexy.it/“Dexy is a general purpose documentation tool that supports any language and could also be used for documenting Web APIs.”
Enunciate http://enunciate.codehaus.org/“Enunciate generates HTML documentation of Java Web services, scraped from the JavaDocs.”
MireDot http://www.miredot.com/“MireDot is a REST API documentation generator for Java that generates beautiful interactive documentation with minimal configuration effort.”
MuleSoft API Designer & Console http://www.mulesoft.org/documentation/display/current/API+Designer“API Designer is the custom environment specifically dedicated to designing and writing an API definition inRAML.”
Tripit/Slate https://github.com/tripit/slate“Slate helps you to create beautiful single-page API documentation. It is a smart, easy API documentation template that can be used to document your own website’s API.”
Turnapi http://turnapi.com/features“Intelligent WIKI-editor, markdown based standards, documentation branching, sync with Git, SVN, Mercurial, clean looking themes.”

A List of Available API Documentation Tools

The following tables provide lists of free and commercial tools that are used and recommended by several API document writers in the industry.

Table 2. Freeware/Open Source/GPL/BSD Tools

Tool Name Languages supported Output Formats Description
ApiGen PHP HTML http://apigen.org/“ApiGen creates professional API documentation from PHP source code, similar to discontinued phpDocumentor/phpDoc.”
CppDoc C/C++ HTML http://www.cs.scranton.edu/ ~doc/cppdoc/“CppDoc generates HTML documentation for C++ classes, from the source code and special comments embedded within the code. CppDoc also generates inner class workings and relationships.”
Ddoc D HTML, CHM, PDF, LaTeX, PostScript, man pages, XML http://dlang.org/ddoc.htmlDdoc generates API documentation from the comments embedded in the source code written in D language.
Doxygen C, C++, C#, Objective-C, IDL, Java, VHDL, PHP, Python, Tcl, Fortran, and D HTML, RTF,LATEX, XML, Unix-Man page, and DocBook http://www.doxygen.nl/index.html“Doxygen is the de facto standard tool for generating documentation from annotated C++ sources, but it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba,Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl, and to some extent D.”
Epydoc Python HTML, PDF, http://epydoc.sourceforge.net/“Epydoc generates API documentation for Python modules, based on their docstrings.”
fpdoc Delphi/Pascal HTML, XHTML, CHM, RTF, LaTeX, Text, Unix-Man pages http://www.freepascal.org/docs-html/ fpdoc/fpdoc.html“Free Pascal code documenter FPDoc is a tool that combines a Pascal unit file and a description file in XML format and produces reference documentation for the unit.”
Haddock Haskell HTML, CHM http://www.haskell.org/haddock/ #Overview“Haddock, automatically generates documentation from annotated Haskell source code. It is primarily intended for documenting libraries, but it should be useful for any kind of Haskell code.”
HeaderDoc C,C++, Java, Pascal, IDL, PHP, Perl, Python, Ruby, Javascript, Tcl, AppleScript, MIG, Bourne shell, C shell HTML, man pages, XML https://developer.apple.com/library/ mac/documentation/DeveloperTools/ Conceptual/HeaderDoc/intro/intro.html“HeaderDoc is a set of tools for embedding structured comments in source code and header files written in various languages and subsequently producing rich HTML and XML output from those comments.”
IDLdoc IDL HTML http://planetoweb.cesr.fr/twiki/pub/ Main/HowtoInformatique/idldoc-tutorial.pdf“IDLdoc is used to generate Javadoc-style HTML documents from comments in IDL.”
Javadoc Java HTML http://www.oracle.com/technetwork/java/javase/documentation/javadoc-137458.html“Javadoc is a tool for generating API documentation in HTML format from doc comments in Java source code.”
jGrouseDoc JavaScript HTML, XML https://code.google.com/p/ jgrousedoc/“jGrouseDoc allows developers to produce documentation for their javascript code based on javadoc-like comments embedded into the source code.”
JSDoc JavaScript HTML http://usejsdoc.org/“JSDoc is an API documentation generator for JavaScript, similar to JavaDoc or PHPDoc. The JSDoc tool scans the comments added to the source code, and generates a complete HTML documentation website for you”.
Live Documenter .NET HTML http://theboxsoftware.com/products/ live-documenter/“Live Documenter is a .NET documentation tool, that works by displaying the documentation live for your project.”
Natural Docs C#, Perl, ActionScript, Any with comments HTML http://www.naturaldocs.org/”Natural Docs is a documentation generator for multiple programming languages. You document your code in a natural syntax that reads like plain English. Natural Docs then scans your code and builds high-quality HTML documentation from it.”
phpDocumentor PHP HTML, CHM, PDF, DocBook, XML http://www.phpdoc.org/phpDocumentor enables you to generate documentation from your PHP source code.
phpSimpleDoc PHP HTML http://phpsimpledoc.tig12.net/“phpSimpleDoc is a documentation generator that generates HTML documentation from PHP source code.”
ROBODoc C, C++, Fortran, Perl, shell scripts, Assembler, DCL, DB/C,Tcl/Tk, Forth, Lisp, COBOL, Occam, Basic, HTML, Clarion, and any other language that supports remarks. HTML, XML, RTF, LaTeX,TROFF, ASCII, DocBook http://rfsber.home.xs4all.nl/ Robo/“ROBODoc extracts specially formatted documentation headers from source files and stores in a different file. ROBODoc can be used to later reformat the documentation to the supported output formats.”
Sandcastle .NET HTML, CHM http://shfb.codeplex.com/“Sandcastle can be used to create help files consisting of both conceptual and API reference topics. API reference topics are created by combining the XML comments that are embedded in your source code with the syntax and structure of the types which is acquired by reflecting against the associated .NET Framework assembly. Conceptual topics are created by converting XML documents that you author containing Microsoft Assistance Markup Language (MAML).”
Sphinx C/C++, Python, JavaScript, HTML, CHM, LaTeX, man pages, XML http://sphinx-doc.org/“Sphinx can be used to create intelligent and beautiful documentation from the source files of a project.”
VBDOX VB, VBScript, ASP HTML, CHM, RTF http://vbdox.sourceforge.net/“VBDOX is a simple program that generates technical documentation from source

comments.”

VBSdoc VB/VBScript HTML http://www.planetcobalt.net/sdb/ vbsdoc.shtmlVBSdoc is a VBScript API documentation generator that generates documents from Javadoc-like comments that are added to the source code.
YARD Ruby HTML YARD is a documentation generation tool for the Ruby programming language. It enables the user to generate consistent, usable documentation that can be exported to a number of formats very easily, and also supports extending for custom Ruby constructs such as custom class level definitions.http://yardoc.org/

Table 3. Commercial Tools

Tool Name Languages supported Output Formats Description
Atomineer Pro C, C++/CLI, C++, C#, Visual Basic, Java, UnrealScript HTML, RTF http://www.atomineerutils.com/Atomineer Pro is a commenting tool that can be used to add comments automatically to the code. You need to use additional tool to generate the output from the generated comments.
BI Documenter / Doc xPress .NET CHM, HTML http://pragmaticworks.com/Products/BI-DocumenterBI Documenter generates MSDN style output for SQL Server documentation.
DB Manual SQL Server, Oracle CHM http://download.cnet.com/DB-Manual/3000-10254_4-10451302.html“DB Manual helps to document databases automatically, quickly, easily, and put the information in the world famous MSDN layout or

CHM-files.”

DBDesc SQL Server, Oracle, MySQL, Microsoft Access HTML, RTF, PDF, XML http://www.leadum.com/products.php“Dbdesc is a powerful tool to help you document your databases. It can produce detailed documents describing your databases.”
docfacto Javadoc DITA http://docfacto.com/product/docfacto-dita-doclet“docfacto DITA Doclet is a doclet that handles generics, doesn’t require any specialisation and generates DITA files from Javadoc to compliment your existing DITA files. This Doclet honours the Docfacto Taglets as well.”
Doc-O-Matic C, C++, C#, Delphi, VB.NET, IDL, Java, PHP, JavaScript, ASPX, JSP, MatLab. HTML, CHM, RTF, PDF, XML http://www.doc-o-matic.com/“Doc-O-Matic is a source code documentation and Help authoring tool. It takes source code and comments, adds conceptual topics and external input and produces documentation from it.”
Document! X C++/CLI only, Java, C#, VB/VBScript, IDL, .NET, Access, PL/SQL HTML, CHM, http://www.innovasys.com/product/dx/overview“Document! X automates the process of creating and maintaining documentation for a wide range of solution elements.”
ForgeDoc C#,VB.NET,

C++

HTML, CHM, http://www.forgedoc.com/ForgeDoc is a class library documentation generator for .NET assemblies.
GenHelp C/C++, C#, Delphi/Pascal, .NET HTML, CHM, RTF http://www.frasersoft.net/genhelp/index.html“GenHelp and GenHelp Pro are new generation tools to assist in documenting code and creating help files.”
GhostDoc Pro VB.NET, C#, C/C++ CHM, HTML, http://submain.com/products/ghostdoc.aspx“GhostDoc is a Visual Studio extension that automatically generates XML documentation comments for methods and properties based on their type, parameters, name, and other contextual information. Additionally, the paid version provides ultimate documentation configuration flexibility and automation of routine documentation operations.”
VSdocman C#, VB/VBScript/ .NET HTML, CHM, RTF, XML http://www.helixoft.com/vsdocman/overview.html“VSdocman – a .NET documentation compiler – is directly integrated in Visual Studio so it will assist you with complete process of creating a documentation. This includes intelligent semi-automatic commenting of your code elements, creating additional topics (non-API reference) and generating and deploying the documentation.”

Anita Andrew is a senior technical writer on the engineering team at Talisma, a CRM company located in Bangalore, India She is a member of the STC India Chapter Anita has over 13 years of experience and has donned the hats of a technical writer, e-learning professional, programmer, and technical trainer. Her skills and interests include technical communication, API documentation, product training, process improvement, and research and troubleshooting issues related to authoring tools and technologies. She recently automated the process of API documentation generation using Sandcastle for Talisma CRM APIs. You can connect with her at in.linkedin.com/in/anitaandrew/ or at ani2005@gmail.com.