← Back to team overview

zim-wiki team mailing list archive

Re: newbie here: info request (for import)


After a bit of python-learning, I wrote my script.
It nicely crawls a given subtree, and generates all the Zim-files in a common directory. Each file has the correct syntax (see example appended), with links to children&parents. I've still a point I dont understand concerning the ability of Zim to recognize my structure: 1) if I start zim by itself, it gives me this warning on the command line: "WARNING: Filesystem encoding is set to ASCII or Latin1, using UTF-8 instead", and a warning box with "Upgrade Notebook? This notebook was created by an older of version of zim...." 2) if I do as you suggest, zim --index . , I got 2 warnings on the command line: "WARNING: Filesystem encoding is set to ASCII or Latin1, using UTF-8 instead\nWARNING: This notebook needs to be upgraded to the latest data format", and when I start zim I have however the Upgrade Notebook? warning box.
So, I do not see the point of doing zim --index .
Also, what'sup with the encoding? They are plain text files, as you can see, e.g.:

$> cat campostela.txt
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2010-09-21T15:11:44.575864

====== /0ale/Archive/nastri/campostela ======
Created Tuesday 21 September 2010



thanks for any help...


On 09/17/2010 05:31 PM, Jaap Karssenberg wrote:
On Fri, Sep 17, 2010 at 3:58 PM, Alessandro Magni<magni@xxxxxxxx>  wrote:
  sorry if it's the wrong place to ask:

I just discovered this wiki and find it very promising for what I'd like to
do - a simple way to manage my workplace.

My problem - and I'd like to know if Zim can solve it - is to take my
workplace, i.e. my work directory structure, and in some way import into the
wiki, in such a way that for each folder in my directory structure I would
have a Zim node.
I really cannot do it manually, since my folder structure is a child of many
years of work, and the current output of: find /0ale/ -type d | wc gives me
11875 folders :-)
As you mention zim uses plain text files for the pages. However there
is a header of a few lines on the top of each file. You can do two

1) Just put all text files in a folder and open that folder as a zim notebook.

Zim will miss config files and prompt you to update the notebook.
Doing so will add headers to all text files. The disadvantage is that
for such a large structure this may take a long time and maybe not so
easy to check progress.

2) First create an empty notebook and than add files using a small
script to add the headers.

Advantage is that you control the process. Disadvantage is that you
need to do a bit hacking yourself.

Couple of notes that may apply for both cases:
* To avoid waiting a long time for the index to build you can run "zim
--index /path" in the terminal to rebuild a sane index of all files.
* Any character sequences in your files that conflict with the zim
wiki syntax may have unforseen results

Of course it is wise to have backups when you try this, I would also
advise to put the zim notebook under version control before importing
the data, so it is easier to track and rollback small errors.

Hope this helps,



/  Dr.Alessandro Magni
\        Electromagnetics Division
/        INRiM Strada delle Cacce 91, 10135 Torino (ITALIA)
\        Email magni@xxxxxxxx
/        Tel: 0039-011-3919821  Fax: 0039-011-3919834
\        URL http://www.inrim.it/~magni
/ Our business in life is not to succeed but to continue to fail
\ in high spirits.  -- Robert Louis Stevenson

Follow ups