Giter VIP home page Giter VIP logo

Comments (9)

mquinson avatar mquinson commented on August 17, 2024

Which formater are you using here? I may well be blind, but it seems to be no Markdown format importer, is it? The first step for a proper MarkDown support is probably to have a dedicated formater, don't you think? As always, PR are warmely welcomed :-P

from po4a.

intrigeri avatar intrigeri commented on August 17, 2024

Which formater are you using here? I may well be blind, but it seems to be no Markdown format importer, is it? The first step for a proper MarkDown support is probably to have a dedicated formater, don't you think?

I have (vague) plans for other improvements in Markdown bullet list handling and noticed this discussion. @mquinson, I'm not sure I understand your comment correctly and wether I should be discouraged to improve the existing Markdown support (in Locale::Po4a::Text) because I would be required to first create a brand new class and think hard about design to avoid too much code duplication.

I would argue that it's best to improve Markdown syntax support in Locale::Po4a::Text as long as these conditions are met:

  • the parse_markdown method remains small (currently it is pretty small; compare for example to the asciidoc support that takes about 50% of the SLOC in that class)
  • improving support of Markdown syntax incidentally improves parsing of other simple text documents supported by that class; I think this should be easy given staying close to how most people would write text without knowing about Markdown is one design goal of that format; IMO it's already confirmed by the fact we already have pretty good Markdown support with very little Markdown-specific code.

Whenever any of these conditions is not met then I'll be all for creating a dedicated Locale::Po4a::Markdown class but right now I don't really see the point given it would basically be a copy of Locale::Po4a::Text minus the asciidoc, debian/control and fortunes bits.

What do you think?

from po4a.

emmapeel2 avatar emmapeel2 commented on August 17, 2024

will a Locale::Po4a::Markdown class:

  • strip the markdown from [[!meta title="this is our title"] and generate a mstr= "this is our title"?
  • similar with [[!wikipedia Word desc="mydescription"] becoming mstr= "Word" and mstr= "mydescription" in .pot ?
  • could maybe verify the existence of internal links?

from po4a.

intrigeri avatar intrigeri commented on August 17, 2024

from po4a.

emmapeel2 avatar emmapeel2 commented on August 17, 2024

ok!

from po4a.

bexelbie avatar bexelbie commented on August 17, 2024

I'd be interested to know if this is a case where leveraging another CPAN based markdown processor would be of help. Otherwise, I agree that your criteria for splitting or not splitting look good.

from po4a.

mquinson avatar mquinson commented on August 17, 2024

Hello, sorry for the delay.

I totally agree with @intrigeri that support for markdown can grow further in the text parser since it does not harm the text parser in any way for now. When we will have to choose to split the text here or there, depending on whether we assume that it's asciidoc or markdown, then we'll need to consider spliting the parsers. But not for now. So, my first question is now answered.

As for the remark of @bexelbie , I really fail to understand how you could use a regular parser to build a po4a transtractor. I'd be interested in an example ;)

from po4a.

intrigeri avatar intrigeri commented on August 17, 2024

from po4a.

toddy15 avatar toddy15 commented on August 17, 2024

We now have a test case for this, see MarkDown.md in the test directory. From what I can tell, this issue seems to be solved -- the parser generates separate msgids for each bullet point and marks them as being wrappable.

I'm therefore closing this issue, please reopen it if you're missing some functionallity.

from po4a.

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.