-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for "self_contained" document option #172
Comments
I would like to however there are bugs in pandoc that prevent it from working properly with the Bootswatch themes. In particular retrieving the fonts if I recall correctly. I attempted to try and get this fixed with jgm/pandoc#1477, which was resolved. However my example I sent to him must not have reproduced the exact problem properly, because the issue still occurs after that change. |
Sounds good. If I have the chance, I will try and look into the pandoc issue as well, but I don't think it's likely to happen in the near future. Perhaps we can just keep this open as a reminder for now and see how things are going after a few new versions of pandoc? |
I believe that this works now. Or at least it doesn't show an error like before. I just reinstalled haskell, cabal-install, pandoc and pandoc-citeproc. I saved the example html from jgm/pandoc#1477 in test-pandoc-bug.html then ran: $ pandoc <test-pandoc-bug.html --standalone --self-contained
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<html>
<head>
<pre><code><link rel="stylesheet" type="text/css" href="http://bootswatch.com/amelia/bootstrap.css"></code></pre>
</head>
</html>
</body>
</html> I saved the output in test-pandoc-bug-output.html. Reproducibility info$ pandoc --version
pandoc 1.13.2.1
Compiled with texmath 0.8.1, highlighting-kate 0.5.14.
Syntax highlighting is supported for the following languages:
abc, actionscript, ada, agda, apache, asn1, asp, awk, bash, bibtex, boo, c,
changelog, clojure, cmake, coffee, coldfusion, commonlisp, cpp, cs, css,
curry, d, diff, djangotemplate, dockerfile, dot, doxygen, doxygenlua, dtd,
eiffel, email, erlang, fasm, fortran, fsharp, gcc, glsl, gnuassembler, go,
haskell, haxe, html, idris, ini, isocpp, java, javadoc, javascript, json,
jsp, julia, latex, lex, lilypond, literatecurry, literatehaskell, lua, m4,
makefile, mandoc, markdown, mathematica, matlab, maxima, mediawiki,
metafont, mips, modelines, modula2, modula3, monobasic, nasm, noweb,
objectivec, objectivecpp, ocaml, octave, opencl, pascal, perl, php, pike,
postscript, prolog, pure, python, r, relaxng, relaxngcompact, rest, rhtml,
roff, ruby, rust, scala, scheme, sci, sed, sgml, sql, sqlmysql,
sqlpostgresql, tcl, tcsh, texinfo, verilog, vhdl, xml, xorg, xslt, xul,
yacc, yaml, zsh
Default user data directory: /Users/lcollado/.pandoc
Copyright (C) 2006-2014 John MacFarlane
Web: http://johnmacfarlane.net/pandoc
This is free software; see the source for copying conditions.
There is no warranty, not even for merchantability or fitness
for a particular purpose.
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.3
$ pandoc-citeproc --version
pandoc-citeproc 0.6.0.1 |
Yeah the reproducible example I originally gave works, however the example didn't reproduce the problem correctly, as I still get errors trying to use |
I'm wondering whether this is still an issue. In my fork I removed the hard coded I've only tested this with fairly simple bootstrap_document. It would be great if someone else could confirm this with a document that previously failed. Edit: That should be |
Still broken, with https://github.com/jimhester/knitrBootstrap/tree/standalone I get the following error render("vignettes/cars.Rmd")
Trying to process a file with only the following in it produces the same error and seems to be a good minimal reproducible example. echo '<link rel="alternate stylesheet" type="text/css" href="https://netdna.bootstrapcdn.com/bootswatch/3.0.0/amelia/bootstrap.min.css" title="Amelia" media="screen"></link>' > test.md
pandoc test.md --to html --from markdown --self-contained --output out.html
# pandoc: Could not fetch //fonts.googleapis.com/css?family=Lobster|Cabin:400,700
# InvalidUrlException "//fonts.googleapis.com/css?family=Lobster%7CCabin:400,700" "Invalid URL" I would encourage you to open a pandoc issue with the preceding block if you are interested in getting this fixed. |
Thanks @jimhester. While that example indeed breaks with pandoc 1.16.0.2 it doesn't seem to be an issue with the vignettes using the rmarkdown_template branch. I successfully generated all the examples as self contained web pages: https://rawgit.com/humburg/knitrBootstrap/stand_alone/vignettes/cars.html |
Reading #68 again I realise that this presumably only works because of the workaround (using a local dependency). I've reported the issue (jgm/pandoc#2737) using your reproducible example. |
Investigating this in some more detail it seems that rmarkdown doesn't support remote dependencies (unless I'm misunderstanding this: html_dependencies.R#L139-L140). So sticking with the local dependencies may be the way forward (regardless of what happens with the pandoc related issue). |
Hi Jim,
Do you think it would be much work to add support for the
self_contained
option that is available for rmarkdown html_documents?This would be useful for having images saved separately.
The text was updated successfully, but these errors were encountered: