crowbook icon indicating copy to clipboard operation
crowbook copied to clipboard

Links and images are not relative to the Markdown file but to config file

Open unknown321 opened this issue 1 year ago • 0 comments

$ head -n 10 test.book 
author: Your name
title: Your title
output.epub: book.epub
#resources.base_path.images: 
+ ./icons/index.md
+ ./changelog.md
....

$ /tmp/crowbook -n test.book 
🐦 CROWBOOK 📚 0.17.0
[WARN] en.resources.no_match
[ERROR] Error rendering epub: ./icons/index.md: Could not find file './../browse/thumbs/advanced-analytics-on-big-data.png' for image

$ grep advanced-analytics-on-big-data.png icons/index.md 
![Example architecture diagram showing multiple services connected together with numbered steps.](../browse/thumbs/advanced-analytics-on-big-data.png)

$ tree 
. 
├── icons
│   └── index.md
├── _images
│   └── rss-icon.png
├── browse
│   └── thumbs
│       └── advanced-analytics-on-big-data.png
└── test.book

All resources are addressed relatively to source files, however they are searched relatively to configuration file.

According to help:

resources.base_path
  type: path (default: not set)
  Path where to find resources (in the source tree). By default, links and
  images are relative to the Markdown file. If this is set, it will be to this
  path.

My resources are scattered all over the sources, setting resources.base_path to ./icons breaks other files.

unknown321 avatar Mar 10 '24 23:03 unknown321