This is more a matter of choosing a thoughtful structure for your
project before using transclusion than a problem for MMD to solve.
MMD does not "police" URLs to ensure accuracy. It uses what you tell it
to use, on the assumption you know what you are doing.
The contents of a MMD document are just text.... They have no
"location" per se. This is why you can pipe text directly to the
multimarkdown command (e.g. `cat foo.txt | multimarkdown`).
Transclusion is handled slightly differently, because it has to be. By
definition, transclusion requires that MMD "knows" where a file is, and
where transcluded files are.
So an image URL, e.g. `<image/bla.png>`, is left alone. MMD has know
way of knowing your intent when using that URL. It may be that the text
will be processed and sent to an entirely different computer/server for
hosting on a web site.
In your use case, you want to develop a thoughtful structure that works
whether you are transcluding or not. For example, all images could go
in a single directory (e.g. `images`), and there is only one level of
transclusion nesting. Images can be referenced by
`../images/image-1.png` from any of the chapters. The main file would
also be in a level 1 directory, so that it can also reference `../images`.
project
|
- images
|
- chapter1
|
_ chapter2
|
- main
Fletcher
On 11/23/16 10:33 AM, Tore Haug-Warberg wrote:
> I have the same needs myself. As far as I can understand {{<file>}}
> opens <file> recursively, thus incrementing the relative path at each
> level of transclusion, whereas ![](<file> "") opens <file> *after* the
> document has been *linearized*. In my opinion this makes MMD less
> valuable as a tool for parsing hierarchical document structures. I
> would say it is within the 80 : 80 philosophy of MMD.
>
>
> On Saturday, April 30, 2016 at 7:57:29 PM UTC+2, Michael Chen wrote:
>
> I have folders chapter1, ...., chapter14; and within each fold
> chapterN, there is a markdown file chapterN.md and a subfolder
> image. The chapterN.md contains ![bla](image/bla.png).
>
> I listed all markdown files in my index file as:
>
> {{chapter1/chapter1.md <
http://chapter1.md>}}
> {{chapter2/chapter2.md <
http://chapter2.md>}}
> .
> .
> .
> etc.
>
> After the file transclusion, the images are still referenced as
> "image/bla.png", which should be "chapter1/image/bla.png". Shall we
> fix this?
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "MultiMarkdown Discussion List" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
multimarkdow...@googlegroups.com
> <mailto:
multimarkdow...@googlegroups.com>.
> To post to this group, send email to
multim...@googlegroups.com
> <mailto:
multim...@googlegroups.com>.
> Visit this group at
https://groups.google.com/group/multimarkdown.
> For more options, visit
https://groups.google.com/d/optout.
--
Fletcher T. Penney
fletche...@gmail.com