-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(JATS): Add footnote #896
Conversation
Thanks for this @rgieseke !
I decided in Schema that the content of a Could you please add |
What i was expecting is something like {
"type": "Article",
"content": [
{
"type": "Paragraph",
"content": [
"Further",
{
"type": "Note",
"id": "note-1",
"content": [
{
"type": "Paragraph",
"id": "Ch0.note-1",
"content": [
"A footnote",
]
}
]
},
" thinking about it."
]
}
]
} I though a footnote is like something in parens which can also be read inline. Is this not possible because a block element cannot contain further block elements? The note itself could be an inline element, couldn't it? |
Codecov Report
@@ Coverage Diff @@
## master #896 +/- ##
==========================================
+ Coverage 87.02% 87.06% +0.04%
==========================================
Files 88 88
Lines 7900 7919 +19
Branches 2511 2524 +13
==========================================
+ Hits 6875 6895 +20
+ Misses 1003 1002 -1
Partials 22 22
Continue to review full report at Codecov.
|
Done! I was reluctant in my first commit to add this but this probably makes sense. |
Oh sorry, I misunderstood your point about the note being in it's own paragraph. Now I see what you mean...
Yes, that was what I envisioned too. I think this may have been caused by the fact that we forgot to add Also it would be good to add a test for this using the above JATS and expected JSON. |
- ensures BlockContent introduced in stencila/schema@ebc45600ccca
Looks good! I had to introduce a workaround related to stencila/schema@ebc4560 This also affects other decoders (HTML, Markdown, Gdoc, Ipynb) and i'm not sure if my change is the proper solution. {
"type": "Article",
"content": [
{
"type": "Paragraph",
"content": [
"Further",
{
"type": "Note",
"id": "note-1",
"noteType": "Footnote",
"content": [
{
"type": "Paragraph",
"id": "Ch0.note-1",
"content": [
"An ",
{
"type": "Strong",
"content": [
"important"
]
},
" comment."
]
}
]
},
" thoughts below."
]
}
]
} |
I tried adding a test file, but right now i can't get to run the tests (npx jest src/codecs/jats) without failure even if i revert to earlier schema versions. |
Sorry for the late reply, been offline for a few days. Given the fixes that need to be made due to stencila/schema@ebc4560, I think the most efficient approach is for me to merge this PR and then work on those fixes for JATS and the other codecs on |
🎉 This PR is included in version 0.114.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
A first attempt at adding footnote (
fn
) support to the JATS decoder (as discussed in #880 and stencila/schema#251) .Considering the following JATS example:
I get this JSON:
Ideally, the footnote would appear as an inline element. Is this due to how paragraphs are handled?