Re: [Zim-wiki] Hidden text

2012-10-31 Thread Jaap Karssenberg
On Wed, Oct 31, 2012 at 7:43 AM, 1.John 1.j...@seznam.cz wrote:
 I am writing plug-in in which I would need to store additional info to same
 pages is there a way how to hide this info from zim?

Not really, unless you put some fields in the header.

-- 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] Hidden text

2012-10-31 Thread Fred McDavid
I did a little work on a plugin to hilite code snippets but hit a wall 
with non-pluggable tags that I think is the same that would prevent such 
hidden info.


I did a little hacking on the Dumper class in zim/formats/wiki.py to 
make tags pluggable, but so far it's not much to look at.


Jaap, do you have any plans to make this possible?  If not, would you 
mind if I took a stab at it (while sometimes asking for help)?


--Fred



On 2012-10-31 03:17, Jaap Karssenberg wrote:

On Wed, Oct 31, 2012 at 7:43 AM, 1.John 1.j...@seznam.cz wrote:
I am writing plug-in in which I would need to store additional info 
to same

pages is there a way how to hide this info from zim?


Not really, unless you put some fields in the header.

-- 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


--
Fred McDavid
founder, LandMetrics
f...@landmetrics.com
540.300.5263

___
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] Hidden text

2012-10-31 Thread Jaap Karssenberg
On Wed, Oct 31, 2012 at 3:33 PM, Fred McDavid f...@landmetrics.com wrote:
 I did a little work on a plugin to hilite code snippets but hit a wall with
 non-pluggable tags that I think is the same that would prevent such hidden
 info.

 I did a little hacking on the Dumper class in zim/formats/wiki.py to make
 tags pluggable, but so far it's not much to look at.

 Jaap, do you have any plans to make this possible?  If not, would you mind
 if I took a stab at it (while sometimes asking for help)?

I'm sorry, but a lost you at non-pluggable tags. Afraid I don't have
clue what you mean by that.

As a general comment, if you are hacking on the parser and dumper
classes, please use the pyzim-next branch.

Regards,

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] Hidden text

2012-10-31 Thread Fred McDavid
in the Dumper class, there's a dump_children method that loops thru 
elements and recursively calls itself in a way that (I think) precludes 
adding elements via the plugin mechanism.


I've been trying to pull this out of the loop:

elif element.tag == 'h':
level = int(element.attrib['level'])
if level  1:   level = 1
elif level  5: level = 5
tag = '='*(7 - level)
output.append(tag+' '+element.text+' '+tag)

On 2012-10-31 10:49, Jaap Karssenberg wrote:
On Wed, Oct 31, 2012 at 3:33 PM, Fred McDavid f...@landmetrics.com 
wrote:
I did a little work on a plugin to hilite code snippets but hit a 
wall with
non-pluggable tags that I think is the same that would prevent such 
hidden

info.

I did a little hacking on the Dumper class in zim/formats/wiki.py to 
make

tags pluggable, but so far it's not much to look at.

Jaap, do you have any plans to make this possible?  If not, would 
you mind

if I took a stab at it (while sometimes asking for help)?


I'm sorry, but a lost you at non-pluggable tags. Afraid I don't 
have

clue what you mean by that.

As a general comment, if you are hacking on the parser and dumper
classes, please use the pyzim-next branch.

Regards,

Jaap


--
Fred McDavid
founder, LandMetrics
f...@landmetrics.com
540.300.5263

___
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] Hidden text (resend)

2012-10-31 Thread Fred McDavid
in the Dumper class, there's a dump_children method that loops thru 
elements and recursively calls itself in a way that (I think) precludes 
adding elements via the plugin mechanism.


I've been trying to pull this out of the loop:

elif element.tag == 'h':
level = int(element.attrib['level'])
if level  1:   level = 1
elif level  5: level = 5
tag = '='*(7 - level)
output.append(tag+' '+element.text+' '+tag)

and replace it with

def 
element_dumper_h(dumper,element,list,output,list_level=-1,list_type=None,list_iter='0'):

level = int(element.attrib['level'])
if level  1:   level = 1
elif level  5: level = 5
tag = '='*(7 - level)
output.append(tag+' '+element.text+' '+tag)
DumperClass.registerElementDumper( 'h', element_dumper_h )

I think it'll make it easier to write plugins that can extend the wiki 
syntax.


I'l have a look at the pyzim-next branch.

Regards,

--Fred

On 2012-10-31 10:49, Jaap Karssenberg wrote:
On Wed, Oct 31, 2012 at 3:33 PM, Fred McDavid f...@landmetrics.com 
wrote:
I did a little work on a plugin to hilite code snippets but hit a 
wall with
non-pluggable tags that I think is the same that would prevent such 
hidden

info.

I did a little hacking on the Dumper class in zim/formats/wiki.py to 
make

tags pluggable, but so far it's not much to look at.

Jaap, do you have any plans to make this possible?  If not, would 
you mind

if I took a stab at it (while sometimes asking for help)?


I'm sorry, but a lost you at non-pluggable tags. Afraid I don't 
have

clue what you mean by that.

As a general comment, if you are hacking on the parser and dumper
classes, please use the pyzim-next branch.

Regards,

Jaap


--
Fred McDavid
founder, LandMetrics
f...@landmetrics.com
540.300.5263

--
Fred McDavid
founder, LandMetrics
f...@landmetrics.com
540.300.5263

___
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