Iframes #61
Answered
by
boisgera
sHermanGriffiths
asked this question in
Q&A
Iframes
#61
-
Is there any class that represents an iframe? I'd like to output an iframe in html and markdown. |
Beta Was this translation helpful? Give feedback.
Answered by
boisgera
Jan 26, 2024
Replies: 1 comment
-
There is no Iframe class in the Python pandoc library since there is no such type in the Pandoc Haskell collection of types. But if you want to include iframes in a pandoc document (programatically) you can use the import pandoc
from pandoc.types import Pandoc, Meta, RawBlock, Header, Str
header = Header(1, ["", [], []], [Str("OSM")])
iframe = RawBlock("html",
"""
<iframe
id="inlineFrameExample"
title="Inline Frame Example"
width="300"
height="200"
src="https://www.openstreetmap.org/export/embed.html?bbox=-0.004017949104309083%2C51.47612752641776%2C0.00030577182769775396%2C51.478569861898606&layer=mapnik"
>
</iframe>
"""
)
doc = Pandoc(Meta({}), [header, iframe])
print(pandoc.write(doc, format="html"))
print(pandoc.write(doc, format="markdown")) The same trick works for LaTeX constructs that are not directly supported as types. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sHermanGriffiths
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is no Iframe class in the Python pandoc library since there is no such type in the Pandoc Haskell collection of types.
But if you want to include iframes in a pandoc document (programatically) you can use the
RawBlock
class. An example would be: