Closed mbakeranalecta closed 8 years ago
I suppose we could also use the language annotation:
But that is a bit of a problem since ! is supposed to take a standard language or locale code.
The issue with
``` sam
is that it is conceivable that you might want to give a codeblock a title, in which case this would be the natural position for it.
An option is to overload ! such that its value is of a different type when applied to codeblocks
But a bigger issue here is that in any text that talks about code, the assignment of language to codeblocks will be much much more common that the assignment of language to anything else. So why use the obscure syntax for the common case?
another option is to do this:
``` xml
and
```(?baz) xml
In other words, put the language in the title position.
But this seems counter intuitive. Language is an annotation and annotation go in parens.
It is worth bearing in mind that most of the block metadata are shortcuts. You can always use fields to accomplish the same semantics.
foo:(?bar)
vs.
foo:
if: bar
Similarly, you can do:
codeblock:
language: xml
| foo = 2
| bar = 7
or
codesample:
language: xml
foo = 2
bar = 7
There is therefore no need to make any of the shortcuts complete. They are a convenience feature and they diminish in value if they become obscure or difficult to learn and use.
language and namespace attributes should be removed.
Now that each block attribute must be in a separate annotation, the issues here are moot.
The codeblock annotations need reviewing. Currently the format is:
(language "source" (namespace) ?condition #name *ref)
But source should be handled by a citation for consistency.
Not sure of the value of namespace.
That would leave:
(language ?condition #name *ref)
Another possibility would be to leave the block annotation structure the same and use the space after the annotation for the language tag:
or
This would make the format of the language string open and not dependent of the annotation parser.
It is quite consistent with the use of titles on blocks.