Commit graph

62 commits

Author SHA1 Message Date
Hugo Locurcio
78a6a57884 makerst: Add descriptions to method qualifiers
This closes https://github.com/godotengine/godot-docs/issues/1753.

(cherry picked from commit c162a39c7b)
2020-07-30 22:46:16 +02:00
Rémi Verschelde
7bf9787921 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.

(cherry picked from commit cd4e46ee65)
2020-06-10 15:30:52 +02:00
Hugo Locurcio
a3bd201cc7 makerst: Print status messages to make the CI output clearer
This also removes an unused method.

(cherry picked from commit 9065b7ed4e)
2020-06-04 12:09:39 +02:00
Yuri Sizov
22ebdd72d9 Add more verbosity for property overrides in RST documentation
(cherry picked from commit 38821dc6d7)
2020-04-16 11:57:50 +02:00
PouleyKetchoupp
d4c77e60c0 Fixed errors in makerst pre-commit hook
(cherry picked from commit 619354fb2c)
2020-04-06 18:16:11 +02: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
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
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
Yeongho Kim
d4a55fb639 Print errors when tab indent found in [codeblock] 2019-10-01 23:39:45 +09:00
Bojidar Marinov
6c4407bae4
Add overriden properties to the documentation
Fixes #31855
2019-09-04 15:21:40 +03:00
StraToN
d83b8881ae Adds a meta on top of every generated class to hide 'Edit on Github' link
Linked docs issue https://github.com/godotengine/godot-docs/pull/2656
2019-07-25 15:57:43 +02:00
Bojidar Marinov
0c4c36d823
Add default values to the editor help, docs, and generated RST
Also, make spacing of "=" in the editor help a bit more consistent.
Closes #16086
2019-06-27 18:29:35 +03:00
Rémi Verschelde
c7246d8e1e makerst: Fix format of [url] links in reST
Moved some logic to make_url in an attempt to reuse it in the parser,
but it proved too complex so I ended up not using it. I kept it as a
separate method nevertheless.
2019-06-11 10:51:10 +02:00
Stanislav
102f73b88a Add support for [url=] tag to makerst.py
Fixes #28904
2019-05-16 16:13:42 +03:00
Hendrikto
49a81308c0 Remove unused imports 2019-04-06 18:05:05 +02:00
Ignacio Etcheverry
d80bc5cbba ClassRef: Replace [code]CurrentClass[/code] with [CurrentClass]
Modified makerst to generate code tags for these to avoid hyperlinks to the same class.
2019-03-29 23:47:35 +01:00
Ignacio Etcheverry
c8aa85189a EditorHelp, makerst: Improve enum ref resolving and constant ref support
Enum reference resolving will now search in the @GlobalScope if no class is specified and the enum cannot be resolved in the current class.
Added support for constant references in EditorHelp, e.g.: [constant KEY_ENTER] or [constant Control.FOCUS_CLICK]. It supports enum constants (the enum name must not be included).
2019-03-29 23:40:31 +01:00
Rémi Verschelde
61771ad39b doc: Fix style for vararg in makerst 2019-03-10 11:31:27 +01:00
merumelu
4d9b7b9803 makerst: make vararg methods look the same as in editor help 2019-03-05 20:42:09 +01:00
Pieter-Jan Briers
685dffb1d5 makerst.py refactor.
It's now smart and keeps track of every entity in the doc files. Now it can pick up on broken references and such inside the doc files.
Eventually we'll be able to run it on Travis and check for errors automatically.

General file cleanup.

References to elements of classes now have a prefix for their type. class_Control_minimum_size_changed becomes class_Control_method_minimum_size_changed, or signal_, because the reason I did this was to fix reference conflicts.

You can also reference constants now with BBCode.

Also made it use argparse, adding an --output and a --dry-run argument.

I did not fix all the errors it's reporting in the documentation files, there's about 150+ of them but that's outside of the scope of this commit.
2018-12-28 16:55:51 +01:00
Pieter-Jan Briers
15a3d16d08 Clean up & improve makerst.py
Man this file even had some semicolons in it.

I cleaned up the entire file, while it's still pretty ugly it's much better now.
I also added type checks so it passes mypy --strict.
make_type now throws a warning on unresolved type references, which there are a bunch of. I'm not responsible for fixing those though.
Also some more hardening against crashes. For example XML tags without content won't cause crashes now.
Functionality has not been modified as far as I can tell.

Update Makefile for Python 3

Fix ordering issues related to enums & constants
2018-12-27 13:57:08 +01:00
João Álvaro Ferreira
a720993cc8 Enabled rst files to escape for parentheses after brackets 2018-12-11 12:58:57 +00:00
lupoDharkael
edcca5f7ad Dont use equality operators with None singleton in python files 2018-10-27 01:18:15 +02:00
LikeLakers2
0d6546ed44 Add extra newline after enum members and constants, to ensure they'll format properly after a multi-line description 2018-10-02 16:48:40 -04:00
Rémi Verschelde
d26c6b28a6 doc: Fixes to rst converter 2018-09-21 09:50:21 +02:00
LikeLakers2
268ae71fae Fix the weird method linking issue when the previous method's description ends with a code block 2018-09-20 18:14:47 -04:00
Rémi Verschelde
4e0f415c83 doc: Make property sections in rst similar to editor docs
There is now an overview table with hyperlinks, and further down a detailed
list of properties with their setter/getter and description.

Theme items are now also included in the rst output.

Refactored make_method() a bit.
2018-09-13 02:13:19 +02:00
Rémi Verschelde
a923eff9a4 Doc: Use PascalCase names in hyperlinks
We were not consistently applying .lower() every time we construct
an hyperlink, so there would be case mismatch. It works fine to keep
the natural case for those links.
2018-09-13 01:55:56 +02:00
Rémi Verschelde
ba64ea2283 Doc: Use same headers and order in-editor and online 2018-09-12 17:12:23 +02:00
robojumper
98b59cf2a3 Add support for tutorial links to makerst.py
Also change the <tutorials> structure to make use of individual <link> tags
2018-06-12 17:40:24 +02:00
Rémi Verschelde
819911d16e makerst.py: Properly escape \ for rst
Fixes godotengine/godot-docs#1486.
2018-05-31 15:38:33 +02:00
Pieter-Jan Briers
331b0e8526 Makes doc methods display enums. 2018-05-12 20:08:39 +02:00
Viktor Ferenczi
272ecddb28 Properly closing all files in Python code 2018-03-11 14:55:50 +01:00
Anish
84e8c49f5d Documentation tool does not add escapes to code and codeblocks
Instead of adding the escapes to all * and _ the tool now excludes
the characters inside [code] and [codeblock].

Resolves: #15156
2018-02-16 02:24:05 +05:30
Joachim Meyer
3ca84df551 Enums get listed in the docs and enum members now also link to the
corresponding enum in the webdocs
Fixes #13254
2017-12-22 00:38:03 +01:00
Martin Capitanio
7c3ba6f72b Fix the class docs for the rst-syntax errors.
- Generate a correkt rst-syntax for the [/code] inline markup.
  (http://www.sphinx-doc.org/en/1.6.5/rest.html#inline-markup)
- Fix xml souce bugs

for the sphinx's rst syntax werrors:

class_area.rst:319: WARNING: Inline literal start-string without end-string.
class_area2d.rst:287: WARNING: Inline literal start-string without end-string.
class_audioserver.rst:287: WARNING: Inline literal start-string without end-string.
class_control.rst:509: WARNING: Inline literal start-string without end-string.
class_image.rst:422: WARNING: Inline literal start-string without end-string.
class_image.rst:434: WARNING: Inline literal start-string without end-string.
class_inputevent.rst:74: WARNING: Inline literal start-string without end-string.
class_inputeventaction.rst:45: WARNING: Inline literal start-string without end-string.
class_inputmap.rst:47: WARNING: Inline literal start-string without end-string.
class_kinematicbody.rst:80: WARNING: Inline interpreted text or phrase reference start-string without end-string.
class_kinematicbody2d.rst:80: WARNING: Inline interpreted text or phrase reference start-string without end-string.
class_line2d.rst:182: WARNING: Inline literal start-string without end-string.
class_thread.rst:51: WARNING: Inline literal start-string without end-string.
class_treeitem.rst:160: WARNING: Inline literal start-string without end-string.
2017-11-19 20:47:36 +01:00
Martin Capitanio
ade4f3084c Fix class docs, improve error handling of the rst generator.
The rst-generator gives you now a hint what's going on:
Bad reference: 'method.RegEx.search_all' in file: ../modules/regex/doc_classes/RegExMatch.xml

grep 'method.RegEx.search_all' ../modules/regex/doc_classes/RegExMatch.xml
	Contains the results of a single regex match returned by [method RegEx.search]
	and [method.RegEx.search_all]. It can be used to find the position and range of the match
	and its capturing groups, and it can extract its sub-string for you.
2017-11-18 01:41:32 +01:00
Rémi Verschelde
2e212a2cfd makerst: Remove stray spaces in method signatures 2017-10-21 14:01:05 +02:00
Rémi Verschelde
2cd044e89b makerst: Add support for [member] and [signal]
Part of #11137. [enum] is still missing, and none are implemented in the engine itself yet.
2017-10-21 13:53:59 +02:00
Rémi Verschelde
b302084395 makerst: Fix rst-ization of members and escaping of [Class]s
Fixes #11517.
2017-10-21 12:33:52 +02:00
Rémi Verschelde
deefc2a63d makerst: Fix support for module classes
Previous code expected only one XML per module, which is not the case for
e.g. mono or gdnative.
Also add newline after signal description to fix rst warning, and make the
script Python 3-compatible.

[ci skip]
2017-10-14 15:22:06 +02:00
Alexander Meerhoff
a11a9ddffc makerst.py: Support split classes XML and use folders and/or single files as input
The new syntax is (from `doc/`): `tools/makerst.py classes/ ../modules/`.
Also adapted `make rst` target accordingly.

[ci skip]
2017-09-23 10:34:35 +02:00
Poommetee Ketson
5bbbecc315 Docs: ignore tags inside code,codeblock tag 2017-07-22 21:22:38 +07:00
Julian Murgia
9c7b4c82a7 Add Signals descriptions when they exist. 2017-06-14 15:48:50 +02:00
Rémi Verschelde
817dd7ccbb style: Fix PEP8 blank lines issues in Python files
Done with `autopep8 --select=E3,W3`, fixes:

- E301 - Add missing blank line.
- E302 - Add missing 2 blank lines.
- E303 - Remove extra blank lines.
- E304 - Remove blank line following function decorator.
- E309 - Add missing blank line.
- W391 - Remove trailing blank lines.
2016-11-01 00:35:16 +01:00
Rémi Verschelde
d4c17700aa style: Fix PEP8 whitespace issues in Python files
Done with `autopep8 --select=E2,W2`, fixes:

- E201 - Remove extraneous whitespace.
- E202 - Remove extraneous whitespace.
- E203 - Remove extraneous whitespace.
- E211 - Remove extraneous whitespace.
- E221 - Fix extraneous whitespace around keywords.
- E222 - Fix extraneous whitespace around keywords.
- E223 - Fix extraneous whitespace around keywords.
- E224 - Remove extraneous whitespace around operator.
- E225 - Fix missing whitespace around operator.
- E226 - Fix missing whitespace around operator.
- E227 - Fix missing whitespace around operator.
- E228 - Fix missing whitespace around operator.
- E231 - Add missing whitespace.
- E231 - Fix various deprecated code (via lib2to3).
- E241 - Fix extraneous whitespace around keywords.
- E242 - Remove extraneous whitespace around operator.
- E251 - Remove whitespace around parameter '=' sign.
- E261 - Fix spacing after comment hash.
- E262 - Fix spacing after comment hash.
- E265 - Format block comments.
- E271 - Fix extraneous whitespace around keywords.
- E272 - Fix extraneous whitespace around keywords.
- E273 - Fix extraneous whitespace around keywords.
- E274 - Fix extraneous whitespace around keywords.
- W291 - Remove trailing whitespace.
- W293 - Remove trailing whitespace.
2016-11-01 00:35:16 +01:00