summaryrefslogtreecommitdiff
path: root/doc/tools/makerst.py
AgeCommit message (Collapse)Author
2019-07-25Adds a meta on top of every generated class to hide 'Edit on Github' linkStraToN
Linked docs issue https://github.com/godotengine/godot-docs/pull/2656
2019-06-27Add default values to the editor help, docs, and generated RSTBojidar Marinov
Also, make spacing of "=" in the editor help a bit more consistent. Closes #16086
2019-06-11makerst: Fix format of [url] links in reSTRémi Verschelde
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-05-16Add support for [url=] tag to makerst.pyStanislav
Fixes #28904
2019-04-06Remove unused importsHendrikto
2019-03-29ClassRef: Replace [code]CurrentClass[/code] with [CurrentClass]Ignacio Etcheverry
Modified makerst to generate code tags for these to avoid hyperlinks to the same class.
2019-03-29EditorHelp, makerst: Improve enum ref resolving and constant ref supportIgnacio Etcheverry
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-10doc: Fix style for vararg in makerstRémi Verschelde
2019-03-05makerst: make vararg methods look the same as in editor helpmerumelu
2018-12-28makerst.py refactor.Pieter-Jan Briers
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-27Clean up & improve makerst.pyPieter-Jan Briers
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-11Enabled rst files to escape for parentheses after bracketsJoão Álvaro Ferreira
2018-10-27Dont use equality operators with None singleton in python fileslupoDharkael
2018-10-02Add extra newline after enum members and constants, to ensure they'll format ↵LikeLakers2
properly after a multi-line description
2018-09-21doc: Fixes to rst converterRémi Verschelde
2018-09-20Fix the weird method linking issue when the previous method's description ↵LikeLakers2
ends with a code block
2018-09-13doc: Make property sections in rst similar to editor docsRémi Verschelde
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-13Doc: Use PascalCase names in hyperlinksRémi Verschelde
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-12Doc: Use same headers and order in-editor and onlineRémi Verschelde
2018-06-12Add support for tutorial links to makerst.pyrobojumper
Also change the <tutorials> structure to make use of individual <link> tags
2018-05-31makerst.py: Properly escape \ for rstRémi Verschelde
Fixes godotengine/godot-docs#1486.
2018-05-12Makes doc methods display enums.Pieter-Jan Briers
2018-03-11Properly closing all files in Python codeViktor Ferenczi
2018-02-16Documentation tool does not add escapes to code and codeblocksAnish
Instead of adding the escapes to all * and _ the tool now excludes the characters inside [code] and [codeblock]. Resolves: #15156
2017-12-22Enums get listed in the docs and enum members now also link to theJoachim Meyer
corresponding enum in the webdocs Fixes #13254
2017-11-19Fix the class docs for the rst-syntax errors.Martin Capitanio
- 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-18Fix class docs, improve error handling of the rst generator.Martin Capitanio
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-10-21makerst: Remove stray spaces in method signaturesRémi Verschelde
2017-10-21makerst: Add support for [member] and [signal]Rémi Verschelde
Part of #11137. [enum] is still missing, and none are implemented in the engine itself yet.
2017-10-21makerst: Fix rst-ization of members and escaping of [Class]sRémi Verschelde
Fixes #11517.
2017-10-14makerst: Fix support for module classesRémi Verschelde
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-09-23makerst.py: Support split classes XML and use folders and/or single files as ↵Alexander Meerhoff
input The new syntax is (from `doc/`): `tools/makerst.py classes/ ../modules/`. Also adapted `make rst` target accordingly. [ci skip]
2017-07-22Docs: ignore tags inside code,codeblock tagPoommetee Ketson
2017-06-14Add Signals descriptions when they exist.Julian Murgia
2016-11-01style: Fix PEP8 blank lines issues in Python filesRémi Verschelde
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-01style: Fix PEP8 whitespace issues in Python filesRémi Verschelde
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-01style: Start applying PEP8 to Python files, indentation issuesRémi Verschelde
Done with `autopep8 --select=E1`, fixes: - E101 - Reindent all lines. - E112 - Fix under-indented comments. - E113 - Fix over-indented comments. - E115 - Fix under-indented comments. - E116 - Fix over-indented comments. - E121 - Fix a badly indented line. - E122 - Fix a badly indented line. - E123 - Fix a badly indented line. - E124 - Fix a badly indented line. - E125 - Fix indentation undistinguish from the next logical line. - E126 - Fix a badly indented line. - E127 - Fix a badly indented line. - E128 - Fix a badly indented line. - E129 - Fix a badly indented line.
2016-10-17SCsub: Add python shebang as a hint for syntax highlightingRémi Verschelde
Also switch existing shebangs to "better" /usr/bin/env python.
2016-06-22classref: Fix UTF-8 parsing in makerstRémi Verschelde
2016-04-02Remove trailing spacesRémi Verschelde
2016-02-17Add a warning header to each rst fileRémi Verschelde
To tell potential contributors that they should direct their work to the XML template and not the auto-generated reST
2016-02-17Implement support for [codeblock] tag in helpRémi Verschelde
It allows to define a multiline space-indented code block that will be properly parsed by the reST converter for the online docs. The in-editor help understand the [codeblock] tag as it supposedly understand [code] already (i.e. it just seems to discard it, though the code was supposed to switch it to a monospace font, but that's likely another issue.
2016-02-07Improve parsing of [method ...] tagsRémi Verschelde
Also improve some code display.
2016-02-07Fix badly formatted tags in XMLRémi Verschelde
Also add parsing of [code] tags in RST converter
2016-02-07Display better inheritance info in docJuan Linietsky
2016-02-07Small makerst improvementsRémi Verschelde
2016-02-07Enhance xml to rst converterRémi Verschelde
Fixes a number of issues: - Headings underliners now have the correct length - Newline+Tabs in descriptions are replaced by two newlines to make a proper paragraph - [br] are replaced by two newlines, making a proper paragraph - Properly parse internal hyperlinks in constants description - Fix broken internal links due to missing newlines - Show method header even when it has no description, to have something to reference in hyperlinks
2016-02-06-Added RST generator for class referenceJuan Linietsky