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 echo "# Emacs Markdown Mode
17 <!-- This file is autogenerated by webpage.sh from the comments at the top of
18 markdown-mode.el. Make edits there, not here. -->" > README.md
20 cat markdown-mode.el |\
21 # Keep only the Commentary section
22 awk "/$STARTRE/,/$STOPRE/" |\
23 # Remove the start and step regexps
24 grep -v "$STARTRE" |
grep -v "$STOPRE" |\
26 sed -e 's/^;;; \(.*\):$/## \1/' |\
27 # Remove leading spaces (but don't disturb pre blocks)
28 sed -e 's/^;;[ ]\{0,1\}//' |\
30 #sed -e 's/\(\[\[[^]\n]*\]\]\)/\\\1/g' |\
31 # Use Markdown-style backticks for single-quoted lisp code
32 sed -e 's/`\([^'\'']*\)'\''/`\1`/g' |\
33 # Use <kbd> tags for single character, unprefixed keybindings
34 sed -e 's/`\([^`]\)`/<kbd>\1<\/kbd>/g' |\
35 # Use <kbd> tags for TAB and RET keys
36 sed -e 's/`TAB`/<kbd>TAB<\/kbd>/g' |\
37 sed -e 's/`RET`/<kbd>RET<\/kbd>/g' |\
38 # Use <kbd> tags for keybindings prefixed by C, M, or S
39 sed -e 's/`\([CMS]-[^`]*\)`/<kbd>\1<\/kbd>/g' |\
40 # Remove email addresses
41 sed -e 's/ <[^>]*@[^<]*> / /g' \
42 |
tee -a README.md
>> index.text