Skip to content

Commit

Permalink
Merge pull request #911 from tim-moody/r6.2-docs
Browse files Browse the repository at this point in the history
update refresh-wiki-docs.sh with lib-refresh-wiki-docs.sh and remove latter
  • Loading branch information
tim-moody authored Apr 19, 2017
2 parents 9b0a56e + 500bab2 commit f3078a1
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 104 deletions.
17 changes: 8 additions & 9 deletions roles/httpd/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
- name: create admin group
group: name=admin
state=present

- name: Add apache user to admin group
user: name={{ apache_user }}
groups=admin
Expand All @@ -113,20 +113,19 @@
enabled=yes

- name: Create iiab-info directory
file: path={{ doc_root }}/iiab-info
file: path={{ doc_root }}/info
mode=0755
owner={{ apache_data }}
group={{ apache_data }}
state=directory

- name: create a config file for iiab-info
template: src=iiab-info.conf.j2
dest=/etc/{{ apache_config_dir }}/iiab-info.conf
- name: Remove iiab-info.conf
file: dest=/etc/{{ apache_config_dir }}/iiab-info.conf
state=absent

- name: enable it in debian
file: src=/etc/{{ apache_config_dir }}/iiab-info.conf
dest=/etc/apache2/sites-enabled/iiab-info.conf
state=link
- name: Remove iiab-info.conf symlink
file: dest=/etc/apache2/sites-enabled/iiab-info.conf
state=absent
when: is_debuntu

- include: html.yml
Expand Down
77 changes: 0 additions & 77 deletions scripts/lib-refresh-wiki-docs.sh

This file was deleted.

47 changes: 29 additions & 18 deletions scripts/refresh-wiki-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ source /etc/xsce/xsce.env
REPONAME=xsce
REPO=https://github.com/XSCE
WIKI=xsce-wiki
TARGET_URL=/info
WWWROOT=/library/www/html
INPUT=/tmp/${WIKI}
OUTPUT=/tmp/${WIKI}.out

# this script is located in the scritps/ direcctory in the local repo
# this script is located in the scritps/ directory in the local repo
SCRIPTDIR=$(dirname $0)
pushd $SCRIPTDIR

if [ ! -d /tmp/${WIKI} ]; then
mkdir -p /tmp/${WIKI}
git clone $REPO/$REPONAME.wiki.git /tmp/${WIKI}
fi
rm -rf $INPUT
rm -rf $OUTPUT
mkdir -p $INPUT
mkdir -p $OUTPUT

rsync -v /tmp/$WIKI/* ../docs
git clone $REPO/$REPONAME.wiki.git $INPUT

# convert the markdown docs to html
which pandoc
Expand All @@ -26,23 +30,25 @@ if [ $? -ne 0 ]; then
apt-get install -y pandoc
fi
fi
mkdir -p ../docs/html/online-help-offline
#mkdir -p ../docs/html/offline-help
mkdir -p $WWWROOT$TARGET_URL/html

for f in `ls ../docs`; do
# To Do find more links to rewrite, especially after moving from xsce to iiab
for f in `ls /tmp/${WIKI}`; do
FTRIMMED=${f%.md}
if [ $FTRIMMED = "Home" ]; then FTRIMMED=index;fi
pandoc -s ../docs/$f -o ../docs/html/online-help-offline/$FTRIMMED.html
pandoc -s /tmp/${WIKI}/$f -o $OUTPUT/$FTRIMMED.html
# make links refer to local directory
sed -i -e "s|$REPO/$REPONAME/wiki/\(.*\)\">|./\1.html\">|" ../docs/html/online-help-offline/$FTRIMMED.html
sed -i -e "s|http://schoolserver.org/faq|/info/FAQ|" ../docs/html/online-help-offline/$FTRIMMED.html
sed -i -e "s|$REPO/$REPONAME/blob/release-.*/\(.*\)\">|../\1.html\">|" ../docs/html/online-help-offline/$FTRIMMED.html
sed -i -e "s|$REPO/$REPONAME/wiki/\(.*\)\">|./\1.html\">|" $OUTPUT/$FTRIMMED.html
sed -i -e "s|http://schoolserver.org/faq|/info/html/FAQ|" $OUTPUT/$FTRIMMED.html
sed -i -e "s|$REPO/$REPONAME/blob/release-.*/\(.*\)\">|./\1.html\">|" $OUTPUT/$FTRIMMED.html
done

rsync -av $OUTPUT/ $WWWROOT$TARGET_URL

# copy the faq and other things
lynx -reload -source http://wiki.laptop.org/go/XS_Community_Edition/FAQ > ../docs/html/FAQ
lynx -reload -source http://wiki.laptop.org/go/XS_Community_Edition/Security > ../docs/html/Security
lynx -reload -source http://wiki.laptop.org/go/XS_Community_Edition/local_vars.yml > ../docs/html/local_vars.yml
lynx -reload -source http://wiki.laptop.org/go/XS_Community_Edition/FAQ > $WWWROOT$TARGET_URL/html/FAQ
lynx -reload -source http://wiki.laptop.org/go/XS_Community_Edition/Security > $WWWROOT$TARGET_URL/html/Security
lynx -reload -source http://wiki.laptop.org/go/XS_Community_Edition/local_vars.yml > $WWWROOT$TARGET_URL/html/local_vars.yml

# fetch the embedded help pages from the admin console
#for f in `ls ../roles/xsce-admin/files/console/help`; do
Expand All @@ -56,8 +62,13 @@ lynx -reload -source http://wiki.laptop.org/go/XS_Community_Edition/local_vars.y
for f in `ls ../Release*`; do
# FTRIMMED=${f%.md}
FTRIMMED=${f:2}
pandoc -s $f -o ../docs/html/$FTRIMMED.html
pandoc -s $f -o $WWWROOT$TARGET_URL$FTRIMMED.html
# make links refer to local directory
sed -i -e "s|$REPO/$REPONAME/wiki/\(.*\)\">|./\1.html\">)|" ../docs/html/$FTRIMMED.html
sed -i -e "s|$REPO/$REPONAME/wiki/\(.*\)\">|./\1.html\">)|" $WWWROOT$TARGET_URL$FTRIMMED.html
done

rm -rf $INPUT
rm -rf $OUTPUT

popd

0 comments on commit f3078a1

Please sign in to comment.