-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAlgorithm.txt
More file actions
42 lines (36 loc) · 1.3 KB
/
Algorithm.txt
File metadata and controls
42 lines (36 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Goal: allow us...
1. to check to see if all HTML files link to same CSS
2. get styles in order of appearance
3. check for DRY (across all css files - not style tags)
4. check across all CSS for meeting requirements
5. determining whether all HTML files meet all CSS requirements
Actions:
* Keep order_of_css_by_file - use it to determine...
if all files link to same CSS
order of appearance
Guidelines:
* Don't reinvent the wheel
* Don't repeat myself
- don't make more stylesheet objects than I have to
Questions:
* Do I care about the cascade?
- I might
- If so, I should get a master stylesheet that is in the order of appearance
* What's already in place?
SET CSS_file_data to empty list
FOREACH file in folder
GET Head tag from text
GET filename
SET stylesheets to empty string
SET page_CSS to list
FOREACH tag in Head tags
IF tag is a link to local sheet
GET CSS from tag contents
APPEND
Data Dictionary:
CSS_file_data list of page_CSS
HEAD tag object contains all children tags of HEAD
filename string that represents an HTML file's name
stylesheets is a string of all CSS code in order of appearance (same order as links to local CSS files)
page_CSS a list of file_data
file_data a tuple of