HTML patch included

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

HTML patch included

Bram Moolenaar

Christian -

I included your patch to produce a side-by-side diff with :TOhtml.
It looks nice!

I changed it a bit, so that it also works when producing CSS.
And quit the buffers for the individual html files.
And add a variable to disable this behavior and produce just one
HTML file for the current buffer.

There are probably a few remaining problems.  Please send me patches on
top of the latest version.

--
Yah, well, we had to carve our electrons out of driftwood we'd
find.  In the winter.  Uphill.  Both ways.

 /// Bram Moolenaar -- [hidden email] -- 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    ///

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HTML patch included

Dominique Pellé
Bram Moolenaar wrote:

> Christian -
>
> I included your patch to produce a side-by-side diff with :TOhtml.
> It looks nice!
>
> I changed it a bit, so that it also works when producing CSS.
> And quit the buffers for the individual html files.
> And add a variable to disable this behavior and produce just one
> HTML file for the current buffer.
>
> There are probably a few remaining problems.  Please send me patches on
> top of the latest version.

Hi

I see one problem.  In my ~/.vimrc, I have this:

  let html_use_css=1
  let html_use_xhtml=1
  let html_dynamic_folds=1

It allows to create dynamic folds in HTML output when doing :TOhtml.
Clicking on the +/- in folds opens or closes them.  Doing :TOhtml
on a diff output creates folds in HTML (good), but clicking on + does
not open them (bug). I see that the HTML output in diff mode is
missing the <script type='text/javascript'>...</script>  section.

Regards
-- Dominique

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HTML patch included

Ben Fritz


On Jul 11, 5:10 pm, Dominique Pellé <[hidden email]> wrote:

> Bram Moolenaar wrote:
> > Christian -
>
> > I included your patch to produce a side-by-side diff with :TOhtml.
> > It looks nice!
>
>
> I see one problem.  In my ~/.vimrc, I have this:
>
>   let html_use_css=1
>   let html_use_xhtml=1
>   let html_dynamic_folds=1
>
> It allows to create dynamic folds in HTML output when doing :TOhtml.
> Clicking on the +/- in folds opens or closes them.  Doing :TOhtml
> on a diff output creates folds in HTML (good), but clicking on + does
> not open them (bug). I see that the HTML output in diff mode is
> missing the <script type='text/javascript'>...</script>  section.
>

I had meant to look at this patch, because if I recall the discussion
didn't include anything about dynamic folding. I haven't tried it
yet...is this the one that combined the two html outputs side-by-side
in the same HTML page, or does it create two separate pages?

If it creates a single page (which I would certainly prefer), I'd like
to see clicking the '+' on one side to also open the '+' on the other
side. I remember giving a little thought to this. The javascript just
looks for a class or id (I forget which) of 'fold1', 'fold2', etc. It
shouldn't be too hard to change the class/id to 'side1fold1',
'side1fold2', etc. and then have similar names on side2, and update
the javascript to open/close both sides. I certainly think this would
be preferable to only opening/closing folds on one side.

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HTML patch included

Bram Moolenaar

Ben Fritz wrote:

> On Jul 11, 5:10=A0pm, Dominique Pell=E9 <[hidden email]> wrote:
> > Bram Moolenaar wrote:
> > > Christian -
> >
> > > I included your patch to produce a side-by-side diff with :TOhtml.
> > > It looks nice!
> >
> >
> > I see one problem. =A0In my ~/.vimrc, I have this:
> >
> > =A0 let html_use_css=3D1
> > =A0 let html_use_xhtml=3D1
> > =A0 let html_dynamic_folds=3D1
> >
> > It allows to create dynamic folds in HTML output when doing :TOhtml.
> > Clicking on the +/- in folds opens or closes them. =A0Doing :TOhtml
> > on a diff output creates folds in HTML (good), but clicking on + does
> > not open them (bug). I see that the HTML output in diff mode is
> > missing the <script type=3D'text/javascript'>...</script> =A0section.
> >
>
> I had meant to look at this patch, because if I recall the discussion
> didn't include anything about dynamic folding. I haven't tried it
> yet...is this the one that combined the two html outputs side-by-side
> in the same HTML page, or does it create two separate pages?
>
> If it creates a single page (which I would certainly prefer), I'd like
> to see clicking the '+' on one side to also open the '+' on the other
> side. I remember giving a little thought to this. The javascript just
> looks for a class or id (I forget which) of 'fold1', 'fold2', etc. It
> shouldn't be too hard to change the class/id to 'side1fold1',
> 'side1fold2', etc. and then have similar names on side2, and update
> the javascript to open/close both sides. I certainly think this would
> be preferable to only opening/closing folds on one side.

At least the part of the header that defines the javascript needs to be
copied from one of the individual pages to the result page.

I added code to copy the style information.  Since this can be different
for each page, I copy all of them.  There is some duplication but it
still works.  For the javascript part only one copy is needed.

Can someone make a patch for this?  It would actually be nice if someone
can take over maintenance, now that it's no longer a simple short
script.

--
Not too long ago, unzipping in public was illegal...

 /// Bram Moolenaar -- [hidden email] -- 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    ///

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HTML patch included

Ben Fritz


On Jul 12, 6:45 am, Bram Moolenaar <[hidden email]> wrote:

>
> At least the part of the header that defines the javascript needs to be
> copied from one of the individual pages to the result page.
>
> I added code to copy the style information.  Since this can be different
> for each page, I copy all of them.  There is some duplication but it
> still works.  For the javascript part only one copy is needed.
>
> Can someone make a patch for this?  It would actually be nice if someone
> can take over maintenance, now that it's no longer a simple short
> script.
>

I'd be willing to take over maintenance. I still have that progress
bar patch whose thread sort of fizzled out, and plan to work on a
patch to add 'conceal' support soon anyway.

I'll try to get a patch together sometime this week for the javascript
folding of diff output. Your discussion above makes it sound like a
single "diff view" html buffer is created...something I've certainly
wanted a few times!

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HTML patch included

Bram Moolenaar

Ben Fritz wrote:

> On Jul 12, 6:45 am, Bram Moolenaar <[hidden email]> wrote:
> >
> > At least the part of the header that defines the javascript needs to be
> > copied from one of the individual pages to the result page.
> >
> > I added code to copy the style information.  Since this can be different
> > for each page, I copy all of them.  There is some duplication but it
> > still works.  For the javascript part only one copy is needed.
> >
> > Can someone make a patch for this?  It would actually be nice if someone
> > can take over maintenance, now that it's no longer a simple short
> > script.
> >
>
> I'd be willing to take over maintenance. I still have that progress
> bar patch whose thread sort of fizzled out, and plan to work on a
> patch to add 'conceal' support soon anyway.
>
> I'll try to get a patch together sometime this week for the javascript
> folding of diff output. Your discussion above makes it sound like a
> single "diff view" html buffer is created...something I've certainly
> wanted a few times!

OK.  Please send me a version with updated header soon.

We are getting closer to the 7.3 release, I'm slowly reducing the impact
of changes to include.  Thus if you want to make big changes such as the
progress bar, better do this soon or otherwise I might postpone it until
after the 7.3 release.

--
   LAUNCELOT leaps into SHOT with a mighty cry and runs the GUARD through and
   hacks him to the floor.  Blood.  Swashbuckling music (perhaps).
   LAUNCELOT races through into the castle screaming.
SECOND SENTRY: Hey!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [hidden email] -- 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    ///

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HTML patch included

Ben Fritz
On Mon, Jul 12, 2010 at 4:06 PM, Bram Moolenaar <[hidden email]> wrote:

>
> Ben Fritz wrote:
>
>>
>> I'll try to get a patch together sometime this week for the javascript
>> folding of diff output. Your discussion above makes it sound like a
>> single "diff view" html buffer is created...something I've certainly
>> wanted a few times!
>
> OK.  Please send me a version with updated header soon.
>
Patch attached to fix dynamic folding in the diff view, and update the
headers with me as maintainer.

Please try it out...I also made some updates to make the diff view
more usable (in my opinion), and to make some markup validation fixes,
but I did not test with more than 2 files in diff mode, and also was
unable to test the generated markup on IE versions less than 8. I
tested the generated markup on IE8, and recent versions of  Firefox,
Safari, Chrome, and Opera on Windows XP and Vista.

Testing with a variety of options would be good as well; I only did
some brief testing, but I don't foresee any problems with other
options from the changes I made.

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

tohtml_diff_dynfold.patch (49K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HTML patch included

Bram Moolenaar

Benjamin Fritz wrote:

> Patch attached to fix dynamic folding in the diff view, and update the
> headers with me as maintainer.
>
> Please try it out...I also made some updates to make the diff view
> more usable (in my opinion), and to make some markup validation fixes,
> but I did not test with more than 2 files in diff mode, and also was
> unable to test the generated markup on IE versions less than 8. I
> tested the generated markup on IE8, and recent versions of  Firefox,
> Safari, Chrome, and Opera on Windows XP and Vista.
>
> Testing with a variety of options would be good as well; I only did
> some brief testing, but I don't foresee any problems with other
> options from the changes I made.

I haven't tried it, mostly looks OK.  Except:

-" vim: noet sw=2 sts=2
+" Make sure any patches will probably use consistent indent
+"   vim: ts=2 sw=2 sts=2 et

All runtime files use a tabstop setting of 8.


About these deleted lines:

        -" hover opening implies dynamic folding
        -if exists("s:html_hover_unfold")
        -  let s:html_dynamic_folds = 1
        -endif

When someone sources 2html.vim directly, not using :TOhtml, won't
something break now?

--
"A mouse can be just as dangerous as a bullet or a bomb."
             (US Representative Lamar Smith, R-Texas)

 /// Bram Moolenaar -- [hidden email] -- 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    ///

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Loading...