mirror of
https://github.com/clang-retro/mac-sdk.git
synced 2026-11-28 13:19:22 -08:00
Docs: add an API reference made by Doxygen
The docs workflow installs Doxygen, and the MkDocs hook runs it after the site is built, writing the reference to api/ with the site's colors and logo. The nav links to it. Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRTLG3jxEW8av9GuXpG
This commit is contained in:
8 files changed
+94
No files matched your search
@@ -0,0 +1 @@
|
||||
__pycache__/
|
||||
@@ -0,0 +1,8 @@
|
||||
# The API reference of the documentation site (api/), run by .docs/hooks.py
|
||||
# from the repository's root after `mkdocs build`.
|
||||
@INCLUDE = .docs/Doxyfile.base
|
||||
PROJECT_NAME = "Classic Mac OS SDK"
|
||||
PROJECT_BRIEF = "The Toolbox headers"
|
||||
INPUT = include
|
||||
FILE_PATTERNS = *.h
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
@@ -0,0 +1,55 @@
|
||||
# Doxygen settings shared by the clang-retro sites' API references.
|
||||
# Each repository's .docs/Doxyfile includes this one and sets PROJECT_NAME,
|
||||
# INPUT and the rest; .docs/hooks.py runs it after `mkdocs build` and puts
|
||||
# the HTML in <site>/api/.
|
||||
|
||||
OUTPUT_DIRECTORY = $(RETRO_API_OUT)
|
||||
HTML_OUTPUT = api
|
||||
CREATE_SUBDIRS = NO
|
||||
GENERATE_HTML = YES
|
||||
GENERATE_LATEX = NO
|
||||
GENERATE_TREEVIEW = YES
|
||||
SEARCHENGINE = YES
|
||||
SERVER_BASED_SEARCH = NO
|
||||
QUIET = YES
|
||||
WARNINGS = NO
|
||||
WARN_IF_UNDOCUMENTED = NO
|
||||
WARN_IF_DOC_ERROR = NO
|
||||
WARN_NO_PARAMDOC = NO
|
||||
|
||||
RECURSIVE = YES
|
||||
EXTRACT_ALL = YES
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
SOURCE_BROWSER = YES
|
||||
STRIP_CODE_COMMENTS = NO
|
||||
REFERENCED_BY_RELATION = NO
|
||||
REFERENCES_RELATION = NO
|
||||
VERBATIM_HEADERS = YES
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
QT_AUTOBRIEF = YES
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH = $(RETRO_ROOT)
|
||||
STRIP_FROM_INC_PATH = $(RETRO_ROOT)
|
||||
SORT_MEMBER_DOCS = NO
|
||||
HAVE_DOT = NO
|
||||
EXCLUDE_PATTERNS = */tests/* */test/* */examples/* */demos/* */site/*
|
||||
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = YES
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
# The 16-bit and Toolbox keywords, so declarations parse as plain C.
|
||||
PREDEFINED = __far= __near= __huge= _far= _near= _huge= \
|
||||
__pascal= _pascal= __export= _export= \
|
||||
__loadds= _loadds= __interrupt= _interrupt= \
|
||||
__cdecl= _cdecl= __stdcall= __attribute__(x)= \
|
||||
__declspec(x)= pascal= DOXYGEN
|
||||
|
||||
HTML_COLORSTYLE = TOGGLE
|
||||
HTML_COLORSTYLE_HUE = 135
|
||||
HTML_COLORSTYLE_SAT = 120
|
||||
HTML_COLORSTYLE_GAMMA = 90
|
||||
HTML_DYNAMIC_SECTIONS = YES
|
||||
PROJECT_LOGO = $(RETRO_DOCS)/assets/logo-48.png
|
||||
@@ -68,6 +68,8 @@ markdown_extensions:
|
||||
validation:
|
||||
nav:
|
||||
omitted_files: info
|
||||
# The API reference (api/) is made by doxygen after the site.
|
||||
not_found: info
|
||||
links:
|
||||
not_found: warn
|
||||
anchors: info
|
||||
|
||||
@@ -28,10 +28,16 @@
|
||||
# branch: main
|
||||
# pages: repository files shown as site pages
|
||||
# README.md: index.md
|
||||
# doxygen: .docs/Doxyfile an API reference built into <site>/api/
|
||||
# after the site (from the root; needs
|
||||
# doxygen, else it is left out with a note)
|
||||
|
||||
import logging
|
||||
import os
|
||||
import posixpath
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
from mkdocs.exceptions import PluginError
|
||||
|
||||
@@ -41,6 +47,7 @@ _HEADING = re.compile(r'^(#{1,6})\s+(.*?)\s*#*\s*$')
|
||||
_LINK = re.compile(r'(!?)\[((?:[^\[\]]|\[[^\]]*\])*)\]\(\s*<?([^)\s>]+)>?(\s+"[^"]*")?\s*\)')
|
||||
|
||||
_settings = {}
|
||||
log = logging.getLogger("mkdocs.hooks.retro")
|
||||
|
||||
|
||||
def on_config(config):
|
||||
@@ -177,3 +184,21 @@ def on_page_markdown(markdown, page, config, files):
|
||||
last = m.end()
|
||||
parts.append(_fix_links(markdown[last:], page_path, page_path))
|
||||
return "".join(parts)
|
||||
|
||||
|
||||
def on_post_build(config):
|
||||
doxyfile = _settings.get("doxygen")
|
||||
if not doxyfile:
|
||||
return
|
||||
if shutil.which("doxygen") is None:
|
||||
log.info("doxygen is not installed: the API reference (api/) is left out")
|
||||
return
|
||||
env = dict(os.environ,
|
||||
RETRO_API_OUT=os.path.abspath(config.site_dir),
|
||||
RETRO_ROOT=_settings["root"],
|
||||
RETRO_DOCS=os.path.abspath(config.docs_dir))
|
||||
result = subprocess.run(["doxygen", doxyfile], cwd=_settings["root"], env=env,
|
||||
capture_output=True, text=True)
|
||||
if result.returncode != 0:
|
||||
raise PluginError(f"doxygen {doxyfile} failed:\n{result.stderr}")
|
||||
log.info("API reference written to %s", os.path.join(config.site_dir, "api"))
|
||||
@@ -36,6 +36,7 @@ jobs:
|
||||
python-version: '3.12'
|
||||
cache: pip
|
||||
cache-dependency-path: .docs/requirements.txt
|
||||
- run: sudo apt-get install -y --no-install-recommends doxygen
|
||||
- run: pip install -r .docs/requirements.txt
|
||||
- run: mkdocs build --strict
|
||||
- name: Is GitHub Pages on?
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@@ -12,6 +12,7 @@ hooks:
|
||||
|
||||
extra:
|
||||
retro:
|
||||
doxygen: .docs/Doxyfile
|
||||
github: clang-retro/mac-sdk
|
||||
branch: main
|
||||
pages:
|
||||
@@ -29,4 +30,5 @@ nav:
|
||||
- "Not done yet": status.md
|
||||
- "Contributing": contributing.md
|
||||
- "License": license.md
|
||||
- API reference: api/index.html
|
||||
- "All clang-retro projects": https://clang-retro.github.io/
|
||||
Reference in new issue
Block a user