implemented api reference support
This commit is contained in:
+3
-1
@@ -1,7 +1,9 @@
|
|||||||
.bundle
|
.bundle
|
||||||
.jekyll-metadata
|
.jekyll-metadata
|
||||||
|
_data/api/*
|
||||||
|
_data/nav_api.yml
|
||||||
_site
|
_site
|
||||||
_config-prod.yml
|
_config-prod.yml
|
||||||
_config-local.yml
|
_config-local.yml
|
||||||
docs
|
api/*
|
||||||
vendor
|
vendor
|
||||||
|
|||||||
@@ -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 %}
|
||||||
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
{% for link in include.links %}
|
{% for link in include.links %}
|
||||||
{% if page.url contains link.url %}
|
{% capture slash_url_slash %}/{{ link.url }}/{% endcapture %}
|
||||||
|
{% if page.url contains slash_url_slash %}
|
||||||
<li class="active">
|
<li class="active">
|
||||||
{% else %}
|
{% else %}
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -37,7 +37,8 @@
|
|||||||
|
|
||||||
<div class="main {{ page.type }}">
|
<div class="main {{ page.type }}">
|
||||||
<aside class="side-nav">
|
<aside class="side-nav">
|
||||||
{% include nav.html links=site.data.nav preceding_address="/" %}
|
{% assign nav = site.data.nav | array_concat:site.data.nav_api %}
|
||||||
|
{% include nav.html links=nav preceding_address="/" %}
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<div class="heading">
|
<div class="heading">
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
module Jekyll
|
||||||
|
module APIURLFilter
|
||||||
|
def api_url(input)
|
||||||
|
input.gsub(/\./, "/").downcase if !input.nil?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Liquid::Template.register_filter(Jekyll::APIURLFilter)
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
module Jekyll
|
||||||
|
module ArrayConcatFilter
|
||||||
|
def array_concat(arr1, arr2)
|
||||||
|
result = []
|
||||||
|
result.concat(arr1)
|
||||||
|
result.concat(arr2)
|
||||||
|
arr1 = result
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Liquid::Template.register_filter(Jekyll::ArrayConcatFilter)
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
module Jekyll
|
||||||
|
module NoNLFilter
|
||||||
|
def no_nl(input)
|
||||||
|
input.gsub(/\n/, " ")if !input.nil?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
Liquid::Template.register_filter(Jekyll::NoNLFilter)
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title: Classes
|
||||||
|
description: Lorem ipsum dolor sit amet, consectetur adipisicing elit laborum.
|
||||||
|
type: folder
|
||||||
|
---
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title: API Reference
|
||||||
|
description: Lorem ipsum dolor sit amet, consectetur adipisicing elit laborum.
|
||||||
|
type: folder
|
||||||
|
---
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
title: Mixins
|
||||||
|
description: Lorem ipsum dolor sit amet, consectetur adipisicing elit laborum.
|
||||||
|
type: folder
|
||||||
|
---
|
||||||
|
|
||||||
|
{% assign links = site.data.nav_api[1].pages %}
|
||||||
|
{% include index.html links=links %}
|
||||||
Reference in New Issue
Block a user