Skip to content

Commit

Permalink
Merge pull request #54179 from aaronfranke/make-rst
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored Oct 26, 2021
2 parents ba23ef9 + 8f05e26 commit 2ecab04
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/static_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ jobs:
- name: Documentation checks
run: |
doc/tools/makerst.py --dry-run doc/classes modules
doc/tools/make_rst.py --dry-run doc/classes modules
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ doxygen:
rst:
rm -rf $(OUTPUTDIR)/rst
mkdir -p $(OUTPUTDIR)/rst
python3 $(TOOLSDIR)/makerst.py -o $(OUTPUTDIR)/rst $(CLASSES)
python3 $(TOOLSDIR)/make_rst.py -o $(OUTPUTDIR)/rst $(CLASSES)

rstjs:
rm -rf $(OUTPUTDIR)/rstjs
Expand Down
4 changes: 3 additions & 1 deletion doc/tools/makerst.py → doc/tools/make_rst.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env python3

# This script makes RST files from the XML class reference for use with the online docs.

import argparse
import os
import re
Expand Down Expand Up @@ -399,7 +401,7 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S

# Warn contributors not to edit this file directly
f.write(":github_url: hide\n\n")
f.write(".. Generated automatically by doc/tools/makerst.py in Godot's source tree.\n")
f.write(".. Generated automatically by doc/tools/make_rst.py in Godot's source tree.\n")
f.write(".. DO NOT EDIT THIS FILE, but the " + class_name + ".xml source instead.\n")
f.write(".. The source is found in doc/classes or modules/<name>/doc_classes.\n\n")

Expand Down
4 changes: 2 additions & 2 deletions misc/hooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ contributors to make sure they comply with our requirements.
`PATH`, or if you want to enable colored output with `pygmentize`.
- Pre-commit hook for `black`: Applies `black` to the staged Python files
before accepting a commit.
- Pre-commit hook for `makerst`: Checks the class reference syntax using
`makerst.py`.
- Pre-commit hook for `make_rst`: Checks the class reference syntax using
`make_rst.py`.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion misc/hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# as this script. Hooks should return 0 if successful and nonzero to cancel the
# commit. They are executed in the order in which they are listed.
#HOOKS="pre-commit-compile pre-commit-uncrustify"
HOOKS="pre-commit-clang-format pre-commit-black pre-commit-makerst"
HOOKS="pre-commit-clang-format pre-commit-black pre-commit-make-rst"
###########################################################
# There should be no need to change anything below this line.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Git pre-commit hook that checks the class reference syntax using makerst.py.
# Git pre-commit hook that checks the class reference syntax using make_rst.py.

# Workaround because we can't execute the .py file directly on windows
PYTHON=python
Expand All @@ -9,4 +9,4 @@ if [[ "$py_ver" != "3" ]]; then
PYTHON+=3
fi

$PYTHON doc/tools/makerst.py doc/classes modules --dry-run
$PYTHON doc/tools/make_rst.py doc/classes modules --dry-run

0 comments on commit 2ecab04

Please sign in to comment.