Skip to content
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

[BUG] Error when display("text/html", string) to embed raw HTML #381

Closed
eisthf opened this issue Jun 23, 2020 · 1 comment
Closed

[BUG] Error when display("text/html", string) to embed raw HTML #381

eisthf opened this issue Jun 23, 2020 · 1 comment
Labels

Comments

@eisthf
Copy link

eisthf commented Jun 23, 2020

description

According to the document at http://weavejl.mpastell.com/stable/usage/: it should be possible to embed raw HTML using display() but the following error occurs:

ERROR: MethodError: no method matching show(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::MIME{Symbol("text/html")}, ::String)
Closest candidates are:
  show(::IO, !Matched::MIME{Symbol("text/plain")}, ::Any) at multimedia.jl:47
  show(::IO, ::MIME{Symbol("text/html")}, !Matched::Method) at methodshow.jl:340
  show(::IO, ::MIME{Symbol("text/html")}, !Matched::Base.MethodList) at methodshow.jl:393
  ...

versions

using InteractiveUtils; versioninfo():

julia> versioninfo()
Julia Version 1.5.0-beta1.0
Commit 6443f6c95a (2020-05-28 17:42 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = "C:\Users\Earth\AppData\Local\atom\app-1.47.0\atom.exe"  -a
  JULIA_NUM_THREADS = 8

using Pkg; Pkg.status():

Status `C:\Users\Earth\.julia\environments\v1.5\Project.toml`
  [c52e3926] Atom v0.12.11
  [336ed68f] CSV v0.6.2
  [717857b8] DSP v0.6.7
  [a93c6f00] DataFrames v0.21.1
  [31c24e10] Distributions v0.23.4
  [e5e0dc1b] Juno v0.8.2
  [5fb14364] OhMyREPL v0.5.5
  [9b87118b] PackageCompiler v1.1.1
  [b98c9c47] Pipe v1.3.0
  [f0f68f2c] PlotlyJS v0.13.1
  [91a5bcdd] Plots v1.3.6
  [438e738f] PyCall v1.91.4
  [295af30f] Revise v2.7.0
  [2913bbd2] StatsBase v0.33.0
  [44d3d7a6] Weave v0.10.2

minimum reproducible steps

# Test
! display("text/html", "Header from julia");
julia> weave("test.jmd", doctype="md2html", out_path = :pwd)
┌ Warning: ERROR: MethodError occurred, including output in Weaved document
└ @ Weave C:\Users\Earth\.julia\packages\Weave\AL87K\src\run.jl:248
[ Info: Report weaved to test.html
"D:\\work\\julia\\test.html"
@eisthf eisthf added the bug label Jun 23, 2020
@eisthf
Copy link
Author

eisthf commented Jun 24, 2020

HTML string should have been wrapped in a HTML object as follows:
display("text/html", html"Header from julia"); or display("text/html", HTML("Header from julia"));

It would be nice if the example in the Weave document be updated accordingly.

@eisthf eisthf closed this as completed Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant