TEIC / Stylesheets

TEI XSL Stylesheets
231 stars 124 forks source link

multiple problems with CSS installation and references #501

Closed craigberry closed 3 years ago

craigberry commented 3 years ago

The following observations are based on the dev branch as of 8c4c0b3b6e84b93a.

There are a bunch of references throughout the sources to stylesheets located at https://www.tei-c.org/release/xml/tei/stylesheet:

$ egrep -R 'https://www\.tei-c\.org/release/xml/tei/stylesheet/.*\.css' * | wc -l
67

All of those currently give 404 errors, and in fact there is not even a stylesheet directory at https://www.tei-c.org/release/xml/tei/. Perhaps this is a web site deployment problem?

There are also a couple of references to CSS files at the relative path ../css, but there is no such location produced by the installation procedure:

$ egrep -R '\.\./css/.*\.css' * | wc -l
       4

Specifically, the common target in Makefile copies files from the local css/ directory to release/xslcommon/xml/tei/stylesheet and the installcommon target deploys the entire release/xslcommon/xml directory tree. Nothing in the installation creates or populates a css/ directory.

I was able to get epub conversions working again by using the correct relative path (../css --> ../) as follows:

diff --git a/epub/tei-to-epub.xsl b/epub/tei-to-epub.xsl
index d1ca9023..fc465df6 100644
--- a/epub/tei-to-epub.xsl
+++ b/epub/tei-to-epub.xsl
@@ -54,9 +54,9 @@ of this software, even if advised of the possibility of such damage.
   <xsl:param name="bottomNavigationPanel">false</xsl:param>
   <xsl:param name="coverimage"/>
   <xsl:param name="createanttask">false</xsl:param>
-  <xsl:param name="cssFile">../css/tei.css</xsl:param>
-  <xsl:param name="cssODDFile">../css/odd.css</xsl:param>
-  <xsl:param name="cssPrintFile">../css/epub-print.css</xsl:param>
+  <xsl:param name="cssFile">../tei.css</xsl:param>
+  <xsl:param name="cssODDFile">../odd.css</xsl:param>
+  <xsl:param name="cssPrintFile">../epub-print.css</xsl:param>
   <xsl:param name="debug">false</xsl:param>
   <xsl:param name="directory">.</xsl:param>
   <xsl:param name="doctypePublic">-//W3C//DTD XHTML 1.1//EN</xsl:param>
diff --git a/epub3/tei-to-epub3.xsl b/epub3/tei-to-epub3.xsl
index 50d370d9..47e9bac5 100644
--- a/epub3/tei-to-epub3.xsl
+++ b/epub3/tei-to-epub3.xsl
@@ -68,9 +68,9 @@ of this software, even if advised of the possibility of such damage.
   <xsl:param name="bottomNavigationPanel">false</xsl:param>
   <xsl:param name="coverimage"/>
   <xsl:param name="createanttask">false</xsl:param>
-  <xsl:param name="cssFile">https://www.tei-c.org/release/xml/tei/stylesheet/tei.css</xsl:param>
-  <xsl:param name="cssODDFile">https://www.tei-c.org/release/xml/tei/stylesheet/odd.css</xsl:param>
-  <xsl:param name="cssPrintFile">https://www.tei-c.org/release/xml/tei/stylesheet/epub-print.css</xsl:param>
+  <xsl:param name="cssFile">../tei.css</xsl:param>
+  <xsl:param name="cssODDFile">../odd.css</xsl:param>
+  <xsl:param name="cssPrintFile">../epub-print.css</xsl:param>
   <xsl:param name="debug">false</xsl:param>
   <xsl:param name="directory">.</xsl:param>
   <xsl:param name="doctypePublic"/>

But this is basically reverting a36a4645d0d8d91e59 and 24ec3a013ed70a6cb5 and d25fe11d497ceac19 and revisiting some of what was discussed in #312. Ping-ponging back and forth between relative paths and Internet URLs, and between a relative path that works pre-install but fails post-install doesn't seem like the best way to handle this.

I don't know what the rationale was for using Internet URLs rather than relative paths; to me it's a disadvantage because if the web site is down or (as right now) no longer serves up the files it formerly had then my working installation is broken without any changes to that installation.

It looks like there are a couple of ways relative paths could be done so that the same reference works in uninstalled and installed situations:

1.) Move the linkcss target from install to common and have all references use ../ instead of ../css. This would make the ../path work in a built but uninstalled directory tree, which it can't now because the top-level links aren't created until install time.

2.) Make the installcommon target create and populate a ${PREFIX}/share/xml/tei/stylesheet/css directory and make all references point to ../css instead of ../.

I could attempt a PR doing one of these, but again, I don't know why the remote URLs were preferred and there is a great deal of prior are here that I grasp very dimly.

Advice welcome.

sydb commented 3 years ago

Indeed, @craigberry. Basically just posting here to let you know you’re right, we’re on it, but it may be a bit. Just yesterday evening @HelenaSabel and I noticed this problem, and alerted Council. As I type folks are trying to set up an ad-hoc meeting for tomorrow to address this, with the hopes that we can fix it on Wednesday. At the moment I lean slightly towards your (2), but I also do not understand a good deal of the prior art.

hcayless commented 3 years ago

Thanks @craigberry! It is a deployment issue, and I've just fixed it.