While others in Document titles was discussing about document titles, there was a divergent discussion on metadata standards.
http://talk.commonmark.org/t/document-titles/649/21
Document title is a metadata, but so is many other critical informations like author name etc… So we may likely need it.
Ah, especially for stuff like document and processor type declaration. e.g.
| parser: commonmark core + storywriter
| layout: resume
Would be pretty handy, if you want to select the right CSS for the type of document you are reading. E.g. resume looks different from a filmscript.
Anyway, below is what I written in the other thread, but moved here.
If you need explicitly, then this is a potential approach.
-
|
is a separator char that declares following line to be a key:value metadata statement - Can stack multiple key values pairing of metadata, but must be seperated by
|
.
e.g.| key:value : a ; b_ : c | key1:value1
gives{"key":"value : a ; b_ : c", "key1":"value1" }
- It is contextually dependent on h1, h2, h3 headings etc…
pros: Cleaner visuals. YAML like
cons: Cannot simply copy paste YAML like the jekyll -----
notation.
e.g.
My title
| layout: post
| title: Blogging Like a Hacker
The primary theme of Porter’s[1] critique of dialectic desublimation is the difference between class and society. Several theories concerning not, in fact, discourse, but subdiscourse exist. Thus, the subject is interpolated into a Sartreist absurdity that includes culture as a reality.
source text: http://www.elsewhere.org/journal/pomo/
Hmmmm… if we assume that |
represents meta data. Then we can extend this to be contextually depended on subsections. Leading to this.
# My title #
| layout: post
| title: Blogging Like a Hacker
| summary: How to blog like a hacker and win at life
... intro content...
## subheading what to do? ##
| summary: You need to do this
| key1:value1
| key2:value2
... subcontent ...
## subheading what to do? 2 ##
| summary: You need to do this 2 | key1:value1 | key2:value2
... 2nd subcontent ...
So the meta data might not show in visual representation. But would certainly be viewable in AST. This allows for perhaps smarter applications like say code block metadata. (Should not be used for extension settings, as that is not the purpose of |
but rather the generic attribute syntax {}
)
```````````````````````````````````````````` {.python requiredPackages=numPy }
print("hello world")
````````````````````````````````````````````
| author: burk dake | year: 2014 | licence: Public Domain |
Need block level metadata as well? Maybe this form?
Blogging Like a Hacker
||||||||||||||||||||||||||||||||||||||||||||||||||||
layout: post
title: Blogging Like a Hacker
summary: How to blog like a hacker and win at life
||||||||||||||||||||||||||||||||||||||||||||||||||||
The primary theme of Porter’s[1] critique of dialectic desublimation is the difference between class and society. Several theories concerning not, in fact, discourse, but subdiscourse exist. Thus, the subject is interpolated into a Sartreist absurdity that includes culture as a reality.
Block level could provide additional opportunities for smarter metadata structure. E.g. Embedded Vcards.
||||||||||||||||| Vcard: Forrest Gump |||||||||||||||||
BEGIN:VCARD
VERSION:2.1
N:Gump;Forrest
FN:Forrest Gump
ORG:Bubba Gump Shrimp Co.
TITLE:Shrimp Man
PHOTO;GIF:http://www.example.com/dir_photos/my_photo.gif
TEL;WORK;VOICE:(111) 555-1212
TEL;HOME;VOICE:(404) 555-1212
ADR;WORK:;;100 Waters Edge;Baytown;LA;30314;United States of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:100 Waters Edge=0D=0ABaytown, LA 30314=0D=0AUnited States of America
ADR;HOME:;;42 Plantation St.;Baytown;LA;30314;United States of America
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:42 Plantation St.=0D=0ABaytown, LA 30314=0D=0AUnited States of America
EMAIL;PREF;INTERNET:forrestgump@example.com
REV:20080424T195243Z
END:VCARD
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If the parser cannot handle whatever is in the block, the metadata would simply be saved as a string (e.g. vcard syntax might not be readable by certain parsers).
Only issue is, how do you selectively show and hide certain metadatas? (e.g. I imagine you want to show your Vcard sometimes in rendered view.