Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obsidian not exporting images from relative path #118

Open
anutator opened this issue Apr 25, 2022 · 7 comments
Open

Obsidian not exporting images from relative path #118

anutator opened this issue Apr 25, 2022 · 7 comments

Comments

@anutator
Copy link

anutator commented Apr 25, 2022

I try to export my article to .docx format.
I can export images only if I copy them to the root folder. But I keep images in relative folder "assets":

|
--vault folder (root folder)
 --- DevOps (category folder)
  - Article1.md
  - Article2.md
  - assets   (subfolder with images)
    --- image1.png
    --- image2.png
 --- Gitlab (category folder)
   - Article3.md
   - Article4.md
   - assets  (subfolder with images)
     --- image3.png
     --- image4.png

I tried to change main.js file as it was shown on #81 (markdown+rebase_relative_paths)
But still I don't get images.
If I set in Pandoc settings Export files from HTML or Markdown — Markdown
I get .docx file without images

Export files from HTML or Markdown — HTML
I don't get .docx file because images from article are not found in Obsidian vault folder.

If i copy images from assets folder to vault folder I get .docx with images. But I can't do that every time — I have many images and articles.

Images are inserted in Obsidian such way:
![[zabbix-login.png]]

My settings in .obsidian/plugins/obsidian-pandoc/main.js

       case 'md': {
          const result = yield pandoc({
              file: inputFile, format: 'markdown+rebase_relative_paths',
              pandoc: this.settings.pandoc, pdflatex: this.settings.pdflatex
          }, { file: outputFile, format }, this.settings.extraArguments.split('\n'));
          error = result.error;
          command = result.command;
          break;
      }  
@NoxoN1602
Copy link

Same issue here, unfortunately.
This feels like an easy to fix issue or am I mistaken?
Would b really nice if this was adressed

@Xoffio
Copy link

Xoffio commented Aug 3, 2022

Same here...

@vstoms
Copy link

vstoms commented Oct 17, 2022

Same here.

@anutator
Copy link
Author

anutator commented May 15, 2023

Pandoc doesn't work with image wikilinks such as ![[image1.png]]. There are two new plugins in pandoc 3, they automatically convert URL wikilinks to markdown links, but they don't convert images. I opened an issue jgm/pandoc#8853.
As alternative I installed https://github.com/ozntel/obsidian-link-converter plugin, but I installed it manually (I didn't find it in Obsidian plugin list). At first I convert all my wikilinks from an article to markdown links:
wikilinks-to-markdown

Or you can convert all vault wikilinks to markdown links. Besides you can convert markdown links to wikilinks.

And then I use Pandoc plugin to export an article to docx or epub.
Pandoc Plugin Preferences:
Export files from HTML or Markdown — Markdown
Extra Pandoc arguments — --resource-path=assets

@sruby
Copy link

sruby commented Oct 16, 2023

Pandoc doesn't work with image wikilinks such as ![[image1.png]]. There are two new plugins in pandoc 3, they automatically convert URL wikilinks to markdown links, but they don't convert images. I opened an issue jgm/pandoc#8853. As alternative I installed https://github.com/ozntel/obsidian-link-converter plugin, but I installed it manually (I didn't find it in Obsidian plugin list). At first I convert all my wikilinks from an article to markdown links: wikilinks-to-markdown

Or you can convert all vault wikilinks to markdown links. Besides you can convert markdown links to wikilinks.

And then I use Pandoc plugin to export an article to docx or epub. Pandoc Plugin Preferences: Export files from HTML or Markdown — Markdown Extra Pandoc arguments — --resource-path=assets

I always disable WikiLinks in Obsidian, in the same folder , most images can be export with docx, but part images can't be exported.
warn log:

image

@lyndondrake
Copy link

I've just run into the same issue. Is there any plausible fix for this?

@afganrasulov
Copy link

Found the solution

I had the same problem, and I think I found the solution. I recorded a video to help you out. Here is the link: https://youtu.be/pKawg6mPWE4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants