As mentioned, this package ships the source code of fbdoc. It has to get compiled and linked to an executable binary first. Therefor at least the FB compiler has to be installed on the users system. Other tools are used by the author, here's how to get all components working.
The following table lists all dependencies for fbdoc and their category. The FreeBASIC compiler is mandatory (M), the others are optional. Some are recommended (R) in order to make use of all package features. Some are helpful for testing (T) purposes. LINUX users may find some packages in their distrubution management system (D).
Name | Type | Function |
---|---|---|
fbc | M | FreeBASIC compiler to compile the source code |
GIT | R D | version control system to organize the files |
CMake | R D | build management system to build executables and documentation |
cmakefbc | R | FreeBASIC extension for CMake |
Doxygen | R D | documentation generator (ie. for this text) |
Graphviz | R D | Graph Visualization Software (caller/callee graphs) |
LaTeX | R D | A document preparation system (PDF output) |
Geany | T D | Integrated development environment (ie. to test templates) |
gtk-doc | T D | A further documentation generator (ie. for testing purposes) |
devscripts & tools | R D | Scripts for building Debian packages (for target deb) |
It's beyond the scope of this guide to describe the installation for those programming tools. Find detailed installation instructions on the related websides, linked by the name in the first column.
sudo
in case of non-LINUX systems.Depending on whether you installed the optional GIT package, there're two ways to get the fbdoc package.
Using GIT is the prefered way to download the fbdoc package (since it helps users to get involved in to the development process). Get your copy and change to the source tree by executing
git clone https://github.com/DTJF/fbdoc cd fbdoc
As an alternative you can download a Zip archive by clicking the Download ZIP button on the fbdoc website, and use your local Zip software to unpack the archive. Then change to the newly created folder.
Depending on whether the optional CMake package is installed (recommended), the fbdoc executable can either get compiled by the build management scripts or has to get compiled manually.
The prefered way to build the executable and the documentation files is to use the scripts for the CMake build system. The CMake scripts check your system and through warnings if anything is missing. Depending on the missing part this may end up by
Anyway, the first run will complain about the missing fbdoc executable. This executable has to get built and installed before the doc target can get configured and used.
Either in-source or out-of-source builds are supported. The later should be the prefered choise. Execute the following commands starting at the root directory of the package.
The following command triple will compile the executable in the source tree and install it on the system:
cmake . make sudo make install
sudo
in case of non-LINUX systems.The following command quintuple will create a new build folder, change to that folder, compile the executable and install it on the system:
mkdir build cd build cmake .. make sudo make install
sudo
in case of non-LINUX systems.In order to build the documentation, all recommended packages listed in section Tools have to get installed. This also means that the fbdoc executable has to get compiled and installed first.
The following command will build the documentation in form of an HTML file tree and in form of a PDF file (either in-source or out-of-source):
make doc
doxy/html/index.html
. doxy/fbdoc.pdf
.Both targets can get build separately by executing
make doc_htm make doc_pdf
The project is prepared to build packages for Debian based Linux versions (ie. like Ubuntu, Mint, ...). It's beyond the scope of this documentation to explain that process in detail. It's also a bit tricky, since the project is self-hosting (it needs itself to build its documentation).
In order to create a package, make sure that you installed all dependencies listed above. Then adapt the files in folder debian and execute the following command (either in-source or out-of-source in the build folder):
make deb
Find the resulting files in the folder debian
(the text _V_A
get replaced by the project version and the system architecture):
Build-Depends
checking. Therefor configure the package by cmakefbc .. -DDEBUILD_FLAGS=-d
. Once you created and installed the package, you don't need to set the DEBUILD_FLAGS
variable any more.In order to uninstall the package, remove the files listed in the file install_manifest.txt
. Ie. on Debian LINUX (or Ubuntu) execute
sudo xargs rm < install_manifest.txt
Manual builds are laborious. They're necessary when the recommended tools aren't installed.
The source code is located in folder src/bas
. Beside the module files this folder also contains a file named fbdoc.bas
, which collects all modules files in to a single source tree, in order to compile all-in-one by executing
cd src/bas fbc -w all fbdoc.bas -x fbdoc
This creates an executable binary named
fbdoc
(on UNIX-like systems) orfbdoc.exe
(on other systems).That's all you need to get started. Now you can use fbdoc and check its features, see chapter Examples for examples.
To install the program just copy the executable in to a directory of your system PATH
. Ie. on Debian LINUX execute
cp src/bas/fbdoc /usr/local/bin
In order to build the documentation, all recommended packages listed in section Tools have to get installed, exept CMake and cmakefbc. This also means that the fbdoc executable has to get compiled and installed first.
The following command quadruple will build the documentation in form of an HTML file tree and in form of a PDF file (either in-source or out-of-source). Privious to the Doxygen run the list of function names get updated and after the run the syntax highlighting of the source code listings gets fixed.
cd doxy fbdoc -l doxygen fbdoc -s
doxy/html/index.html
. This does not create a PDF file by default. In order to get this format, you've to adapt the output settings in configuration file Doxyfile.In order to uninstall just remove the executable. Ie. on Debian LINUX execute
sudo rm /usr/local/bin/fbdoc
fbdoc can be used as a filter (= custom command) for Geany IDE. Using this feature, the current selection (a text fragment) can get sent to the fbdoc filter and Geany replaces the former selection by the received filter output. From the user point of view it looks like paste a new text block in to a previously selected section.
To get this working, Geany has to get started and the menu item Edit -> Format -> Send Selection to -> Set Custom Commands
needs to get selected. In the newly opened dialog a click on Add
creates a new item with an entry box, which get filled by
fbdoc --geany-mode "DoxygenTemplates"
to use the emitter for Doxygen templates. In order to use the default emitter for gtk-doc templates just omit the quoted emitter name
fbdoc --geany-mode
PATH
. Otherwise the complete path to the executable has to get prepended to the command.To test the installation
Format -> Send Selection to -> YOUR_NEW_COMMAND_ITEM
.The following text should appear (assuming you're using the DoxygenTemplates setting)
If you don't get this text nor any other message in the editor window, then check the status
message tab (in the notebook window at the bottom) to get a hint for solving the problem.
<Crtl>-[1|2|3]
is default. Find further details in Geany documentation.