referator/test/footnotes.json.erb

31 lines
1.1 KiB
Plaintext

{
"self": [
<%- notes['self'].each_with_index do |note, index| -%>
{
"index": <%= Integer(note['index']).to_json %>,
"category": "self",
"id": <%= String(note['id']).to_json %>,
"slug": <%= String(note['slug']).to_json %>,
"anchor": <%= String(note['anchor']).to_json %>,
"fragment": <%= String(note['fragment']).to_json %>,
"url": <%= "#{note['id']}.html".to_json %>,
"text": <%= String(note['text']).to_json %>
}<%= ',' unless index == notes['self'].count - 1 %>
<%- end -%>
],
"link": [
<%- notes['link'].each_with_index do |note, index| -%>
{
"index": <%= Integer(note['index']).to_json %>,
"category": "link",
"id": <%= String(note['id']).to_json %>,
"slug": <%= String(note['slug']).to_json %>,
"anchor": <%= String(note['anchor']).to_json %>,
"fragment": <%= String(note['fragment']).to_json %>,
"url": <%= String(note['url']).to_json %>,
"text": <%= String(note['text']).to_json %>
}<%= ',' unless index == notes['link'].count - 1 %>
<%- end -%>
]
}