helvitiis / warofcurrents

A repository for the War of Currents Digital Humanities project.
The Unlicense
3 stars 1 forks source link

new XSLT to generate HTML for documents #26

Closed ebeshero closed 6 years ago

ebeshero commented 6 years ago

@quantum-satire @Jamielynn92 and @ajnewton1 : Aaron was with me and advised as I was working on this: I prepared an XSLT file that is as yet unfinished. It is currently doing what we did in the homework XSLT Ex 5 and 6 with the input collection of poem files, to output them to HTML, but the output right now is one HTML file, with each article separated in its own <div> element with its own distinct @id attribute based on its pubDate. This was just the easiest way to output everything quickly.

Aaron thinks that might be something worth working with in its own right--that you might want all your output to be in one HTML document, and you could combine that with your table of contents to hide them all, and show them on click. That could work!

Alternatively, we can run another process to split the output into multiple files, and there a few different approaches:

No matter what approach you decide, basically we're overhauling how you're outputting the HTML, so that it's easier to write simple commands just once in the relevant SSI, CSS, or JavaScript file, and so that your output is going to be valid HTML. Right now, the HTML output is not well-formed, but the tags are good HTML tags (not XML embedded in HTML). We're also trying to minimize/eliminate any inline CSS and JavaScript that you'd be tempted to implement manually. We can go over all this together the next time I see you (perhaps this afternoon? Perhaps Monday). I'm out of class at 3pm and will be in my office in FOB 204 if you want to come find me for a bit.

ebeshero commented 6 years ago

@quantum-satire @ajnewton1 @Jamielynn92 The XSLT file is here: https://github.com/quantum-satire/warofcurrents/blob/master/website/documentToHTML.xsl

Aaron and I decided to destroy, nuke, and otherwise lay waste to the "documents html" directory, since it had old problematic code in it. Consider that for the moment to be replaced by the single HTML file containing all document output:

Aaron is in favor of having all the documents be output at the same level so that we don't have to worry about referencing their CSS and JavaScript in a parent directory (which is going to cause confusion). That makes sense, but if you do want to store your documents in separate HTML files I think I'd advise keeping them in their own directory, having them reach up to a parent directory for CSS and JS and SSI files from the main site, just because these are a special set of documents that you'll be automatically outputting with XSLT (differently from the way you'll be updating say the index or about.html pages by hand). If you decide to leave the output in one giant HTML file, though, it's not so much an issue.

ebeshero commented 6 years ago

@quantum-satire @ajnewton1 @Jamielynn92 IMPORTANT: I did not finish the XSLT, and we did not try putting the HTML all-documents-in-one output file up on the web server. When I say I didn't finish it, I mean, that I only output basic things like your structure, and I implemented just two HTML <span> elements. One was to control the author byline (for which you may want to write CSS), and the other was just to transform the persName elements into <span class="persName>. You can and should add template rules following my lead for any other elements mixed into your paragraph content that you need to be toggling with JavaScript and highlighting with CSS.

helvitiis commented 6 years ago

@ebeshero @ajnewton1 Thank you for helping us with this! I'm sorry I had to leave so quickly and couldn't stay to give any input on it. I have a few questions:

  1. Can we still add ids to the <span> elements even if the original xml documents folder was wiped out from our site? i.e. <span class = "persName" id = "Edison">.
  2. When we add JavaScript to toggle names, places, locations, etc. will it mark all of the documents or one at a time? And, can we apply a count() function to each individual document?
  3. Can we include a "show all" toggle button that will open all of the documents at once on the page? Also, will it look too chaotic to have all of the documents open at once / will it negatively affect loading time?
  4. What are the differences between the processes you listed above in your first comment? I'm also agreeing with Aaron that it seems to be the best and easiest choice to output all of the files on one level at this point--it was getting a little chaotic trying to figure out what to do with all of the HTML pages holding the documents.

On more of a lesser side note here regarding color choice--I think at this point it would be easiest to keep the colors we have now as I realized the art I made for the front page as well as the graphics and the logo uses the color scheme we have now, and after locally changing the background color it looks silly. I'm thinking about making the font bigger or finding a different font if it seems to be a big issue with legibility of the documents, and it seems that the only visibility issue so far is with dim projectors and outdated or non-color-managed monitors.

I have work from 11:30 to 1:30 on Monday, but I think it's important to have a meeting to discuss the project if possible. Is there a convenient time that day (or the next) we could do this?

ebeshero commented 6 years ago

@quantum-satire On the first question:

Can we still add ids to the <span> elements even if the original xml documents folder was wiped out from our site? i.e. <span class = "persName" id = "Edison">.

I'm a little confused by this. The only thing we eliminated was the folder named "documents html", which contained only html files. The XML we used as a source is the "documents" directory which appears to be unchanged. I'm taking a look, for example, at https://github.com/quantum-satire/warofcurrents/blob/master/website/documents/NP1891-02-20.xml , and the XML contains information from which you could easily write an xsl template rule to output HTML span elements with @id attributes as you suggest. (Please do that by building on the XSLT file we worked on, and not with regex. The XSLT should help to plan how you're mapping from XML to HTML, so the encoding actually serves as documentation!)

helvitiis commented 6 years ago

@ebeshero Whoops! Alright, I misunderstood which folder you had deleted. Thanks for the clarification!

ebeshero commented 6 years ago

@quantum-satire On the other three questions--we'll want to talk about and experiment with the possibilities, and the longer meeting you suggest is a very good idea--perhaps Tuesday afternoon if everyone is available? Briefly though:

At this stage, it's time to play a bit with the XSLT (and make new XSLT files from it) to experiment with outputting different combinations and remixes that show interesting patterns... Survey your code and think about what would be interesting to list, chart, or summarize from it...

helvitiis commented 6 years ago

@ebeshero I had been planning on making a map using the marked <loc> elements, but I know we wanted to do a lot more with the code. Can we log marked elements such as <persName>, <current> and <company> and show corresponding responsive SVG charts beside each document, as well as an overall count? (My only worry about this is the amount of time we have left to do it)

I can meet Tuesday after SF if that's convenient for you! @ajnewton1 @Jamielynn92 this would be about 2:20 pm on Tuesday.

ebeshero commented 6 years ago

@quantum-satire You can, and you should give it a try! There's time enough. :-)

dotfig commented 6 years ago

@quantum-satire I have class during that time but I can see what I can do. Where would this be?

helvitiis commented 6 years ago

@ajnewton1 It would be in Dr. B's office in FOB

Jamielynn92 commented 6 years ago

I can meet after English tomorrow.

helvitiis commented 6 years ago

@Jamielynn92 What time would that be?

ebeshero commented 6 years ago

@quantum-satire @Jamielynn92 @ajnewton1 I just realized I have a faculty meeting tomorrow from 2:30 - 3:30 pm--but I can meet around 3:30! Does 3:30-ish work at my office, FOB 204? (We can move downstairs to the Center room for more space if the whole team is there.)

helvitiis commented 6 years ago

@ebeshero I can meet at 3:30!

Jamielynn92 commented 6 years ago

I can. Just gotta figure out what to kill an hour. I get out at 2:15

Jamielynn92 commented 6 years ago

How to kill an hour. Lol my bad.

ebeshero commented 6 years ago

Let's move this (since it's a project meeting) down to the Center in FOB 131. You can let yourself in by punching in the sequence of odd numbers. And I'll see you at 3:30pm.