mbakeranalecta / sam

Semantic Authoring Markdown
Other
79 stars 8 forks source link

Language annotations on inline code #135

Closed mbakeranalecta closed 7 years ago

mbakeranalecta commented 7 years ago

Language annotation on inline code works differently from on codeblocks. as this excerpt from the language docs explains.

Since decorations are just shortcuts for annotated phrases, you can add additional {annotation}s and {citation}s to decorations just as if they were regular phrases. The following annotates the inline code sample to specify its language.

            ```(sam)
                In Python 3, the correct form is `print("Hello World")`(python). 

Notice that this is not the same as the language attribute on a codeblock. On a codeblock,

            ```(sam)
                ```(python)
                   print("Hello World")

the language attribute has a value of python, which corresponds to language="python". Whereas in inline example above specifies python as the type of the annotation, which corresponds to type="python".

An alternative is:

            ```(sam)
                In Python 3, the correct form is `print("Hello World")`(language "python"). 

Which is equivalent to `type='language' specifically='python'.

This raised two issues:

Potential solutions:

The basic problem here is that we have an overlap between attribute syntax and annotation syntax. Not sure I want to revisit that at this point.

Seems pretty clear the most natural thing for writers would be to do `print("Hello World")`(python)

mbakeranalecta commented 7 years ago

Inline code and codeblocks work the same as of 8e8c6a0b4c9c41bd72fab5fd53e3d967e9688110