SCons tool to generate Doxyfile for Doxygen
Project description
SCons tool to generate Doxyfile for Doxygen. The generated Doxyfile may be further used by scons_doxygen tool.
Installation
There are few ways to install this tool for your project.
From pypi
This method may be preferable if you build your project under a virtualenv. To add doxyfile tool from pypi, type (within your wirtualenv):
pip install scons-tool-loader scons-tool-doxyfile
or, if your project uses pipenv:
pipenv install --dev scons-tool-loader scons-tool-doxyfile
Alternatively, you may add this to your Pipfile
[dev-packages]
scons-tool-loader = "*"
scons-tool-doxyfile = "*"
The tool will be installed as a namespaced package sconstool.doxyfile in project’s virtual environment. You may further use scons-tool-loader to load the tool.
As a git submodule
Create new git repository:
mkdir /tmp/prj && cd /tmp/prj touch README.rst git init
Add the scons-tool-doxyfile as a submodule:
git submodule add git://github.com/ptomulik/scons-tool-doxyfile.git site_scons/site_tools/doxyfile
For python 2.x create __init__.py in site_tools directory:
touch site_scons/site_tools/__init__.py
this will allow to directly import site_tools.doxyfile (this may be required by other tools).
Usage example
Git-based projects
Copy doxygen template to src/, for example:
mkdir src && cp site_scons/site_tools/doxyfile/Doxyfile.in src/
Create some source files, for example src/test.hpp:
// src/test.hpp /** * @brief Test class */ class TestClass { };
Write SConstruct file:
# SConstruct env = Environment(tools=['doxyfile', 'doxygen']) SConscript('src/SConscript', exports=['env'], variant_dir='build', duplicate=0)
Write src/SConscript:
# src/SConscript Import(['env']) doxyfile = env.Doxyfile( INPUT = '.', RECURSIVE = True) env.Doxygen(doxyfile)
Try it out:
scons
This shall create documentation under build directory.
Check the generated documentation (it should contain docs for TestClass under Classes tab):
firefox build/html/index.html
Details
Module contents and description
The scons-tool-doxyfile contains these crucial files:
__init__.py, doxyoptions.py and about.py files,
Doxyfile.in template,
SConstruct script, and
this README.rst
The tool provides a Doxyfile() builder which generates Doxyfile configuration file from Doxyfile.in template. It accepts several options to customize the generated Doxyfile. The options are passed as keyword arguments to Doxyfile:
env.Doxyfile(INPUT='.', RECURSIVE=True, STRIP_FROM_INC_PATH='.', ...)
Same template may be used to generate documentation for several sub-projects by using different sets of options (and variant builds, if necessary). You may also use your own template file, instead of default Doxyfile.in shipped along with this tool.
Option types
The options Doxyfile() builder accepts are categorized into several types:
Type |
Note |
Example value in SConscript |
Example output to Doxyfile |
---|---|---|---|
int |
integer |
3 |
3 |
str |
string |
‘str1’ or ‘str 2’ |
str1 or “str 2” |
list |
list |
[‘a b’, False, 3] |
“a b” False 3 |
dict |
dictionary |
{‘a’ : ‘A’, ‘b’ : ‘B’} |
a=A b=B |
bool |
boolean |
True or False |
YES or NO |
entry |
ref to file or directory |
‘foo’ |
/tmp/prj/build/foo |
file |
ref to file |
‘bar.txt’ |
/tmp/prj/build/bar.txt |
dir |
ref to directory |
‘.’ |
/tmp/prj/build |
srcentry |
ref to source file or dir |
‘foo’ |
/tmp/prj/src/foo |
srcfile |
ref to source file |
‘foo.txt’ |
/tmp/prj/src/foo.txt |
srcdir |
ref to source directory |
‘.’ |
/tmp/prj/src |
dualentry |
ref to entry + its source |
‘foo’ |
/tmp/prj/build/foo \
/tmp/prj/src/foo
|
dualfile |
ref to file + its source |
‘foo.txt’ |
/tmp/prj/build/foo.txt \
/tmp/prj/src/foo.txt
|
dualdir |
ref to dir + its source |
‘.’ |
/tmp/prj/build \
/tmp/prj/src
|
entries |
list of entries |
[‘foo’, ‘bar/gez’] |
/tmp/prj/build/foo \
/tmp/prj/build/bar/geez
|
files |
list of files |
[‘foo’, ‘bar.txt’] |
/tmp/prj/build/foo \
/tmp/prj/build/bar.txt
|
dirs |
list of directories |
[‘.’, ‘foo’] |
/tmp/prj/build \
/tmp/prj/build/foo
|
srcentries |
list of source entries |
[‘.’, ‘foo’] |
/tmp/prj/src \
/tmp/prj/src/foo
|
srcfiles |
list of source files |
[‘a.txt’, ‘b.txt’] |
/tmp/prj/src/a.txt \
/tmp/prj/src/b.txt
|
srcdirs |
list of source dirs |
[‘.’, ‘foo’] |
/tmp/prj/src \
/tmp/prj/src/foo
|
dualentries |
list of dual entries |
[‘.’, ‘foo’] |
/tmp/prj/build \
/tmp/prj/src \
/tmp/prj/build/foo \
/tmp/prj/src/foo
|
dualfiles |
list of dual files |
[‘a.txt’, ‘b.txt’] |
/tmp/prj/build/a.txt \
/tmp/prj/src/a.txt \
/tmp/prj/build/b.txt \
/tmp/prj/src/b.txt
|
dualdirs |
list of dual directories |
[‘.’, ‘foo’] |
/tmp/prj/build \
/tmp/prj/src \
/tmp/prj/build/foo \
/tmp/prj/src/foo
|
An entry is a path to file or directory (undecided). For each value of type entry, file or dir a single path is outputted to Doxyfile. If relative paths are provided by user, they are assumed to be relative to a directory containing the calling SConscript. Note, that SCons will write absolute paths to Doxyfile, so you should consider using STRIP_FROM_PATH, STRIP_FROM_INC_PATH and similar options.
In variant builds, the entry, file and directory, if given as relative paths, will point to a file or subdirectory of build dir.
A srcentry, srcfile, or srcdir will generate a path pointing to a source file or directory corresponding to given file. This, of course, becomes relevant when variant builds are used.
Dual entry, file (or directory) results with a single path or two paths being emitted to Doxyfile. For variant builds, pair of paths is written to Doxyfile: the first one in build dir and the second pointing to a corresponding source file or dir.
The values written to Doxyfile are automatically quoted if they contain white spaces. For example, the hash {'a' : 'be ce'} will result with a="be ce".
Values being assigned to Doxyfile options are subject of simple validation.
Supported options
The supported options are summarized in the following table:
Option |
Type |
Default |
---|---|---|
str |
||
str |
||
bool |
NO |
|
bool |
YES |
|
bool |
NO |
|
bool |
YES |
|
bool |
NO |
|
bool |
YES |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
OS specific |
|
srcfile |
||
str |
||
files |
||
bool |
NO |
|
str |
||
bool |
YES |
|
bool |
YES |
|
bool |
YES |
|
str |
||
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
YES |
|
bool |
NO |
|
bool |
NO |
|
dir |
||
str |
org.doxygen.Project |
|
str |
“Doxygen generated docs” |
|
str |
org.doxygen.Publisher |
|
str |
Publisher |
|
srcdirs |
||
bool |
YES |
|
str |
Helvetica |
|
srcdir |
||
int |
10 |
|
int |
50 |
|
str |
png |
|
bool |
NO |
|
int |
0 |
|
str |
||
bool |
NO |
|
str |
UTF-8 |
|
str |
org.doxygen.Project |
|
str |
||
bool |
YES |
|
int |
4 |
|
srcdirs |
||
str |
||
bool |
NO |
|
srcdirs |
||
str |
||
str |
||
bool |
NO |
|
list |
||
bool |
NO |
|
str |
||
bool |
YES |
|
bool |
YES |
|
bool |
NO |
|
str |
||
bool |
NO |
|
bool |
NO |
|
bool |
YES |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
str |
||
str |
||
bool |
NO |
|
str |
||
str |
||
dict |
||
bool |
NO |
|
dict |
||
bool |
NO |
|
int |
10 |
|
bool |
YES |
|
bool |
YES |
|
bool |
NO |
|
bool |
YES |
|
bool |
NO |
|
bool |
YES |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
YES |
|
bool |
NO |
|
bool |
YES |
|
bool |
YES |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
file |
||
bool |
YES |
|
bool |
YES |
|
bool |
NO |
|
bool |
NO |
|
bool |
YES |
|
bool |
YES |
|
bool |
NO |
|
str |
||
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
YES |
|
int |
80 |
|
int |
220 |
|
int |
100 |
|
bool |
NO |
|
srcfiles |
||
srcfile |
||
str |
.html |
|
srcfile |
||
srcfile |
||
int |
100 |
|
str |
html |
|
srcfile |
||
bool |
YES |
|
bool |
YES |
|
str |
||
srcdirs |
||
bool |
YES |
|
str |
||
bool |
YES |
|
srcdirs |
||
bool |
YES |
|
bool |
NO |
|
bool |
YES |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
srcentries |
||
str |
UTF-8 |
|
str |
||
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
str |
||
str |
latex |
|
srcfiles |
||
srcfile |
||
srcfile |
||
bool |
NO |
|
str |
latex |
|
bool |
NO |
|
srcfile |
||
int |
0 |
|
bool |
NO |
|
str |
makeindex |
|
str |
.3 |
|
bool |
NO |
|
str |
man |
|
bool |
YES |
|
srcfile |
||
str |
||
str |
HTML-CSS |
|
str |
||
int |
0 |
|
int |
30 |
|
dirs |
||
str |
||
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
dir |
||
str |
English |
|
str |
a4 |
|
bool |
YES |
|
bool |
NO |
|
str |
||
bool |
YES |
|
str |
/usr/bin/perl |
|
list |
||
str |
||
str |
||
str |
“My Project” |
|
str |
||
str |
||
str |
||
str |
||
str |
||
str |
||
str |
||
str |
doc |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
YES |
|
bool |
NO |
|
bool |
YES |
|
file |
||
bool |
NO |
|
str |
rtf |
|
file |
||
str |
searchdata.xml |
|
bool |
YES |
|
str |
||
bool |
YES |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
YES |
|
bool |
YES |
|
bool |
YES |
|
bool |
YES |
|
bool |
NO |
|
bool |
YES |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
bool |
YES |
|
bool |
NO |
|
bool |
YES |
|
bool |
NO |
|
bool |
YES |
|
srcdirs |
||
srcdirs |
||
bool |
YES |
|
int |
4 |
|
str |
||
str |
||
bool |
NO |
|
bool |
NO |
|
int |
250 |
|
bool |
NO |
|
int |
10 |
|
bool |
NO |
|
bool |
NO |
|
bool |
NO |
|
srcfile |
||
bool |
YES |
|
bool |
YES |
|
bool |
YES |
|
str |
“$file:$line: $text” |
|
bool |
YES |
|
bool |
YES |
|
file |
||
bool |
NO |
|
str |
||
str |
xml |
|
bool |
YES |
|
str |
Notes to developers
Regenerating documentation for options
If you change some options in doxyoptions.py, then you should regenerate option’s documentation in README.rst. New documentation may be generated by running:
scons -Q doc-options
After that, copy-paste the output of the above command to an appropriate place in this README.rst (note, just skip scons messages).
LICENSE
Copyright (c) 2013-2018 by Pawel Tomulik <ptomulik@meil.pw.edu.pl>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file scons-tool-doxyfile-0.2.0.tar.gz
.
File metadata
- Download URL: scons-tool-doxyfile-0.2.0.tar.gz
- Upload date:
- Size: 35.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97156a9a5fa5a2fe2ef79751805ea2e9a6ade59e2b04002f6a353da3fffa0e37 |
|
MD5 | 74d10a05de34f4ca9c299501b29a3965 |
|
BLAKE2b-256 | 7dc01a7d440b77e2d2d8bbfc2330880d6ce2eeb03adae518ee737f72837c5a39 |
File details
Details for the file scons_tool_doxyfile-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: scons_tool_doxyfile-0.2.0-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9e5c8157a96e64b60643501cd64cb4e5e0415e14aa04552085a0d07f6476ea6 |
|
MD5 | a9392f7fe9bc3f3db99965e44c2889e6 |
|
BLAKE2b-256 | 07865a7f756370e5bb57cff3df1ee8c2805216d7549b4e659f96fbd06e7a73de |