Skip to content

Allow bibliography path and link URL to be configured#23

Open
olvidalo wants to merge 1 commit intoEpiDoc:masterfrom
olvidalo:fix/bibliography-path-param
Open

Allow bibliography path and link URL to be configured#23
olvidalo wants to merge 1 commit intoEpiDoc:masterfrom
olvidalo:fix/bibliography-path-param

Conversation

@olvidalo
Copy link
Copy Markdown
Contributor

Currently, the t:ptr[@target] template in htm-teibibl.xsl hardcodes two EFES specific values:

  • The path to the bibliography authority file (webapps/ROOT/content/xml/authority/bibliography.xml relative to system-property('user.dir') provided by the Java runtime through EFES/Cocoon
  • The bibliography item link URL pattern (../concordance/bibliography/{id}.html).

This makes it hard to use the stylesheets outside of EFES, or with different output site structures that don't follow EFES' patterns.

This PRs uses two configurable params following existing conventions to solve this:

  • The htm-teibibl template now uses $localbibl to construct the path to the bibliography file
  • In global-varsandparams.xml, $localbibl is set to the currently hardcoded default path via the new $default-bibloc variable, ensuring full backwards compatibility without breaking existing projects
  • The new $bib-link-template param can be used to provide an URL template where $1 is replaced by the bibliography entry ID. Defaults to current pattern ../concordance/bibliography/$1.html for backwards compatibility.

It would be great if this could be considered for merging as one step to make the stylesheets more independent from EFES.

@IreneVagionakis
Copy link
Copy Markdown
Member

Sorry - it was me who added these hardcoded paths, thank you for cleaning up my mess!

At the time I thought that adding the note <!-- if you are running this template outside EFES, change the path to the bibliography authority list accordingly --> would have been enough to make it not-EFES-dependent, but of course it is much better to handle this via parameters like you did.

I haven't tested it properly yet, but something that I noticed: shouldn't we add the new parameter(s) to global-parameters.xml as well, specifying their default value (e.g. 'none')?

I am afraid that some more adjustments will be needed, since similar hardcoded paths occurr also in htm-teidivapparatus.xsl for bibliography.xml and in teig.xml for symbols.xml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants