Giter Site home page Giter Site logo

Line breaks about jatsparser HOT 14 CLOSED

vitaliy-1 avatar vitaliy-1 commented on July 28, 2024
Line breaks

from jatsparser.

Comments (14)

Vitaliy-1 avatar Vitaliy-1 commented on July 28, 2024

Hi @eddoff,

Why do you need line breaks? Where do you use them?

from jatsparser.

eddoff avatar eddoff commented on July 28, 2024

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.

eddoff avatar eddoff commented on July 28, 2024

Is it also possible to allow to use CDTA-tags?

from jatsparser.

Vitaliy-1 avatar Vitaliy-1 commented on July 28, 2024

Nope, CDATA isn't implemented.
Maybe, you would like to make a PR for line breaks?

from jatsparser.

eddoff avatar eddoff commented on July 28, 2024

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.

Vitaliy-1 avatar Vitaliy-1 commented on July 28, 2024

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.

eddoff avatar eddoff commented on July 28, 2024

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.

Vitaliy-1 avatar Vitaliy-1 commented on July 28, 2024

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.

eddoff avatar eddoff commented on July 28, 2024

Yep, please add <verse-group>, <verse-line> and <attrib> then.

from jatsparser.

eddoff avatar eddoff commented on July 28, 2024

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.

Vitaliy-1 avatar Vitaliy-1 commented on July 28, 2024

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.

eddoff avatar eddoff commented on July 28, 2024

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.

Vitaliy-1 avatar Vitaliy-1 commented on July 28, 2024

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.

Vitaliy-1 avatar Vitaliy-1 commented on July 28, 2024

@eddoff , can you open a new issue for this, as this one is resolved?

from jatsparser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.