Plugin idea: Adjust links root when exporting to html

Links not working when exporting to html or pdf has been discussed in the forum several times. Is it possible to fix it as a plugin, so when we import a notebook as html directory (or few notes for that matter as single html files) it adjusts the links so they are alive after export?

1 Like

To me this seems more like a bug and should be fixed in the core.

I just exported a note to PDF and the links work.

Thus you have to be a bit more specific about what does not work and give us a proper example (in a code block or export to jex), so that we can try to reproduce the issue.

If you link two notes in joplin then export them to html or pdf.. the links wont work. Ex.: Note A has link to note B. When you export both the link remains pointing to where note B is kept in Joplin, wiht its note ID. What we expect is: when you export both, the link A to B points to the new exported html/pdf file (with it's title as link not it's ID), not to the .md note inside joplin.

Yes note links aren't supported for HTML or PDF export, but I don't think a plugin would help here as it's indeed part of core. If someone can figure out how to get this working, I'd accept a pull request.

I' not a programmer so I can't tell.. BTW.. your plugins are awsome, but we need the .jpl of inline tags plugin.. keep it up :slight_smile:

Oh! I see.. thanks for replying so quickly.. hope someone can figure it out.

Also in a someohow related topic.. would it be possible to add the tags to the exported note, at the bottom for example?

I'm not sure how this is supposed to work anyway. An internal link has the hash of the note it links to.
If you export such a note, how would you link to a separate PDF file (even if you translated the hash and link to the note name + extension? (Please note that you can have the same title for different notes.)

note A and B will create 2 PDFs: A.pdf and B.pdf. So how do you create a link to B.pdf in A.pdf?
This cannot work.

not even with A.html and B.html?

Maybe, but how? Do you just use relative links? Thus they must exist in the same directory?
But even then. As I said, you could have 2 links to 2 different notes, but they have the same title. So how do you solve this problem?

yes relative links, both in the same directory. Having the same title won't happen in Windows file system, it won't accept it. so the export tool in Joplin should change the name (suffixing it with 1 for example) if there are 2 notes with the same title. In any case if this is the only issue, we (users) can live with warning not to have 2 notes with the same title.

That would work like resource links work now - so it would translate from [note](:/someid) to <a href="./someid.md">note</a>.

Not sure if that can work at all for PDF though.

Sorry for being dense but I do not understand the purpose of this. It sounds almost like trying to use Joplin as a kind of eBook or web-site creator.

Also what happens when:

  • Note A is linked to Note B and Note C
  • Note B is linked to Note D
  • You export Notes A & B

What would Joplin do with the A > C link or the B > D link? It cannot create links as you have not exported the note. So Note A will have one working and one broken link and Note B will not have any working links and you cannot tell if any actually work until you click them.

If the notes are created, edited, linked and viewed in Joplin then there is no problem as that is what Joplin is for; organising notes, not publishing them.

What am I missing?

1 Like

Not all people use note-taking apps to keep notes there, lots of people use it to produce (blogs, books, academic papers) not in the final production, but for data collection and organziations (there are some lilterature in the subject even). So conversion to other formats with full functionality is needed, othewise converters wouldn't be created in the first place.

As for the broken links, it is the responsibility of the user.

I think this should not be part of the core, at least, the core should not and cannot be compatible with all tools. For example, I created joplin-blog to export joplin notes to blog, but currently only supports hexo/vuepress, there are specific directory rules when exporting them, and I plan to export them to docsify (company documents) and upload pictures to Figure bed, the integrated translation tool deepl and then publish it to dev.to, these are far from what the core of joplin can do.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.