From 2b76a1dcb056720641b0a1b2002c7c63329dfa92 Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 16 Jun 2011 22:30:23 +0100 Subject: Improve webpage, specify javascript (as that's the ecmascript variant we're using) --- INSTALL | 2 +- Makefile | 30 +++++++++++++++++++----------- README | 4 ++-- TODO | 3 --- web/doap-src.ttl | 2 +- web/websummary.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ webheader.html | 15 --------------- websummary.sh | 44 -------------------------------------------- 8 files changed, 68 insertions(+), 77 deletions(-) create mode 100644 web/websummary.sh delete mode 100644 webheader.html delete mode 100644 websummary.sh diff --git a/INSTALL b/INSTALL index 439a7ed..8fcb6a1 100644 --- a/INSTALL +++ b/INSTALL @@ -1,4 +1,4 @@ -SimplyRead is written in ECMAScript, and how to launch it varies a +SimplyRead is written in JavaScript, and how to launch it varies a little depending on browser. # Firefox diff --git a/Makefile b/Makefile index 60b6647..510526c 100644 --- a/Makefile +++ b/Makefile @@ -37,20 +37,28 @@ web/gecko-updates.rdf: $(NAME)-$(VERSION).xpi web/chromium-updates.xml: chromium/updates.xml sed -e "s/VERSION/$(VERSION)/g" -e "s|WEBSITE|$(WEBSITE)|g" < $< > $@ -web/index.html: web/doap-src.ttl README webheader.html +web/doap.ttl: web/doap-src.ttl + sed -e "s|FOAF|$(AUTHORFOAF)|g" -e "s|AUTHORNAME|$(AUTHORNAME)|g" \ + -e "s|AUTHORHOME|$(AUTHORHOME)|g" -e "s|WEBSITE|$(WEBSITE)|g" \ + -e "s|REPOURL|$(REPOURL)|g" < $< > $@ + +web/index.html: web/doap.ttl README echo making webpage - cat < webheader.html > $@ + echo "$(NAME)" > $@ + echo '' >> $@ + echo '" >> $@ smu < README >> $@ - echo '

Download SimplyRead $(VERSION)
' >> $@ - echo 'GPG signature

' >> $@ - echo '

SimplyRead $(VERSION) for Firefox
' >> $@ - echo 'GPG signature

' >> $@ - echo '

SimplyRead $(VERSION) for Chromium
' >> $@ - echo 'GPG signature

' >> $@ + echo "[$(NAME) $(VERSION) source]($(NAME)-$(VERSION).tar.bz2) ([sig]($(NAME)-$(VERSION).tar.bz2.sig))" | smu >> $@ + + echo "[$(NAME) $(VERSION) for Firefox]($(NAME)-$(VERSION).xpi) ([sig]($(NAME)-$(VERSION).xpi.sig))" | smu >> $@ + + echo "[$(NAME) $(VERSION) for Chromium]($(NAME)-$(VERSION).crx) ([sig]($(NAME)-$(VERSION).crx.sig))" | smu >> $@ + echo '
' >> $@ - sed -e "s|FOAF|$(AUTHORFOAF)|g" -e "s|AUTHORNAME|$(AUTHORNAME)|g" \ - -e "s|AUTHORHOME|$(AUTHORHOME)|g" -e "s|WEBSITE|$(WEBSITE)|g" \ - -e "s|REPOURL|$(REPOURL)|g" < web/doap-src.ttl > web/doap.ttl sh web/websummary.sh web/doap.ttl | smu >> $@ echo '' >> $@ diff --git a/README b/README index 0a68f8a..a33f941 100644 --- a/README +++ b/README @@ -7,8 +7,8 @@ removes everything but the article from a webpage, displaying it simply and attractively. The program is packaged as an extension for several web -browsers, or as a standalone ECMAScript program to integrate -into other browsers. Read the INSTALL file for details. +browsers, or as a standalone JavaScript program to integrate +into other browsers. Running it multiple times switches between showing the original page and the simple version. diff --git a/TODO b/TODO index 62722ad..cc646ea 100644 --- a/TODO +++ b/TODO @@ -6,9 +6,6 @@ gecko: https://developer.mozilla.org/en/Extension_Versioning,_Update_and_Compatibility#Update_RDF_Format openssl dgst -sha512 -binary -sign private.pem web/gecko-updates.rdf i'm pretty sure generates the correct signature. however it then has to be encoded, using asn1/der & base64. also, according to the docs only the hash is signed/hashed, whereas it looks like the whole (particularly serialised) rdf is used by uhura -web: - change 'download simplyread' button to 'simplyread 0.4 source' - test: current tests test the keyboard shortcut, by sending an event; diff --git a/web/doap-src.ttl b/web/doap-src.ttl index 770e4ed..a0ad5e6 100644 --- a/web/doap-src.ttl +++ b/web/doap-src.ttl @@ -9,7 +9,7 @@ doap:shortdesc "Stop browsing, start reading"; doap:homepage ; doap:repository :repo; - doap:programming-language "ECMAScript"; + doap:programming-language "JavaScript"; doap:license ; doap:release :v0dot1, :v0dot2, :v0dot3, :v0dot4, :v0dot5; doap:maintainer . diff --git a/web/websummary.sh b/web/websummary.sh new file mode 100644 index 0000000..8da2790 --- /dev/null +++ b/web/websummary.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +test $# -ne 1 && echo "usage: $0 doap" && exit 1 + +rdf="$1" + +q="PREFIX doap: +PREFIX foaf: +SELECT ?home ?repo ?license ?maintainer ?maintainerhome ?lang ?repotype +WHERE { +?p a doap:Project; + doap:homepage ?home; + doap:repository ?r; + doap:license ?license; + doap:programming-language ?lang; + doap:maintainer ?m. +?r a ?repotype; + doap:location ?repo. +?m foaf:name ?maintainer; + foaf:homepage ?maintainerhome. +}" + +roqet -q -r csv -e "$q" -D /dev/stdin < $rdf | sed '/^Result/d' \ +| while read r; do + home=`echo $r | awk -F , '{print $2}'| sed -e 's/uri\(//' -e 's/\)//'` + repo=`echo $r | awk -F , '{print $3}'| sed -e 's/uri\(//' -e 's/\)//'` + licenseuri=`echo $r | awk -F , '{print $4}'| sed -e 's/uri\(//' -e 's/\)//'` + maint=`echo $r | awk -F , '{print $5}'| sed -e 's/"//g'` + mainthome=`echo $r | awk -F , '{print $6}'| sed -e 's/uri\(//' -e 's/\)//'` + lang=`echo $r | awk -F , '{print $7}'| sed -e 's/"//g'` + test "$licenseuri" = "http://www.gnu.org/licenses/gpl.html" && license="GPL" + test "$licenseuri" = "http://www.gnu.org/licenses/agpl.html" && license="AGPL" + test "$licenseuri" = "http://creativecommons.org/licenses/MIT/" && license="MIT" + repotype=`echo $r | awk -F , '{print $8}'| sed -e 's/uri\(//' -e 's/\)//'` + test "$repotype" = "http://usefulinc.com/ns/doap#GitRepository" && repocmd="git clone" + + cat <<- _EOF_ +- Project homepage: [$home]($home) +- Code repository: $repocmd $repo +- Maintainer: [$maint]($mainthome) +- Language: $lang +- License: [$license]($licenseuri) +- DOAP: [${home}doap.ttl](${home}doap.ttl) +_EOF_ +done diff --git a/webheader.html b/webheader.html deleted file mode 100644 index 7d73833..0000000 --- a/webheader.html +++ /dev/null @@ -1,15 +0,0 @@ - - - -SimplyRead - Stop browsing, start reading - diff --git a/websummary.sh b/websummary.sh deleted file mode 100644 index c274443..0000000 --- a/websummary.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -test $# -ne 1 && echo "usage: $0 doap" && exit 1 - -rdf="$1" - -q="PREFIX doap: -PREFIX foaf: -SELECT ?home ?repo ?license ?maintainer ?maintainerhome ?lang ?repotype -WHERE { -?p a doap:Project; - doap:homepage ?home; - doap:repository ?r; - doap:license ?license; - doap:programming-language ?lang; - doap:maintainer ?m. -?r a ?repotype; - doap:location ?repo. -?m foaf:name ?maintainer; - foaf:homepage ?maintainerhome. -}" - -roqet -q -r csv -e "$q" -D /dev/stdin < $rdf | sed '/^Result/d' \ -| while read r; do - home=`echo $r | awk -F , '{print $2}'| sed -e 's/uri(\(.*\))/\1/'` - repo=`echo $r | awk -F , '{print $3}'| sed -e 's/uri(\(.*\))/\1/'` - licenseuri=`echo $r | awk -F , '{print $4}'| sed -e 's/uri(\(.*\))/\1/'` - maint=`echo $r | awk -F , '{print $5}'| sed -e 's/"\(.*\)"/\1/'` - mainthome=`echo $r | awk -F , '{print $6}'| sed -e 's/uri(\(.*\))/\1/'` - lang=`echo $r | awk -F , '{print $7}'| sed -e 's/"\(.*\)"/\1/'` - test "$licenseuri" = "http://www.gnu.org/licenses/gpl.html" && license="GPL" - test "$licenseuri" = "http://www.gnu.org/licenses/agpl.html" && license="AGPL" - test "$licenseuri" = "http://creativecommons.org/licenses/MIT/" && license="MIT" - repotype=`echo $r | awk -F , '{print $8}'| sed -e 's/uri(\(.*\))/\1/'` - test "$repotype" = "http://usefulinc.com/ns/doap#GitRepository" && repocmd="git clone" - - cat <<- _EOF_ -- Project homepage: [$home]($home) -- Code repository: $repocmd $repo -- Maintainer: [$maint]($mainthome) -- Language: $lang -- License: [$license]($licenseuri) -_EOF_ -done -- cgit v1.2.3