Skip to main content
All CollectionsAuthor Help
I've switched to Markua mode and my images and code resources are not working any more! How do resources work?
I've switched to Markua mode and my images and code resources are not working any more! How do resources work?
Leanpub Support avatar
Written by Leanpub Support
Updated over 2 years ago

***

Please note that this article is for authors who are writing in Markua. To see if your book is currently using Markua, please check here:

leanpub.com/YOUR_BOOK/manuscript_format

...making sure to replace YOUR_BOOK with your book's unique address.

***

If you have a book which is written in Leanpub Flavoured Markdown and you are switching to Markua mode, this is what you should do:

  1. Make a resources  directory inside your manuscript  directory.

  2. Put your images  and code  directories inside of it.

The structure is:

manuscript/*
manuscript/resources/images/*
manuscript/resources/code/*

For example:

manuscript/Book.txt
manuscript/somebookfile1.txt
manuscript/somebookfile2.txt
manuscript/somebookfile3.txt
manuscript/resources/images/foo.png
manuscript/resources/images/bar.png
manuscript/resources/images/baz.png

Book manuscript files go in the manuscript directory.

Images go in the manuscript/resources/images  directory.

Code samples go in the manuscript/resources/images  directory.

If you do this, then your existing images which you were referring to as images/blah.png in Leanpub Flavoured Markdown will still work in your Markua book.

Note that you technically don't need to make images and code subdirectories of the resources  directory: you can just put everything in the resources  directory, or you can use whatever subdirectory names you want. But then you will need to modify every image path.

For example, you can do this:

manuscript/Book.txt
manuscript/somebookfile1.txt
manuscript/somebookfile2.txt
manuscript/somebookfile3.txt
manuscript/resources/foo.png
manuscript/resources/bar.png
manuscript/resources/baz.png

However, this would require a bulk edit of your use of images in your book files, to remove the images/  from the paths.

See this section of the Markua spec https://leanpub.com/markua/read#leanpub-auto-local-resources for more information.

Finally, for Markua books using our in-browser editor, you don't need to do anything special.

Did this answer your question?