Re: [Zim-wiki] mime type of zim notes

2011-12-05 Thread Jaap Karssenberg
All,

We have had this discussion before. I'm not against changing the extension
for zim notes, but only on the condition that we have a clear file
extension. The .note suggested above is something I would consider as it
is human readable - but not sure if we can use that if it is already in use
by Tomboy.

Suggestions I rejected i nthe past include .zim - which is used for the
notebook config, .wiki as being to generic (although I might reconsider
that one) and more cryptic combinations like zwk for zim-wiki etc.

Regards,

Jaap


On Mon, Dec 5, 2011 at 3:53 AM, Michael Mulqueen mich...@mulqueen.me.ukwrote:

 Hi Marcel and Svenn,

 Obviously Jaap will have to decide as it's his project. But I'd be
 very much in favour of using a different file extension for zim's
 files. I see only benefits. We gain the ability to do a fast mimetype
 determination and with it the ability to integrate into things like
 Zeitgeist. It won't change the ability to open zim files in a plain
 text editor such as vim or gedit. In fact, if anyone needs this, all
 they need to do is change the default program for the mimetype (which
 is easily done from Nautilus) or access from the open dialogue of the
 program. I note that the mime file for zim describes zim's format as a
 subset of plain text, so you would hope that anything that struggled
 with the idea of text/x-zim-wiki would see text/plain and treat it as
 such.

 I can't remember for sure, but I seem to recall older versions of zim
 (perhaps even back to the Perl Zim) not having the current header
 information etc. that they do. Perhaps Jaap could confirm whether I'm
 imagining this or not. In those days, it would obviously make sense
 for them to be referred to as plain text, because that's actually all
 they were. Now it's closer to file format in its own right.

 Regards,
 Mike

 On Sun, Dec 4, 2011 at 10:09 PM, Svenn Are Bjerkem
 svenn.bjer...@googlemail.com wrote:
  On 4 December 2011 22:49, Marcel Stimberg
  stimb...@users.sourceforge.net wrote:
  Hi Michael,
  I think there are two solutions to this problem:
  * Register the .txt extension for the text/x-zim-wiki mime type --
  this has the small disadvantage that for all .txt files, a time-costly
  (relatively speaking) content lookup has to be performed
  * Use a different extension for zim notes (e.g. Tomboy uses .note)
 
  Any thoughts on this?
 
  I really would like to see zim accept that .txt files are pure text
  files and not supposed to be interpreted. Maybe making the extension
  configurable in the notebook.zim file? Using 'find' or 'locate' in
  unix looking for files with ending .txt seldom show me only my zim
  notebook pages.
 
  --
  Svenn
 
  ___
  Mailing list: https://launchpad.net/~zim-wiki
  Post to : zim-wiki@lists.launchpad.net
  Unsubscribe : https://launchpad.net/~zim-wiki
  More help   : https://help.launchpad.net/ListHelp

 ___
 Mailing list: https://launchpad.net/~zim-wiki
 Post to : zim-wiki@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~zim-wiki
 More help   : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp


Re: [Zim-wiki] mime type of zim notes

2011-12-05 Thread Svenn Are Bjerkem
On 5 December 2011 15:43, Jaap Karssenberg jaap.karssenb...@gmail.com wrote:
 All,

 We have had this discussion before. I'm not against changing the extension
 for zim notes, but only on the condition that we have a clear file
 extension. The .note suggested above is something I would consider as it
 is human readable - but not sure if we can use that if it is already in use
 by Tomboy.

Well, I guess zim has attracted new users, and old users are testing
the limits of what zim can be used for. If it is not completely
impossible to make the zim wiki file extensions configurable, I think
that would be a good solution. Then I could use .z1m or .z1mw1k1 and
would never expect to collide with any other mime in the world. Well I
would have to change the mime type myself, but that would be ok.

-- 
Svenn

___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp


Re: [Zim-wiki] mime type of zim notes

2011-12-05 Thread Brendan Kidwell
My personal opinion is that this would be a good change, for the
reasons currently on the table. I would use the file extension
.zimpage or .zimnote.

Also, what happens if you shell-launch a Zim page file from the
desktop file manager or search tool using the executable zim? Does
it explore up the tree to find a notebook.zim file, open the whole
notebook and navigate to the page? If not I think it should. How much
work would that be?



On 12/5/11, Jaap Karssenberg jaap.karssenb...@gmail.com wrote:
 All,

 We have had this discussion before. I'm not against changing the extension
 for zim notes, but only on the condition that we have a clear file
 extension. The .note suggested above is something I would consider as it
 is human readable - but not sure if we can use that if it is already in use
 by Tomboy.

 Suggestions I rejected i nthe past include .zim - which is used for the
 notebook config, .wiki as being to generic (although I might reconsider
 that one) and more cryptic combinations like zwk for zim-wiki etc.

 Regards,

 Jaap


 On Mon, Dec 5, 2011 at 3:53 AM, Michael Mulqueen
 mich...@mulqueen.me.ukwrote:

 Hi Marcel and Svenn,

 Obviously Jaap will have to decide as it's his project. But I'd be
 very much in favour of using a different file extension for zim's
 files. I see only benefits. We gain the ability to do a fast mimetype
 determination and with it the ability to integrate into things like
 Zeitgeist. It won't change the ability to open zim files in a plain
 text editor such as vim or gedit. In fact, if anyone needs this, all
 they need to do is change the default program for the mimetype (which
 is easily done from Nautilus) or access from the open dialogue of the
 program. I note that the mime file for zim describes zim's format as a
 subset of plain text, so you would hope that anything that struggled
 with the idea of text/x-zim-wiki would see text/plain and treat it as
 such.

 I can't remember for sure, but I seem to recall older versions of zim
 (perhaps even back to the Perl Zim) not having the current header
 information etc. that they do. Perhaps Jaap could confirm whether I'm
 imagining this or not. In those days, it would obviously make sense
 for them to be referred to as plain text, because that's actually all
 they were. Now it's closer to file format in its own right.

 Regards,
 Mike

 On Sun, Dec 4, 2011 at 10:09 PM, Svenn Are Bjerkem
 svenn.bjer...@googlemail.com wrote:
  On 4 December 2011 22:49, Marcel Stimberg
  stimb...@users.sourceforge.net wrote:
  Hi Michael,
  I think there are two solutions to this problem:
  * Register the .txt extension for the text/x-zim-wiki mime type --
  this has the small disadvantage that for all .txt files, a time-costly
  (relatively speaking) content lookup has to be performed
  * Use a different extension for zim notes (e.g. Tomboy uses .note)
 
  Any thoughts on this?
 
  I really would like to see zim accept that .txt files are pure text
  files and not supposed to be interpreted. Maybe making the extension
  configurable in the notebook.zim file? Using 'find' or 'locate' in
  unix looking for files with ending .txt seldom show me only my zim
  notebook pages.
 
  --
  Svenn
 
  ___
  Mailing list: https://launchpad.net/~zim-wiki
  Post to : zim-wiki@lists.launchpad.net
  Unsubscribe : https://launchpad.net/~zim-wiki
  More help   : https://help.launchpad.net/ListHelp

 ___
 Mailing list: https://launchpad.net/~zim-wiki
 Post to : zim-wiki@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~zim-wiki
 More help   : https://help.launchpad.net/ListHelp



___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp


Re: [Zim-wiki] mime type of zim notes

2011-12-05 Thread Jaap Karssenberg
On Mon, Dec 5, 2011 at 5:27 PM, Brendan Kidwell sn...@glump.net wrote:

 Also, what happens if you shell-launch a Zim page file from the
 desktop file manager or search tool using the executable zim? Does
 it explore up the tree to find a notebook.zim file, open the whole
 notebook and navigate to the page?


Yes it does that already for quite some time - try it out some time :)

-- Jaap
___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp


Re: [Zim-wiki] mime type of zim notes

2011-12-04 Thread Michael Mulqueen
Hi Marcel,

I can confirm this on Arch Linux with gvfs 1.10.1-1. I suppose it's to
be somewhat expected considering it actually is a plain text file and
this was a design goal of zim (to have human readable raw files). I've
had a quick look over /usr/share/mime/packages/zim.xml and everything
looks in order. The command xdg-mime query filetype
/path/to/zim/file.txt also gives text/plain. xdg-mime is the reference
implementation of the specification, so I think there might be
something wrong with the way zim declares the mime type.

You may find the following reference useful:
http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec

Regards,
Mike

On Sun, Dec 4, 2011 at 1:21 PM, Marcel Stimberg
stimb...@users.sourceforge.net wrote:
 Hi all,

 after letting the code rot for a while, I finally want to finish the
 Zeitgeist integration plugin for zim[1]. However, the usefulness is
 currently reduced because the mime type of zim pages is not correctly
 detected by my system (Ubuntu 11.10) -- did anyone else notice this as
 well? The file utility works fine, but the Gnome environment (e.g.
 nautilus) just recognizes the file type as text/plain:

 $file foo.txt
 foo.txt: text/x-zim-wiki
 $ gvfs-info foo.txt | grep content-type
  standard::content-type: text/plain
  standard::fast-content-type: text/plain

 Thanks,
  Marcel

 [1] https://bugs.launchpad.net/zim/+bug/610515

 ___
 Mailing list: https://launchpad.net/~zim-wiki
 Post to     : zim-wiki@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~zim-wiki
 More help   : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp


Re: [Zim-wiki] mime type of zim notes

2011-12-04 Thread Marcel Stimberg
Hi Michael,

thanks for the confirmation. I looked a bit more into the subject and
found the reason for the observed behaviour -- in fact, a quite simple
reason: For determining the file type, it is recommended (and
implemented by xdg-open etc.) to first look at the glob pattern (i.e.
normally the file extension) and only then to look at the file
content. And as zim notes have the extension .txt, they are recognized
as text/plain which registers this extension.

I think there are two solutions to this problem:
* Register the .txt extension for the text/x-zim-wiki mime type --
this has the small disadvantage that for all .txt files, a time-costly
(relatively speaking) content lookup has to be performed
* Use a different extension for zim notes (e.g. Tomboy uses .note)

Any thoughts on this?

Cheers,
  Marcel

___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp


Re: [Zim-wiki] mime type of zim notes

2011-12-04 Thread Svenn Are Bjerkem
On 4 December 2011 22:49, Marcel Stimberg
stimb...@users.sourceforge.net wrote:
 Hi Michael,
 I think there are two solutions to this problem:
 * Register the .txt extension for the text/x-zim-wiki mime type --
 this has the small disadvantage that for all .txt files, a time-costly
 (relatively speaking) content lookup has to be performed
 * Use a different extension for zim notes (e.g. Tomboy uses .note)

 Any thoughts on this?

I really would like to see zim accept that .txt files are pure text
files and not supposed to be interpreted. Maybe making the extension
configurable in the notebook.zim file? Using 'find' or 'locate' in
unix looking for files with ending .txt seldom show me only my zim
notebook pages.

-- 
Svenn

___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp


Re: [Zim-wiki] mime type of zim notes

2011-12-04 Thread Michael Mulqueen
Hi Marcel and Svenn,

Obviously Jaap will have to decide as it's his project. But I'd be
very much in favour of using a different file extension for zim's
files. I see only benefits. We gain the ability to do a fast mimetype
determination and with it the ability to integrate into things like
Zeitgeist. It won't change the ability to open zim files in a plain
text editor such as vim or gedit. In fact, if anyone needs this, all
they need to do is change the default program for the mimetype (which
is easily done from Nautilus) or access from the open dialogue of the
program. I note that the mime file for zim describes zim's format as a
subset of plain text, so you would hope that anything that struggled
with the idea of text/x-zim-wiki would see text/plain and treat it as
such.

I can't remember for sure, but I seem to recall older versions of zim
(perhaps even back to the Perl Zim) not having the current header
information etc. that they do. Perhaps Jaap could confirm whether I'm
imagining this or not. In those days, it would obviously make sense
for them to be referred to as plain text, because that's actually all
they were. Now it's closer to file format in its own right.

Regards,
Mike

On Sun, Dec 4, 2011 at 10:09 PM, Svenn Are Bjerkem
svenn.bjer...@googlemail.com wrote:
 On 4 December 2011 22:49, Marcel Stimberg
 stimb...@users.sourceforge.net wrote:
 Hi Michael,
 I think there are two solutions to this problem:
 * Register the .txt extension for the text/x-zim-wiki mime type --
 this has the small disadvantage that for all .txt files, a time-costly
 (relatively speaking) content lookup has to be performed
 * Use a different extension for zim notes (e.g. Tomboy uses .note)

 Any thoughts on this?

 I really would like to see zim accept that .txt files are pure text
 files and not supposed to be interpreted. Maybe making the extension
 configurable in the notebook.zim file? Using 'find' or 'locate' in
 unix looking for files with ending .txt seldom show me only my zim
 notebook pages.

 --
 Svenn

 ___
 Mailing list: https://launchpad.net/~zim-wiki
 Post to     : zim-wiki@lists.launchpad.net
 Unsubscribe : https://launchpad.net/~zim-wiki
 More help   : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~zim-wiki
Post to : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp