name: Generate and Deploy Doxygen Documentation on: push: branches: - master pull_request: branches: - master jobs: build-and-deploy: runs-on: ubuntu-latest steps: # Checkout the repository - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 # Install dependencies - name: Install dependencies run: | sudo apt-get update sudo apt-get install -y doxygen graphviz python3-pip # Clone m.css and set up Python - name: Set up m.css run: | git clone --depth 1 https://github.com/mosra/m.css.git pip install pillow matplotlib # List contents to debug - name: Debug m.css directory run: | echo "Listing m.css contents:" find mcss -type f | grep -E "\.css$" # Prepare documentation configuration - name: Prepare Doxygen configuration run: | mkdir -p docs # Use Python to generate the CSS python3 mcss/documentation/css.py dark documentation # Generate Doxygen configuration file - name: Generate Doxyfile run: | cat > docs/Doxyfile << EOL # General configuration PROJECT_NAME = fbgl PROJECT_NUMBER = 0.1.0 PROJECT_BRIEF = "Documentation for the fbgl library" OUTPUT_DIRECTORY = docs CREATE_SUBDIRS = YES OPTIMIZE_OUTPUT_FOR_C = YES GENERATE_HTML = YES GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_RTF = NO GENERATE_XML = NO # Input sources INPUT = fbgl.h README.md FILE_PATTERNS = *.h README.md RECURSIVE = NO EXCLUDE_PATTERNS = test/* # Markdown support USE_MDFILE_AS_MAINPAGE = README.md MARKDOWN_SUPPORT = YES # Extract documentation EXTRACT_ALL = YES EXTRACT_PRIVATE = NO EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_METHODS = YES # Source browsing SOURCE_BROWSER = YES INLINE_SOURCES = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES # Documentation styling for m.css HTML_OUTPUT = html HTML_EXTRA_STYLESHEET = "\ m.css/output/m-dark.compiled.css \ m.css/output/m-documentation.compiled.css" HTML_DYNAMIC_SECTIONS = YES GENERATE_TREEVIEW = YES # Search functionality SEARCHENGINE = YES SERVER_BASED_SEARCH = NO EXTERNAL_SEARCH = NO SEARCHDATA_FILE = searchdata.xml # Warnings WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_NO_PARAMDOC = YES WARN_FORMAT = "\$file:\$line: \$text" # Extra configurations ALIASES = "note=\par\textbf{Note:}" ALIASES += "todo=\par\textbf{TODO:}" ALIASES += "bug=\par\textbf{Bug:}" EXCLUDE_SYMBOLS = "*Test*" # Graph and diagram support HAVE_DOT = YES DOT_GRAPH_MAX_NODES = 50 DOT_TRANSPARENT = YES DOT_IMAGE_FORMAT = svg CALL_GRAPH = YES CALLER_GRAPH = YES CLASS_DIAGRAMS = YES DOT_MULTI_TARGETS = YES EOL # Generate Doxygen documentation - name: Generate Doxygen documentation run: | # Ensure output directory exists mkdir -p m.css/output # Generate CSS using m.css Python script python3 mcss/documentation/css.py dark documentation # Run Doxygen doxygen docs/Doxyfile # Deploy to GitHub Pages - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: docs/html force_orphan: true full_commit_message: Update documentation