]> www.wagner.pp.ru Git - fiction/Kate-the-Empress.git/blobdiff - joinfiles.awk
Converted to UTF-8. Moved HTML generation to pandoc, added epub generation
[fiction/Kate-the-Empress.git] / joinfiles.awk
diff --git a/joinfiles.awk b/joinfiles.awk
new file mode 100644 (file)
index 0000000..de96d5a
--- /dev/null
@@ -0,0 +1,16 @@
+/\\part/ {gsub("part","section");gsub(".addcontentsline{.*}","");}
+/\\chapter/ {gsub("chapter","subsection");gsub(".addcontentsline{.*}","");}
+$1 == "\\input" {fn=$2; while (getline <fn) {
+                                                       sub("^\\\\stars","\n\n\\subsubsection{* * *}\n\n");
+                                                       gsub("\"=","-");
+                                                       $0=gensub("\\\\'{(.)}","\\1́","g",$0);
+                                                       print;
+                                               }
+                                               next;
+                               }
+
+
+{
+
+sub("^\\\\stars","\n\n\\subsubsection{* * *}\n\n");
+print;}