Brown-University-Library / usepweb_project

MIT License
0 stars 5 forks source link

epidoc css is being ignored #80

Closed emylonas closed 3 years ago

emylonas commented 3 years ago

When we display an inscription, we render it using some XSL scripts written by the USEP project (to render the overall inscription structure), which include XSL scripts from EpiDoc, to render the inscription text, translation and so on. The EpiDoc XSL scripts generate a chunk of HTML that assumes the presence of a CSS script Some URLs: The overall inscription page XSL: https://github.com/Brown-University-Library/usep-data/blob/master/resources/xsl/USEp_display.xsl The Epidoc XSL scripts: https://github.com/Brown-University-Library/usep-data/tree/master/resources/xsl/epidoc-xsl-p5 The EpiDoc CSS file: https://github.com/Brown-University-Library/usep-data/blob/master/resources/xsl/epidoc-xsl-p5/global.css

The EpiDoc scripts work as follows: They are called using start-edition.xsl We are using default formatting.

global-parameters.xml sets the value of css-loc to the correct (relative) file path. start-edition.xsl assigns the value of css-loc to param-css-loc htm-tpl-cssandscripts.xsl (which is included in start-edition.xsl) has a template "css-script" that generates the <link rel="stylesheet"....> element using param-css-loc

htm-tpl-structure.xsl (main structure template) calls the template "css-script" as it generates the HTML for the <head> element. This inserts the <link rel="stylesheet...> into the <head> element.

Our web pages pay no attention to the EpiDoc CSS, because we actually start our inscription display with the template default-body-structure, which is after the stylesheets would have the <head> of the HTML file. So the CSS is never put into play.

I think we should include a call to the EpiDoc CSS in the Django template for inscription display, where we call the main.css file. This will provide the proper formatting for the inscription.

Alternatively, we could @import the EpiDoc CSS into main.css, but that would make it globally available, which might cause problems. Thoughts?

emylonas commented 3 years ago

This is a good test case, it should have underlines. They are not visible at the moment. https://dlibwwwcit.services.brown.edu/projects/usep/inscription/MD.Balt.JHU.G.A.804/

emylonas commented 3 years ago

@atbradley to figure out how to access the EpiDoc css file from github without allowing django to prepend the project base URL to it.

atbradley commented 3 years ago

It works when using a local copy of global.css. Github serves the raw stylesheet as text/plain--that's the only thing I can see that might be breaking it when loading from there. I can commit the current dev version if it's working for everyone.

As far as updating that CSS, we can write a simple cron job to update the file periodically or build something in to @birkin's deploy script.

emylonas commented 3 years ago

I think we should copy the CSS into the web environment with the other CSS files. We can update it as we do now, via pull requests. It would be great if we could do it when git is updated, but that may take more time.

I don't think a cron job is a good idea. This changes rarely, likely only when the EpiDoc Stylesheets have a new release (about twice a year). or occasionally we may have to make a small adjustment.

atbradley commented 3 years ago

I've added a local copy of the CSS and it's currently being used in dev. Those changes are now part of my pull request #78.