|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Hi all,
Im looking at writing a shell-script to filter css on the fly, allowing only specific properties through, and removing others, eg. given a css file containing: div.important,p.important { margin: 1em; padding: 0.1em; border: solid #F00; font-size: larger; } (note: above css code could be represented as one line) and some sort of config file containing a list of allowed properties: font-size font-color background-color it woud return div.important,p.important { font-size: larger; } How do I go about it? Ive looked at SAC parser but couldnt find any examples and Im not realy interested in the object model of the css file. Is sed/awk the way to go ? Any code samples would help, since Im not familiar with those. Thanks |
|
#2
|
|||
|
|||
|
Quote:
You probably want to use perl. The "tr" function is for text substitution. Do you need to do this in a CGI script? Magnus |
|
#3
|
|||
|
|||
|
|
![]() |
| Viewing: Dev Shed Forums > Web Site Management > Scripts > script to filter css |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|