Commit 4ef4fa03 authored by chauveau's avatar chauveau
Browse files

encore des chemins relatifs remplacés par des absolus + encore des bugs d'i18n...

encore des chemins relatifs remplacés par des absolus + encore des bugs d'i18n + noindent sur max:fullDocument
parent d59602fd
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -670,7 +670,23 @@ Ces deux plugins sont propres aux éditions encodées en TEI. Ils ne nécessiten
      * plugins/equations/equations.xsl
      * plugins/equations/equations.src.js
	  
### Index

Génération automatique d'index. La version actuelle ne fonctionne que pour les *personnes*.

> Exemple de configuration:


```xml
    <plugin name='index'>
      <parameters>
        <parameter key="url" value="http://pdnpreprod.unicaen.fr/basex/rest/prosopographie/"/>
        <parameter key="login" value="login"/>
        <parameter key="password" value="password"/>
        <parameter key="backToText" value="./ancestor::*:div[@*:type='chapitre']/@xml:id"/>
      </parameters>
    </plugin>
```

#Développer dans MaX

+1 −0
Original line number Diff line number Diff line
@@ -305,6 +305,7 @@ function max:getHTMLByID($project, $id, $xsl, $xslparams as xs:string *, $wrap a
declare
%rest:GET
%output:method("html")
%output:indent("no")
%rest:path("/editions/{$project}/doc/{$doc=.*\.xml|.*\.svg}")
function max:getFullDocument($project, $doc){
  
+1 −2
Original line number Diff line number Diff line
@@ -98,8 +98,7 @@ function max.plugin.index:index($project){
    else max.plugin.index:generateIndex($project)
};

declare %private
function max.plugin.index:generateIndex($project){
declare function max.plugin.index:generateIndex($project){
  try{
    let $indexFilePath :=file:parent(file:parent(file:parent(static-base-uri()))) || '/editions/'||$project||'/fragments/index.frag.html'
    let $dbPath := max.config:getProjectDBPath($project)
+5 −8
Original line number Diff line number Diff line
@@ -361,8 +361,8 @@ declare %private function max.html:buildSubMenu($projectId, $pageId){
          <div id="sub-navbar" class="collapse navbar-collapse">
            <ul class="nav navbar-nav">{
              for $c in $parentEntry/subentry
                let $target := $c/target/text()
                let $label := max.i18n:getText($projectId, "menu." || $c/id/text())
                let $target := $docMenu//entry[./id=$c/text()]/target/text()
                let $label := max.i18n:getText($projectId, "menu." || $docMenu//entry[./id=$c/text()]/id/text())
                return <li><a href="{$target}">{if(not($label='menu.')) then $label else $c/text()}</a></li>
            }
            </ul>
@@ -381,18 +381,15 @@ declare %private function max.html:buildSubMenu($projectId, $pageId){
(:gets a project static HTML fragment (wrapped in an html div):)
declare function max.html:getHTMLFragment($project, $fragmentName as xs:string)
as element(div){

    let $fragmentPath := concat("../editions/",$project, "/fragments/", $fragmentName, ".frag.html")
    let $fragmentPath := max.util:maxHome() ||"/editions/"||$project|| "/fragments/"||$fragmentName|| ".frag.html"
    return  <div id='content'>{doc($fragmentPath)}</div> 

  
};

(:gets a project static HTML fragment (wrapped in an html div):)
declare function max.html:getHTMLFragmentFile($project, $fragmentFile as xs:string)
as element(){

    let $fragmentPath := concat("../", $fragmentFile)
    let $fragmentPath := max.util:maxHome() ||'/'|| $fragmentFile
    return  doc($fragmentPath)/*[1]