Commits

Anonymous committed 18fcb3c

[Fortunes] Add individual link to every cookie in the show.cgi.

Add a link to every cookie after the <h3>..</h3>. TODO: style it better.

  • Participants
  • Parent commits 4fab3a7

Comments (0)

Files changed (15)

 
 # The touch is to make sure we compile the .html.wml again.
 
-$(FORTUNES_XHTMLS): $(FORTUNES_XHTMLS_DIR)/%.xhtml : $(T2_FORTUNES_DIR)/%.xml
+FORTUNES_CONVERT_TO_XHTML_SCRIPT = $(T2_FORTUNES_DIR)/convert-to-xhtml.pl
+
+$(FORTUNES_XHTMLS): $(FORTUNES_XHTMLS_DIR)/%.xhtml : $(T2_FORTUNES_DIR)/%.xml $(FORTUNES_CONVERT_TO_XHTML_SCRIPT)
 	bash $(T2_FORTUNES_DIR)/run-validator.bash $< && \
-	perl $(T2_FORTUNES_DIR)/convert-to-xhtml.pl $< $@ && \
+	perl $(FORTUNES_CONVERT_TO_XHTML_SCRIPT) $< $@ && \
 	touch $(patsubst %.xml,%.html.wml,$<)
 
 $(FORTUNES_TEXTS): $(T2_FORTUNES_DIR)/%: $(T2_FORTUNES_DIR)/%.xml

File lib/render_fortunes_pages.wml

+#include "xhtml/1.x/std/toc.wml"
+
+<define-tag fortune_h3 endtag="required">
+<preserve id />
+<set-var %attributes />
+<h3 id="<get-var id />">%body</h3>
+<p class="disp">
+<a href="show.cgi?id=<get-var id />">Display</a>
+</p>
+<restore id />
+</define-tag>

File t2/humour/fortunes/convert-to-xhtml.pl

 $contents =~ s{\A(.*?)<body>}{}ms;
 $contents =~ s{</body>(.*?)\z}{}ms;
 
+$contents =~ s{<h3( id="[^>]+>[^<]+)</h3>}{<fortune_h3$1</fortune_h3>}g;
+
 open my $xhtml_raw_out, ">", "${abs_out_fn}-for-input";
 binmode ($xhtml_raw_out, ":utf8");
 print {$xhtml_raw_out} $contents;

File t2/humour/fortunes/friends.html.wml

 #include '../template.wml'
-#include "xhtml/1.x/std/toc.wml"
+#include "render_fortunes_pages.wml"
 
 <latemp_subject "Quotes from Friends - (Fortunes Cookies) - Shlomi Fish's Collection" />
 

File t2/humour/fortunes/joel-on-software.html.wml

 #include '../template.wml'
-#include "xhtml/1.x/std/toc.wml"
+#include "render_fortunes_pages.wml"
 
 <latemp_subject "&quot;Joel on Software&quot; Quotes - (Fortunes Cookies) Shlomi Fish's Collection" />
 

File t2/humour/fortunes/nyh-sigs.html.wml

 #include '../template.wml'
-#include "xhtml/1.x/std/toc.wml"
+#include "render_fortunes_pages.wml"
 
 <latemp_subject "Nadav Har'El Signatures - Fortunes Cookies - Shlomi Fish's Collection" />
 

File t2/humour/fortunes/osp_rules.html.wml

 #include '../template.wml'
-#include "xhtml/1.x/std/toc.wml"
+#include "render_fortunes_pages.wml"
 
 <latemp_subject "Rules of Open Source Programming Fortunes" />
 

File t2/humour/fortunes/paul-graham.html.wml

 #include '../template.wml'
-#include "xhtml/1.x/std/toc.wml"
+#include "render_fortunes_pages.wml"
 
 <latemp_subject "Paul Graham Fortune Cookies" />
 

File t2/humour/fortunes/sharp-perl.html.wml

 #include '../template.wml'
-#include "xhtml/1.x/std/toc.wml"
+#include "render_fortunes_pages.wml"
 
 <latemp_subject "Freenode #perl Conversations - (Fortunes Cookies) Shlomi Fish's Collection" />
 

File t2/humour/fortunes/sharp-programming.html.wml

 #include '../template.wml'
-#include "xhtml/1.x/std/toc.wml"
+#include "render_fortunes_pages.wml"
 
 <latemp_subject "Freenode ##programming Conversations - (Fortunes Cookies) Shlomi Fish's Collection" />
 

File t2/humour/fortunes/shlomif-factoids.html.wml

 #include '../template.wml'
-#include "xhtml/1.x/std/toc.wml"
+#include "render_fortunes_pages.wml"
 
 <latemp_subject "Shlomi Fish and Friends' Additions to the Chuck Norris/Etc. Facts" />
 

File t2/humour/fortunes/shlomif-fav.html.wml

 #include '../template.wml'
-#include "xhtml/1.x/std/toc.wml"
+#include "render_fortunes_pages.wml"
 
 <latemp_subject "Shlomi Fish's Favourite Fortunes" />
 

File t2/humour/fortunes/shlomif.html.wml

 #include '../template.wml'
-#include "xhtml/1.x/std/toc.wml"
+#include "render_fortunes_pages.wml"
 
 <latemp_subject "Shlomi Fish's Quotes as Fortunes Cookies" />
 

File t2/humour/fortunes/subversion.html.wml

 #include '../template.wml'
-#include "xhtml/1.x/std/toc.wml"
+#include "render_fortunes_pages.wml"
 
 <latemp_subject "Subversion Fortune Cookies" />
 

File t2/humour/fortunes/tinic.html.wml

 #include '../template.wml'
-#include "xhtml/1.x/std/toc.wml"
+#include "render_fortunes_pages.wml"
 
 <latemp_subject "'There is no IGLU Cabal' Fortunes " />