Also attached is an example of the output when used on the two
attached patches. I used html_dynamic_folds on the 2html.vim patch,
and additionally html_no_foldcolumn and html_hover_unfold on the
syntax.txt patch.
As discussed in the vim_dev thread above, it may be desirable to be
able to do away with the foldcolumn in the html output, but it was
hard to determine what to do to allow folds to open and close without
it. Rather than making the javascript and markup needlessly complex, I
just used CSS 2.0 :hover selection to open folds on hover if desired
(though normally, only CSS 1.0 support is required, and a fallback is
inserted for IE6).
Please comment!
-- Ben
That's very nice and useful. Thanks.
One minor comment. In syntax.txt, I read:
If you use this option, it would not be possible to open the folds
I think it should be...
If you used this option, it would not be possible to open the folds
:s/use/&d/
-- Dominique
I can't apply the patch cleanly unfortunately. There are conflicts.
2html.vim.diff is a patch from a version last changed on "2008 Dec 03"
But...
2html.vim in CVS was last changed on "2008 Jul 17" (too old)
2html.vim from ftp contains a version changed on "2009 Jan 13" (too new)
Regards
-- Dominique
Another possibility is:
If you use this version, it won't be possible to open the folds.
...used...would not... makes it seem that no one would ever use the
option in question.
(For you Frenchmen, it's the same as between "si vous utilisiez cette
option, il serait impossible d'ouvrir les plis" vs. "si vous utilisez...
il sera...".
Best regards,
Tony.
--
Happiness, n.:
An agreeable sensation arising from contemplating the misery of
another.
-- Ambrose Bierce, "The Devil's Dictionary"
Yes, on the FTP server.
> Alternatively, I could use SVN if the runtime files are up-to-date in
> there. It looks like the ones in CVS are not. I would probably prefer
> this method, actually.
SVN has the same content as CVS, i.e. older runtime files.
If you prefer the convenience of a version control system to get the
latest runtime files, you can also use one of my git trees. They are
kept simple and clear and won't add confusion.
http://repo.or.cz/w/vim_mainline.git
branch 'vim-runtime' for merely the latest runtime files
branch 'master' for vim sources + the latest runtime files
or
http://repo.or.cz/w/vim_extended.git
branch 'vim-with-runtime' is the same as 'master' from vim_mainline
Not as simple due to
Markus
Oh, an unfinished sentence, while looking for an appropriate word in the
dictionary and digressing. What I wanted to say is, that there are more
branches, so it seems naturally not as simple.
Markus
Try: rsync -avzcP --delete --exclude="dos" --exclude="spell"
ftp.nluug.nl::Vim/runtime/ .
But I personally do that in another directory than my main vim
directory because it not only pulls new files but also delete files.
I don't know why runtime files are not updated in CVS like source
files. It would be more convenient. Or maybe in a separate CVS
module if runtime files are deemed too large.
-- Dominique
Also fixed a bug due to an interesting quirk of the default fold text:
+-- 35 for 2-digit line counts
+--200 for 3 or more digits in the line count
> On 17/01/09 09:48, Dominique Pelle wrote:
> > Benjamin Fritz wrote
> >
> > > A patch is attached for the behavior discussed in
> > > these threads:
> > > http://groups.google.com/group/vim_use/browse_thread/thread/8532e7236f113ab7/0b508a50b767a1e1
> > > http://groups.google.com/group/vim_dev/browse_thread/thread/56d5debad6f5f351/44cc7eb3b4787440
> > >
> > > [...]
> >
> > That's very nice and useful. Thanks.
> > One minor comment. In syntax.txt, I read:
> >
> > If you use this option, it would not be possible to
> > open the folds
> >
> > I think it should be...
> >
> > If you used this option, it would not be possible to
> > open the folds
> >
> > :s/use/&d/
> >
> > -- Dominique
>
> Another possibility is:
>
> If you use this version, it won't be possible to
> open the folds.
(s/version/option/ but this is irrelevant to the discussion.)
> ...used...would not... makes it seem that no one would
> ever use the option in question.
Yes, this is better, but it should be
If you :let html_no_foldcolumn = 1 it
won't be possible to open the folds unless
you use :let html_hover_unfold = 1
or whatever the correct usage is. Alternatively remove
the sentence altogether and say:
:let html_hover_unfold = 1 will use CSS 2.0 to
allow a user to open a fold by hovering the mouse
pointer over it. This is useful when using
:let html_no_foldcolumn = 1.
--Antony
Thank you Benjamin! Why not just put a completed version here? It's not so
convenient to install it on windows.
--
Regards,
Van.
Me neither. I think the problem is that Vim doesn't have a repository
with useful history. The only history available are the bugfixes from
the official patches. The CVS/SVN repo seems rather to be intended for
ease of updating the sources than having a history.
> It would be more convenient.
If you need convenience, try the 'master' branch from
http://repo.or.cz/w/vim_mainline.git
Markus
> Thank you Benjamin! Why not just put a completed version here? It's not so
> convenient to install it on windows.
>
Indeed, why not? I really don't see it done very often (or at all),
but I've attached the full script. I've also attached new patches to
fix the text in the help file as discussed, and to make the 2html
script not over-ride user-defined variables (it stores its own local
copy instead). I think these are ready for inclusion, unless the
version has changed under my nose again. I'll check that tomorrow.
To the list: is there a reason not to post full files? I will
certainly avoid it in the future if it is frowned upon for good
reason...
> On Tue, Jan 20, 2009 at 3:01 AM, Yue Wu <van...@gmail.com> wrote:
>
>> Thank you Benjamin! Why not just put a completed version here? It's not
>> so
>> convenient to install it on windows.
>>
>
> Indeed, why not? I really don't see it done very often (or at all),
> but I've attached the full script. I've also attached new patches to
> fix the text in the help file as discussed, and to make the 2html
> script not over-ride user-defined variables (it stores its own local
> copy instead). I think these are ready for inclusion, unless the
> version has changed under my nose again. I'll check that tomorrow.
>
Hi, Benjamin,
I don't know if I use it correctly? I throw the 2html.vim into
~/.vim/syntax, then open a file that has folding enabled, then use 2html
to output the html:
source ~/.vim/syntax/2html.vim
But seems it doesn't work.
--
Regards,
Van.
That's the right way to use it. Make sure you do this first:
:let html_dynamic_folds = 1
Otherwise you will just get the default behavior.
You should also be able to use the TOhtml command.
Awesome! Thank you!
--
Regards,
Van.
I haven't looked in detail at the changes yet. I'm first awaiting
comments. If the change looks like it won't break anything when folding
is off it should be OK to include.
--
hundred-and-one symptoms of being an internet addict:
69. Yahoo welcomes you with your own start page
/// 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 ///
This should do it. I also fixed a minor bug in the generated html when
multiple folds open on the same line and using g:html_hover_unfold
with a fold column.
Sorry this took so many tries to get right...I think this should be
it, though. Please try it out and let me know if I missed anything or
if there's something you don't like!