Replies: 6 comments 4 replies
-
I'm not sure
But:
|
Beta Was this translation helpful? Give feedback.
-
Good tip on I'm going to investigate how |
Beta Was this translation helpful? Give feedback.
-
@denismaier Thanks for suggesting not using
which pandoc turns into the following JATS:
For convenience I'm thinking of adding some functionality (perhaps a Lua filter) to have this wrapping automatically when an author does just back-ticks for verbatim inline text. Regardless, the example output JATS above seems a better approach. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
what about using |
Beta Was this translation helpful? Give feedback.
-
For a number of reasons (partly because of the "CSS for JATS" idea), another path I'm considering is making Baseprint XML of BpDF a combination of a small subset of JATS + a small subset of XHTML. The way tables are handled in JATS is essentially taking this approach of just adding a subset of XHTML to JATS. So in this case |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am wondering if anyone has advice or suggestions regarding a technicality I am hammering out in a small dialect of JATS (Baseprint JATS [1]) which is output by a pandoc wrapper tool (named "Baseprinter" [2], developed by me).
As best I can tell, JATS has no commonly used XML elements or transformation to HTML where a distinction is made between these two cases of "presentational semantics":
display in a monospace font (but otherwise look like adjacent text)
display in a monospace font and MORE visual distinction like color change, background change, and/or border (e.g., styling for inline "code" by Bootstrap CSS, GitHub and Wikipedia)
This is roughly the de-facto presentational semantics of HTML
<tt>
vs HTML<code>
.PubMed Central JATS XML articles with inline code only gets transformed into (1) and never (2), via the JATS
<monospace>
element. The JATS<code>
element is not inline like the HTML<code>
element. There is no equivalent to the HTML<code>
element in JATS.HTML has many tags for code-like text which are styled in different ways depending on the website, namely
<tt>
,<kbd>
,<samp>
, and<code>
. In part due to these many HTML tags, the markdown dialects for Wikipedia and GitHub have mechanisms for authors to choose (1) or (2).Currently pandoc converts inline verbatim markdown (using backticks) into a "Code" type data structure and then a JATS element.
My current plan is to use an XML attribute/value of
specific-use="code"
for JATS<monospace>
and the markdown inline attribute{specific-use=code}
after verbatim back-ticks. Pandoc currently recognizes this attribute and will perform this markdown-to-JATS conversion.Since some authors (like me) probably want the
specific-use="code"
by default for all inline verbatim markdown, I am thinking of adding a Lua filter to the Baseprinter tool. I figure there is a way to have a Lua filter add this automatically when it detects a particular flag in the document metadata.I am disinclined to have Baseprint JATS readers automatically convert
<monospace>
to Bootstrap/GitHub/Wikipedia code styling because:A) PubMed Central does not do this,
B) not all verbatim text is code, and
C) it seems reasonable that some authors might want just a slight visual change in text (a
la PubMed Central) but not as much "ink" as what Bootstrap/GitHub/Wikipedia styling adds to code text.
I'm also disinclined to start resorting to the JATS
<styled-content style="...">
element/attribute because it will be over-specific and not let websites render code in different CSS styles (e.g. Bootstrap CSS, GitHub and Wikipedia make slightly different trade-offs and attempt dark mode support).To me, it's a bit like single vs double quote or italic vs bold. One can argue about semantics, but the de-facto reality is there are two options that are very similar and sometimes authors want one vs other, but don't need to get into the exact precise presentational details of each of the two alternatives, but there are some rough de-facto presentional expectations.
Thank you for any advice, warnings, suggestions, wisdom on this inline verbatim text distinction.
[1] https://perm.pub/DPRkAz3vwSj85mBCgG49DeyndaE/
[2] https://try.perm.pub/baseprinter/
Beta Was this translation helpful? Give feedback.
All reactions