Jacob
14cd8c4122
that you must not use ALL_CAPS for enum members. enum class is now used as well, to further reinforce the idea that this is a C++ library. While neither of these changes are necessary, it leads to a better and more intuitive API design. More operator overloading has also been added for many of the classes, particularly the [] index operator, which can now be used in place of the at() method. More methods have also been added, particularly for Section and Document. Some methods have also been fixed, or have had their behavior altered slightly, but this should now be covered under the new tests, which have also been (for the most part) rewritten, both because they were previously both primitive and rather ugly and because new functionality was added. Examples have also been updated to reflect the changes made in this commit, so that they build successfully. Of course, these changes mean that the new API is incompatible with any applications written with the 0.0.1 version. Hopefully most of these changes are dealt with before the 1.0 release, because I would prefer not making API-breaking changes by that point. |
||
---|---|---|
.github/workflows | ||
cmake | ||
docs | ||
examples | ||
include | ||
scripts | ||
src | ||
tests | ||
.gitignore | ||
CMakeLists.txt | ||
LICENSE | ||
README.md |
docpp
C++11 library for generating HTML, CSS and SGML-like documents.
Features
- HTML and CSS document generation and deserialization
- Sensible indentation for pretty-formatting.
- Modern C++ API
- No dependencies, other than the standard library
- Windows, macOS, Linux and *BSD support
- LGPL license
Not yet implemented
- HTML/CSS serialization (parsing from e.g. file)
Installation
To install the library, you can utilize the provided CMakeLists.txt file:
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
cmake --build .
cmake --install . --prefix /usr
This will install the library to /usr/lib and the headers to /usr/include/docpp. If you use Arch Linux, you can specify -DGENERATE_PKGBUILD=ON to generate a PKGBUILD file in the build directory. You can then use makepkg to build a package.
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DGENERATE_PKGBUILD=ON
cmake --build .
makepkg -si
If you use Gentoo Linux, you can specify -DGENERATE_EBUILD=ON to generate an ebuild file in the build directory, along with the manifest.
Usage
Just include docpp.hpp in your project and link against the library. Examples can be found in the examples directory.
License
This project is licensed under the GNU Lesser General Public License v3.0 - see the LICENSE file for details.
Code of Conduct
None. Just don't blow up my house. And, don't ask me to rewrite it in Rust.