Sha256: 7b2a7dcec3fb6bb5b36993bcac3fd1c933673d66c2254f2813cb8113dcc6b322

Contents?: true

Size: 1.35 KB

Versions: 9

Compression:

Stored size: 1.35 KB

Contents

<%-
  Prmd::Template.render('schemata/helper.erb', options[:template], {
    options:         options,
    resource:        resource,
    schema:          schema,
    schemata:        schemata
  })

  title = schemata['title'].split(' - ', 2).last
-%>
<%- unless options[:doc][:disable_title_and_description] %>
## <a name="resource-<%= resource %>"></a><%= title %>

<%= schemata['description'] %>
<%- end -%>

<%- if schemata['properties'] && !schemata['properties'].empty? %>
### Attributes

| Name | Type | Description | Example |
| ------- | ------- | ------- | ------- |
<%- refs = extract_schemata_refs(schema, schemata['properties']).map {|v| v && v.split("/")} %>
<%- extract_attributes(schema, schemata['properties']).each_with_index do |(key, type, description, example), i| %>
<%- if refs[i] && refs[i][1] == "definitions" && refs[i][2] != resource %>
<%- name = '[%s](#%s)' % [key, 'resource-' + refs[i][2]] %>
<%- else %>
<%- name = key %>
<%- end %>
| **<%= name %>** | *<%= type %>* | <%= description %> | <%= example %> |
<%- end %>

<%- end %>
<%- (schemata['links'] || []).each do |link, datum| %>
<%=
  Prmd::Template.render('schemata/link.md.erb', options[:template], {
    options:         options,
    resource:        resource,
    schema:          schema,
    schemata:        schemata,
    link:            link,
    title:           title
  })
%>
<%- end -%>

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
prmd-0.11.4 lib/prmd/templates/schemata.md.erb
prmd-0.11.3 lib/prmd/templates/schemata.md.erb
prmd-0.11.2 lib/prmd/templates/schemata.md.erb
prmd-0.11.1 lib/prmd/templates/schemata.md.erb
prmd-0.11.0 lib/prmd/templates/schemata.md.erb
prmd-0.10.0 lib/prmd/templates/schemata.md.erb
prmd-0.9.0 lib/prmd/templates/schemata.md.erb
prmd-0.8.0 lib/prmd/templates/schemata.md.erb
prmd-0.7.4 lib/prmd/templates/schemata.md.erb