Open kwkwan opened 2 months ago
hello @kwkwan this looks very similar to the template i have been using to paste in the content to the "Notes property" ; what is == Content
is this an asciidoc heading or a special indicator that "content" is to follow?
do we need to support the case that only one language is present, and in that case would the [lang xx] indicator still be required? just wondering
I have discussed with @opoudjis a few days ago about this syntax.
There are basically 2 ways we can embed AsciiDoc content in an external plain text field:
In addition, the header line of [format=asciidoc]
is also unsupported in AsciiDoc. We currently don't have a plain text syntax that differentiates between AsciiDoc and other rich text formats. We need to come up with something?
Sample:
= Content (title is unnecessary)
[lang=ja]
== Content (clause heading is unnecessary)
(Japanese content)
[lang=en]
== Content (clause heading is unnecessary)
(English content)
Sample
[lang=ja]
--
(Japanese content)
--
[lang=en]
--
(English content)
--
We need to come up with a "magic format recognizing phrase" that differentiates AsciiDoc from other rich text formats.
If we use approach 1, then the initial = ...
can differentiate against # ...
(Markdown).
The other approach being used is the YAML front matter format that is used by Jekyll, i.e.
---
format: asciidoc
---
= blah
...
Approach 1 is definitely easier to implement because the grammar is well defined. This is the "give me all" approach, and for elements that are not supported in the user's case (e.g. if this is to be inserted in a table cell), the user will have to tailor the content to fit.
Approach 2 requires defining a "AsciiDoc profile", possibly via #74, but enumerating the possible values can be difficult. However, it will save the user from the trouble in filtering out unsupported elements.
I think both Approach 1 and 2 tell us that #74 is absolutely necessary for this task, either way.
Thoughts @hmdne ?
We could add a filter system to Coradoc, which would convert a Coradoc tree before outputting the result. Then we could use that in command line like so: --filter=language:pt_BR
which would filter out all the nodes that are of a different language than pt_BR
. Similarly we could provide an API, for instance by extending Coradoc::Converter
: https://github.com/metanorma/coradoc/blob/main/lib/coradoc/converter.rb . This should be straightforward.
We currently don't have a plain text syntax that differentiates between AsciiDoc and other rich text formats
We have file extensions and/or mime types. Anything more, I'm afraid, will not be used by majority of documents. This kind of feels like UTF-8 BOM to me. If we want to deduce a type of some embedded text, I'd rather suggest extending the format of embedding to contain a mime type.
We currently don't have a plain text syntax that differentiates between AsciiDoc and other rich text formats
We have file extensions and/or mime types. Anything more, I'm afraid, will not be used by majority of documents. This kind of feels like UTF-8 BOM to me. If we want to deduce a type of some embedded text, I'd rather suggest extending the format of embedding to contain a mime type.
We've recently done away with it as unused, but the Relaton grammar had MIME types for text it would find (and it never used them): Metanorma XML and Asciidoc, of course, are custom formats.
{ ( "text/plain" | "text/html" | "application/docbook+xml" |
"application/tei+xml" | "text/x-asciidoc" | "text/markdown" | "application/x-metanorma+xml" | text ) }
Assume I have content in both Japanese and English looks like the following:
I would like to have a command to selectively output the content like: