zachlebar / Annotare-Legacy

A personal wiki aimed at storing notes and research.
7 stars 2 forks source link

Parse Metadata from Markdown Source Files #2

Open zachlebar opened 12 years ago

zachlebar commented 12 years ago

What I'm looking for here is a way to specify additional metadata about a document without needing to pre-define what that metadata is going to be.

Through a syntax extension to normal Markdown, a user can specify things like title, author, date, time, location, tags, etc.

Example: # @title: The Adventures of Huck Finn ## @author: Mark Twain @tags: #american literature, #huck finn, #mark twain, #mississippi river

Why I say that these things don't need to be pre-defined is that I envision the way these elements would then be parsed would be in conjunction with the Markdown syntax, except with the inclusion of a class = ... to the element.

Example: <h1 class="title">The Adventures of Huck Finn</h1> <h2 class="author">The Adventures of Huck Finn</h2> <p class="tags">#american literature, #huck finn, #mark twain, #mississippi river</p>

What can then be done with CSS is declarations can be declared for elements with these styles associated with them.

Example:

h1 {
. . . base styles . . .
}

h1.title {
. . . additional styles . . .
}

I think this allows for maximum flexibility on the part of the user, and also on the part of the designer. Granted, this is coming from one individual who holds both of those perspectives.