Loading src/main/core/errors.xqm +3 −2 Changes for src/main/core/errors.xqm: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ import module namespace conf = 'https://certic.unicaen.fr/max/conf' at 'conf.xq declare %output:method("html") %output:html-version('5') function errors:not-found($message, $lang as xs:string) as element(html){ function errors:not-found($message, $lang as xs:string){ let $tmpl := templating:template-file('error.html') let $detail := if(conf:is-dev-mode()) then $message else '' let $render := if($tmpl) Loading Loading @@ -50,8 +50,9 @@ function errors:simple-error($code as xs:QName, $desc as xs:string, $line as xs: 'MaX Error : ' || $message) }; (:~ : Returns an error page : Returns a 500 error page : @return HTML page :) declare Loading src/main/core/routes.xqm +5 −5 Changes for src/main/core/routes.xqm: 5 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ declare %output:html-version("5.0") %output:encoding("UTF-8") %rest:path("/{$path=(index.html)?") function routes:index($path as xs:string?) as element(html){ function routes:index($path as xs:string?){ routes:page($conf:default-lang, 'index') }; Loading Loading @@ -72,7 +72,7 @@ declare %output:method("html") %output:html-version('5') %rest:path("/{$lang=[a-z]{2}}/pages/{$path=.+}.html") function routes:page($lang as xs:string, $path as xs:string) as element(html){ function routes:page($lang as xs:string, $path as xs:string){ try { let $mdFile := file:current-dir() || $globals:content-html-dir || '/' || $lang || '/' || $path || '.md' let $htmlFile := file:current-dir() || $globals:content-html-dir || '/' || $lang || '/' || $path || '.html' Loading Loading @@ -274,15 +274,15 @@ function routes:file( (:~ : MaX Documentation test function. : MaX functions documentation. : Returns an HTML documentation for MaX Xqueries functions. : @return HTML page :) declare %rest:GET %output:method("html") %rest:path("/max-documentation.html") function routes:html-documentation(){ %rest:path("/doc/functions.html") function routes:functions-documentation(){ let $toIgnore := ('globals.xqm','markdown.xqm') let $packageDoc := doc(conf:get-package-file-path()) let $xqDocs := <div>{for $module in $packageDoc//*:xquery/*:file where not(string($module) = $toIgnore) Loading src/main/core/templating.xqm +1 −1 Changes for src/main/core/templating.xqm: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ import module namespace utils= 'https://certic.unicaen.fr/max/utils' at 'utils.x : @param $map variables : @return HTML page :) declare function templating:render($template as xs:string, $map as map(*)) as element(html){ declare function templating:render($template as xs:string, $map as map(*)){ let $filePath := templating:template-file($template) let $templateDoc := try { doc($filePath) Loading Loading
src/main/core/errors.xqm +3 −2 Changes for src/main/core/errors.xqm: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ import module namespace conf = 'https://certic.unicaen.fr/max/conf' at 'conf.xq declare %output:method("html") %output:html-version('5') function errors:not-found($message, $lang as xs:string) as element(html){ function errors:not-found($message, $lang as xs:string){ let $tmpl := templating:template-file('error.html') let $detail := if(conf:is-dev-mode()) then $message else '' let $render := if($tmpl) Loading Loading @@ -50,8 +50,9 @@ function errors:simple-error($code as xs:QName, $desc as xs:string, $line as xs: 'MaX Error : ' || $message) }; (:~ : Returns an error page : Returns a 500 error page : @return HTML page :) declare Loading
src/main/core/routes.xqm +5 −5 Changes for src/main/core/routes.xqm: 5 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ declare %output:html-version("5.0") %output:encoding("UTF-8") %rest:path("/{$path=(index.html)?") function routes:index($path as xs:string?) as element(html){ function routes:index($path as xs:string?){ routes:page($conf:default-lang, 'index') }; Loading Loading @@ -72,7 +72,7 @@ declare %output:method("html") %output:html-version('5') %rest:path("/{$lang=[a-z]{2}}/pages/{$path=.+}.html") function routes:page($lang as xs:string, $path as xs:string) as element(html){ function routes:page($lang as xs:string, $path as xs:string){ try { let $mdFile := file:current-dir() || $globals:content-html-dir || '/' || $lang || '/' || $path || '.md' let $htmlFile := file:current-dir() || $globals:content-html-dir || '/' || $lang || '/' || $path || '.html' Loading Loading @@ -274,15 +274,15 @@ function routes:file( (:~ : MaX Documentation test function. : MaX functions documentation. : Returns an HTML documentation for MaX Xqueries functions. : @return HTML page :) declare %rest:GET %output:method("html") %rest:path("/max-documentation.html") function routes:html-documentation(){ %rest:path("/doc/functions.html") function routes:functions-documentation(){ let $toIgnore := ('globals.xqm','markdown.xqm') let $packageDoc := doc(conf:get-package-file-path()) let $xqDocs := <div>{for $module in $packageDoc//*:xquery/*:file where not(string($module) = $toIgnore) Loading
src/main/core/templating.xqm +1 −1 Changes for src/main/core/templating.xqm: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -15,7 +15,7 @@ import module namespace utils= 'https://certic.unicaen.fr/max/utils' at 'utils.x : @param $map variables : @return HTML page :) declare function templating:render($template as xs:string, $map as map(*)) as element(html){ declare function templating:render($template as xs:string, $map as map(*)){ let $filePath := templating:template-file($template) let $templateDoc := try { doc($filePath) Loading