Zim

Can I change InterWiki links on HTML export?

Asked by David

I have multiple notebooks that I connect with InterWiki links. These work great while using Zim on the desktop.

When I export to HTML, external InterWiki links (e.g. wp?wiki ) continue to work. Desktop links, however, don't work as expected.

Desktop links continue to point to local files. But if I want to upload the HTML somewhere, this does not make sense (and reveals potentially sensitive information about my directory hierarchy).

Is it possible to change the InterWiki value for some/all InterWiki links only when exporting to HTML? e.g. When using Zim on the desktop, they open Zim notebooks as expected, when exporting to HTML they use a URL (like wp?wiki ).

Finally (and I suspect this would be an enhancement request) would it be possible to disable InterWiki links on export?

Question information

Language:
English Edit question
Status:
Solved
For:
Zim Edit question
Assignee:
No assignee Edit question
Solved by:
Jaap Karssenberg
Solved:
Last query:
Last reply:
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#1

I'm afraid I do not fully understand the questions. You say interwiki links
work as expected, but desktop file links do not work.

Is the issue with links to local files or with interwiki links? (They are
not the same).

Regards,

Jaap

On Mon, May 19, 2014 at 11:21 AM, d❤vid seaward <
<email address hidden>> wrote:

> New question #248870 on Zim:
> https://answers.launchpad.net/zim/+question/248870
>
> I have multiple notebooks that I connect with InterWiki links. These work
> great while using Zim on the desktop.
>
> When I export to HTML, external InterWiki links (e.g. wp?wiki ) continue
> to work. Desktop links, however, don't work as expected.
>
> Desktop links continue to point to local files. But if I want to upload
> the HTML somewhere, this does not make sense (and reveals potentially
> sensitive information about my directory hierarchy).
>
> Is it possible to change the InterWiki value for some/all InterWiki links
> only when exporting to HTML? e.g. When using Zim on the desktop, they open
> Zim notebooks as expected, when exporting to HTML they use a URL (like
> wp?wiki ).
>
> Finally (and I suspect this would be an enhancement request) would it be
> possible to disable InterWiki links on export?
>
> --
> You received this question notification because you are an answer
> contact for Zim.
>

Revision history for this message
David (lofidevops) said :
#2

Sorry, I wasn't clear.

InterWiki links work when using Zim on the desktop.

InterWiki links do not work when exporting to HTML. Instead they point to desktop file locations, which doesn't work if I upload the HTML somewhere and access the HTML from a different machine. I would like them to point to a URL instead (but only when exporting to HTML).

e.g. on my desktop Book?Name opens Zim notebook "Book" at page "Name", but when I export to HTML Book?Name opens URL http://www.example.com/Name instead

Revision history for this message
David (lofidevops) said :
#3

One possibility that occurred to me is that I could store alternate InterWiki URLs in a different profile. Then I could:

 * Edit wiki using default profile
 * Click on InterWiki links to open links in Zim notebooks
 * Change to an "Export profile"
 * Export to HTML and upload it somewhere
 * Click on InterWiki links to open links at external URLs
 * Change to "default profile" for further editing

Is this possible? I'm planning on writing a script to do the HTML export, so it wouldn't be too much of a hassle once I did it once (assuming all these steps are scriptable).

I'm open to other suggestions too :)

Revision history for this message
Best Jaap Karssenberg (jaap.karssenberg) said :
#4

Sounds like something we should support in the export function. Do you
really need individual mapping of the URLs, or would it work to have a
single "prefix" for mapping local file locations to an URL ?

For comparison, we do something similar with the "document root" where you
have a special folder that on export can map to an URL.

Regards,

Jaap

On Mon, May 19, 2014 at 4:31 PM, d❤vid seaward <
<email address hidden>> wrote:

> Question #248870 on Zim changed:
> https://answers.launchpad.net/zim/+question/248870
>
> d❤vid seaward posted a new comment:
> One possibility that occurred to me is that I could store alternate
> InterWiki URLs in a different profile. Then I could:
>
> * Edit wiki using default profile
> * Click on InterWiki links to open links in Zim notebooks
> * Change to an "Export profile"
> * Export to HTML and upload it somewhere
> * Click on InterWiki links to open links at external URLs
> * Change to "default profile" for further editing
>
> Is this possible? I'm planning on writing a script to do the HTML
> export, so it wouldn't be too much of a hassle once I did it once
> (assuming all these steps are scriptable).
>
> I'm open to other suggestions too :)
>
> --
> You received this question notification because you are an answer
> contact for Zim.
>

Revision history for this message
David (lofidevops) said :
#5

I have only one other Notebook I plan to publish, so one URL would do for me, but I can imagine someone else publishing multiple Notebooks. Perhaps you could leverage the document root of the Notebook being linked to?

For now I will use a script to adjust the HTML post-export. Thanks for all the feedback.

Revision history for this message
David (lofidevops) said :
#6

Thanks Jaap Karssenberg, that solved my question.