Commits

Shlomi Fish committed 840166a

Compressing the input.

Also fixed lines that start with #.

  • Participants
  • Parent commits 03ad178

Comments (0)

Files changed (3)

 rng
 rules.mak
 t2/humour/fortunes/*.dat
-t2/humour/fortunes/all-in-one.html.wml
+t2/humour/fortunes/all-in-one.uncompressed.html.wml
 t2/humour/fortunes/arcs-list.mak
 t2/humour/fortunes/fortunes-shlomif-*.tar.gz
 t2/humour/fortunes/fortunes-shlomif-all.atom
 FORTUNES_DIR = humour/fortunes
 T2_FORTUNES_DIR = t2/$(FORTUNES_DIR)
 FORTUNES_ALL_IN_ONE__BASE = all-in-one.html
-T2_FORTUNES_ALL_WML = $(T2_FORTUNES_DIR)/$(FORTUNES_ALL_IN_ONE__BASE).wml
+FORTUNES_ALL_IN_ONE__TEMP__BASE = all-in-one.uncompressed.html
+T2_FORTUNES_ALL_WML = $(T2_FORTUNES_DIR)/$(FORTUNES_ALL_IN_ONE__TEMP__BASE).wml
 T2_FORTUNES_ALL__HTML = $(T2_DEST_FORTUNES_DIR)/$(FORTUNES_ALL_IN_ONE__BASE)
+T2_FORTUNES_ALL__TEMP__HTML = $(T2_DEST_FORTUNES_DIR)/$(FORTUNES_ALL_IN_ONE__TEMP__BASE)
 
 include $(T2_FORTUNES_DIR)/arcs-list.mak
 include $(T2_FORTUNES_DIR)/fortunes-list.mak
 
 $(FORTUNES_WMLS_HTMLS): $(T2_DEST_FORTUNES_DIR)/%.html: $(FORTUNES_XHTMLS_DIR)/%.xhtml-for-input
 
-$(T2_FORTUNES_ALL__HTML): $(T2_FORTUNES_ALL_WML) $(FORTUNES_XHTMLS__FOR_INPUT_PORTIONS)
+$(T2_FORTUNES_ALL__TEMP__HTML): $(T2_FORTUNES_ALL_WML) $(FORTUNES_XHTMLS__FOR_INPUT_PORTIONS)
+
+$(T2_FORTUNES_ALL__HTML): $(T2_FORTUNES_ALL__TEMP__HTML)
+	tidy -asxhtml -utf8 -o $@ $<
 
 $(FORTUNES_TEXTS): $(T2_FORTUNES_DIR)/%: $(T2_FORTUNES_DIR)/%.xml
 	bash $(T2_FORTUNES_DIR)/run-validator.bash $< && \

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

 
 $contents =~ s{<h3( id="[^>]+>[^<]+)</h3>}{<fortune_h3$1</fortune_h3>}g;
 
+$contents =~ s/^(\s*)#/${1}\\#/gms;
 
 my $fn = "${abs_out_fn}-for-input";
 open my $xhtml_raw_out, ">", $fn