Comments (14)
Hi @eddoff,
Why do you need line breaks? Where do you use them?
from jatsparser.
Some part of the article text was a citation of a poetry or song. And there I want to decide where to put the line breaks. For example check this article:
http://www.venue.ep.liu.se/article.html?DOI=10.3384/venue.2001-788X.13218
if I use
the spacing will be too large.
from jatsparser.
Is it also possible to allow to use CDTA-tags?
from jatsparser.
Nope, CDATA isn't implemented.
Maybe, you would like to make a PR for line breaks?
from jatsparser.
I tried to make a change in JATSParser/src/JATSParser/HTML/Text.php as you might have seen in my first post in this thread (which I later edited since I realized it did not work).
from jatsparser.
You were on the right path. You modified JATS Parser's HTML output (only case "break":
...); the change should be also reflected in the class that is responsible for parsing JATS: https://github.com/Vitaliy-1/JATSParser/blob/master/src/JATSParser/Body/Text.php#L21; I think just pointing that the code should control also element with the name break
by adding it to the referenced array should be enough.
from jatsparser.
I tried, but it did not work. Could it be any problem since the the tag is written with only one tag: (i.e. no starting and ending tag). Do I need to have "break/" in the code then instead?
from jatsparser.
I'm reading the latest version of NISO JATS publishing set standards and it's said there that use of break
tag is discouraged. Moreover, if it'll be used in the way we are planning - JATS XML wouldn't be valid. Take a look: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/break.html
By the link, you can find the answer on how to mark poems - it's verse-group
tag. It's something that I can add, what do you think?
from jatsparser.
Yep, please add <verse-group>
, <verse-line>
and <attrib>
then.
from jatsparser.
Thank you for this
However there seems to be problems. Here is Fatal error from the log:
[Tue Jan 21 11:18:37.638314 2020] [php7:error] [pid 22476] [client xxx:2669] PHP Fatal error: Uncaught TypeError: Return value of JATSParser\\Body\\Verse::getContent() must be of the type array, null returned in /var/www/html/journal/plugins/themes/oldGregg/JATSParser/src/JATSParser/Body/Verse.php:25\nStack trace:\n#0 /var/www/html/journal/plugins/themes/oldGregg/JATSParser/src/JATSParser/HTML/Verse.php(13): JATSParser\\Body\\Verse->getContent()\n#1 /var/www/html/journal/plugins/themes/oldGregg/JATSParser/src/JATSParser/HTML/Document.php(168): JATSParser\\HTML\\Verse->setContent(Object(JATSParser\\Body\\Verse))\n#2 /var/www/html/journal/plugins/themes/oldGregg/JATSParser/src/JATSParser/HTML/Document.php(16): JATSParser\\HTML\\Document->extractContent(Array)\n#3 /var/www/html/journal/plugins/themes/oldGregg/OldGreggThemePlugin.inc.php(323): JATSParser\\HTML\\Document->__construct(Object(JATSParser\\Body\\Document))\n#4 /var/www/html/journal/plugins/themes/oldGregg/OldGreggThemePlugin.inc.php(191): OldGreggThemePlugin->htmlCreation(Object(TemplateManager), Object(JATSParser\\Body\\Document), Object(ArticleGalley))\n#5 /var/ww in /var/www/html/journal/plugins/themes/oldGregg/JATSParser/src/JATSParser/Body/Verse.php on line 25
from jatsparser.
Do you have verse-lines
's inside verse-group
? Like here: https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/verse-line.html
from jatsparser.
Great! Thank you! Now it works!
Is it also possible to add a class to the p-element so that it is possible to change the layout with CSS?
For example:
from jatsparser.
As far as I can see from NISO JATS guidelines, the closest by meaning attribute for this is type
, like list-type
for lists, sec-type
for sections and content-type
for most repeated elements. It's something that I can add and is partially implemented, e.g. for lists.
from jatsparser.
@eddoff , can you open a new issue for this, as this one is resolved?
from jatsparser.
Related Issues (20)
- Table attributes does not render HOT 1
- Appendix not extracted from JATS XML HOT 4
- Add support for disp-quote HOT 2
- Hyperlinks to external uri inside JATS XML <p> tag HOT 1
- Add class to p-element in poetry
- Figures inside a <p> aren't recognized correctly. HOT 4
- Refactor getContent method of JATS Document and Section
- Use citeproc-php for rendering references conversion to the HTML
- Issue with inline-graphic, display-formula and fig tags HOT 4
- CiteProc throws a fatal error if year isn't valid
- Fatal error if submission file deleted HOT 1
- Display inline-formula HOT 1
- little mistake between publisherLoc and publisherName HOT 1
- HTML: IDs for figures and tables are missing HOT 2
- How to adjust logo size? HOT 1
- Text nodes shouldn't be trimmed when converted to HTML HOT 3
- Create handler for PDF Converter page
- Anchor tags HOT 3
- Footnotes not working HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jatsparser.