[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev lynx html source colorization program
From: |
Vlad Harchev |
Subject: |
Re: lynx-dev lynx html source colorization program |
Date: |
Wed, 17 Mar 1999 01:51:00 +0400 (SAMT) |
On Mon, 15 Mar 1999, Vlad Harchev wrote:
> Here is a progam that can be used to colorize the source in lynx. I've
> written it today. Just 'flex file.l && cc lex.yy.c'. It's a filter.
> It can be easily integrated in lynx - since flex is very flexible. Try it
> out. I've used flex-2.5.4. From a given html file it produces another html
> file, with tags encapsulated and source formatting preserved. Ie, if the
> source file contains:
>[...]
Have anybody tried this ? I will try to embed it into lynx - ie I'l add or
modify a file in the 'WWW/Library/Implementation' directory (and of course
something in 'src' will be added/modified). Here is my thoughts about how it
should be done:
* I think it should be an alternative for currently availble source file
screen - ie it won't be replaced. It will be invoked by '|' - ie
shift + '\' on unremapped PC keyboard.
* I'd like that module to have configuration settings somewhere (most
probably in lynx.cfg accessible via file inclusion) - they will
be the following:
- Whether to remove excessive whites inside tags - between brackets and
tag attributes. Option name HTMLSRC_PACK_SPACES.
- Whether to uppercase/lowercase/leave-as-is names of tags and names of
their attributes. Option name HTMLSRC_TAG_TRANSFORM, values are {0,1,2}
(0 - leave-as-is, 1 - lowercase, 2 - uppercase).
- The program currently understands following lexems:
comment, generalized angle brackets ( '<' , '>' , '</' ), tag name,
attribute name, attribute value, normal text ( this will be
inserted once). The option for each lexem is what combination of tags to
insert before and what after it.
Two configuration parameters correspond to 1 lexem - each is a string -
a html tags. Configuration parameter corresponding to the starting this
lexem is suffixed with '_S', and corresponding to the end - '_E'. Here is
a table that shows correspondence between lexems and parameter names.
lexem Parameter string
--------------------------------------------
comment HTMLSRC_COM
gen. angle brackets HTMLSRC_BRACKET
tag name HTMLSRC_TAGNAME
attribute name HTMLSRC_ATTRNAME
attribute value HTMLSRC_ATTRVAL
normal text HTMLSRC_NORMAL
Example:
HTMLSRC_COM_S:"<i>"
HTMLSRC_COM_E:"</i>"
#...
Are there any opinions/suggestions?
PS: I've enhanced/fixed the program I've sent before, so if anybody needs it,
mail me.
Best regards,
-Vlad