Skip to content

Commit

Permalink
platformos tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Slashek committed Aug 29, 2023
1 parent d635cfc commit ad43950
Show file tree
Hide file tree
Showing 5 changed files with 923 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/views/pages/api/liquid/filters/index.json.liquid
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% cache 'lsp-filters-json' %}
{%- capture url -%}https://deidcfp1yn7c2.cloudfront.net/platform_docs/{{ context.version }}/filters.json{%- endcapture -%}
{% assign data = url | download_file | parse_json: raw_text: true %}
{% render 'api/liquid/filters', data: data %}
{%- capture url -%}https://deidcfp1yn7c2.cloudfront.net/platform_docs/{{ context.version }}/filters.json{%- endcapture -%}
{% assign data = url | download_file | parse_json: raw_text: true %}
{% render 'api/liquid/filters', data: data %}
{% endcache %}
5 changes: 5 additions & 0 deletions app/views/pages/api/liquid/tags/index.json.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% cache 'lsp-tags-json' %}
{%- capture url -%}https://deidcfp1yn7c2.cloudfront.net/platform_docs/{{ context.version }}/tags.json{%- endcapture -%}
{% assign data = url | download_file | parse_json: raw_text: true %}
{% render 'api/liquid/tags', data: data %}
{% endcache %}
54 changes: 54 additions & 0 deletions app/views/partials/api/liquid/platformos_tags.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{% capture tags %}
[
{%- for item in data.tags -%}
{% if item.name == blank %}{% continue %}{% endif %}
{
"category": "{{ item.category | default: 'platformOS' }}",
"deprecated": {{ item.deprecated | default: false | json }},
"deprecation_reason": "{{item.deprecated | join: ', '}}",
"description": {{ item.description | json }},
"syntax": {{ item.examples.first | replace: '"', '\"' | json }},
"name": "{{item.name}}",
"parameters": [
{% for param in item.params %}
{
"description": {{ param.description | json }},
"name": {{ param.name | json }},
"required": {{ param.required | default: false | json }},
"types": {{ param.types }}
}{% unless forloop.last %},{% endunless %}
{% endfor %}
],
"return_type": [
{% for return_type in item.returns %}
{
"type": "{{ return_type.types | join: ', ' | downcase }}",
"name": "",
"description": "{{return_type.description | replace: '"', '\"' | replace: "
", "\n" }}",
"array_value": ""
}{% unless forloop.last %},{% endunless %}
{% endfor %}
],
"examples": [
{% for example in item.examples %}
{
"name": "",
"description": "",
"syntax": "",
"path": "",
"raw_liquid": {{ example | replace: '"', '\"' | json }},
"parameter": false,
"display_type": "text",
"show_data_tab": true
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]
{% endcapture %}
{% liquid
assign tags = tags | parse_json: raw_text: true
return tags
%}
Loading

0 comments on commit ad43950

Please sign in to comment.