From 263f7eaf305ef535b1d33aa618085f118c4986a6 Mon Sep 17 00:00:00 2001 From: Kilian Ciuffolo Date: Mon, 9 Nov 2015 09:55:04 -0800 Subject: [PATCH] implemented api reference support --- .gitignore | 4 +++- _data/api/.gitkeep | 0 _includes/namespace.html | 47 ++++++++++++++++++++++++++++++++++++++++ _includes/nav.html | 3 ++- _layouts/default.html | 3 ++- _plugins/api_url.rb | 9 ++++++++ _plugins/array_concat.rb | 12 ++++++++++ _plugins/no_nl.rb | 9 ++++++++ api/class/index.md | 6 +++++ api/index.md | 6 +++++ api/mixin/index.md | 9 ++++++++ 11 files changed, 105 insertions(+), 3 deletions(-) create mode 100644 _data/api/.gitkeep create mode 100644 _includes/namespace.html create mode 100644 _plugins/api_url.rb create mode 100644 _plugins/array_concat.rb create mode 100644 _plugins/no_nl.rb create mode 100644 api/class/index.md create mode 100644 api/index.md create mode 100644 api/mixin/index.md diff --git a/.gitignore b/.gitignore index 52453958f..874dec434 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ .bundle .jekyll-metadata +_data/api/* +_data/nav_api.yml _site _config-prod.yml _config-local.yml -docs +api/* vendor diff --git a/_data/api/.gitkeep b/_data/api/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/_includes/namespace.html b/_includes/namespace.html new file mode 100644 index 000000000..986c1a905 --- /dev/null +++ b/_includes/namespace.html @@ -0,0 +1,47 @@ +{% if include.data.borrows.size %} +## Extends +{% for item in include.data.borrows %} +[{{ item }}]({{ site.baseurl }}/api/class/{{ item | api_url }}) +{% endfor %} +{% endif %} + +{% if include.data.properties.size > 0 %} +## Properties +link | summary +--- | --- +{% for item in include.data.properties %}[{{ item.name }}]({{ site.baseurl }}/api/{{ item.dataTypes[0] | api_url }}) | {{ item.summary | no_nl }} +{% endfor %} +{% endif %} + +{% if include.data.methods.size > 0 %} +## Methods +{% for item in include.data.methods %} + +### {{ item.name }} +{{ item.summary | no_nl }} + +#### Signature +`{{ item.signature }}` + +{% if item.params.size > 0 %} +#### Parameters + +Name | Type | Description +--- | --- | --- +{% for param in item.params %}{{ param.name }} | {{ param.types }} | {{ param.desc | no_nl }} +{% endfor %} +{% endif %} + +#### Return type +{% for type in item.return.types %}[{{ type }}]({{ site.baseurl}}/api/class/{{ type | api_url }}), {% endfor %}: {{ item.return.desc }} + +{% endfor %} +{% endif %} + +{% if include.data.events.size > 0 %} +## Events +link | summary +--- | --- +{% for item in include.data.events %}[{{ item.name }}]({{ site.baseurl }}/api/{{ item.dataTypes[0] | api_url }}) | {{ item.summary | no_nl }} +{% endfor %} +{% endif %} diff --git a/_includes/nav.html b/_includes/nav.html index 5e7cf78f3..cfcdd6461 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -1,6 +1,7 @@