My document looks like this
---
title: 'Test'
---
lorem ipsum
I want to access the title variable to print it like this:
function Image (elem)
elem.attributes.caption = 'Image of chapter ' .. title
return elem
The caption of all images should be: 'Image of chapter Test'
.
Something like this should work (untested), inspired by the docs:
title = nil
function Meta(m)
title = m.title
return m
end
function Image (elem)
elem.attributes.caption = 'Image of chapter ' .. title
return elem
end