From 402f7fc83315cbe73f2d6a15585027f81f53a7b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20=22sp1rit=22=E2=80=8B?= Date: Wed, 24 Aug 2022 13:16:52 +0200 Subject: [PATCH 1/6] Initial work on documentation generated by doxygen --- .github/workflows/ubuntu.yml | 14 +- doc/cairodoc.h | 46 + doc/mainpage.h | 228 +++ doc/meson.build | 29 +- doc/microtex.docmacros.tex | 1 + doc/microtex.doxy.in | 2664 ++++++++++++++++++++++++++++++++++ doc/theme/header.html | 65 + doc/theme/style.css | 2026 ++++++++++++++++++++++++++ 8 files changed, 5068 insertions(+), 5 deletions(-) create mode 100644 doc/cairodoc.h create mode 100644 doc/mainpage.h create mode 100644 doc/microtex.docmacros.tex create mode 100644 doc/microtex.doxy.in create mode 100644 doc/theme/header.html create mode 100644 doc/theme/style.css diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 64f02e9a..584b67d3 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v2 - name: Downloading dependencies 📥 run: | - sudo apt-get install build-essential meson libgtksourceviewmm-3.0-dev libgtkmm-3.0-dev libgtk-4-dev libgtksourceview-5-dev gi-docgen + sudo apt-get install build-essential meson libgtksourceviewmm-3.0-dev libgtkmm-3.0-dev libgtk-4-dev libgtksourceview-5-dev gi-docgen doxygen sudo apt-get install qtbase5-dev qttools5-dev-tools - name: Configure 🔧 run: meson _build -DTARGET_DOCUMENTATION=true @@ -25,11 +25,23 @@ jobs: pushd _build tar -c * | zstd -o $GITHUB_WORKSPACE/artifacts.tar.zst popd + - name: Package documentation 📜 + run: | + mkdir -p pfx + DESTDIR=$PWD/pfx ninja -C _build install + pushd pfx/usr/local/share/doc/microtex/ + tar -c * | zstd -o $GITHUB_WORKSPACE/documentation.tar.zst + popd - name: Upload build artifacts 📤 uses: actions/upload-artifact@v1 with: name: Build artifacts path: artifacts.tar.zst + - name: Upload documentation 📤 + uses: actions/upload-artifact@v1 + with: + name: Documentation + path: documentation.tar.zst build_by_cmake: runs-on: ${{ matrix.os }} diff --git a/doc/cairodoc.h b/doc/cairodoc.h new file mode 100644 index 00000000..3ffc2295 --- /dev/null +++ b/doc/cairodoc.h @@ -0,0 +1,46 @@ +/** \page cairo_doc Cairo Documentation + * + * \section cairo_opts Build options + * + * \subsection Meson + * to build support for the Cairo platform using meson, you need to + * invoke meson using -DCAIRO=true as parameter. + * + * If you want to build the GTK3MM demo too, you need to add the + * -DEXAMPLE_GTKMM=true to the params too. + * + * \subsection CMake + * + * for cmake, you need to configure it, with -DCAIRO=ON + * and optionally with -DBUILD_EXAMPLE_GTKMM=ON. + * + * \section cairo_usage Usage + * + * \subsection cairo_init Initialization and PlatformFactory setup + * Refer to \ref index "the main page" for info about information about automatic + * font detection. The PlatformFactory setup is cairo specific. + * @code + * microtex::InitFontSenseAuto autoinit; + * microtex::MicroTeX::init(autoinit); + * microtex::PlatformFactory::registerFactory("gtk", std::make_unique()); + * microtex::PlatformFactory::activate("gtk"); + * @endcode + * + * \subsection cairo_render Rendering + * You need to make use of microtex::Graphics2D_cairo to render + * equations onto a cairo surface. The graphics context takes a pointer + * to a cairo context (cairo_t). Please note that the caller + * keeps the ownership of the cairo context. + * + * To receive a microtex::Render, you can either use the convinience + * method microtex::MicroTeX::parse(), or construct it yourself using + * microtex::RenderBuilder if you need more customization. + * + * @code + * void render_to_cairo(cairo_t* ctx, microtex::Render* tex) { + * microtex::Graphics2D_cairo g2(ctx); + * tex->draw(g2, 0, 0); + * } + * @endcode + * + */ diff --git a/doc/mainpage.h b/doc/mainpage.h new file mode 100644 index 00000000..d131b06b --- /dev/null +++ b/doc/mainpage.h @@ -0,0 +1,228 @@ +/** \mainpage µTeX + * + * A dynamic, cross-platform, and embeddable LaTeX rendering library + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Version1.0.0
LicenseMIT
AuthorsNanoMichael <artiano@hotmail.com>
Forgehttps://github.com/NanoMichael/MicroTeX
+ * + * \section introduction Introduction + * + * \f$\MicroTeX\f$ is a versitile library, capable of very efficiently + * rendering most \f$\LaTeX\f$ equations on any surface that provides + * postscript-esque vector draw instructions. If you are interested in + * implementing \f$\MicroTeX\f$ for such a surface, that doesn't have + * support yet, read this document. + * + * Currently, \f$\MicroTeX\f$ supports the following libraries and + * frameworks: + * + * + * \section install_sec Installation + * + * \subsection prebuilt Install µTeX using precompiled packages + * + * \subsection compile Compile µTeX from source + * + * To build \f$\MicroTeX\f$ yourself, please ensure that all of the + * following dependencies are installed on your operating system and + * accesible by pkg-config. + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Librarypkg-configWebsite
For the Cairo platform:
libfontconfigfontconfigfreedesktop.org/wiki/Software/fontconfig/
Cairocairocairographics.org
Cairo FreeTypecairo-ftcairographics.org
Pangopangopango.gnome.org
Pango Cairopangocairopango.gnome.org
For the QT platform:
QT5 Guiqt5qt.io
kde.org/community/whatiskde/kdefreeqtfoundation/
For the win32 platform:
GDI+libgdiplusdocs.microsoft.com/en-us/windows/win32/gdiplus/-gdiplus-gdi-start
github.com/mono/libgdiplus
For the WASM platform:
Emscriptenn/aemscripten.org
For the GTK4 widget (also requires the dependencies listed under Cairo):
GLibglib-2.0wiki.gnome.org/Projects/GLib
GTK 4gtk4gtk.org
Cairo SVGcairo-svgcairographics.org
+ * Please note, that the demo applications for a corresponding library might have additional dependencies + * + * \subsubsection meson Build µTeX using Meson + * If you are able to use meson, please look at the meson_options.txt + * in the root directory of \f$\MicroTeX\f$ and figure out what + * platforms you wish to use. Then invoke: + * @code + * meson _build -D