kubaPod / M2MD

Simple converter of Mathematica notebooks to markdown.
45 stars 13 forks source link

MDExport cannot overwrite default ImagesFetchURL #16

Closed miRoox closed 3 years ago

miRoox commented 4 years ago

I have used MDExport to export a notebook file like:

MDExport["test.md", NotebookOpen["test.nb"], "ImagesFetchURL" -> URL["img"]]

but I still got a wrong image url:

![0j6mbj99c3g8m](img\0j6mbj99c3g8m.png)

My environment:

kubaPod commented 4 years ago

@miRoox hi, sorry for delay. I wasn't working on the project lately but this option seems to do what it should. Can you explain what is the expected outcome? I am aware of a suboptimal state of docs and a rather chaotic api atm so I am not surprised there's a confusion of any kind.

miRoox commented 4 years ago

Sorry for my mistake. I have edited the issue comment to fix my typo: /->\.

So what I really expected output is

![0j6mbj99c3g8m](img/0j6mbj99c3g8m.png)

since the wiki said:

  • _URL is an important one because it acts the same way as above but the path will be created using URLBuild instead of FileNameJoin

And I found that the actual problem occurred in options passing, so I create https://github.com/kubaPod/M2MD/pull/17 to fix it.

kubaPod commented 3 years ago

@miRoox terribly sorry for silence, I didn't have time to focus on this. The problem was caused by a simple mistake with:

MDExport[..., opts___]:=Export[..., M2MD[..., ImagesFetchURL->_, opts]

while opts should've been placed at the beginning of M2MD options pattern. I didn't quickly fixed it because something related to a big picture I was working on... which I now do not remember. So I will include the fix in the release today. Sorry again.