diff --git a/_data/ref/alpha/jobsystem-c.json b/_data/ref/alpha/jobsystem-c.json index efaa86580..737742f3f 100644 --- a/_data/ref/alpha/jobsystem-c.json +++ b/_data/ref/alpha/jobsystem-c.json @@ -692,6 +692,7 @@ "namespace": "JobSystem", "notes": [], "path": "engine/dlib/src/dmsdk/dlib/jobsystem.h", - "type": "Defold C" + "type": "Defold C", + "include": "dmsdk/dlib/jobsystem.h" } -} \ No newline at end of file +} diff --git a/_data/ref/beta/jobsystem-c.json b/_data/ref/beta/jobsystem-c.json index efaa86580..737742f3f 100644 --- a/_data/ref/beta/jobsystem-c.json +++ b/_data/ref/beta/jobsystem-c.json @@ -692,6 +692,7 @@ "namespace": "JobSystem", "notes": [], "path": "engine/dlib/src/dmsdk/dlib/jobsystem.h", - "type": "Defold C" + "type": "Defold C", + "include": "dmsdk/dlib/jobsystem.h" } -} \ No newline at end of file +} diff --git a/_includes/api_c.html b/_includes/api_c.html index 84b8c0179..16c309017 100644 --- a/_includes/api_c.html +++ b/_includes/api_c.html @@ -27,18 +27,20 @@

{{ ref.info.name + {%- if ref.info.language == "C++" and ref.info.namespace != "" -%} + {%- unless global_namespaces contains ref.info.namespace -%} - {%- unless global_namespaces contains ref.info.namespace -%} - {%- if ref.info.namespace != "" -%} Namespace: {{ ref.info.namespace }} - {%- endif -%} - {%- endunless -%} + {%- endunless -%} + {%- endif -%} + {%- if ref.info.include and ref.info.include != "" -%} Include: #include <{{ ref.info.include }}> + {%- endif -%} diff --git a/update.py b/update.py index 30ba37800..23d587a99 100755 --- a/update.py +++ b/update.py @@ -1147,9 +1147,10 @@ def process_refdoc(download = False): api["info"]["language"] = "Lua" # sys.exit(5) - # set api type - api["info"]["type"] = "Defold " + api["info"]["language"] + language = api["info"]["language"] + # set api type + api["info"]["type"] = "Defold " + language # make sure file is only the filename and no path if api["info"]["file"] == "": @@ -1157,8 +1158,8 @@ def process_refdoc(download = False): elif str.find(api["info"]["file"], "/") != -1: api["info"]["file"] = os.path.basename(api["info"]["file"]) - # generate include path for C++ files - if language == "C++": + # generate include path for C/C++ files + if language in ("C++", "C"): dmsdk_index = str.find(api["info"]["path"], "dmsdk/") api["info"]["include"] = api["info"]["path"] if dmsdk_index != -1: @@ -1166,7 +1167,6 @@ def process_refdoc(download = False): # create the key by which we index and collect APIs namespace_key = namespace - language = api["info"]["language"] if language == "C++": # namespace_key = namespace_key + "-cpp" namespace_key = api["info"]["path"].replace("..", "").replace("/", "-").replace(".", "-")