Rapporter / pander

An R Pandoc Writer: Convert arbitrary R objects into markdown
http://rapporter.github.io/pander/
Open Software License 3.0
294 stars 66 forks source link

add parameter to set (pass on) the hyphenation language #312

Open salim-b opened 6 years ago

salim-b commented 6 years ago

Since I'm mostly writing stuff in German and the hyphenation function which pander uses under the hood already supports a bunch of languages including German, I'd like to have an option to change the current hard-coded value of 'en.us'.

The relevant code seems to be this line of helpers.R: https://github.com/Rapporter/pander/blob/32e0f75ef359225a27aba3641fbe4fa84a5dc6d5/R/helpers.R#L404

If I'm right, we just need to be able to set hyph.pattern directly in pandoc.table (and maybe other relevant pander functions, I don't know) and pass that argument on to koRpus::hyphen(). Of course, 'en.us' could still be the default.

According to the package documentation the following languages are currently supported out of the box:

So a lot of non-english speaking people would benefit of this addition 🙂 What do you think?

daroczig commented 6 years ago

Sure, we should parametrize the language for koRpus and maybe it will be useful at some other parts of pander as well (eg decimal mark defaults in the future, but let's not turn this into something complicated).

I think we should add a new field in panderOptions -- I won't be able to actively work on this in the near future, but would be happy to review and merge a related PR

salim-b commented 6 years ago

I won't be able to actively work on this in the near future, but would be happy to review and merge a related PR

Ok, I see. Actually I'd like to contribute, but haven't developed R packages before. So I'd need some time to get started (and get familiar with pander's internals). At the moment I won't have time for this either, but hopefully that might change towards the end of the year... 😬

daroczig commented 6 years ago

FTR it seems that hyphenation is being moved out of koRpus to its own package at https://cran.r-project.org/web/packages/sylly, so this maybe we should address that as well as part of this idea