From 4ecfc4241891431add22d33cc0f8b46137e31951 Mon Sep 17 00:00:00 2001
From: Jonas Smedegaard
(TODO)
+(TODO)
My name is Manu Sporny
-My name is Manu [Sporny]
-My name is [Manu Sporny] {schema:name}
+
My name is Manu Sporny
+My name is Manu [Sporny]
+My name is [Manu Sporny] {schema:name}
My name is Manu Sporny{schema:name}
You can give me a ring.
-You can give me a ring {=#manu}.
+You can give me a ring {=<#manu>}.
``` Notice how second paragraph has punctuation *after* the hints. +#### List + Similarly for a list: ```markdown @@ -199,26 +235,36 @@ Would produce the following HTML+RDFa: ```htmlMy name is Manu Sporny, -and you can give me a ring.
+and you can give me a ring.
My name is Thomas Francart.
``` -Notice how second header and succeeding paragraph is wrapped with a div tag, whereas third header is omitted because it is not a *descendant* but a *sibling*. +Notice how second header and succeeding paragraph is wrapped +with a div tag, +whereas third header is omitted +because it is not a *descendant* but a *sibling*. ### Block-siblings scope -Hints in a header or list block with no non-whitespace characters before or after the hints, followed by a block of same type and level, applies individually to each following block of same type and level, until any block of a lower level. +Hints in a header or list block +with no non-whitespace characters before or after the hints, +followed by a block of same type and level, +applies individually to each following block of same type and level, +until any block of a lower level. ```markdown # People + ## {.schema:Person} + ## Manu Sporny + My name is Manu Sporny. + ## Thomas Francart + My name is Thomas Francart. + # Animals ``` Would produce the following HTML+RDFa: ```html -My name is Manu Sporny.
+
My name is Manu Sporny.
My name is Manu Sporny.
+
My name is Manu Sporny.
My name is Thomas Francart.
I once read this: @@ -336,8 +422,15 @@ I once read this: ### Link definition scope -Hints not immediately following an explicit span, in a link definition block with no non-whitespace characters after the hints, applies to all references to that definition, even if no link is defined. -Similar to Markdown link definitions, source markup of this kind does not in itself result in any output html markup: It only affects _other_ markup, and if unused it simply is ignored. +Hints not immediately following an explicit span, +in a link definition block +with no non-whitespace characters after the hints, +applies to all references to that definition, +even if no link is defined. +Similar to Markdown link definitions, +source markup of this kind does not in itself result +in any output html markup: +It only affects _other_ markup, and if unused it simply is ignored. ```markdown My name is @@ -358,21 +451,28 @@ Would produce the following HTML+RDFa:My name is Manu Sporny and you can give me a ring via -1-800-555-0199.
+1-800-555-0199. ``` ## Semantic Markdown and other Markdown extensions ### Attributes extension -See [PHP Markdown extra special attributes](https://michelf.ca/projects/php-markdown/extra/#spe-attr) and [Pandoc's header attributes](https://pandoc.org/MANUAL.html#heading-identifiers): +See [PHP Markdown extra special attributes](https://michelf.ca/projects/php-markdown/extra/#spe-attr) +and [Pandoc's header attributes](https://pandoc.org/MANUAL.html#heading-identifiers): -Semantic Markdown uses similar syntax, but either with different leading character "=" or "keywords" containing a colon. +Semantic Markdown uses similar syntax, +but either with different leading character "=" +or "keywords" containing a colon. Extract from PHP Markdown extra documentation: - -> With Markdown Extra, you can set the id and class attribute on certain elements using an attribute block. For instance, put the desired id prefixed by a hash inside curly brackets after the header at the end of the line, like this: +> With Markdown Extra, +> you can set the id and class attribute on certain elements +> using an attribute block. +> For instance, put the desired id prefixed by a hash +> inside curly brackets after the header at the end of the line, +> like this: > > ```markdown > Header 1 {#header1} @@ -380,30 +480,45 @@ Extract from PHP Markdown extra documentation: > >## Header 2 ## {#header2} >``` ->Then you can create links to different parts of the same document like this: +> +> Then you can create links to different parts of the same document +> like this: > > ```markdown > [Link back to header 1](#header1) > ``` ->To add a class name, which can be used as a hook for a style sheet, use a dot like this: ->```markdown ->## The Site ## {.main} ->``` ->You can also add custom attributes having simple values by specifying the attribute name, followed by an equal sign, followed by the value (which cannot contain spaces at this time): ->```markdown ->## Le Site ## {lang=fr} ->``` ->The id, multiple class names, and other custom attributes can be combined by putting them all into the same special attribute block: ->```markdown ->## Le Site ## {.main .shine #the-site lang=fr} ->``` ->At this time, special attribute blocks can be used with +> +> To add a class name, which can be used as a hook for a style sheet, +> use a dot like this: +> +> ```markdown +> ## The Site ## {.main} +> ``` +> +> You can also add custom attributes having simple values +> by specifying the attribute name, +> followed by an equal sign, followed by the value +> (which cannot contain spaces at this time): +> +> ```markdown +> ## Le Site ## {lang=fr} +> ``` +> +> The id, multiple class names, and other custom attributes +> can be combined +> by putting them all into the same special attribute block: +> +> ```markdown +> ## Le Site ## {.main .shine #the-site lang=fr} +> ``` +> +> At this time, special attribute blocks can be used with +> > - headers, > - fenced code blocks > - links, and > - images. - ### spans See Pandoc [bracketed spans](https://pandoc.org/MANUAL.html#divs-and-spans) @@ -422,40 +537,40 @@ Would produce the following HTML+RDFa: ### blocks - - #### block example -Annotations declared as a an initial separate block applies to all siblings by introducing a surrounding `We are preparing the 2020 Music Festival !
+We are preparing the 2020 Music Festival!
We are preparing the 2020 Music Festival !
+We are preparing the 2020 Music Festival!
``` - ### Extend the extensions: use attributes at other places #### Set attributes on lists @@ -468,7 +583,6 @@ Would produce the following HTML+RDFa: - member 3 ``` - #### Set attributes on list items ```markdown @@ -485,17 +599,17 @@ Thomas is _39_{foaf:age}. ### Define a "property attribute" -An attribute without `.`, without `#` and that is not a key-value pair should be recognized as a property name, e.g. `{foaf:name}`. +An attribute without `.`, without `#` and that is not a key-value pair +should be recognized as a property name, e.g. `{foaf:name}`. ### Define a "subject attribute" -An attribute beginning with the `=` sign indicates a subject IRI, equivalent to an `resource=xxx` property, e.g. `{=wdt:Q42}` is equivalent to `His name is Douglas Adams
``` -But beware that if one hint is broken then the whole annotation is passed through as-is, e.g. if using an undefined prefix: +But beware that if one hint is broken +then the whole annotation is passed through as-is, +e.g. if using an undefined prefix: ```markdown His name is [Douglas Adams]{.foaf:Person =wdt:Q42} @@ -608,13 +730,17 @@ Should produce the following HTML+RDFa ## Where to find the current subject? -RDFa relies on a mechanism to indicate the [_current subject_ of the annotation](https://www.w3.org/TR/rdfa-core/#setting-the-current-subject). Semantic Markdown aims at having an equivalent mechanism. +RDFa relies on a mechanism +to indicate the [_current subject_ of the annotation](https://www.w3.org/TR/rdfa-core/#setting-the-current-subject). +Semantic Markdown aims at having an equivalent mechanism. -Intuitively, the current subject is the resource annotated in the "closest ancestor" of a property annotation. +Intuitively, the current subject is the resource +annotated in the "closest ancestor" of a property annotation. ### Current span subject -Used to indicate that a certain inline portion of a sentence is about an entity. +Used to indicate +that a certain inline portion of a sentence is about an entity. ```markdown [Tim Berners Lee]{=wdt:Q80} invented the web. @@ -628,10 +754,11 @@ Should yieldTim Berners Lee invented the web.
``` - ### Current paragraph subject -Used to indicate that a whole paragraph is about an entity. The annotation is at the end of the paragraph for readability. +Used to indicate +that a whole paragraph is about an entity. +The annotation is at the end of the paragraph for readability. ```markdown Tim Berners Lee invented the web. {=wdt:Q80} @@ -647,7 +774,9 @@ Should yield ### Current list subject -Used to indicate that a whole list describes an entity. The annotation should be sought at the end of the line preceding the list. +Used to indicate that a whole list describes an entity. +The annotation should be sought +at the end of the line preceding the list. ```markdown {=wdt:Q80} @@ -662,19 +791,23 @@ Should yield ```htmlThe web was invented by this geek:
Tim Berners Lee invented the web.
-He now works on Solid.
+Tim Berners Lee invented the web.
+He now works on Solid.
Tim Berners Lee invented the web.
-He now works on Solid.
+Tim Berners Lee invented the web.
+He now works on Solid.
A paragraphe after the div ended.
``` ## Declaring prefixes -Declare [prefix definitions](#Prefix-definition-syntax), anywhere in the document, preferably at the end to ease readability. +Declare [prefix definitions](#Prefix-definition-syntax), +anywhere in the document, +preferably at the end to ease readability. ```markdown {.schema:Event} @@ -875,16 +1017,17 @@ Should yield ```html