Branch: refs/heads/master
Author: Dominic Hopf <dmaphy(a)googlemail.com>
Committer: Dominic Hopf <dmaphy(a)googlemail.com>
Date: Tue, 16 Apr 2013 22:48:43 UTC
Commit: 04922cba9c053ed8cfaf0ace808bc45159dc579c
https://github.com/geany/plugins.geany.org/commit/04922cba9c053ed8cfaf0ace8…
Log Message:
-----------
Merge pull request #3 from vmkononenko/master
Changed plugin pages generation concept
Modified Paths:
--------------
gencontent.sh
Modified: gencontent.sh
398 files changed, 264 insertions(+), 134 deletions(-)
===================================================================
@@ -8,8 +8,8 @@
# plugins.geany.org website
#
# (C) Copyright 2010 by Dominic Hopf <dmaphy(a)googlemail.com>
-# Version: 1.1.1
-# Last Change: 2011-12-17
+# Version: 1.2.0
+# Last Change: 2013-04-15
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,6 +25,14 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# ChangeLog:
+# 2013-04-15 Volodymyr Kononenko <vm(a)kononenko.ws>
+# * the plugin listing (left side navigation bar) is now being generated
+# from all plugins, available in master branch
+# * if the plugin had different page in previous Geany versions, these
+# pages are also being generated. Links to them are included in the
+# bottom of plugin page
+# * fixed checking exceptions in EXCLUDE_PLUGINS
+#
# 2011-12-17 Dominic Hopf <dmaphy(a)googlemail.com>
# * generate .html files from READMEs for the latest Geany-Plugins version
# instead of git master
@@ -47,169 +55,291 @@
# missing!
# SOURCESDIR is the directory, where the README files will be found
-SOURCESDIR=$HOME"/.tmp/geany-plugins/"
+SOURCESDIR=${HOME}"/.tmp/geany-plugins/"
+
+WORKDIR=$(pwd)"/"
# CONTENTDIR is the directory, where the generated HTML files will be put
-CONTENTDIR="./content/"
+CONTENTDIR=${WORKDIR}"content/"
# LOGDIR is the directory where to put any logfiles and information about the
# generation of the content files
-LOGDIR="./gencontent_logs/"
+LOGDIR=${WORKDIR}"gencontent_logs/"
# plugins to exclude from the nightly re-generation via rst2html because they
# have a separate HTML page not generated from the README file
-EXCLUDE_PLUGINS=( geanylatex geanysendmail geanylua )
+declare -a EXCLUDE_PLUGINS=( geanylatex geanysendmail geanylua )
+
+RST2HTML=$(which rst2html)
+TIDY=$(which tidy)
+
+# List of plugins, available in the letest release
+declare -a RELEASE_PLUGIN_LIST
-RST2HTML="/usr/bin/rst2html"
-TIDY="/usr/bin/tidy"
+# List of plugins, available in the letest release
+declare -a MASTER_PLUGIN_LIST
if [ ! -x "$RST2HTML" ]
then
- echo "rst2html not found. Exiting."
- exit 127
+ echo "rst2html not found. Exiting."
+ exit 127
fi
if [ ! -x "$TIDY" ]
then
- echo "tidy not found. Exiting."
- exit 127
+ echo "tidy not found. Exiting."
+ exit 127
fi
-# small function to check an array if an element is included
in_array()
{
- NEEDLE=$1
- shift
-
- # search for the NEEDLE $1 in the haystack $@
- for j in $@;
- do
- if [ $NEEDLE == $j ]; then
- return 0;
- fi;
- done;
-
- return 1;
+ declare -a arr=("${!2}")
+ found=0
+
+ for i in "${arr[@]}"
+ do
+ if [ "${i}" == "$1" ]; then
+ found=1
+ fi
+ done
+
+ return ${found}
}
-if [ ! -d $SOURCESDIR ]; then
- echo -e "Directory containing sources $SOURCESDIR could not be found. Trying to clone from git...\n"
- git clone git://github.com/geany/geany-plugins.git $SOURCESDIR
-fi
+function prepare_source_dir()
+{
+ if [ ! -d "${SOURCESDIR}" ]; then
+ echo -e "Directory containing sources $SOURCESDIR could not be found.\nTrying to clone from git...\n"
+ git clone git://github.com/geany/geany-plugins.git ${SOURCESDIR}
+ fi
+
+ if [ $? -ne 0 ]; then
+ echo "git clone failed. Exiting..."
+ exit 1
+ fi
+}
-cd $SOURCESDIR
-
-echo "Checking out master branch..."
-git checkout master
-echo "Updating master branch..."
-git pull
-
-VERSION=`git tag -l | tail -n1`
-echo "Found latest Geany-Plugins version: $VERSION."
-
-git branch | grep $VERSION
-
-if [ $? -ne 0 ]; then
- echo "A local branch does not exist for $VERSION."
- echo "Checking if $VERSION exists remote.."
- UPSTREAM=`git branch -r | grep $VERSION`
-
- if [ $? -eq 0 ]; then
- echo "Remote branch $UPSTREAM found. Checking out..."
- git checkout -b $VERSION $UPSTREAM
- else
- echo "Could not find a remote branch. Checking out the tag $VERSION..."
- git checkout $VERSION > /dev/null
- fi
-else
- echo "A local branch exists for $VERSION. Updating..."
- git checkout $VERSION && git pull
-fi
-cd - > /dev/null
+function prepare_content_dir()
+{
+ if [ ! -d "${CONTENTDIR}" ]; then
+ echo -e "Directory containing contents $CONTENTDIR could not be found!\n"
+ exit 1
+ fi
+}
-if [ ! -d $CONTENTDIR ]; then
- echo -e "Directory containing contents $CONTENTDIR could not be found!\n"
- exit 1
-fi
+function prepare_log_dir()
+{
+ mkdir -p ${LOGDIR}
+}
+
+
+function add_to_navigation()
+{
+ dir=$1
+ title=$(echo ${dir} | sed 's/\([a-z]\)\([a-zA-Z0-9]*\)/\u\1\2/g')
+ echo "<li><a href=\"${dir}.html\">${title}</a></li>" >> "${CONTENTDIR}geany-plugins-listing.html"
+}
-mkdir -p $LOGDIR
-
-
-# reset geany-plugins-listing.html, the file which is included as navigation
-rm -f $CONTENTDIR"geany-plugins-listing.html"
-touch $CONTENTDIR"geany-plugins-listing.html"
-
-for i in `ls $SOURCESDIR`;
-do
- if [ -d $SOURCESDIR$i -a $i"x" != "buildx" -a $i"x" != "pox" ]; then
- # check if the current plugin is included in the exclusion-list...
- in_array $i ${EXCLUDE_PLUGINS[@]}
-
- if [ $? -eq 0 ]; then # ... if yes, ...
- # ... add it to the navigation ...
- title=`echo ${i} | sed 's/\([a-z]\)\([a-zA-Z0-9]*\)/\u\1\2/g'`
- echo "<li><a href=\"$i.html\">${title}</a></li>" >> $CONTENTDIR"geany-plugins-listing.html"
- continue # ... and jump to the next one
- fi;
-
- LOGFILE=$LOGDIR$i"_log_"`date "+%Y-%m-%d"`
-
- echo -e "Generating content file $i.html...\n\n" > $LOGFILE
-
- if [ -s $SOURCESDIR$i/README ]; then
- # TODO: there is still output from rst2html to the shell, that ideally should'nt be
- # TODO: newer versions of rst2html may face problems with the configuration files encoding
- $RST2HTML -s --config=$CONTENTDIR"rst2html_config.conf" $SOURCESDIR$i/README > .README.html 2> $LOGFILE
- title=`echo ${i} | sed 's/\([a-z]\)\([a-zA-Z0-9]*\)/\u\1\2/g'`
- echo "<li><a href=\"$i.html\">${title}</a></li>" >> $CONTENTDIR"geany-plugins-listing.html"
-
- if [ $? -ne 0 ]; then
- echo -e "$RST2HTML exited with $?.\n\n"
- continue
- fi
- else
- echo -e "File $SOURCESDIR$i/README not found.\nYou might want to have a look whats up there.\nCopying no-readme-template instead.."
- cp "./templates/no-readme-template.html" $CONTENTDIR$i.html
- sed -i "s/{plugin_name}/$i/g" $CONTENTDIR$i.html
- continue
- fi
- echo -e "\n\n" >> $LOGFILE
-
-
- $TIDY -config $CONTENTDIR"tidy.conf" .README.html >> $LOGFILE 2>&1
- case "$?" in
- 1)
- echo -e "$TIDY exited with 1, There were warnings."
- ;;
- 2)
- echo "$TIDY exited with 2. There were errors.\n\n"
- continue
- ;;
- *)
- echo -e "$TIDY exited with $?. Everything should be fine.\n"
- ;;
- esac
- echo -e "Result:\t$CONTENTDIR$i.html\nLog:\t$LOGFILE\n"
- echo -e "\n\n" >> $LOGFILE
-
- # since tidy just outputs spaces, not tabs, we'll replace those spaces
- # with tabs again ourself
- sed -i "s/ /\t/g" .README.html
- cp .README.html $CONTENTDIR$i.html
- echo -e "\n\n" >> $LOGFILE
-
- fi # if [ -d $SOURCESDIR$i -a $i"x" != "buildx" -a $i"x" != "pox" ];
-done
-
-echo "Switching back to master branch..."
-git checkout master
+function is_plugin()
+{
+ f=$1
+ cd ${SOURCESDIR}
+ if [ -d "${f}" ] && [ "${f}x" != "buildx" ] && [ "${f}x" != "pox" ]; then
+ return 1
+ else
+ return 0
+ fi
+}
+
+
+# Generates geany-plugins-listing.html - the file which is included as navigation
+function gen_plugins_listing_html()
+{
+ cd ${SOURCESDIR}
+
+ echo "Checking out master branch..."
+ git checkout master
+ echo "Updating master branch..."
+ git pull
+
+ cd ${WORKDIR}
+
+ # reset old geany-plugins-listing.html
+ rm -f ${CONTENTDIR}"geany-plugins-listing.html"
+
+ for dir in $(ls ${SOURCESDIR})
+ do
+ is_plugin ${dir}
+ if [ $? -eq 1 ]; then
+ add_to_navigation ${dir}
+ MASTER_PLUGIN_LIST+=("${dir}")
+ fi
+ done
+}
+
+
+function gen_html_from_readme()
+{
+ plugin="$1"
+ dir="$2"
+ LOGFILE="${LOGDIR}${plugin}_log_"$(date "+%Y-%m-%d")
+
+ cd ${CONTENTDIR}
+ # TODO: newer versions of rst2html may face problems with the configuration files encoding
+ $RST2HTML -s --config=${CONTENTDIR}"rst2html_config.conf" ${SOURCESDIR}${plugin}/README ${SOURCESDIR}.README.html 2> $LOGFILE
+ cd - > /dev/null
+
+ retcode=$?
+ if [ ${retcode} -ne 0 ]; then
+ echo -e "$RST2HTML exited with ${retcode}.\n\n"
+ fi
+
+ $TIDY -config ${WORKDIR}tidy.conf .README.html >> $LOGFILE 2>&1
+ case "$?" in
+ 1)
+ echo -e "$TIDY exited with 1. There were warnings."
+ ;;
+ 2)
+ echo "$TIDY exited with 2. There were errors.\n\n"
+ ;;
+ *)
+ echo -e "$TIDY exited with $?. Everything should be fine.\n"
+ ;;
+ esac
+ echo -e "Result:\t${dir}${plugin}.html\nLog:\t${LOGFILE}\n"
+ echo -e "\n\n" >> $LOGFILE
+
+ # since tidy just outputs spaces, not tabs, we'll replace those spaces
+ # with tabs again ourself
+ sed -i "s/ /\t/g" .README.html
+ cp .README.html ${dir}${plugin}.html
+ echo -e "\n\n" >> ${LOGFILE}
+}
+
+
+function gen_plugin_pages()
+{
+ cd $SOURCESDIR
+ for fname in $(ls ${SOURCESDIR})
+ do
+ is_plugin ${fname}
+ if [ $? -ne 1 ]; then
+ continue
+ fi
+
+ RELEASE_PLUGIN_LIST+=(${fname})
+
+ in_array ${fname} EXCLUDE_PLUGINS[@]
+ if [ $? -eq 1 ]; then
+ continue
+ fi
+
+ prevtag=""
+ for tag in $(git tag | tac)
+ do
+ git checkout -q ${tag}
+ if [ ${tag} == $(git tag | tail -n 1) ]; then
+ if [ -s ${SOURCESDIR}${fname}/README ]; then
+ gen_html_from_readme ${fname} ${CONTENTDIR}
+ else
+ echo -e "File ${SOURCESDIR}${fname}/README not found.\nYou might want to have a look whats up there.\nCopying no-readme-template instead."
+ cp ${WORKDIR}/templates/no-readme-template.html ${CONTENTDIR}${fname}.html
+ sed -i "s/{plugin_name}/${fname}/g" ${CONTENTDIR}${fname}.html
+ prevtag=${tag}
+ continue
+ fi
+ else
+ diff=$(git diff ${prevtag} -- ${fname}/README)
+ if [ -n "${diff}" ]; then
+ # diff output is not empty
+ mkdir -p ${CONTENTDIR}${tag}
+ gen_html_from_readme ${fname} ${CONTENTDIR}${tag}"/"
+ fi
+ fi
+ prevtag=${tag}
+ done
+
+ git checkout -q $(git tag | tail -n 1)
+ done
+}
+
+
+# The function generates pages for plugins, which are missing in release
+# but are present in master branch
+function gen_new_plugins_pages()
+{
+ git checkout master
+ for plugin in ${MASTER_PLUGIN_LIST[@]}
+ do
+ in_array ${plugin} RELEASE_PLUGIN_LIST[@]
+ if [ $? -eq 0 ]; then
+ gen_html_from_readme ${plugin} ${CONTENTDIR}
+ fi
+ done
+}
+
+
+function add_links_to_old_pages()
+{
+ declare -A header_added
+ for plugin in ${RELEASE_PLUGIN_LIST[@]}
+ do
+ header_added["${plugin}"]=0
+ done
+
+ for tag in $(ls ${CONTENTDIR})
+ do
+ if [ ! -d ${CONTENTDIR}${tag} ]; then
+ # this is not dir with old pages. Skip it
+ continue
+ fi
+ for plugin in $(ls ${CONTENTDIR}${tag} | awk -F'.' '{print $1}')
+ do
+ if [ ${header_added[${plugin}]} -eq 0 ]; then
+ # Adding header
+ echo -e "<div class=\"section\" id=\"docs-for-previous-versions\">\n<h3>\nDocs for previous versions\n</h3>\n<p>\n<ul>\n" >> ${CONTENTDIR}${plugin}.html
+ header_added["${plugin}"]=1
+ fi
+ echo -e "<li><a href=\"index.php?site=${tag}/${plugin}\">${tag}</a></li>\n" >> ${CONTENTDIR}${plugin}.html
+ done
+ done
+
+ # closing opened tags
+ for plugin in "${!header_added[@]}"
+ do
+ if [ ${header_added[${plugin}]} -eq 1 ]; then
+ echo -e "</ul>\n</p>\n</div>" >> ${CONTENTDIR}${plugin}.html
+ $TIDY -config ${WORKDIR}tidy.conf ${CONTENTDIR}${plugin}.html > /dev/null 2>&1
+ fi
+ done
+}
+
# clean up any unneccessary files
-find $LOGDIR -mtime +7 -delete # delete logfiles older than 7 days
+function clean_up()
+{
+ # delete logfiles older than 7 days
+ find $LOGDIR -mtime +7 -delete
+}
+
+
+function main()
+{
+ prepare_source_dir
+ prepare_content_dir
+ prepare_log_dir
+ gen_plugins_listing_html
+ gen_plugin_pages
+ gen_new_plugins_pages
+ add_links_to_old_pages
+ clean_up
+}
+
+main
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Frank Lanitz <frank(a)frank.uvena.de>
Committer: Frank Lanitz <frank(a)frank.uvena.de>
Date: Mon, 15 Apr 2013 14:17:28 UTC
Commit: 3ea5639b70626894e38f51aae104186501f5921d
https://github.com/geany/geany-plugins/commit/3ea5639b70626894e38f51aae1041…
Log Message:
-----------
HACKING: Added info about MAINTAINERS and po/POTFILES.in
Modified Paths:
--------------
HACKING
Modified: HACKING
40 files changed, 40 insertions(+), 0 deletions(-)
===================================================================
@@ -141,6 +141,7 @@ Example::
This avoid spawning an unexpected browser when the configured one is
wrong, and gives the user a chance to correctly fix the preference.
+
Coding and Plugin structure
===========================
@@ -235,7 +236,46 @@ informationen how to build the sources. An example could look like::
include $(top_srcdir)/build/cppcheck.mk
+Additional things to do for a new plugin
+----------------------------------------
+
+Adding yourself to MAINTAINERS
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+As you might want to keep on maintaining your newly added plugin, we
+recommend to put your contact data to file MAINTAINERS which is
+located inside geany-plugins root folder. The entry should contain
+your plugin name as well as some of the important data. An example
+could look like::
+
+ myfancyplugin
+ P: Jon Doe <jon(a)example.org>
+ M: Jon Doe <jon(a)example.org>
+ W: http://example.org/myfancyplugin
+ S: Maintained
+
+The flags can be compiled like this:
+
+* P: Person
+* M: Mail patches to: FullName <address@domain>
+* W: Web-page with status/info
+* S: Status of plugin
+
+Once you have a look onto MAINTAINERS you will see a lot of examples
+as well as some more detailed information.
+
+
+Adding your plugin-files to po/POTFILES.in
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+If you want to have your plugin translated into different languages
+you will have to add your plugin to file po/POTFILES.in. This
+contains a list of all translateable files for each plugin. An
+example could look like::
+
+ #myfancyplugin
+ yourfancypluginname/src/yourfancypluginname.c
+
I18n/l10n
---------
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Volodymyr Kononenko <vm(a)kononenko.ws>
Committer: Volodymyr Kononenko <volodymyr.kononenko(a)globallogic.com>
Date: Mon, 15 Apr 2013 11:22:54 UTC
Commit: 7281c688cd4fb9d5fc9be6b4e13dfdb0e341db07
https://github.com/geany/plugins.geany.org/commit/7281c688cd4fb9d5fc9be6b4e…
Log Message:
-----------
Changed plugin pages generation concept
* the plugin listing (left side navigation bar) is now being generated
from all plugins, available in master branch
* if the plugin had different page in previous Geany versions, these
pages are also being generated. Links to them are included in the
bottom of plugin page
* fixed checking exceptions in EXCLUDE_PLUGINS
Modified Paths:
--------------
gencontent.sh
Modified: gencontent.sh
398 files changed, 264 insertions(+), 134 deletions(-)
===================================================================
@@ -8,8 +8,8 @@
# plugins.geany.org website
#
# (C) Copyright 2010 by Dominic Hopf <dmaphy(a)googlemail.com>
-# Version: 1.1.1
-# Last Change: 2011-12-17
+# Version: 1.2.0
+# Last Change: 2013-04-15
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,6 +25,14 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# ChangeLog:
+# 2013-04-15 Volodymyr Kononenko <vm(a)kononenko.ws>
+# * the plugin listing (left side navigation bar) is now being generated
+# from all plugins, available in master branch
+# * if the plugin had different page in previous Geany versions, these
+# pages are also being generated. Links to them are included in the
+# bottom of plugin page
+# * fixed checking exceptions in EXCLUDE_PLUGINS
+#
# 2011-12-17 Dominic Hopf <dmaphy(a)googlemail.com>
# * generate .html files from READMEs for the latest Geany-Plugins version
# instead of git master
@@ -47,169 +55,291 @@
# missing!
# SOURCESDIR is the directory, where the README files will be found
-SOURCESDIR=$HOME"/.tmp/geany-plugins/"
+SOURCESDIR=${HOME}"/.tmp/geany-plugins/"
+
+WORKDIR=$(pwd)"/"
# CONTENTDIR is the directory, where the generated HTML files will be put
-CONTENTDIR="./content/"
+CONTENTDIR=${WORKDIR}"content/"
# LOGDIR is the directory where to put any logfiles and information about the
# generation of the content files
-LOGDIR="./gencontent_logs/"
+LOGDIR=${WORKDIR}"gencontent_logs/"
# plugins to exclude from the nightly re-generation via rst2html because they
# have a separate HTML page not generated from the README file
-EXCLUDE_PLUGINS=( geanylatex geanysendmail geanylua )
+declare -a EXCLUDE_PLUGINS=( geanylatex geanysendmail geanylua )
+
+RST2HTML=$(which rst2html)
+TIDY=$(which tidy)
+
+# List of plugins, available in the letest release
+declare -a RELEASE_PLUGIN_LIST
-RST2HTML="/usr/bin/rst2html"
-TIDY="/usr/bin/tidy"
+# List of plugins, available in the letest release
+declare -a MASTER_PLUGIN_LIST
if [ ! -x "$RST2HTML" ]
then
- echo "rst2html not found. Exiting."
- exit 127
+ echo "rst2html not found. Exiting."
+ exit 127
fi
if [ ! -x "$TIDY" ]
then
- echo "tidy not found. Exiting."
- exit 127
+ echo "tidy not found. Exiting."
+ exit 127
fi
-# small function to check an array if an element is included
in_array()
{
- NEEDLE=$1
- shift
-
- # search for the NEEDLE $1 in the haystack $@
- for j in $@;
- do
- if [ $NEEDLE == $j ]; then
- return 0;
- fi;
- done;
-
- return 1;
+ declare -a arr=("${!2}")
+ found=0
+
+ for i in "${arr[@]}"
+ do
+ if [ "${i}" == "$1" ]; then
+ found=1
+ fi
+ done
+
+ return ${found}
}
-if [ ! -d $SOURCESDIR ]; then
- echo -e "Directory containing sources $SOURCESDIR could not be found. Trying to clone from git...\n"
- git clone git://github.com/geany/geany-plugins.git $SOURCESDIR
-fi
+function prepare_source_dir()
+{
+ if [ ! -d "${SOURCESDIR}" ]; then
+ echo -e "Directory containing sources $SOURCESDIR could not be found.\nTrying to clone from git...\n"
+ git clone git://github.com/geany/geany-plugins.git ${SOURCESDIR}
+ fi
+
+ if [ $? -ne 0 ]; then
+ echo "git clone failed. Exiting..."
+ exit 1
+ fi
+}
-cd $SOURCESDIR
-
-echo "Checking out master branch..."
-git checkout master
-echo "Updating master branch..."
-git pull
-
-VERSION=`git tag -l | tail -n1`
-echo "Found latest Geany-Plugins version: $VERSION."
-
-git branch | grep $VERSION
-
-if [ $? -ne 0 ]; then
- echo "A local branch does not exist for $VERSION."
- echo "Checking if $VERSION exists remote.."
- UPSTREAM=`git branch -r | grep $VERSION`
-
- if [ $? -eq 0 ]; then
- echo "Remote branch $UPSTREAM found. Checking out..."
- git checkout -b $VERSION $UPSTREAM
- else
- echo "Could not find a remote branch. Checking out the tag $VERSION..."
- git checkout $VERSION > /dev/null
- fi
-else
- echo "A local branch exists for $VERSION. Updating..."
- git checkout $VERSION && git pull
-fi
-cd - > /dev/null
+function prepare_content_dir()
+{
+ if [ ! -d "${CONTENTDIR}" ]; then
+ echo -e "Directory containing contents $CONTENTDIR could not be found!\n"
+ exit 1
+ fi
+}
-if [ ! -d $CONTENTDIR ]; then
- echo -e "Directory containing contents $CONTENTDIR could not be found!\n"
- exit 1
-fi
+function prepare_log_dir()
+{
+ mkdir -p ${LOGDIR}
+}
+
+
+function add_to_navigation()
+{
+ dir=$1
+ title=$(echo ${dir} | sed 's/\([a-z]\)\([a-zA-Z0-9]*\)/\u\1\2/g')
+ echo "<li><a href=\"${dir}.html\">${title}</a></li>" >> "${CONTENTDIR}geany-plugins-listing.html"
+}
-mkdir -p $LOGDIR
-
-
-# reset geany-plugins-listing.html, the file which is included as navigation
-rm -f $CONTENTDIR"geany-plugins-listing.html"
-touch $CONTENTDIR"geany-plugins-listing.html"
-
-for i in `ls $SOURCESDIR`;
-do
- if [ -d $SOURCESDIR$i -a $i"x" != "buildx" -a $i"x" != "pox" ]; then
- # check if the current plugin is included in the exclusion-list...
- in_array $i ${EXCLUDE_PLUGINS[@]}
-
- if [ $? -eq 0 ]; then # ... if yes, ...
- # ... add it to the navigation ...
- title=`echo ${i} | sed 's/\([a-z]\)\([a-zA-Z0-9]*\)/\u\1\2/g'`
- echo "<li><a href=\"$i.html\">${title}</a></li>" >> $CONTENTDIR"geany-plugins-listing.html"
- continue # ... and jump to the next one
- fi;
-
- LOGFILE=$LOGDIR$i"_log_"`date "+%Y-%m-%d"`
-
- echo -e "Generating content file $i.html...\n\n" > $LOGFILE
-
- if [ -s $SOURCESDIR$i/README ]; then
- # TODO: there is still output from rst2html to the shell, that ideally should'nt be
- # TODO: newer versions of rst2html may face problems with the configuration files encoding
- $RST2HTML -s --config=$CONTENTDIR"rst2html_config.conf" $SOURCESDIR$i/README > .README.html 2> $LOGFILE
- title=`echo ${i} | sed 's/\([a-z]\)\([a-zA-Z0-9]*\)/\u\1\2/g'`
- echo "<li><a href=\"$i.html\">${title}</a></li>" >> $CONTENTDIR"geany-plugins-listing.html"
-
- if [ $? -ne 0 ]; then
- echo -e "$RST2HTML exited with $?.\n\n"
- continue
- fi
- else
- echo -e "File $SOURCESDIR$i/README not found.\nYou might want to have a look whats up there.\nCopying no-readme-template instead.."
- cp "./templates/no-readme-template.html" $CONTENTDIR$i.html
- sed -i "s/{plugin_name}/$i/g" $CONTENTDIR$i.html
- continue
- fi
- echo -e "\n\n" >> $LOGFILE
-
-
- $TIDY -config $CONTENTDIR"tidy.conf" .README.html >> $LOGFILE 2>&1
- case "$?" in
- 1)
- echo -e "$TIDY exited with 1, There were warnings."
- ;;
- 2)
- echo "$TIDY exited with 2. There were errors.\n\n"
- continue
- ;;
- *)
- echo -e "$TIDY exited with $?. Everything should be fine.\n"
- ;;
- esac
- echo -e "Result:\t$CONTENTDIR$i.html\nLog:\t$LOGFILE\n"
- echo -e "\n\n" >> $LOGFILE
-
- # since tidy just outputs spaces, not tabs, we'll replace those spaces
- # with tabs again ourself
- sed -i "s/ /\t/g" .README.html
- cp .README.html $CONTENTDIR$i.html
- echo -e "\n\n" >> $LOGFILE
-
- fi # if [ -d $SOURCESDIR$i -a $i"x" != "buildx" -a $i"x" != "pox" ];
-done
-
-echo "Switching back to master branch..."
-git checkout master
+function is_plugin()
+{
+ f=$1
+ cd ${SOURCESDIR}
+ if [ -d "${f}" ] && [ "${f}x" != "buildx" ] && [ "${f}x" != "pox" ]; then
+ return 1
+ else
+ return 0
+ fi
+}
+
+
+# Generates geany-plugins-listing.html - the file which is included as navigation
+function gen_plugins_listing_html()
+{
+ cd ${SOURCESDIR}
+
+ echo "Checking out master branch..."
+ git checkout master
+ echo "Updating master branch..."
+ git pull
+
+ cd ${WORKDIR}
+
+ # reset old geany-plugins-listing.html
+ rm -f ${CONTENTDIR}"geany-plugins-listing.html"
+
+ for dir in $(ls ${SOURCESDIR})
+ do
+ is_plugin ${dir}
+ if [ $? -eq 1 ]; then
+ add_to_navigation ${dir}
+ MASTER_PLUGIN_LIST+=("${dir}")
+ fi
+ done
+}
+
+
+function gen_html_from_readme()
+{
+ plugin="$1"
+ dir="$2"
+ LOGFILE="${LOGDIR}${plugin}_log_"$(date "+%Y-%m-%d")
+
+ cd ${CONTENTDIR}
+ # TODO: newer versions of rst2html may face problems with the configuration files encoding
+ $RST2HTML -s --config=${CONTENTDIR}"rst2html_config.conf" ${SOURCESDIR}${plugin}/README ${SOURCESDIR}.README.html 2> $LOGFILE
+ cd - > /dev/null
+
+ retcode=$?
+ if [ ${retcode} -ne 0 ]; then
+ echo -e "$RST2HTML exited with ${retcode}.\n\n"
+ fi
+
+ $TIDY -config ${WORKDIR}tidy.conf .README.html >> $LOGFILE 2>&1
+ case "$?" in
+ 1)
+ echo -e "$TIDY exited with 1. There were warnings."
+ ;;
+ 2)
+ echo "$TIDY exited with 2. There were errors.\n\n"
+ ;;
+ *)
+ echo -e "$TIDY exited with $?. Everything should be fine.\n"
+ ;;
+ esac
+ echo -e "Result:\t${dir}${plugin}.html\nLog:\t${LOGFILE}\n"
+ echo -e "\n\n" >> $LOGFILE
+
+ # since tidy just outputs spaces, not tabs, we'll replace those spaces
+ # with tabs again ourself
+ sed -i "s/ /\t/g" .README.html
+ cp .README.html ${dir}${plugin}.html
+ echo -e "\n\n" >> ${LOGFILE}
+}
+
+
+function gen_plugin_pages()
+{
+ cd $SOURCESDIR
+ for fname in $(ls ${SOURCESDIR})
+ do
+ is_plugin ${fname}
+ if [ $? -ne 1 ]; then
+ continue
+ fi
+
+ RELEASE_PLUGIN_LIST+=(${fname})
+
+ in_array ${fname} EXCLUDE_PLUGINS[@]
+ if [ $? -eq 1 ]; then
+ continue
+ fi
+
+ prevtag=""
+ for tag in $(git tag | tac)
+ do
+ git checkout -q ${tag}
+ if [ ${tag} == $(git tag | tail -n 1) ]; then
+ if [ -s ${SOURCESDIR}${fname}/README ]; then
+ gen_html_from_readme ${fname} ${CONTENTDIR}
+ else
+ echo -e "File ${SOURCESDIR}${fname}/README not found.\nYou might want to have a look whats up there.\nCopying no-readme-template instead."
+ cp ${WORKDIR}/templates/no-readme-template.html ${CONTENTDIR}${fname}.html
+ sed -i "s/{plugin_name}/${fname}/g" ${CONTENTDIR}${fname}.html
+ prevtag=${tag}
+ continue
+ fi
+ else
+ diff=$(git diff ${prevtag} -- ${fname}/README)
+ if [ -n "${diff}" ]; then
+ # diff output is not empty
+ mkdir -p ${CONTENTDIR}${tag}
+ gen_html_from_readme ${fname} ${CONTENTDIR}${tag}"/"
+ fi
+ fi
+ prevtag=${tag}
+ done
+
+ git checkout -q $(git tag | tail -n 1)
+ done
+}
+
+
+# The function generates pages for plugins, which are missing in release
+# but are present in master branch
+function gen_new_plugins_pages()
+{
+ git checkout master
+ for plugin in ${MASTER_PLUGIN_LIST[@]}
+ do
+ in_array ${plugin} RELEASE_PLUGIN_LIST[@]
+ if [ $? -eq 0 ]; then
+ gen_html_from_readme ${plugin} ${CONTENTDIR}
+ fi
+ done
+}
+
+
+function add_links_to_old_pages()
+{
+ declare -A header_added
+ for plugin in ${RELEASE_PLUGIN_LIST[@]}
+ do
+ header_added["${plugin}"]=0
+ done
+
+ for tag in $(ls ${CONTENTDIR})
+ do
+ if [ ! -d ${CONTENTDIR}${tag} ]; then
+ # this is not dir with old pages. Skip it
+ continue
+ fi
+ for plugin in $(ls ${CONTENTDIR}${tag} | awk -F'.' '{print $1}')
+ do
+ if [ ${header_added[${plugin}]} -eq 0 ]; then
+ # Adding header
+ echo -e "<div class=\"section\" id=\"docs-for-previous-versions\">\n<h3>\nDocs for previous versions\n</h3>\n<p>\n<ul>\n" >> ${CONTENTDIR}${plugin}.html
+ header_added["${plugin}"]=1
+ fi
+ echo -e "<li><a href=\"index.php?site=${tag}/${plugin}\">${tag}</a></li>\n" >> ${CONTENTDIR}${plugin}.html
+ done
+ done
+
+ # closing opened tags
+ for plugin in "${!header_added[@]}"
+ do
+ if [ ${header_added[${plugin}]} -eq 1 ]; then
+ echo -e "</ul>\n</p>\n</div>" >> ${CONTENTDIR}${plugin}.html
+ $TIDY -config ${WORKDIR}tidy.conf ${CONTENTDIR}${plugin}.html > /dev/null 2>&1
+ fi
+ done
+}
+
# clean up any unneccessary files
-find $LOGDIR -mtime +7 -delete # delete logfiles older than 7 days
+function clean_up()
+{
+ # delete logfiles older than 7 days
+ find $LOGDIR -mtime +7 -delete
+}
+
+
+function main()
+{
+ prepare_source_dir
+ prepare_content_dir
+ prepare_log_dir
+ gen_plugins_listing_html
+ gen_plugin_pages
+ gen_new_plugins_pages
+ add_links_to_old_pages
+ clean_up
+}
+
+main
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: Enrico Tröger <enrico.troeger(a)uvena.de>
Date: Sun, 07 Apr 2013 20:48:40 UTC
Commit: 0497aa99d80618f916c7fbbcbda9ada2b2b9f369
https://github.com/geany/geany-plugins/commit/0497aa99d80618f916c7fbbcbda9a…
Log Message:
-----------
Merge pull request #96 from b4n/wip/spellcheck
spellcheck: Fix check for default language if LANG contains UTF-8
Modified Paths:
--------------
spellcheck/src/speller.c
Modified: spellcheck/src/speller.c
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -267,7 +267,7 @@ gchar *sc_speller_get_default_lang(void)
{ /* if we have something like de_DE.UTF-8, strip everything from the period to the end */
gchar *period = strchr(lang, '.');
if (period != NULL)
- result = g_strndup(lang, g_utf8_pointer_to_offset(lang, period));
+ result = g_strndup(lang, period - lang);
}
}
else
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Frank Lanitz <frank(a)frank.uvena.de>
Committer: Frank Lanitz <frank(a)frank.uvena.de>
Date: Sat, 06 Apr 2013 17:30:21 UTC
Commit: 96ea471131d8aebb0274272671b7adefd2ec3085
https://github.com/geany/geany-plugins/commit/96ea471131d8aebb0274272671b7a…
Log Message:
-----------
GeanyLipsum: Ensure whitespace before repeating Lorem Ipsum
Modified Paths:
--------------
geanylipsum/src/geanylipsum.c
Modified: geanylipsum/src/geanylipsum.c
9 files changed, 5 insertions(+), 4 deletions(-)
===================================================================
@@ -1,7 +1,7 @@
/*
* geanylipsum.c
*
- * Copyright 2008-2011 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
+ * Copyright 2008-2013 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -39,7 +39,7 @@
GETTEXT_PACKAGE,
_("GeanyLipsum"),
_("Creating dummy text with Geany"),
- "0.4.3",
+ "0.4.4",
"Frank Lanitz <frank(a)frank.uvena.de>")
static GtkWidget *main_menu_item = NULL;
@@ -48,7 +48,7 @@
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy\
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam\
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet \
-clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.";
+clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ";
/* Doing some basic keybinding stuff */
@@ -120,8 +120,9 @@ enum
g_free(missing_text);
}
for (i = 0; i < x; i++)
+ {
insert_string(doc, lipsum);
-
+ }
sci_end_undo_action(doc->editor->sci);
}
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).