Make option for API Docs + added class Docs in MD

This commit is contained in:
Marc Garcia Puig 2019-05-21 18:42:25 +02:00 committed by Néstor Subirón
parent d6c955fd32
commit 1d46aadcd2
3 changed files with 9 additions and 0 deletions

View File

@ -332,6 +332,9 @@ class Documentation:
html_key(class_key) +
class_name + ' ' +
small(italic('Class')))
# Class main doc
if valid_dic_val(cl, 'doc'):
md.textn(cl['doc'])
# Generate instance variable doc (if any)
if valid_dic_val(cl, 'instance_variables'):
md.title(3, 'Instance Variables')
@ -351,10 +354,12 @@ class Documentation:
def main():
"""Main function"""
print("Generating PythonAPI documentation...")
script_path = os.path.dirname(os.path.abspath(__file__))
docs = Documentation(script_path)
with open(os.path.join(script_path, '../../Docs/python_api.md'), 'w') as md_file:
md_file.write(docs.gen_markdown())
print("Done!")
if __name__ == "__main__":
main()

View File

@ -6,6 +6,7 @@
- class_name: LaneType
# - DESCRIPTION ------------------------
doc: >
Defines the different lane types that Opendrive accepts
# - PROPERTIES -------------------------
instance_variables:
- var_name: NONE

View File

@ -85,6 +85,9 @@ PythonAPI.2: LibCarla.client.release
PythonAPI.3: LibCarla.client.release
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --py3
PythonAPI.docs:
@python PythonAPI/docs/doc_gen.py
.PHONY: LibCarla
LibCarla: LibCarla.release LibCarla.debug