Remove unused regular expressions for clarity
[markdown-mode.git] / webpage.sh
blobd3f748322def583f50a28773372c62ee0b75bd39
1 #!/bin/sh
3 STARTRE='^;;; Commentary:$'
4 STOPRE='^\f$'
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.
9 markup: markdown
10 icon: emacs
11 city: Columbus
12 created: May 24, 2007 23:47 GMT
13 modified: $DATE" > index.text
15 echo "# Emacs Markdown Mode [![MELPA badge][melpa-badge]][melpa-link] [![MELPA stable badge][melpa-stable-badge]][melpa-stable-link] [![Travis CI Build Status][travis-badge]][travis-link]
17 [melpa-link]: https://melpa.org/#/markdown-mode
18 [melpa-stable-link]: https://stable.melpa.org/#/markdown-mode
19 [melpa-badge]: https://melpa.org/packages/markdown-mode-badge.svg
20 [melpa-stable-badge]: https://stable.melpa.org/packages/markdown-mode-badge.svg
21 [travis-link]: https://travis-ci.org/jrblevin/markdown-mode
22 [travis-badge]: https://travis-ci.org/jrblevin/markdown-mode.svg?branch=master
24 <!-- This file is autogenerated by webpage.sh from the comments at the top of
25 markdown-mode.el. Make edits there, not here. -->" > README.md
27 cat markdown-mode.el |\
28 # Keep only the Commentary section
29 awk "/$STARTRE/,/$STOPRE/" |\
30 # Remove the start and step regexps
31 grep -v "$STARTRE" | grep -v "$STOPRE" |\
32 # Convert headers
33 sed -e 's/^;;; \(.*\):$/## \1/' |\
34 # Remove leading spaces (but don't disturb pre blocks)
35 sed -e 's/^;;[ ]\{0,1\}//' |\
36 # Escape wiki links
37 #sed -e 's/\(\[\[[^]\n]*\]\]\)/\\\1/g' |\
38 # Use Markdown-style backticks for single-quoted lisp code
39 sed -e 's/`\([^'\'']*\)'\''/`\1`/g' |\
40 # Use <kbd> tags for single character, unprefixed keybindings
41 sed -e 's/`\([^`]\)`/<kbd>\1<\/kbd>/g' |\
42 # Use <kbd> tags for TAB and RET keys
43 sed -e 's/`TAB`/<kbd>TAB<\/kbd>/g' |\
44 sed -e 's/`RET`/<kbd>RET<\/kbd>/g' |\
45 # Use <kbd> tags for keybindings prefixed by C, M, or S
46 sed -e 's/`\([CMS]-[^`]*\)`/<kbd>\1<\/kbd>/g' |\
47 # Remove email addresses
48 sed -e 's/ <[^>]*@[^<]*> / /g' \
49 | tee -a README.md >> index.text