From 1d46aadcd2e473ed7b6cd4e4c5cdf0f93420288c Mon Sep 17 00:00:00 2001 From: Marc Garcia Puig Date: Tue, 21 May 2019 18:42:25 +0200 Subject: [PATCH] Make option for API Docs + added class Docs in MD --- PythonAPI/docs/doc_gen.py | 5 +++++ PythonAPI/docs/map.yml | 1 + Util/BuildTools/Linux.mk | 3 +++ 3 files changed, 9 insertions(+) diff --git a/PythonAPI/docs/doc_gen.py b/PythonAPI/docs/doc_gen.py index 1f38dc273..c4fd13125 100755 --- a/PythonAPI/docs/doc_gen.py +++ b/PythonAPI/docs/doc_gen.py @@ -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() diff --git a/PythonAPI/docs/map.yml b/PythonAPI/docs/map.yml index a35162a41..93027a48f 100644 --- a/PythonAPI/docs/map.yml +++ b/PythonAPI/docs/map.yml @@ -6,6 +6,7 @@ - class_name: LaneType # - DESCRIPTION ------------------------ doc: > + Defines the different lane types that Opendrive accepts # - PROPERTIES ------------------------- instance_variables: - var_name: NONE diff --git a/Util/BuildTools/Linux.mk b/Util/BuildTools/Linux.mk index 98b6160c5..973b4bafe 100644 --- a/Util/BuildTools/Linux.mk +++ b/Util/BuildTools/Linux.mk @@ -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