gendocs

This is a program for simplifying ddoc generation.

It ensures that the names of the generated .html files include the full module path (with underscores instead of dots) rather than simply being named after the modules (since just using the module names results in connflicts if any packages have modules with the same name).

It also provides an easy way to exclude files from ddoc generation. Any modules or packages with the name internal are excluded as well as any files that are passed on the command line. And package.d files have their corresponding .html files renamed to match the package name.

Also, the program generates a .ddoc file intended for use in a navigation bar on the side of the documentation (similar to what dlang.org has) uses it in the ddoc generation (it's deleted afterwards). The navigation bar contains the full module hierarchy to allow for easy navigation among the modules in the project. Of course, the other .ddoc files have to actually use the MODULE_MENU macro in the generated .ddoc file, or the documentation won't end up with a navigation bar.

The program assumes a layout similar to dub in that the source files are expected to be in a directory called "source", and the generated documentation goes in the "docs" directory (which is deleted before documentation generation to ensure a clean build).

It's expected that any .ddoc files being used will be in the "ddoc" directory, which isn't a dub thing, but they have to go somewhere.

In addition, the program expects there to be a "source_docs" directory. Any .dd files that are there will have corresponding .html files generated for them (e.g. for generating index.html), and any other files or directories (e.g. a "css" or "js" folder) will be copied over to the "docs" folder.

Note that this program does assume that all module names match their file names and that all package names match their folder names.

Members

Functions

genDdoc
void genDdoc(string sourceFile, string htmlFile, string[] ddocFiles)
Undocumented in source. Be warned that the author may not have intended to support it.
genModuleIndex
void genModuleIndex(OR lines, Package* pkg, int depth)
Undocumented in source. Be warned that the author may not have intended to support it.
genModuleListDdoc
string genModuleListDdoc(string[] excludes)
Undocumented in source. Be warned that the author may not have intended to support it.
genModuleMenu
void genModuleMenu(OR lines, Package* pkg, int depth)
Undocumented in source. Be warned that the author may not have intended to support it.
getDdocFiles
string[] getDdocFiles()
Undocumented in source. Be warned that the author may not have intended to support it.
getModules
Package* getModules(string dir, string[] excludes, int depth)
Undocumented in source. Be warned that the author may not have intended to support it.
main
int main(string[] args)
Undocumented in source. Be warned that the author may not have intended to support it.
processSourceDir
void processSourceDir(string sourceDir, string target, string[] excludes, string[] ddocFiles, int depth)
Undocumented in source. Be warned that the author may not have intended to support it.
processSourceDocsDir
void processSourceDocsDir(string sourceDir, string targetDir, string[] ddocFiles)
Undocumented in source. Be warned that the author may not have intended to support it.
stripSourceDir
string stripSourceDir(string path)
Undocumented in source. Be warned that the author may not have intended to support it.

Manifest constants

ddocDir
enum ddocDir;
Undocumented in source.
docsDir
enum docsDir;
Undocumented in source.
sourceDir
enum sourceDir;
Undocumented in source.
sourceDocsDir
enum sourceDocsDir;
Undocumented in source.

Structs

Package
struct Package
Undocumented in source.

Meta

Authors

Jonathan M Davis