File: templatespp

package info (click to toggle)
libtemplates-parser 19-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,180 kB
  • sloc: ada: 11,320; python: 637; makefile: 345; sh: 37
file content (25 lines) | stat: -rw-r--r-- 656 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
set -C -e -f -u
cd "$ADTTMP"

cat > mycss.tcss <<EOF
     @@SET@@ COLOR1=blue
     @@SET@@ COLOR2=red
     @@SET@@ LENGTH1=10
     body {background:@_COLOR1_@}
     div  {background:@_COLOR2_@}
     ul.class {background:@_COLOR1_@}  /* same color as body */

     ul   {width:@_ADD(3):LENGTH1_@px} /* ul 3 pixels wider than li */
     li   {width:@_LENGTH1_@px}
EOF
cat > expected <<EOF
     body {background:blue}
     div  {background:red}
     ul.class {background:blue}  /* same color as body */

     ul   {width:13px} /* ul 3 pixels wider than li */
     li   {width:10px}
EOF
templatespp -o mycss.css mycss.tcss
diff -u expected mycss.css