Wednesday, June 20, 2012

Re: TOhtml - select without linenr

  #!/usr/bin/python    import sys  import time  import csv  from BeautifulSoup import BeautifulSoup, Tag, NavigableString  import sys  import time  import csv  from BeautifulSoup import BeautifulSoup, Tag, NavigableString  import sys  import time  import csv  
  
  1. #!/usr/bin/python
  2. import time
  3. import csv from BeautifulSoup
  4. import BeautifulSoup, Tag, NavigableString
Hello Ben,

I am sorry it has taken me so long to get back to this thread. Just in
case anyone is wondering what it is about, here's a link to the
archived threads:

http://groups.google.com/group/vim_use/browse_thread/thread/aa400607d493a63e
and
http://groups.google.com/group/vim_use/browse_thread/thread/ba698d5c61afae05


REQUIREMENTS
=============

From our previous conversation, here's a list of requirements in
(roughly in order of importance?)

1) line numbers not copyable
2) HTML output surrounded by PRE block
3) folding possible
4) wrapping possible
5) wrapping not through line number column
6) W3C compliant
7) browser support IE8+, Chrome, Firefox, Opera
8) still viewable with JavaScript switched off
9) separable CSS (for embedding in web site)
10) diff filler uncopyable
11) line numbers unselectable

MY TESTS
=============

1) FOLDING: I looked at your folding example (with JavaScript
enabled)
- that is really awesome! I don't use vim folding myself, so hadn't
appreciated this TOhtml feature before.

2) YOUR INPUT METHOD: I had go at making the HTML more compact
and the CSS more cross-browser capable;

3) ALTERNATIVE METHOD I played around with ordered lists.

4) I am leaving the URL to link conversion issue aside for the moment
to focus on the above.

CONCLUSIONS
=============

** TABLE METHOD **

Firstly, the table method I suggested last month is not suitable
because it wouldn't cater for folding and wrapping with any ease.

** INPUT METHOD **

Although your invalid <input> field approach seems a bit clumsy,
it is the most cross-browser capable down to IE6! What I didn't like
about it was the fact that it was so wordy and made the HTML output
rather unreadable. It doesn't cope well with wrapping, which goes
through the line number "column".

My modifications to <input> method:
- onclick etc pulled out, which means less code and therefore better
readability
- separated Vim-derived styles from those needed for creating the
layout
- defined CSS classes with higher specificity so they won't collide
with other styles when embedded in a web page
- eliminated 1px problem between line numbers, which occerred in some
browsers
- I have not yet produced HTML/CSS for folding
- all tests done via changing your output manually
- tested in IE6, FF 3.5, FF10, Chrome, viewed IE7,8,9 via screenshot
service
- CSS W3C validated
- HTML did not because of invalid <input> type

+ 1) line numbers not copyable
+ 2) HTML output surrounded by PRE block
+ 3) folding possible (CSS/HTML not yet implemented)
+ 4) wrapping possible
- 5) wrapping not through line number column
+/- 6) W3C compliant: CSS yes, HTML no because of invalid <input>type
+ 7) browser support IE8+, Chrome, Firefox, Opera
+ 8) still viewable with JavaScript switched off
+ 9) separable CSS (for embedding in web site)
? 10) diff filler uncopyable
+ 11) line numbers unselectable (if JS switched on)


** ORDERED LIST METHOD **

Advantages: less wordy (line numbers automatic), wrapping of
data column only possible, line numbers always unselectable
Disadvantages: dot after line number (work-around possible), IE6,7
incompatible (possibly fixable)

+ 1) line numbers not copyable
+ 2) HTML output surrounded by PRE block
+ 3) folding possible (not tested)
+ 4) wrapping possible
+ 5) wrapping not through line number column
+/- 6) W3C compliant: CSS yes, HTML no because of <div> in <pre>
(work-around possible)
+ 7) browser support IE8+, Chrome, Firefox, Opera
+ 8) still viewable with JavaScript switched off
+ 9) separable CSS (for embedding in web site)
? 10) diff filler uncopyable
+ 11) line numbers unselectable (if JS switched on)

--

Tarlika Elisabeth Schmitz, Scotland
http://my.mutterings.co.uk/

--
You received this message from the "vim_use" 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

No comments: