Skip to main content
All CollectionsAuthor Help
Leanpub Courses Support iFrames
Leanpub Courses Support iFrames

Keywords: course, courses, iFrame, iFrames, how

Leanpub Support avatar
Written by Leanpub Support
Updated over 6 months ago
Leanpub Courses Support iFrames

We had a request for iFrame support in courses. The use case was simple, and generic: to be able to use Leanpub to create a course with quizzes and exercises, without having to rewrite all the material in Markua.

So, we shipped an MVP version of this. Screenshots are below, as well as the code that produced.

(Note that we need to prevent the Leanpub website from being rendered in an IFrame. Once we do, the first example will not work.)

The really cool thing, by the way, is that a PDF of slides does work (per the second example). So, if you can produce a PDF of slides, you’re good to go!

There is one huge gotcha: the content must be at an https URL. An http URL will NOT work.

Anyway, here’s the example code; see the attached screenshots to see how it behaves:

# iFrame Examples

## An HTML iFrame

Here's a paragraph before the figure.

{type: iframe, title: "The Leanpub Website", poster: LeanpubHomepage.png, width: 300, height: 200}
![][https://leanpub.com](https://leanpub.com)

Here's a paragraph after the figure.

## A PDF iFrame Here's a paragraph before the figure.

{type: iframe, title: "Introducing Markua", poster: Markua.png, width: 300, height: 200}
![](https://s3.us-west-1.amazonaws.com/markua.com/Markua.pdf)

Here's a paragraph after the figure.

code
course%20display
html%20iframe

The full spec for the feature is here:

However, the “title in quotes after URL” syntax does not work in Markua 0.10, and courses currently do not support Markua 0.30 yet. So, only the approach above works.

Here is the thread in the Authors Forum about this topic:

If you are seeing a "refused to connect" message when you try to set up an iFrame, please see this article.

OK, that's it!


If you have any questions or thoughts on writing and self-publishing with Leanpub, please join our global community of authors in our Authors Forum here!

Interested in creating your first Leanpub book? Here are some quick tutorials for our most popular writing modes: http://help.leanpub.com/en/articles/3088382-quick-walkthroughs-for-getting-started-on-a-leanpub-book

Are you looking for great deals on Leanpub ebooks, ebook bundles, and courses? Sign up for our Weekly and Monthly newsletter sales here!

Did this answer your question?