Commit graph

128 commits

Author SHA1 Message Date
Hugo Locurcio
f0b860fbad
makerst: Improve error reporting
- List file names before error descriptions, as is common in linters.
- Print the number of errors reported at the end of the list.
- Use double quotes instead of single quotes in messages.
2022-04-11 02:34:37 +02:00
Rémi Verschelde
1bdb82c64e
Fix typos with codespell
Using codespell 2.2-dev from current git.

Added `misc/scripts/codespell.sh` to make it easier to run it once in a
while and update the skip and ignore lists.
2022-02-10 12:30:19 +01:00
Max Hilbrunner
26da72eb4b Fix make_rst.py on Windows 2022-01-24 10:30:07 +01:00
Hugo Locurcio
1b01cef301
Update doc_status script to support constructors and operators docs
- Reorder columns from highest number of items contained within
  to lowest number.
- Remove some obsolete code and fix a typo.
2022-01-07 23:50:10 +01:00
Rémi Verschelde
0905f81c0a
Merge pull request #56162 from akien-mga/i18n-make_rst-more-translatable
i18n: Make more `make_rst.py` strings translatable
2022-01-07 09:23:57 +01:00
Rémi Verschelde
fd1d0c28c2
i18n: Make more make_rst.py strings translatable
For now we leave out the strings which could break rst table formatting.
2022-01-06 21:13:38 +01:00
Haoyu Qiu
a07e2b71fc Fix make_rst.py missing escape in front of some links 2021-12-23 00:50:40 +08:00
Rémi Verschelde
b98785309f
i18n: Add --lang option to make_rst.py to write translated headings
Add a few missing headings to the translation templates.
2021-12-21 13:47:11 +01:00
Haoyu Qiu
9844e36354 Update make_rst.py for non-latin texts 2021-12-21 16:35:47 +08:00
Yuri Sizov
b3992f7e6e Make overridden properties link to parent definition
Co-authored-by: Josh DeGraw <joshmdegraw@gmail.com>
2021-12-03 17:47:22 +03:00
Rémi Verschelde
1a9e3d581b
doc: Fix make_rst.py hyperlinks for theme items
Fixup to #55092.
2021-11-19 10:41:17 +01:00
kobewi
6f929395d9 Add [theme_item] tag to editor help 2021-11-18 15:32:23 +01:00
Rémi Verschelde
5341e6010e
Allow dehardcoding documentation branch and URL in docs links
This makes it possible to change the branch of the documentation that
URLs are pointing to without having to modify all class reference
files.

In the XML class reference, the `$DOCS_URL` placeholder should be used,
and will be replaced automatically in the editor and when generating
the RST class reference.

The documentation branch string is set in `version.py`.

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-11-15 13:02:21 +01:00
Yuri Sizov
51b251e889 Restore constructor/operator information in online docs 2021-11-02 22:33:55 +03:00
Aaron Franke
8f05e26198
Rename "makerst.py" to "make_rst.py" 2021-10-24 01:58:59 -05:00
Rémi Verschelde
20b56f557c
makerst: Disable making refs for operator methods
As this requires more work to ensure that the refs are valid and unique.
2021-10-05 19:13:24 +02:00
Rémi Verschelde
1e36f5f524
makerst: Make external links anonymous
Otherwise we get errors if we use the same title for different links in a given class.
2021-10-05 19:13:24 +02:00
Rémi Verschelde
e87f3dd4d0
makerst: Add substitution for static qualifier 2021-10-05 19:13:24 +02:00
reduz
44d62a9f4b Implement NativeExtension pointer arguments
* Allows calling into native extensions directly with a pointer
* Makes it easier to implement some APIs more efficiently
* Appears with a "*" in the documentation for the argument.
* Implementing the pointer handling is entirely up to the implementation, although the extension API provides some hint.
* AudioStream has been implemented as an example, allowing to create NativeExtension based AudioStreams.
2021-08-23 19:58:40 -03:00
Max Hilbrunner
5161c97c9c Remove underscore hacks
Way less cruft. :)

Co-authored-by: Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com>
2021-08-17 16:10:28 +02:00
Yuri Sizov
1352a087b3 Fix minor code style issues in the RST generator 2021-08-06 18:18:22 +03:00
Yuri Sizov
bf2839ea3e Add theme item descriptions to the online documentation 2021-08-04 22:27:10 +03:00
merumelu
b8752d91dc makerst: use link titles for external tutorials 2021-07-29 21:55:39 +02:00
Johannes Witt
fa573efa1c
Makerst: Remove redundant GDScript from code blocks 2021-07-12 12:57:31 +02:00
Hugo Locurcio
f05aa9cc01
Make makerst.py create folders automatically, print a message when done 2021-07-09 00:55:45 +02:00
Andrii Doroshenko (Xrayez)
679d038043 makerst: Fix generation of overridden properties in child classes
This only affects `Object` classes, not `Variant`.
2021-04-06 17:26:18 +03:00
Andrii Doroshenko (Xrayez)
7fcdd15f0c makerst: Add an option to filter which XML classes to output
Usage:
```
# Output `VisualScript` classes only (found in `modules/visual_script`)
python doc/tools/makerst.py "doc/classes" "modules" --filter "visual_script"

# Output CSG classes only (found in `modules/csg`)
python doc/tools/makerst.py "doc/classes" "modules" --filter "csg"
```
2021-02-15 14:28:11 +02:00
Rémi Verschelde
34cad0d020
doc: Fixups to #43419 which added operators in the docs
- Escape the method names as e.g. `operator <` is invalid XML.
- Add a hack to merge all String % operator definitions for each Variant type
  as a single one with `Variant` argument type.
- Add support for the new qualifiers in makerst.py.
- Drop unused `doc_merge.py`, seems to date back to when we had all the
  documentation in a single `classes.xml`.
2020-11-10 15:00:07 +01:00
Rémi Verschelde
d435537f7e
makerst: Add missing newline at EOF 2020-09-15 10:47:35 +02:00
Rémi Verschelde
5d880bf7db
Merge pull request #40613 from HaSa1002/multi-lang-docs
Add multiple programming language support to class reference
2020-07-31 14:51:33 +02:00
Hugo Locurcio
c162a39c7b
makerst: Add descriptions to method qualifiers
This closes https://github.com/godotengine/godot-docs/issues/1753.
2020-07-30 22:11:02 +02:00
HaSa1002
5b51ae1c5d Add multiple programming language support to class reference 2020-07-23 15:19:09 +02:00
Hugo Locurcio
9065b7ed4e
makerst: Print status messages to make the CI output clearer
This also removes an unused method.
2020-05-27 22:24:33 +02:00
Rémi Verschelde
41af228b76
Merge pull request #36960 from pycbouh/docs-improve-shortcuts
Improve shortcut formatting in docs
2020-04-29 09:40:52 +02:00
Rémi Verschelde
d567c15aed doc: Fix parsing typed arrays in makerst.py
`Type[]` typed arrays will link to `Type`, as it's likely the most
interesting information for the user.

And sync classref with current source.
2020-04-24 17:50:20 +02:00
Yuri Sizov
1ea7295bd2 Improve shortcut formatting in docs 2020-04-10 18:42:11 +03:00
Rémi Verschelde
f33bba15b1
Merge pull request #37426 from pycbouh/docs-override-properties
Add more verbosity for property overrides in RST documentation
2020-04-10 12:25:47 +02:00
PouleyKetchoupp
619354fb2c Fixed errors in makerst pre-commit hook 2020-03-31 00:02:11 +02:00
Yuri Sizov
38821dc6d7 Add more verbosity for property overrides in RST documentation 2020-03-30 14:18:43 +03:00
Rémi Verschelde
cd4e46ee65 SCons: Format buildsystem files with psf/black
Configured for a max line length of 120 characters.

psf/black is very opinionated and purposely doesn't leave much room for
configuration. The output is mostly OK so that should be fine for us,
but some things worth noting:

- Manually wrapped strings will be reflowed, so by using a line length
  of 120 for the sake of preserving readability for our long command
  calls, it also means that some manually wrapped strings are back on
  the same line and should be manually merged again.

- Code generators using string concatenation extensively look awful,
  since black puts each operand on a single line. We need to refactor
  these generators to use more pythonic string formatting, for which
  many options are available (`%`, `format` or f-strings).

- CI checks and a pre-commit hook will be added to ensure that future
  buildsystem changes are well-formatted.
2020-03-30 09:05:53 +02:00
Hugo Locurcio
7c3f6b2870
Improve the doc_status.py console output
- Duplicate the header when the `-a` flag is enabled. Since lots of
  items are displayed in this case, this helps the user remember
  which column is which without having to scroll back to the top.
- Bolden the overall percentages for easier visual grepping.
2020-02-01 00:24:39 +01:00
Rémi Verschelde
2d20fc39aa doc: Drop unused 'category' property from header
We already removed it from the online docs with #35132.

Currently it can only be "Built-In Types" (Variant types) or "Core"
(everything else), which is of limited use.

We might also want to consider dropping it from `ClassDB` altogether
in Godot 4.0.
2020-01-26 16:02:39 +01:00
Tomasz Chabora
25ea912d96 Count theme items in doc_status.py 2020-01-24 14:23:58 +01:00
Rémi Verschelde
97cc2e53f6 makerst: Escape reST markup after enums
Fixes #35501.
2020-01-24 13:08:36 +01:00
Rémi Verschelde
c0595206dd makerst: Use code markup for default values/overrides
Fixes godotengine/godot-docs#3071.
2020-01-20 12:38:08 +01:00
Hugo Locurcio
3c8abbc4bf
doc: Move the class description to be just below the brief description
- Drop the "Brief description" header as it became redundant
  with this change.
- Fix a bug in the editor help where an extraneous newline was added
  after the header if the class isn't inherited by any others.
- Remove the Category line in the rST markup as it's not useful
  for API users.
2020-01-15 00:05:34 +01:00
Hugo Locurcio
17add2dc86
Add a pre-commit hook to check the class reference syntax
This also makes documentation helper scripts executable.
2019-12-06 23:40:19 +01:00
Hugo Locurcio
bc4dbcf793
Travis CI: Run makerst.py to check for documentation errors 2019-12-04 08:51:32 +01:00
Rémi Verschelde
55676b16da makerst: Escape default values using reST markup
Otherwise the docs would complain about values like "godot_"
which reST tries to interpret as an identifier.
2019-11-29 14:25:37 +01:00
Hugo Locurcio
c2e5ef4cec
makerst: Separate signals/enums/properties/methods with a line 2019-10-24 19:06:09 +02:00