Skip to content
Browse files

Finished spec rough draft and added css

  • Loading branch information...
1 parent ff09fb8 commit e72ae2e6faa95c6ebdceb91eb109ee702cfe0156 @ingydotnet ingydotnet committed
Showing with 40 additions and 5 deletions.
  1. +5 −2 Makefile
  2. +1 −0 config.yaml
  3. +3 −0 css/general.css
  4. +8 −3 spec/Makefile
  5. +21 −0 spec/bin/strip.pl
  6. +1 −0 spec/config.yaml
  7. +1 −0 template/html.tt2
View
7 Makefile
@@ -1,9 +1,9 @@
-.PHONY: spec clean
+.PHONY: spec clean open
all: index.html spec
index.html: index.html.tt2
- tt-render --path=.:template $< > $@
+ tt-render --path=.:template --data=config.yaml $< > $@
spec:
make -C $@
@@ -11,3 +11,6 @@ spec:
clean:
rm -f index.html
make -C spec $@
+
+open: index.html
+ open $<
View
1 config.yaml
@@ -0,0 +1 @@
+top: .
View
3 css/general.css
@@ -0,0 +1,3 @@
+body {
+ font-family: sans-serif;
+}
View
11 spec/Makefile
@@ -1,12 +1,17 @@
all: index.html
-index.html: spec-1.0.pod
- pod2html $< > $@ 2> /dev/null
+index.html: index.html.tt2
+ tt-render --path=.:../template --data=config.yaml $< > $@
+
+index.html.tt2: spec-1.0.pod
+ pod2html $< > $@.tmp 2> /dev/null
rm pod2htm[id].tmp
+ bin/strip.pl $@.tmp > $@
+ rm $@.tmp
open: index.html
$@ $<
clean:
- rm -f index.html
+ rm -f index.html*
View
21 spec/bin/strip.pl
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+
+use strict;
+
+my $flag = 0;
+
+while (my $line = <>) {
+ if ($flag) {
+ if ($line =~ /body>/) {
+ print "[% END %]\n";
+ last;
+ }
+ print $line;
+ }
+ else {
+ if ($line =~ /<body/) {
+ print "[% WRAPPER html.tt2 %]\n";
+ $flag = 1;
+ }
+ }
+}
View
1 spec/config.yaml
@@ -0,0 +1 @@
+top: ..
View
1 template/html.tt2
@@ -4,6 +4,7 @@
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>TestML - Testing Meta Language</title>
+ <link href="[% top %]/css/general.css" rel="stylesheet" type="text/css">
<head>
<body>
[% content %]

0 comments on commit e72ae2e

Please sign in to comment.
Something went wrong with that request. Please try again.