3 STARTRE
='^;;; Commentary:$'
5 DATE
=$
(date +"%B %e, %Y %H:%M %Z")
7 echo "title: Emacs Markdown Mode
8 description: A major mode for GNU Emacs for editing Markdown-formatted text files.
12 created: May 24, 2007 23:47 GMT
13 modified: $DATE" > index.text
15 cat markdown-mode.el |\
16 # Keep only the Commentary section
17 awk "/$STARTRE/,/$STOPRE/" |\
18 # Remove the start and step regexps
19 grep -v "$STARTRE" |
grep -v "$STOPRE" |\
21 sed -e 's/^;;; \(.*\):$/\n## \1/' |\
22 # Remove leading spaces (but don't disturb pre blocks)
23 sed -e 's/^;;[ ]\{0,1\}//' |\
25 #sed -e 's/\(\[\[[^]\n]*\]\]\)/\\\1/g' |\
26 # Use Markdown-style backticks for single-quoted lisp code
27 sed -e 's/`\([^'\'']*\)'\''/`\1`/g' |\
28 # Use <kbd> tags for keybindings
29 sed -e 's/`\([CM]-[^`]*\)`/<kbd>\1<\/kbd>/g' |\
30 # Remove email addresses
31 sed -e 's/ <.*@.*> / /g' \