← Back to team overview

zim-wiki team mailing list archive

Re: Interwiki links for Zim Desktop Wiki on Windows

 

Hi Jaap,

Thanks again for your followup.

This is what I tried next:
(1) remove urls.list file that I created
(2) replaced all spaces by underscores in notebook names in the file
notebooks.list in C:\Users\Jason\.config\zim\ directory
(3) tried my link Electronics? - nothing happened, so I ran it from cmd
with the --debug flag.  Two things I noticed:

(a) Error dialog: "Could not find notebook
file:///C:/Users/Jason/Notebooks/Master/zim
(Master is the name of the notebook that I try to place the link in).

(b) I opened the zim.exe.log file and see this line near the bottom:

INFO: Spawning: ['C:\\Program Files (x86)\\Zim Desktop Wiki\\zim.exe',
'zim', 'zim+file:///C:/Users/Jason/Notebooks/Electronics?', '--no-daemon']
(cwd: None)

(I'm guessing this is a copy of the command that is issued to open the
notebook being linked to).

Two things I find strange: (a) the /zim appended to the end of the file of
the notebook I am working in,
(b) that the error reports that the file of the notebook I am working in
(where I put the link) is not being found, rather than the notebook I am
trying to link to is not being found.  I would have guessed that it would
report that it cannot find the notebook that I am trying to link to.

Sorry for so many e-mails.  I'm starting to wonder if I am doing something
really stupid.

Jason

On Fri, Oct 23, 2015 at 1:22 PM, Jaap Karssenberg <
jaap.karssenberg@xxxxxxxxx> wrote:

> Hi Jason,
>
> I just had a look at the parsing of the url.list format. The parser splits
> the line at the first space, all subsequent text is taken as the url.
>
> So the name or "key" that you use in the interwiki link should not contain
> any spaces. Typically these are abreviations, so you want to keep them
> short anyway.
>
> The URL is allowed to contain spaces and is handed to the application
> handling the link without further processing. For file links I recommend
> using spaces instead of "%20" because most applications (including zim)
> just remove the "file:///" bit and assume the rest to be a valid file path.
>
> The "Master NOtebook" example in your last mail probably fails due to the
> "%20".
>
> The "Electronics" example you used earlier should work though. Try the
> "--debug" check on that one. However I wouldn't count on zim being fully
> robust for "nested" notebooks. It might just open the toplevel notebook
> instead.
>
> Regards,
>
> Jaap
>
>
> On Fri, Oct 23, 2015 at 6:07 PM, Jason McLafferty <
> jason.mclafferty@xxxxxxxxx> wrote:
>
>> Hi Jaap,
>>
>> Thank you for your reply.
>>
>> Yes, my entire 'urls.list' file is links to other notebooks, so it seems
>> the right way to do this then is to not worry about creating my own
>> urls.list for notebooks.
>>
>> However, the link is still not working and Mariano's comment about the
>> spaces in a lot of my notebook names has me wondering if this is creating a
>> problem?  Also, my Electronics notebook, which I am trying to link to (and
>> does not have spaces in the file URL) does appear below a notebook which
>> does have spaces in its name and file URL - could it be what he said
>> regarding an earlier failure in reading the list, due to spaces, that leads
>> to the failure?
>>
>> I did try the suggestion of running "zim --debug".  When the notebook
>> open dialog appears, I chose the notebook that I am trying to create the
>> link in.  Then I put the link, click on it, and I get an error message:
>> "Could not find the notebook:
>> file:///C:/Users/Jason/Notebooks/Master%20Notebook/zim.
>>
>> That notebook (Master Notebook) is where I am trying to place the link,
>> not the notebook I am linking to.
>>
>> Jason
>>
>> On Fri, Oct 23, 2015 at 11:41 AM, Jaap Karssenberg <
>> jaap.karssenberg@xxxxxxxxx> wrote:
>>
>>> Stupid question, but are all your interwiki links to other zim
>>> notebooks?
>>>
>>> If so, you shoudl not need to configure the urls.list file at all. Check
>>> the "open another notebook" dialog in zim, all notebooks listed there
>>> should already be recognized as interwiki links.
>>>
>>> In the properties dialog you can set an interwiki keyword for the
>>> noteobook as well. This is used to set a short name to refer to.
>>>
>>> Is that what you are looking for?
>>>
>>>
>>> Otherwise, try running "zim --debug". When you click the link, debug
>>> info should show which urls.list file zim is reading and how it converted
>>> the link.
>>>
>>> Regards,
>>>
>>> Jaap
>>>
>>>
>>>
>>>
>>>
>>> On Fri, Oct 23, 2015 at 5:32 PM, Mariano Draghi <mdraghi@xxxxxxxxx>
>>> wrote:
>>>
>>>> Hi Jason,
>>>>
>>>> I suppose the space might be a problem in the first example. The space
>>>> encoded as "%20" in the URL part might be supported (I really don't know
>>>> for sure), but I'm sure that you cannot define an interwiki prefix with
>>>> spaces in between. At least not in Zim. Zim expects the format of the
>>>> urls.list file to be "prefix url" (i.e., prefix, blank, url), so if your
>>>> prefix has a blank in between, you're not using the expected syntax. You
>>>> should change the first part to "CurveFitting" or "Curve_Fitting" or
>>>> something like that.
>>>>
>>>> The Electronics example looks more or less right, except for the extra
>>>> forward-slash and the ":" in between. But if you have already tried the
>>>> syntax I used, and it still didn't work, then I am really out of ideas :(
>>>>
>>>> At first I thought that the "Electronics?" link would be invalid (I
>>>> never used such syntax), but I've just tested it in my computer (using
>>>> "work?"), and it opens my Work notebook as you would expect. And the other
>>>> example ("Electronics?Multimeter") looks perfectly normal.
>>>>
>>>> Maybe the Electronics interwiki-prefix is not working because Zim
>>>> didn't like the space in the other prefix and aborted the parsing of the
>>>> urls.list file (or disabled the feature completely) before reading the
>>>> Electronics line. I'm just guessing... but it might be a good idea to get
>>>> the format right with a simpler urls.list file, with just one example
>>>> (maybe the Electronics one), so you are sure that any line with wrong or
>>>> unexpected syntax is preventing the whole feature from working. Once you
>>>> have one case working, you might try adding the other ones.
>>>>
>>>> One last thing: make sure you're completely closing Zim before changing
>>>> the urls.list file, and that it is not running in the background or
>>>> systray. I'm not sure if Zim would detect any changes to that kind of
>>>> configuration once it's running.
>>>>
>>>> Sorry, I don't know what else to suggest. Maybe some other user catches
>>>> something we're missing.
>>>>
>>>> Regards,
>>>>
>>>> --
>>>> Mariano
>>>>
>>>>
>>>>
>>>>
>>>> El vie., 23 de oct. de 2015 a la(s) 11:35 a. m., Jason McLafferty <
>>>> jason.mclafferty@xxxxxxxxx> escribió:
>>>>
>>>>> Hi Mariano,
>>>>>
>>>>> Thank you again for your quick reply!  I really appreciate your
>>>>> detailed example.
>>>>>
>>>>> My urls.list is at the same location as yours (different username of
>>>>> course) following your advice in your first response.
>>>>>
>>>>> I used a program to generate my urls.list file (my boss wrote it) that
>>>>> takes a .txt file of the contents of the Notebooks directory, and creates
>>>>> the urls.list file.  Here is one example from my urls.list:
>>>>>
>>>>> Curve Fitting zim+file:///c:/Users/Jason/Notebooks/Curve%20Fitting
>>>>>
>>>>> (I added percent encoding for the spaces in the file URL because it
>>>>> looks like Windows needs this, from what I have read).
>>>>>
>>>>> To test notebook linking, I used a different notebook which has no
>>>>> space to be sure that wasn't the issue:
>>>>>
>>>>> Electronics zim+file:///c:/Users/Jason/Notebook/Electronics
>>>>>
>>>>> I tried two styles of links,
>>>>> (1) Electronics? (which I assumed would open the entire notebook)
>>>>> (2) Electronics?Multimeter (which I assumed would open the Multimeter
>>>>> page in the Electronics notebook).
>>>>>
>>>>> In both cases, clicking the link produces no action.
>>>>>
>>>>> The only thing standing out to me right now is that my file URLs look
>>>>> a bit different than yours (I have three slashes after "file" and a ":"
>>>>> after c, whereas you have two slashes after "file" and no ":" after C), but
>>>>> I tried changing the format of mine to look like yours, but that did not
>>>>> affect the result.
>>>>>
>>>>> Maybe you will see something I missed.
>>>>>
>>>>> Thanks again,
>>>>>
>>>>> Jason
>>>>>
>>>>>
>>>>>
>>>>> On Fri, Oct 23, 2015 at 9:56 AM, Mariano Draghi <mdraghi@xxxxxxxxx>
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Maybe there's a problem with the URL you are writing in the urls.list
>>>>>> file and/or the way you are using the interwiki link?
>>>>>>
>>>>>> Let's see a concrete example:
>>>>>>
>>>>>> - my username in Windows is "mariano", so the %APPDATA% folder
>>>>>> resolves to:
>>>>>> C:\Users\mariano\AppData\Roaming
>>>>>>
>>>>>> - in there I have a urls.list file, in the following location:
>>>>>> C:\Users\mariano\AppData\Roaming\zim\data\zim\urls.list
>>>>>>
>>>>>> - I have two Zim Notebooks, "Personal" and "Work", in the following
>>>>>> locations (these are the folders where each "notebook.zim" file is located):
>>>>>> C:\Users\mariano\Dropbox\Notebooks\Personal
>>>>>> C:\Users\mariano\Dropbox\Notebooks\Work
>>>>>>
>>>>>> - In the urls.list file, I declared an "interwiki" prefix for the
>>>>>> Work notebook, with the following line:
>>>>>> work zim+file://C/Users/mariano/Dropbox/Notebooks/Work
>>>>>>
>>>>>> - With that configuration, then if I open my Personal notebook and
>>>>>> insert a link like this:
>>>>>> work?Home:Projects
>>>>>> Then when I clic it a new instance of Zim is opened, with the Work
>>>>>> notebook, and the page Home->Projects.
>>>>>>
>>>>>> Are you doing more or less something like this?
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> --
>>>>>> Mariano
>>>>>>
>>>>>>
>>>>>>
>>>>>> El vie., 23 de oct. de 2015 a la(s) 10:44 a. m., Jason McLafferty <
>>>>>> jason.mclafferty@xxxxxxxxx> escribió:
>>>>>>
>>>>>>> Hi Mariano,
>>>>>>>
>>>>>>> I greatly appreciate your quick reply, however I am sad to report
>>>>>>> that my links still do not work.  Any other suggestions I might try?
>>>>>>> Thanks!
>>>>>>>
>>>>>>> Jason
>>>>>>>
>>>>>>> On Fri, Oct 23, 2015 at 8:05 AM, Mariano Draghi <mdraghi@xxxxxxxxx>
>>>>>>> wrote:
>>>>>>>
>>>>>>>>
>>>>>>>> Hi Jason,
>>>>>>>>
>>>>>>>> The location of the XDG folders in Windows is a little bit weird...
>>>>>>>> you should put your urls.list in the folder
>>>>>>>> %APPDATA%/zim/data/zim
>>>>>>>>
>>>>>>>> i.e., there should be an extra "zim" folder inside "data". Weird,
>>>>>>>> yes. But it works :)
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>> --
>>>>>>>> Mariano
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> El vie., 23 de oct. de 2015 a la(s) 5:43 a. m., Jason McLafferty <
>>>>>>>> jason.mclafferty@xxxxxxxxx> escribió:
>>>>>>>>
>>>>>>>>> Hi all,
>>>>>>>>>
>>>>>>>>> I am using Zim on Windows 7.  I am trying to add my Zim notebooks
>>>>>>>>> to the urls.list file using the "zim+file://" method described here:
>>>>>>>>>
>>>>>>>>> http://zim-wiki.org/manual/Help/Config_Files.html
>>>>>>>>>
>>>>>>>>> I use ctrl+L to add a link to a notebook as name_of_notebook?,
>>>>>>>>> which creates a link, but when I click on it, nothing happens.
>>>>>>>>>
>>>>>>>>> One thing I noticed when I was working through setting this up, is
>>>>>>>>> that on my system, the directories APPDATA/zim/config and APPDATA/zim/data
>>>>>>>>> do not exist (I checked where APPDATA is on my computer with cmd by typing
>>>>>>>>> cd %appdata% and noting the new directory).  Not being sure if this is
>>>>>>>>> significant or not, I did some poking around in Explorer and found the
>>>>>>>>> following directory: C:\Users\Jason\.config\zim in which I find files like
>>>>>>>>> preferences.conf and style.conf.  I tried putting my urls.list file,
>>>>>>>>> containing all my notebooks and formatted as name-space-zim+file:// in both
>>>>>>>>> of these directories (APPDATA/zim/data and C:\Users\Jason\.config\zim), but
>>>>>>>>> still I do not get a working link.
>>>>>>>>>
>>>>>>>>> Any suggestions to where I am going wrong?
>>>>>>>>>
>>>>>>>>> Thank you,
>>>>>>>>>
>>>>>>>>> Jason
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> Mailing list: https://launchpad.net/~zim-wiki
>>>>>>>>> Post to     : zim-wiki@xxxxxxxxxxxxxxxxxxx
>>>>>>>>> Unsubscribe : https://launchpad.net/~zim-wiki
>>>>>>>>> More help   : https://help.launchpad.net/ListHelp
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~zim-wiki
>>>> Post to     : zim-wiki@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~zim-wiki
>>>> More help   : https://help.launchpad.net/ListHelp
>>>>
>>>>
>>>
>>
>

Follow ups

References