Giter Site home page Giter Site logo

rlesur / weasydoc Goto Github PK

View Code? Open in Web Editor NEW
45.0 3.0 3.0 243 KB

Convert R Markdown to PDF Using Weasyprint (or Prince XML)

License: GNU General Public License v3.0

R 75.05% Dockerfile 4.34% HTML 17.30% CSS 0.67% Lua 2.64%
r rstats rmarkdown-document rmarkdown pdf-generation

weasydoc's People

Contributors

rlesur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

weasydoc's Issues

Font-awesome icons

Do you think it could be possible to have access to font-awesome icons ?

By trying this 1) rstudio/rmarkdown#813 or this https://github.com/rstudio/fontawesome, I was able to add icons in the html document but they are absent in the pdf document with the weasyprint engine.

With Prince, only the 2) option works!

Maybe it's an issue for HTML to PDF converters rather than an issue for your package...

Ugly pdf with weasyprint engine on windows

Using the hpdf_document output format with the WeasyPrint engine on Windows (7 or 10), the pdf is ugly.
There is no problem on Debian or Ubuntu.
Not tested on mac.

The hpdf_document format looks good on windows using Prince engine.

It seems there is a bug in the WeasyPrint windows version, but I do not understand what is the problem.

Produce a minimal example before opening an issue in the WeasyPrint project.

Thanks to @BenjaminLouis for the issue.

Footnotes support

By default, pandoc creates a footnotes section element at the end of the document.
The CSS Generated Content for Paged Media Module adopts a different definition.

Proposal: create a custom class .footnote that would be applied through pandoc's bracketed spans.

Another idea would be to create a pandoc filter for Note

sh: 1: weasyprint: not found

Trying a very simple example.

---
title: Test
output:
  weasydoc::hpdf_document
---

I get the following error when I knit.

output file: test2.knit.md

sh: 1: weasyprint: not found
Error: Document conversion failed with error 127
In addition: Warning message:
In system2(command = engine, args = args) : error in running command
Execution halted

But weasyprint command works fine in the terminal. Not sure why R can't seem to find it. I have tried restarting R, RStudio and the system. Is there some way way to specify a path to the executable? Or perhaps you see something that I don't.

Some issues with table display using {kable} package

Hi Romain,

I found some issues with table display using {kable} and {kableExtra} packages and inserting icons in the table. You'll find explanation and reprex here : https://github.com/BenjaminLouis/reprex-weasydoc/tree/master/issue%2312.

Without details, the issues are :

  • When the R chunk with the table is in a CSS chunk, i.e. :
:::{.my-class} 
R_chink_with_kable
:::

you have to either use the html format with htmltools::HTML() function or use the markdown format in the kable() function

  • If you want to insert icons with solution 1 from #11, you can only do it with the markdown format but then you can't use the kableExtra package to pimp your table

These observation works only for linux and WeasyPrint. Not tested on windowns and with Prince XML

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.