-
Install dependencies (tested in Ubuntu 20)
sudo apt install cmake llvm clang libclang-dev -
Clone source code
git clone https://github.com/KDAB/codebrowser.git -
Compile source with Cmake
cmake . && make -
Install the binaries
sudo make install
-
Install Bear tool to generate 'compile_commands.json' compilation database
sudo apt install bear
-
Download and Install Codebrowser package for your system
-
This will install couple of binaries in the system
codebrowser_generator- Generate HTML version of the source codecodebrowser_indexgenerator- Generate HTML index files
-
Generate
compile_commands.jsonwith bear tool- Goto the project root directory and do
bear make(or)bear -- <your-build-command>.
The output file calledcompile_commands.jsonis saved in the current directory.
- Goto the project root directory and do
-
Create HTML version of your source code
codebrowser_generator -a -b ./compile_commands.json -p <project-name>:<project-path> -o ./output
-
Generate HTML index files
codebrowser_indexgenerator -p <project-name>:<project-path> ./output
-
Get Data directory and place it in parent directory of
./output -
Start the web-server
python -m http.server 8000 -
Explore the source code at http://localhost:8000
This setup doesn't require compile_commands.json file.
-
Create HTML version of your source code
codebrowser_generator -o ./output -p <project-name>:$PWD $PWD --
-
Generate HTML index files
codebrowser_indexgenerator -p <project>:$PWD ./output
-
Follow the steps 3 to 5 mentioned in the above section and explore code in the web-browser
-
Export the output directory
outputto your webserversudo cp -rf ./output /var/www/html/
-
Copy the HTML assets
datato the parent directorysudo cp /usr/share/woboq/data/ /var/www/html
-
Explore your project in browser at http://localhost/output
codebrowser_generator -o ./devcode -p MyProject:$PWD $PWD --
codebrowser_indexgenerator -p MyProject:$PWD ./devcode
https://woboq.com/codebrowser.html
https://github.com/KDAB/codebrowser