There is a pre-processing step on your code that generates static html and reference database. The output of this phase is just a set of static files that can be uploaded on any web hoster. No software is required on the server other than the most basic web server that can serve files.
While generating the code, you will give to the generator an output directory. The files reference themselves using relative path. The layout in the output directory will look like this: (Assuming the output directory is ~/public_html/mycode)
$OUTPUTDIR/projectname or ~/public_html/mycode/projectname contains the generated html files for your project
$OUTPUTDIR/refs or ~/public_html/mycode/refs contains the "database" used for the tooltips
$OUTPUTDIR/include or ~/public_html/mycode/include contains the generated files for the files in /usr/include
The idea is that you can have several project sharing the same output directory. In that case they will also share references and use searches will work between them.
Compiling the generator on Linux
The clang libraries version 3.4 or later
cmake . -DLLVM_CONFIG_EXECUTABLE=/opt/llvm/bin/llvm-config -DCMAKE_BUILD_TYPE=Release
cmake . -DLLVM_CONFIG_EXECUTABLE=/usr/local/Cellar/llvm/<your_llvm_version>/bin/llvm-config -DCMAKE_BUILD_TYPE=Release
Using the generator
Step 1: Generate the compile_commands.json for your project
The code browser is built around the clang tooling infrastructure that uses compile_commands.jsonhttp://clang.llvm.org/docs/JSONCompilationDatabase.html If your build system is cmake, just pass -DCMAKE_EXPORT_COMPILE_COMMANDS=ON to cmake to generate the script. For other build systems (e.g. qmake, make) you can use scripts/fake_compiler.sh as compiler (see comments in that file)
Step 2: Create code HTML using codebrowser_generator
Before generating, make sure the output directory is empty or does not contains stale files from a previous generation.
Call the codebrowser_generator. See later for argument specification
Step 3: Generate the index HTML files using codebrowser_indexer
By running the codebrowser_indexer with the output directory as an argument
Step 4: Copy the data/ directory one level above the generated html
Example: To generate the code for this project itself:
-a process all files from the compile_commands.json. If this argument is not passed, the list of files to process need to be passed
-o with the output directory where the generated files will be put
-b the "build directory" containing the compile_commands.json
-p (one or more) with project specification. That is the name of the project, the absolute path of the source code, and the revision separated by colons example: -p projectname:/path/to/source/code:0.3beta