bingryan / obsidian-markdown-export-plugin

This plugin allows to export directory/single markdown to a folder. support output format(html/markdown)
64 stars 11 forks source link

export to markdown does not create generated images #79

Open bdrewery opened 5 months ago

bdrewery commented 5 months ago

Example: https://github.com/joethei/obsidian-plantuml?tab=readme-ov-file#examples

```plantuml
Bob -> Alice : hello
Alice -> Wonderland: hello
Wonderland -> next: hello
next -> Last: hello
Last -> next: hello
next -> Wonderland : hello
Wonderland -> Alice : hello
Alice -> Bob: hello
```

output

With "export to HTML" an image is inlined in the HTML. With "export to markdown" no external file is generated.

Likewise the following does not generate an image in the export either.

![bob_and_alice](bob_and_alice.puml)
bingryan commented 5 months ago

Example: https://github.com/joethei/obsidian-plantuml?tab=readme-ov-file#examples

```plantuml
Bob -> Alice : hello
Alice -> Wonderland: hello
Wonderland -> next: hello
next -> Last: hello
Last -> next: hello
next -> Wonderland : hello
Wonderland -> Alice : hello
Alice -> Bob: hello

![output](https://camo.githubusercontent.com/1de911a6a9f7e45f07a786887f24439cded5b999c2ce55a96a1174ba08662817/687474703a2f2f7777772e706c616e74756d6c2e636f6d2f706c616e74756d6c2f706e672f5379664645684830722d78473069555370454a4b476d6b6933597438494374396f555332796f35497556627641516235454f6276414e315058313134494c7667484762534b5734384730384741505f344f624766613031314e53574d6532583149413278367734366f5572305f79366130303030)

With "export to HTML" an image is inlined in the HTML. With "export to markdown" no external file is generated.

Likewise the following does not generate an image in the export either.

bob_and_alice

⚠️ Only works when using local rendering

bingryan commented 5 months ago

"export to HTML" is after render, but "export to markdown" is not .

bdrewery commented 5 months ago

How much work is it to support export to markdown after render?

bingryan commented 5 months ago

https://github.com/bingryan/obsidian-markdown-export-plugin/blob/f3aae38fb55be6cc152224358f28067bf64ac7b5/src/utils.ts#L415-L416

It doesn’t take long, just need to render the content for export to markdown.

bingryan commented 5 months ago

BTW, you can try to export to markdown in preview mode