Script to convert wiki FAQ to www.dragonflybsd.org FAQ
This is a multi-part message in MIME format.
--------------060407020709060400020807
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Here is a first run for a script that extracts the
contents of the wiki FAQ so it can be posted to the
dragonfly website.
Any comments? This script would be invoked via cron.
And would be used to keep the website and the FAQ
sync'ed.
TODO: add versioning so we can keep track of the changes
we are importing and send diffs to submit mailing list.
Note: Some of this could be done in the wiki, but thats
another project. :-) Anyone know how to program in php?
Max Okumoto
--------------060407020709060400020807
Content-Type: text/plain;
name="x"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="x"
#!/bin/sh
fetch http://www.sitetronics.com/dfwiki/index.php/DragonFly_FAQ
cp FAQ.header FAQ.cgi
#
# 1. Extract content section from downloaded page.
# 2. Delete table of contents section.
# 3. Remove URLs to edit links.
# 4. Convert <h1> tags to bold.
#
cat DragonFly_FAQ | sed \
-e '1,/<!-- start content -->/d' \
-e '/<!-- end content -->/,$d' \
-e '/<table border="0" id="toc">/,/<\/table>/d' \
-e 's,^<div class="editsection" style="float:right;margin-left:5px;">.*<\/div>,,' \
-e 's/<h1>/<b>/g' \
-e 's/<\/h1>/<\/b>/g' \
>> FAQ.cgi
cat FAQ.footer >> FAQ.cgi
chmod +x FAQ.cgi
--------------060407020709060400020807--
討論串 (同標題文章)
完整討論串 (本文為第 1 之 9 篇):