Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a target for syncing updated help pages to www.

  • Loading branch information...
commit ead05757e583c8124058024b608881967ccc7174 1 parent e19dec6
martinh martinh authored
Showing with 20 additions and 14 deletions.
  1. +4 −1 Makefile
  2. +5 −3 help/md2html
  3. +11 −9 help/md2html.www
  4. +0 −1  help/move_lines.md
5 Makefile
View
@@ -794,7 +794,7 @@ $(DERIVEDDIR)/help.stamp: $(HELP_FILES)
hiutil -vg -s en -Caf $(HELP_EN)/Vico.helpindex $(HELP_EN)
touch $(DERIVEDDIR)/help.stamp
-HELP_SRC = help
+HELP_SRC = $(CURDIR)/help
WWW_HELP_DST = $(CURDIR)/help/www
WWW_HELP_EN = $(WWW_HELP_DST)/en
wwwhelp:
@@ -803,6 +803,9 @@ wwwhelp:
cp -rf $(HELP_SRC)/shared $(WWW_HELP_DST)
cd $(WWW_HELP_EN) && $(HELP_SRC)/md2html.www $(HELP_SRC)/*.md
+syncwwwhelp: wwwhelp
+ rsync -avr $(WWW_HELP_DST)/ www.vicoapp.com:/var/www/vicoapp.com/help/
+
synchelp: help
rsync -avr $(HELP_RESDIR)/ www.vicoapp.com:/var/www/vicoapp.com/help
8 help/md2html
View
@@ -1,14 +1,16 @@
#!/bin/sh
+MARKDOWN_PL=${MARKDOWN:-$HOME/bin/Markdown.pl}
+MARKDOWN="perl $MARKDOWN_PL --html4tags"
+
head()
{
file=$1
title=$2
-cat <<EOF
+ cat <<EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
-
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../shared/help.css" type="text/css" media="screen">
@@ -31,7 +33,7 @@ while test -n "$1"; do
title=$(sed -n '/^# /{s///;p;q;}' "$1")
echo "converting $file with title '$title'" >&2
(head "$file" "$title"
- perl $HOME/bin/Markdown.pl --html4tags "$file"
+ $MARKDOWN "$file"
tail)
shift
done
20 help/md2html.www
View
@@ -1,39 +1,41 @@
#!/bin/sh
+MARKDOWN_PL=${MARKDOWN:-$HOME/bin/Markdown.pl}
+MARKDOWN="perl $MARKDOWN_PL --html4tags"
+
head()
{
file=$1
title=$2
-cat <<EOF
+ cat <<EOF
<!--#set var="title" value="$title" -->
-<!--#include file="/book/shared/head.shtml" -->
+<!--#include virtual="/inc/head.shtml" -->
EOF
}
tail()
{
cat <<EOF
-<!--#include file="/book/shared/tail.shtml" -->
+<!--#include virtual="/inc/tail.shtml" -->
EOF
}
-echo "# Index" > index.md
+echo "# Help Index" > index.md
echo "" >> index.md
while test -n "$1"; do
file=$1
title=$(sed -n '/^# /{s///;p;q;}' "$1")
echo "converting $file with title '$title'" >&2
- html="$(basename "${file%.*}.html")"
+ html="$(basename "${file%.*}.shtml")"
(head "$file" "$title"
- perl $HOME/bin/Markdown.pl --html4tags "$file"
+ sed 's/(\([^:.]*\)\.html)/(\1.shtml)/g' "$file" | $MARKDOWN
tail) > $html
echo " * [$title]($html)" >> index.md
shift
done
(head index.md Index
- perl $HOME/bin/Markdown.pl --html4tags index.md
- tail) > index.html
-
+ $MARKDOWN index.md
+ tail) > index.shtml
1  help/move_lines.md
View
@@ -14,4 +14,3 @@ to that line number. For example, <kbd>10G</kbd> jumps to line number
to the first line if no count is given.
* [Movement](movement.html)
-
Please sign in to comment.
Something went wrong with that request. Please try again.