-
Notifications
You must be signed in to change notification settings - Fork 0
/
rules.Tag
101 lines (101 loc) · 4.23 KB
/
rules.Tag
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# rules.Tag
# Rules for formatting reports.
# Copyright(c) 2013 Jonathan D. Lettvin, All Rights Reserved"
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#==============================================================================
# Copyright(c) 2013 Jonathan D. Lettvin, All Rights Reserved
# date : 20130101
# author : jlettvin
# email : [email protected]
# license: GPLv3
# status : Prototype
# version: 0.0.1
# action : specifies tagnames, required parents, and rendering styles
#==============================================================================
# rules.Tag is interpreted as python to generate global symbol 'rules'.
# rules['parent'] is a dictionary.
# rules['render'] is a dictionary.
#==============================================================================
# parent
# Tags specified in the 'parent' section are auto-generated as classes.
# See Tag.py TAG GENERATION section and test cases for usage.
#==============================================================================
# render
# Dictionaries specified in the 'render' section are available for
# modifying appearance during class instancing.
#==============================================================================
# Tag hierarchy requirements.
# Under the parent section, consider the key TABS.
# TABS is required to be a child of a SECTION.
# Any TABS that is not a child of a SECTION will trigger an assert.
# If a key has a list of multiple parents, then it will not trigger an assert
# if its parent is a member of the list.
#==============================================================================
# A Tag with a colon in its name is converted to a tagname and an option.
# Available options are 'close' and 'single'.
# Options are used as enforced args in TAG subclassing and instancing.
#==============================================================================
{
'parent':{
'HTML' : [],
'HEAD' : ['HTML',],
'LINK' : ['HEAD',],
'BODY' : ['HTML',],
'BR:close' : [],
'H1' : [],
'H2' : [],
'H3' : [],
'FIELD:close' : [],
'TABLE' : [],
'TABS' : ['SECTION',],
'TAB' : ['TABS',],
'SECTION' : [],
'TR' : ['TABLE',],
'TD:close' : ['TR',],
},
'render': {
'cell.passed' : {'width' :'500',
'align' :'center',
'href' :'',
'fontcolor' :'black',
'bgcolor' :'green',
'fontattribute':'bold'},
'cell.info' : {'width' :'500',
'align' :'center',
'href' :'',
'fontcolor' :'black',
'bgcolor' :'white',
'fontattribute':'normal'},
'cell.warning' : {'width' :'500',
'align' :'center',
'href' :'',
'fontcolor' :'brown',
'bgcolor' :'yellow',
'fontattribute':'bold'},
'cell.error' : {'width' :'500',
'align' :'center',
'href' :'',
'fontcolor' :'red',
'bgcolor' :'black',
'fontattribute':'bold'},
'cell.header' : {'width' :'500',
'align' :'center',
'href' :'',
'fontcolor' :'black',
'bgcolor' :'white',
'fontattribute':'bold'},
'cell.critical': {},
},
}