From 10bd6d876652ee415a1c06549d7dfe25895751bb Mon Sep 17 00:00:00 2001 From: Michał Łyszczek Date: Thu, 28 Nov 2019 11:14:57 +0100 Subject: www: move www related files to www directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Łyszczek --- Makefile | 4 +-- gen-download-page.sh | 28 ----------------- man2html.sh | 80 ------------------------------------------------ www/gen-download-page.sh | 28 +++++++++++++++++ www/man2html.sh | 80 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 110 insertions(+), 110 deletions(-) delete mode 100755 gen-download-page.sh delete mode 100755 man2html.sh create mode 100755 www/gen-download-page.sh create mode 100755 www/man2html.sh diff --git a/Makefile b/Makefile index 8081986..64f30bf 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,8 @@ install: install -m 0644 -D -t $(DESTDIR)$(PREFIX)/man3 man/mt_run_named.3 www: - ./gen-download-page.sh - ./man2html.sh + ./www/gen-download-page.sh + ./www/man2html.sh $(MAKE) -C www clean: diff --git a/gen-download-page.sh b/gen-download-page.sh deleted file mode 100755 index c136044..0000000 --- a/gen-download-page.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -project='mtest' -out='www/downloads.html' -remote="http://distfiles.bofc.pl/${project}" - -# extract links to files -links="$(curl "${remote}/" 2>/dev/null \ - | grep "${project}-[0-9]*\.[0-9]*\.[0-9]*\." | sort -r)" - -exec 1<&- -exec 1<>"${out}" - -echo > "${out}" -echo "

downloads

" -echo "

git

" -echo "

" -echo "git clone git@git.bofc.pl:${project}
" -echo "git clone git://git.bofc.pl/${project}
" -echo "git clone http://git.bofc.pl/${project}
" -echo "

" - -echo "

tarballs

" -echo "
"
-
-# convert links to absolute
-echo "${links}" | sed "s!a href=\"!a href=\"${remote}/!"
-echo "
" diff --git a/man2html.sh b/man2html.sh deleted file mode 100755 index 185da7c..0000000 --- a/man2html.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh - -hostname="http://librb.bofc.pl" -out="$(pwd)/www/manuals" -root="$(pwd)" -ftmp="/tmp/mtest-man2html" - -cd "${root}/man" -mkdir "${out}" - -for m in *.[1-8] -do - n="${m##*.}" - echo "opening ${m}" - - if grep "\.so man${n}" "${m}" - then - sed -i "s/man${n}/man/" "${m}" - man2html -r -H "${hostname}" "${m}" > "${ftmp}" - sed -i "s/man\//man${n}\//g" "${m}" - else - man2html -r -H "${hostname}" "${m}" > "${ftmp}" - fi - - # get only body part of the file - body_only="$(sed -n '//,/<\/BODY>/p' "${ftmp}")" - echo "$body_only" > "${ftmp}" - - # remove leftover and

man

tags from beginning - tail -n+3 "${ftmp}" > tmp; mv tmp "${ftmp}" - - # construct top page heading with page info, remove superflous info - name="$(basename ${m})" - name="${name%.*}" - version_info="$(head -n1 ${ftmp} | cut -f3 -d: | cut -f1 -d\<)" - tail -n+2 "${ftmp}" > tmp; mv tmp "${ftmp}" - sed -i "1s/^/

${name}(${n})<\/p>

bofc manual pages<\/p>

${name}(${n})<\/p>\n

/" "${ftmp}" - - # remove uneeded links to non-existing index - sed -i 's/Return to Main Contents<\/A>


//' "${ftmp}" - sed -i 's/Index<\/A>//g' "${ftmp}" - - # extract table of content and put it in the beginning of file - ## cache first two lines (page info) and remove them from file - tmp="$(head -n2 ${ftmp})" - tail -n+3 "${ftmp}" > tmp; mv tmp "${ftmp}" - - ## get table of content from file - toc="$(sed -n '/
/,/<\/DL>/p' "${ftmp}")" - - toc="$(echo "${toc}" | sed 's/
/