filter to strip presentation tags
|
Apr. 01, 2004, 06:30 PM
Post: #1
|
|||
|
|||
Hello:
could anyone please help me solve this task. this is what is needed: 1) see if the URL matches a list of URLs in, say, restyle.txt; 2) if yes, strip all presentation markup; 3) display page according the stylesheet in, say, restyle.css nothing fancy there. i'd just like to see certain pages in a better format. something like verdana / tahoma, in black, against some light-creme or gray background. i'm sure some people have this covered in their setups. thanks in advance. marc |
|||
Apr. 01, 2004, 07:43 PM
Post: #2
|
|||
|
|||
Not sure how 'effective' that would be...
For one, the "names" of the CSS-based line-items would need to be identical for every page in your .txt list of sites... Below is a small portion of a .css style sheet open in another window at this very moment... Code: .fHL {font-size:12pt; font-family:Arial} Sure, you can replace "their" style sheet with one of your own, but you need to keep all of the "names" the same for them to be 'applied' to the page... I can insert that above .css into EVERY page that I visit, but if none of those pages "reference" fCC (number 6 in the above .css), then NOTHING will happen on the page that I inserted that .css into... Sure, there are "fixes"... I insert a .css into EVERY page that defines link formatting for visited links, .pdf links, .gif and .jpg links, javascript links, and mailto: links... And then I disable all .css style sheets... Or I use a "zap presentational html" bookmarklet that proves quite effective... |
|||
Apr. 01, 2004, 07:51 PM
Post: #3
|
|||
|
|||
i understand. but there're simpler cases. like, say, a given page is formated with font tags. i presume some filter might strip this inline formatting, and then reapply a user-defined stylesheet to the background, p, h1-h6, and links.
am i wrong? |
|||
Apr. 01, 2004, 08:47 PM
Post: #4
|
|||
|
|||
Sounds do-able, yes...
I guess I'd have to see the actual .css (and web page) to really know for sure... Perhaps just insert your own .css into every page that defines links, p, h1-h6, and background as "!important;"... |
|||
Apr. 01, 2004, 09:08 PM
Post: #5
|
|||
|
|||
What i'm doing is just blocking all original external stylesheets ...
Code: [Patterns] I didn't need to remove the <style> blocks yet but that is probably easy: bounds=$NEST(<style,</style >) match=*. I wouldn't bother about the other smallish style tags and attributes, unless they actually disturb the page layout *after* applying my user CSS. sidki |
|||
Apr. 01, 2004, 10:28 PM
Post: #6
|
|||
|
|||
sidki, i just checked out quickly your config, and well, yes, the stylesheet substitution feature is what i needed.
now , i have been using JD's advanced config for ages, and i'm not ready / willing (as of yet) to switch to a different config. if you could help incorporate the restyling feature into JD's advanced? i can't figure out exactly what rule to copy from your config. thanks so much in advance. |
|||
Apr. 01, 2004, 10:37 PM
Post: #7
|
|||
|
|||
JD_Advanced already "inserts" a pre-defined .css script to every page...
Just edit JD's "prox-links.css" to incorporate the .css inclusions you are attempting to implement... |
|||
Apr. 01, 2004, 11:06 PM
Post: #8
|
|||
|
|||
thing is, i want the changes to affect only the sites listed in restyle.txt - not _every_ page.
|
|||
Apr. 01, 2004, 11:19 PM
Post: #9
|
|||
|
|||
You can add that filter to my set, just add it and create the new list. Look in the Proxo helps files on how to create a list.
~JD In Proxomitron we trust. |
|||
Apr. 01, 2004, 11:23 PM
Post: #10
|
|||
|
|||
JD5000, what filter exactly are you referring to? the stylesheets must also go to some folder. which one?
thanks. |
|||
Apr. 01, 2004, 11:30 PM
Post: #11
|
|||
|
|||
Based on sidki's, I would think...
Code: [Patterns] Then the stylesheets would go in the html folder. <prox dir>/html/CustomCSS/Custom.css HTH ~JD In Proxomitron we trust. |
|||
Apr. 01, 2004, 11:35 PM
Post: #12
|
|||
|
|||
Sidki, just reminded me. If they have more then one CSS file (Alternate displays), yours will be injected more then once.
In Proxomitron we trust. |
|||
Apr. 01, 2004, 11:35 PM
Post: #13
|
|||
|
|||
thanks, JD5000. in sidki's config it's handled in a rather cool way - i can assign a particular CSS to each given site:
Code: # use a local stylesheet $SET(usercss=CSS_NAME) how could i achive the same effect with your config? thanks so much. |
|||
Apr. 01, 2004, 11:37 PM
Post: #14
|
|||
|
|||
Can't be done right now. In the new set, should be able to do it the same way.
In Proxomitron we trust. |
|||
Apr. 02, 2004, 12:10 AM
Post: #15
|
|||
|
|||
ok, let's see what i did and where it went wrong.
[ i am modifying JD_advanced config. ] 1) created a list named CustomCSS.txt, added this line there - Code: http://www.geocities.com/srl_list/ and put it into <prox dir>/Lists/JD_Lists/Misc Lists/ so the path to the newly created list is - <prox dir>/Lists/JD_Lists/Misc Lists/CustomCSS.txt great. 2) added the list to proxomitron's lists through configure > block lists > add. the list is called "CustomCSS". 3) inserted the code supploed by JD5000 earlier in this thread Code: [Patterns] saved default config. reloaded proxomitron. cleared cache. went to http://www.geocities.com/srl_list/index.html - no changes. where did i go wrong? thanks so much. |
|||
« Next Oldest | Next Newest »
|