Skip to content

Allow bibliography path and link URL to be configured#23

Open
olvidalo wants to merge 2 commits into
EpiDoc:masterfrom
olvidalo:fix/bibliography-path-param
Open

Allow bibliography path and link URL to be configured#23
olvidalo wants to merge 2 commits into
EpiDoc: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.

@olvidalo olvidalo force-pushed the fix/bibliography-path-param branch 2 times, most recently from e8aec27 to bd296ee Compare April 2, 2026 13:59
@olvidalo
Copy link
Copy Markdown
Contributor Author

olvidalo commented Apr 2, 2026

Those comments were a perfectly pragmatic approach, most projects adapt the stylesheets anyway. In my case I'm trying to minimise the need for projects I'm working with to edit the stylesheets directly to keep things better maintainable, and I thought others might benefit from this approach too. So thank you for being open to it!

Thanks for pointing out the need to adjust other hardcoded paths. In the latest commit I've replaced all hardcoded authority file references with the parametrised approach (hope I've cought them all) by introducing these additional params:

  • symbols-file: used in teig.xsl
  • places-file: used in htm-tpl-struct-inslib.xsl.xsl
  • institutions-file: also used in htm-tpl-struct-inslib.xsl

(I thought it would make sense to adapt the InsLib specific files too for consistency.)

I've added authority-dir as a convenience parameter as the defaults paths for all of the relevant params share a common base path. Setting just authority-dir adjusts all paths at once, prepending it to the default filenames (symbols.xml, places.xml, institution.xml, bibliography.xml). The individual params can still override specific files. Defaults point to the currently hardcoded EFES paths, so nothing should change for current projects. I've also added all new parameters to global-parameters.xml as you suggested, and previously hard-coded bibliography links I missed in the first commit now use the template approach as well.

One thing I wasn't sure about is the naming of the parameters: For bibliography I used the existing localbibl parameter but it didn't seem fitting to me to use this pattern for the other names (such as localsymbols), so I went for *-file instead which should make the meaning clear but introduces an inconsistency. Open for suggestions on this, maybe it makes sense to add bibliography-file as an alias for localbibl while keeping the latter as is for backwards compat. Or just leave it as is.

Happy to adjust anything based on your feedback!

@olvidalo olvidalo force-pushed the fix/bibliography-path-param branch from bd296ee to 82739ee Compare April 2, 2026 14:22
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