Summary Files Commits Branches @commit @diff @stats
path: root / generate-hooks / create-title.awk
diff options
context:
space:
mode:
1 files changed, 7 insertions, 0 deletions
-rw-r--r--generate-hooks/create-title.awk7
diff --git a/generate-hooks/create-title.awk b/generate-hooks/create-title.awk
new file mode 100644
index 0000000..14d8ec6
--- /dev/null
+++ b/generate-hooks/create-title.awk
@@ -0,0 +1,7 @@
+/<h1>.+/ {
+ # Takes everything between <h1> and </h1> in the first
+ # <h1> occurence.
+ h = index($0, "<h1>")
+ print substr($0, h, index($0, "</h1") - h)
+ exit
+}