Commit 96a6072b authored by mmarkus1's avatar mmarkus1 Committed by Mathias Goebel

issue #59 - fixed bugs in multilingual to open .md files

parent 88066482
File mode changed from 100644 to 100755
#!/bin/bash
# see https://gist.github.com/samhemelryk/8857553
#
# This pre-commit hook checks that you havn't left and DONOTCOMMIT tokens in
# your code when you go to commit.
#
# To use this script copy it to .git/hooks/pre-commit and make it executable.
#
# This is provided just as an example of how to use a pre-commit hook to
# catch nasties in your code.
# Work out what to diff against, really HEAD will work for any established repository.
if git rev-parse --verify HEAD >/dev/null 2>&1
then
......@@ -17,10 +10,13 @@ else
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
diffstr=`git diff --cached $against | grep -e '^\+.*DONOTCOMMIT.*$'`
if [[ -n "$diffstr" ]] ; then
echo "You have left DONOTCOMMIT in your changes."
echo "It is important that you read and understand them,"
echo "before you proceed and remove them."
exit 1
fi
function test {
diffstr=`git diff $against | grep "$1" | grep -e "^+"`
if [[ -n "$diffstr" ]] ; then
echo "You have left $1 in your changes, you can't commit until it has been removed."
exit 1
fi
}
test console:log\(
test console=\"
#!/bin/bash
# copy the default hooks
WHAT=$(ls .hooks/ -I "*flow*" -1)
for FILE in $WHAT
do
cp .hooks/$FILE .git/hooks/$FILE
done;
exit
#!/bin/bash
# copy the default hooks
WHAT=$(ls .hooks/ -I "*flow*" -1)
for FILE in $WHAT
do
cp .hooks/$FILE .git/hooks/$FILE
done;
exit
#!/bin/bash
# copy the default hooks
WHAT=$(ls .hooks/ -I "*flow*" -1)
for FILE in $WHAT
do
cp .hooks/$FILE .git/hooks/$FILE
done;
exit
......@@ -15,7 +15,7 @@
<echo message="installed version of ant (${antversion}) is satisfying"/>
</target>
<target name="xar" depends="cleanup">
<target name="xar">
<copy file="expath-pkg.xml.tmpl" tofile="expath-pkg.xml" filtering="true" overwrite="true">
<filterset>
<filter token="project.version" value="${project.version}"/>
......@@ -35,7 +35,7 @@
<delete dir="${test.dir}"/>
</target>
<target name="test" depends="antversion-test, xar">
<target name="test" depends="antversion-test, cleanup, xar">
<!-- task setpermissions requries at least ant 1.10.0 -->
<get src="https://bintray.com/existdb/releases/download_file?file_path=eXist-db-${project.processorversion}.tar.bz2" dest="${build.dir}/eXist-db-${project.processorversion}.tar.bz2" skipexisting="true" />
<untar src="${build.dir}/eXist-db-${project.processorversion}.tar.bz2" dest="${test.dir}" compression="bzip2" />
......
......@@ -230,15 +230,32 @@ element { name($node) } {
declare
%templates:wrap
function app:rewriteLink($ref as xs:string) as xs:string {
let $lang := app:getLanguage()
let $base-url := tokenize($ref, "\?|#")[1]
let $get-parameter := tokenize(substring-after($ref, "?"), "#")[1]
let $get-parameter := if(contains($get-parameter, "lang="))
then $get-parameter
else
(tokenize($get-parameter, "&amp;")[.!=""],
"lang="||$lang)
let $anchor := substring-after($ref, "#")
let $lang := app:getLanguage()
let $base-url := tokenize($ref, "\?|#")[1]
let $get-parameter := tokenize(substring-after($ref, "?"), "#")[1]
let $get-parameter :=
if(contains($get-parameter, "lang=")) then $get-parameter
else (tokenize($get-parameter, "&amp;")[. != ""], "lang=" || $lang)
let $anchor := substring-after($ref, "#")
(:~
: special rewrite for .md files in $config:app-root /docs.
: adds a lang suffix and loads the lang specific .md file.
: in case this file does not exist it loads the .md file without langsuffix, so the english one.
: :)
let $base-url :=
if (fn:ends-with($base-url, ".md")) then (
let $langsuffix := concat("_", $lang)
let $base := fn:substring-before($base-url, ".md")
let $result := if (fn:exists(util:binary-doc($config:app-root || "/docs/" || $base || $langsuffix || ".md"))) then (
concat($base, $langsuffix, ".md")
)
else (
concat($base, ".md")
)
return $result
)
else ()
return
$base-url
......@@ -246,6 +263,7 @@ return
|| (if($anchor != "") then "#" || $anchor else ())
};
declare
%templates:wrap
function app:list-docs($node as node(), $model as map(*)) {
......
......@@ -58,6 +58,7 @@ declare function callgraph:main($option as xs:string, $filename as xs:string) as
if(ends-with($option, ".xqm")
or $option = "full"
or xmldb:collection-available($option)) then
let $bla := console:log("test")
let $filename :=
if(contains($filename, ".")) then
error( QName("https://sade.textgrid.de/ns/app", "CALLGRAPH01"),
......
......@@ -34,6 +34,19 @@ for $node in $nodes
return
typeswitch ( $node )
case element( a ) return
if(starts-with($node/@href, "http") or starts-with($node/@href, "#"))
then
element xhtml:a {
$node/@*,
local:linkrewrite($node/node())
}
else
element xhtml:a { $node/@*[local-name(.) != "href"],
attribute href { app:rewriteLink(string($node/@href)) },
local:linkrewrite($node/node())
}
case element ( xhtml:a ) return
if(starts-with($node/@href, "http") or starts-with($node/@href, "#"))
then
element xhtml:a {
......
......@@ -22,6 +22,7 @@
<li>Extend contribution guide</li>
<li>Click on search icon triggers search input</li>
<li>Upgrade to <a href="http://exist-db.org/exist/apps/wiki/blogs/eXist/eXistdb460">eXist-db 4.6.0</a></li>
<li>Add git hooks that refuse commits containing "console:log"/ "console="</li>
</ul>
</li>
<li class="bugs">Bugfixes
......@@ -30,6 +31,7 @@
<li>Escape ':' in links containing a TextGrid URI</li>
<li>Fix new display on index.html (master shows new features that fit to the current version number while develop shows the latest entry in changelog)</li>
<li>Click on facet in search filters search results</li>
<li>Fix multilingual bug for .md files</li>
</ul>
</li>
</ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment