How to specify metas? #22

Closed
opened 10 years ago by adrientetar · 5 comments
adrientetar commented 10 years ago (Migrated from github.com)

In the File Formats doc page, I see:

Beyond that, the only 'metas are the ones that are specified within the source file (see the source formats below for more detail on how to specify metas).

But I see no more information below that…

In the File Formats doc page, I see: > Beyond that, the only 'metas are the ones that are specified within the source file (**see the source formats below for more detail on how to specify metas**). But I see no more information below that…
mbutterick commented 10 years ago (Migrated from github.com)

You can add metas like this, anywhere in the document. They will be collected into a hash table exported as metas:

#lang pollen

◊meta['key: "value"]
You can add metas like this, anywhere in the document. They will be collected into a hash table exported as `metas`: ``` racket #lang pollen ◊meta['key: "value"] ```
mbutterick commented 10 years ago (Migrated from github.com)

Patch docs.

Patch docs.
mbutterick commented 10 years ago (Migrated from github.com)

New docs for metas.

You can also do raco pkg update pollen and the updated docs will be added to your installation.

[New docs for metas.](http://pkg-build.racket-lang.org/doc/pollen/reader.html#%28part._.Inserting_metas%29) You can also do `raco pkg update pollen` and the updated docs will be added to your installation.
adrientetar commented 10 years ago (Migrated from github.com)

@mbutterick Thanks, I wanted to use metas as a way to export the document’s title, like a frontmatter. In the tutorial you mention a way to capture a certain but I’d rather export (or is it unidiomatic?). Anyways, I think it’s the tool to do that and redeem it in the template file.

@mbutterick Thanks, I wanted to use metas as a way to export the document’s title, like a frontmatter. In the tutorial you mention a way to capture a certain but I’d rather export (or is it unidiomatic?). Anyways, I think it’s the tool to do that and redeem it in the template file.
mbutterick commented 10 years ago (Migrated from github.com)

Sure, that's fine. Metas are particularly useful for anything that shouldn't be visible on the page, because they're removed from the output. In the template, you can use select-from-metas to get the value.

Alternatively, if the document title is already visible in the page, you can pull it out using select-from-doc.

Sure, that's fine. Metas are particularly useful for anything that shouldn't be visible on the page, because they're removed from the output. In the template, you can use [`select-from-metas`](http://mbutterick.github.io/pollen/doc/Template.html#%28def._%28%28lib._pollen%2Ftemplate..rkt%29._select-from-metas%29%29) to get the value. Alternatively, if the document title is already visible in the page, you can pull it out using [`select-from-doc`](http://mbutterick.github.io/pollen/doc/Template.html#%28def._%28%28lib._pollen%2Ftemplate..rkt%29._select-from-doc%29%29).
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/pollen#22
Loading…
There is no content yet.