1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00
Files
mariadb/include/mysql/generate_plugin_api_docs.sh
Georgi (Joro) Kodinov 56ca68d7f6 MDBF-1243: Make moxygen doc be a good GitBook citizen.
Removed --anchors from the moxygen command line since this is not
useful to GitBook and renders as garbage in it.
2026-09-16 10:49:10 +03:00

44 lines
1.5 KiB
Bash

#!/bin/bash
# This script generates the plugin API documentation in markdown format.
# Usage: generate_plugin_api_docs.sh [target_dir]
# Creates the following directories in the target_dir:
# md/ - The markdown files generated by moxygen
# xml/ - The XML generated by doxygen
# Creates the following files in the target_dir:
# md/api.md - the main plugin API documentation file
# md/<group>.md - documentation for group <group>
# md/<page>.md - documentation for each <page>
# Note: target_dir is created if not present.
# Note: requires at least moxygen 2.1.11
set -euo pipefail
# If no target_dir is specified, the current directory is used.
if [ -n "$1" ]; then
TARGET_DIR="$1"
else
TARGET_DIR="."
fi
# Exit on error, undefined variable, or pipe failure
set -euo pipefail
# Clean up the output directory, if it exists
rm -rf "$TARGET_DIR/md"
rm -rf "$TARGET_DIR/xml"
# Create the markdown output directory
mkdir -p "$TARGET_DIR/md"
echo "Doxygen version"
doxygen --version
echo "Moxygen version"
moxygen --version
# run doxygen to generate the plugin API documentation XML
# Need to pass output directory so that XML docs get generated in it.
# Need to EXCLUDE the output directory so that doxygen does not try to parse the generated XML and markdown files
(cat Doxyfile.generated_docs_plugin_api ; echo "OUTPUT_DIRECTORY=$TARGET_DIR"; echo "EXCLUDE=$TARGET_DIR/xml $TARGET_DIR/md" ) | doxygen -
# run moxygen to generate the plugin API general doc api.md
moxygen --quiet --pages --groups --output "$TARGET_DIR/md/%s.md" "$TARGET_DIR/xml"