-
Notifications
You must be signed in to change notification settings - Fork 15
Updated to support C api include links #198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,18 +27,20 @@ <h2 id="{{ ref.info.name | slugify }}" data-pagefind-weight="7">{{ ref.info.name | |
| <th></th> | ||
| <th></th> | ||
| </tr> | ||
| {%- if ref.info.language == "C++" and ref.info.namespace != "" -%} | ||
| {%- unless global_namespaces contains ref.info.namespace -%} | ||
| <tr> | ||
| {%- unless global_namespaces contains ref.info.namespace -%} | ||
| {%- if ref.info.namespace != "" -%} | ||
| <td>Namespace:</td> | ||
| <td><code>{{ ref.info.namespace }}</code></td> | ||
| {%- endif -%} | ||
| {%- endunless -%} | ||
| </tr> | ||
| {%- endunless -%} | ||
| {%- endif -%} | ||
| {%- if ref.info.include and ref.info.include != "" -%} | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The include field wasn't set, thus the link was shown, but with no text. To make it clearer, only show an include, if it actually has one. |
||
| <tr> | ||
| <td>Include:</td> | ||
| <td><code>#include <<a href="https://github.com/defold/defold/blob/dev/{{ ref.info.path }}">{{ ref.info.include }}</a>></code></td> | ||
| </tr> | ||
| {%- endif -%} | ||
|
|
||
| </table> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1147,26 +1147,26 @@ 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"] | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tiny cleanup to avoid getting it again later on. |
||
|
|
||
| # set api type | ||
| api["info"]["type"] = "Defold " + language | ||
|
|
||
| # make sure file is only the filename and no path | ||
| if api["info"]["file"] == "": | ||
| api["info"]["file"] = os.path.basename(api["info"]["path"]) | ||
| 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"): | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The fix for the include file link for C files. |
||
| dmsdk_index = str.find(api["info"]["path"], "dmsdk/") | ||
| api["info"]["include"] = api["info"]["path"] | ||
| if dmsdk_index != -1: | ||
| api["info"]["include"] = api["info"]["path"][dmsdk_index:] | ||
|
|
||
| # 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(".", "-") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only show namespace if it's an actual namespace.
The "namespace" field has been overtaken by other functions as well, so we can't simply check if it's not empty.