Skip to content

Instantly share code, notes, and snippets.

@objectivehtml
Created April 6, 2014 17:19
Show Gist options
  • Select an option

  • Save objectivehtml/10008932 to your computer and use it in GitHub Desktop.

Select an option

Save objectivehtml/10008932 to your computer and use it in GitHub Desktop.
<h3>{{ entry.title }}</h3>
{% for block in entry.components %}
<section>
{% if block.type == 'customContent' %}
{{ block.page }}
{% elseif block.type == 'description' %}
<p class="description">{{ block.description }}</p>
{% elseif block.type == 'httpMethods' %}
<h4>Request</h4>
<h4 class="url"><pre>{% for option in block.httpMethods %}{{ option|upper }}{% if loop.last != true %}|{% endif %}{% endfor %}</pre> {domain}.timeblocker.co/{{ block.endpoint }}</h4>
{% elseif block.type == 'code' %}
<h4>{{ block.header }}</h4>
<pre><code class="language-{{ block.language }}">{{ block.example }}</code></pre>
{% elseif block.type == 'parameters' %}
{% if block.related | length %}
{% set block = block.related.first().components.type('parameters').first() %}
{% endif %}
{% if block.parameters | length %}
{% if block.header %}
<h4>{{ block.header }}</h4>
{% else %}
<h4>Parameters</h4>
{% endif %}
<table>
<thead>
<tr>
<th width="30%">Parameter</th>
<th width="20%">Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{% for parameter in block.parameters %}
<tr>
<td>{{ parameter.name }} <pre class="datatype">({{ parameter.dataType }}) {%if parameter.required %}<span class="required">*</span>{% endif %}</pre></td>
<td><pre>{%if parameter.default %}{{ parameter.default }}{% else %}null{% endif %}</pre></td>
<td>{{ parameter.description }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<p class="small-text"><em>* Indicates parameters that are required</em></p>
{% endif %}
{% endif %}
</section>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment