public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Embed plotly charts as standalone html from Markdown
@ 2021-07-13 22:15 Erik Anderson
       [not found] ` <90f4a25c-f44e-4ecf-9688-aa13eaa94097n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Erik Anderson @ 2021-07-13 22:15 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1207 bytes --]

I am attempting to create a standalone HTML file from a markdown file with 
Plotly charts included.

My current strategy is to 
(1) export the chart as html (`fig.write_html('plot1.html')`)
(2) embed the plot in a Report.md file using an Iframe with the `src` 
property equal to the local file, and 
(3) use pandoc to convert from markdown using
```
pandoc Report.html -f markdown -t html -o test.html --standalone
```
However, the resulting html file displays only an empty Iframe (I suspect 
pandoc is using escaping incorrectly since the data is a local file rather 
than online).

Report.md looks like this:
```
# Report

<iframe width=100%, height=650, src='plot1.html'></iframe>
```
 Is there a way to create a standalone html file using local files in this 
way with pandoc?

Thanks,
Erik

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/90f4a25c-f44e-4ecf-9688-aa13eaa94097n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1805 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Embed plotly charts as standalone html from Markdown
       [not found] ` <90f4a25c-f44e-4ecf-9688-aa13eaa94097n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2021-07-14  9:58   ` christi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
  0 siblings, 0 replies; 2+ messages in thread
From: christi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org @ 2021-07-14  9:58 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1435 bytes --]

The way I do it is use the image syntax, with width and height attributes.

On Tuesday, July 13, 2021 at 3:15:11 PM UTC-7 erik...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:

> I am attempting to create a standalone HTML file from a markdown file with 
> Plotly charts included.
>
> My current strategy is to 
> (1) export the chart as html (`fig.write_html('plot1.html')`)
> (2) embed the plot in a Report.md file using an Iframe with the `src` 
> property equal to the local file, and 
> (3) use pandoc to convert from markdown using
> ```
> pandoc Report.html -f markdown -t html -o test.html --standalone
> ```
> However, the resulting html file displays only an empty Iframe (I suspect 
> pandoc is using escaping incorrectly since the data is a local file rather 
> than online).
>
> Report.md looks like this:
> ```
> # Report
>
> <iframe width=100%, height=650, src='plot1.html'></iframe>
> ```
>  Is there a way to create a standalone html file using local files in this 
> way with pandoc?
>
> Thanks,
> Erik
>

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/ed19f06a-cd75-41e6-8bdf-c6d339bd541dn%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 2186 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-14  9:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13 22:15 Embed plotly charts as standalone html from Markdown Erik Anderson
     [not found] ` <90f4a25c-f44e-4ecf-9688-aa13eaa94097n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2021-07-14  9:58   ` christi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).