Skip to content

Repository files navigation

SP DocGen

A documentation generator for SourcePawn includes

Overview

  • chumbucket - Chums through manifest and include files
  • edge_worker - CloudFlare edge server worker for modifying content title and description
  • libalternator - SourcePawn include parser built on tree-sitter-sourcepawn
  • libschema Shared types between documentation components
  • libwalker Git history traversal/walker for sources
  • schema - Typescript library of mostly symbol classes/interfaces for UI

Download

You could download the latest Linux & Windows chumbucket from the artifacts of each commit. Mac builds are currently not being automatically built.

Parser

libalternator parses one include (or plugin) file at a time into a strand of documented symbols. It runs a small preprocessor (conditional compilation, #defines, #endinput) and then walks the tree-sitter syntax tree. Doc comments are attached to declarations the same way the old SourcePawn docparse tool did, and parsed with spdcp.

Dump the strand of a file:

cargo run -p alternator --example dump -- path/to/file.inc

Tests

cargo test -p alternator -p schema

libalternator/tests/corpus holds upstream SourceMod and third-party sources (see its SOURCES.md), and libalternator/tests/expected their expected output. After an intended output change, update the snapshots with ALTERNATOR_BLESS=1 cargo test -p alternator --test corpus and review the diff. To pull newer upstream sources, bump the commits in libalternator/tests/update-corpus.sh and re-run it.

About

SP Documentation Generator

Topics

Resources

Stars

8 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages