Skip to content

Unable to export html with images in another directory #122

Answered by yhatt
TonioGela asked this question in Q&A
Discussion options

You must be logged in to vote

In this case, the root directory of outputted HTML has become ~/Desktop/ so the browser will find out the image from ~/Desktop/images/foo.png. Marp will not try to modify relative paths for the resource. Respects specified paths in Markdown.

So you must specify resources by the absolute path with file: scheme if you want to place HTML in anywhere of local file system.

![bg](file:///Users/xxxxxxxx/marp/images/foo.png)

If you don't want to replace paths, (undocumented) baseUrl option for Marp CLI >= v1.0.2 might be useful to set the assumed file path for relative path resolution. It cannot set through CLI options but can set via a config file.

# .marprc.yml
# Set "baseUrl" to the absolute p…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@TonioGela
Comment options

@TonioGela
Comment options

@yhatt
Comment options

@TonioGela
Comment options

Answer selected by TonioGela
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants