Can 2html preserve the folding feature?

10 views
Skip to first unread message

anhnmncb

unread,
Dec 14, 2008, 6:51:32 PM12/14/08
to vim...@googlegroups.com
Hello, list,
I dont know if 2html can preserve the folding feature? So the transformed
target html will have the folding feature too, I can fold and unfold the
folding.

--
Regards,
anhnmncb

Markus Heidelberg

unread,
Dec 15, 2008, 2:03:00 AM12/15/08
to vim...@googlegroups.com
anhnmncb, 15.12.2008:

>
> Hello, list,
> I dont know if 2html can preserve the folding feature? So the transformed
> target html will have the folding feature too, I can fold and unfold the
> folding.

No, it can't, but it sounds interesting.

anhnmncb

unread,
Dec 15, 2008, 3:26:10 AM12/15/08
to vim...@googlegroups.com

Yes, very. :)

I have no knowledge about html, don't know if it's possible in technical.


--
Regards,
anhnmncb

Tony Mechelynck

unread,
Dec 15, 2008, 3:39:00 AM12/15/08
to vim...@googlegroups.com

I believe it would require javascript in the HTML; and I don't think
it's work the trouble. Now if someone wants to tackle it, why not?


Best regards,
Tony.
--
I used to work in a fire hydrant factory. You couldn't park anywhere
near the place.
-- Steven Wright

Ben Schmidt

unread,
Dec 15, 2008, 5:09:41 AM12/15/08
to vim...@googlegroups.com
Tony Mechelynck wrote:
> On 15/12/08 09:26, anhnmncb wrote:
>> On 2008-12-15, Markus Heidelberg wrote:
>>> anhnmncb, 15.12.2008:
>>>> Hello, list,
>>>> I dont know if 2html can preserve the folding feature? So the transformed
>>>> target html will have the folding feature too, I can fold and unfold the
>>>> folding.
>>> No, it can't, but it sounds interesting.
>> Yes, very. :)
>>
>> I have no knowledge about html, don't know if it's possible in technical.
>
> I believe it would require javascript in the HTML; and I don't think
> it's work the trouble. Now if someone wants to tackle it, why not?

Yes. The Javascript/HTML side of it is quite easy as long as the desired
behaviour can be clearly specified (this is not easy given nested folds,
etc.). The Vim side of it may not be so: I'm not sure if Vimscript can
reliably discover all it needs to know about folds to produce such
output. But maybe... I'll add it to my 'to do' list, which means I might
get to it eventually, but I might not, but it's something that does
vaguely interest me.

Smiles,

Ben.

François Ingelrest

unread,
Dec 15, 2008, 5:14:58 AM12/15/08
to vim...@googlegroups.com
On Mon, Dec 15, 2008 at 11:09, Ben Schmidt wrote:
>> I believe it would require javascript in the HTML; and I don't think
>> it's work the trouble. Now if someone wants to tackle it, why not?
>
> Yes. The Javascript/HTML side of it is quite easy as long as the desired
> behaviour can be clearly specified (this is not easy given nested folds,
> etc.). The Vim side of it may not be so: I'm not sure if Vimscript can
> reliably discover all it needs to know about folds to produce such
> output. But maybe... I'll add it to my 'to do' list, which means I might
> get to it eventually, but I might not, but it's something that does
> vaguely interest me.

Here's an easy way to do it with very little Javascript:

http://www.silent-blade.org/misc/toggle.html

This can be more complicated with nested folds, but not necessarily that much.

anhnmncb

unread,
Dec 15, 2008, 5:52:46 PM12/15/08
to vim...@googlegroups.com

I think nested folds supporting is a killer feature. When it completes, I
don't need any other formating tools to take my code or document presentation,
a html version is enough.


--
Regards,
anhnmncb

Bram Moolenaar

unread,
Dec 16, 2008, 2:24:47 PM12/16/08
to anhnmncb, vim...@googlegroups.com

anhnmncb wrote:

Yes, it would be very nice to have.

Should be possible to do this with <script> and <noscript> tags, so that
when there is no javascript it looks just like it does now.
And we need an option to disable generating the javascript.

Unfortunately I don't have time for this...

--
Arthur pulls Pin out. The MONK blesses the grenade as ...
ARTHUR: (quietly) One, two, five ...
GALAHAD: Three, sir!
ARTHUR: Three.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

anhnmncb

unread,
Dec 16, 2008, 6:54:13 PM12/16/08
to vim...@googlegroups.com
On 2008-12-16, Bram Moolenaar wrote:
>
>
> anhnmncb wrote:
>
>> > On Mon, Dec 15, 2008 at 11:09, Ben Schmidt wrote:
>> >>> I believe it would require javascript in the HTML; and I don't think
>> >>> it's work the trouble. Now if someone wants to tackle it, why not?
>> >>
>> >> Yes. The Javascript/HTML side of it is quite easy as long as the desired
>> >> behaviour can be clearly specified (this is not easy given nested folds,
>> >> etc.). The Vim side of it may not be so: I'm not sure if Vimscript can
>> >> reliably discover all it needs to know about folds to produce such
>> >> output. But maybe... I'll add it to my 'to do' list, which means I might
>> >> get to it eventually, but I might not, but it's something that does
>> >> vaguely interest me.
>> >
>> > Here's an easy way to do it with very little Javascript:
>> >
>> > http://www.silent-blade.org/misc/toggle.html
>> >
>> > This can be more complicated with nested folds, but not necessarily that much.
>>
>> I think nested folds supporting is a killer feature. When it
>> completes, I don't need any other formating tools to take my code or
>> document presentation, a html version is enough.
>
> Yes, it would be very nice to have.
>
> Should be possible to do this with <script> and <noscript> tags, so that
> when there is no javascript it looks just like it does now.
> And we need an option to disable generating the javascript.
>
> Unfortunately I don't have time for this...
Hmm, thanks anyway, I can wait :)


--
Regards,
anhnmncb

fritzophrenic

unread,
Dec 17, 2008, 12:28:44 AM12/17/08
to vim_use


On Dec 16, 5:54 pm, anhnmncb <anhnm...@sina.com> wrote:
> > Should be possible to do this with <script> and <noscript> tags, so that
> > when there is no javascript it looks just like it does now.
> > And we need an option to disable generating the javascript.
>
> > Unfortunately I don't have time for this...
>
> Hmm, thanks anyway, I can wait :)
>

I can't for the life of me figure out how to respond to a thread with
an attachment (and keep it threaded) without having a message in my
inbox (I'm using the google group web interface, with digests sent to
my email), so I started a new thread, on vim_dev:

http://groups.google.com/group/vim_dev/browse_thread/thread/56d5debad6f5f351

I came up with a prototype for the resulting html file with nested
folding, that would default to showing (basically) the same thing as
it does now if javascript is disabled. I'm working on getting the
2html.vim script to actually generate something similar, but progress
is slow...anyway, follow that thread for status or input.

anhnmncb

unread,
Dec 17, 2008, 9:01:36 PM12/17/08
to vim...@googlegroups.com
On 2008-12-17, fritzophrenic wrote:

Hello fritzophrenic, it works in opera 9.63 and ie 6 on windows 2000, really
looks nice, thanks for hard work!

I don't subscribe to vim-dev so I reply you on this list.

--
Regards,
anhnmncb

Ben Fritz

unread,
Jan 17, 2009, 2:43:15 AM1/17/09
to vim_use
Reply all
Reply to author
Forward
0 new messages