comparison runtime/doc/syntax.txt @ 2496:a29075150aee vim73

Improve handling of user settings in :TOhtml. Default to generating CSS. (Benjamin Fritz)
author Bram Moolenaar <bram@vim.org>
date Thu, 05 Aug 2010 21:54:00 +0200
parents ed997d0ceb26
children 6768ebd0bc04
comparison
equal deleted inserted replaced
2495:a847363bf06e 2496:a29075150aee
421 Force to omit the line numbers by using a zero value: > 421 Force to omit the line numbers by using a zero value: >
422 :let g:html_number_lines = 0 422 :let g:html_number_lines = 0
423 Go back to the default to use 'number' by deleting the variable: > 423 Go back to the default to use 'number' by deleting the variable: >
424 :unlet g:html_number_lines 424 :unlet g:html_number_lines
425 425
426 By default, HTML optimized for old browsers is generated. If you prefer using 426 By default, valid HTML 4.01 using cascading style sheets (CSS1) is generated.
427 cascading style sheets (CSS1) for the attributes (resulting in considerably 427 If you need to generate markup for really old browsers or some other user
428 shorter and valid HTML 4 file), use: > 428 agent that lacks basic CSS support, use: >
429 :let g:html_use_css = 1 429 :let g:html_use_css = 0
430 430
431 Concealed text is removed from the HTML and replaced with the appropriate 431 Concealed text is removed from the HTML and replaced with the appropriate
432 character from |:syn-cchar| or 'listchars' depending on the current value of 432 character from |:syn-cchar| or 'listchars' depending on the current value of
433 'conceallevel'. If you always want to display all text in your document, 433 'conceallevel'. If you always want to display all text in your document,
434 either set 'conceallevel' to zero before invoking 2html, or use: > 434 either set 'conceallevel' to zero before invoking 2html, or use: >
494 And to go back to displaying up to three lines again: > 494 And to go back to displaying up to three lines again: >
495 :unlet g:html_whole_filler 495 :unlet g:html_whole_filler
496 < 496 <
497 *convert-to-XML* *convert-to-XHTML* 497 *convert-to-XML* *convert-to-XHTML*
498 An alternative is to have the script generate XHTML (XML compliant HTML). To 498 An alternative is to have the script generate XHTML (XML compliant HTML). To
499 do this set the "use_xhtml" variable: > 499 do this set the "html_use_xhtml" variable: >
500 :let use_xhtml = 1 500 :let g:html_use_xhtml = 1
501 To disable it again delete the variable: > 501
502 :unlet use_xhtml 502 Any of these options can be enabled or disabled by setting them explicitly to
503 the desired value, or restored to their default by removing the variable using
504 |:unlet|.
503 505
504 Remarks: 506 Remarks:
505 - This only works in a version with GUI support. If the GUI is not actually 507 - This only works in a version with GUI support. If the GUI is not actually
506 running (possible for X11) it still works, but not very well (the colors 508 running (possible for X11) it still works, but not very well (the colors
507 may be wrong). 509 may be wrong).
508 - Older browsers will not show the background colors. 510 - Some truly ancient browsers may not show the background colors.
509 - From most browsers you can also print the file (in color)! 511 - From most browsers you can also print the file (in color)!
510 512
511 Here is an example how to run the script over all .c and .h files from a 513 Here is an example how to run the script over all .c and .h files from a
512 Unix shell: > 514 Unix shell: >
513 for f in *.[ch]; do gvim -f +"syn on" +"run! syntax/2html.vim" +"wq" +"q" $f; done 515 for f in *.[ch]; do gvim -f +"syn on" +"run! syntax/2html.vim" +"wq" +"q" $f; done