-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make internal preview version of DHQ for proofing the static site #85
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
head.xsl introduces special CSS rules for the preview site, and topnavigation.xsl adds a "Preview" to the header. A new parameter, "previewable", determines whether these are added to the HTML output. Also, fixed the alt text for the banner and DHQ logos.
generate_static_issues.xsl now includes and passes on the "doProofing" parameter when generating HTML for articles in the TOC. The XSLT does not yet transform the "editorial" articles.
toc.xsl now has a "do-list-articles" parameter, which controls whether or not every article is listed for a given issue. toc.xsl has it turned on by default. The static_issues stylesheet turns it off, because the flood of messages hides useful warnings.
Added a "do-proofing-full" parameter to generate_static_issues.xsl, which, in combination with "do-proofing", determines whether the stylesheet handles all articles, TOC indexes, and compression of XML. When "do-proofing" is on and "do-proofing-full" is turned off, only the "editorial", internal preview is reproduced.
The directories for the static and proofing sites are now set in build-properties.xml. The paths to those directories, and to the base directory, are still set in build.xml, with ".path" added to the property name. So, references to `${toDir.static}` may now have been changed to `${toDir.static.path}`. I've tested generateIssues and generateSite, and they work as before.
I did not replace the link to the Internal Preview's "Articles" list yet, because the Ant process doesn't generate it.
I discovered that the code used to generate the anchor to the linked contributor's biography is out-of-sync with the code used to generate the bios page. Links will work but don't take you directly to the clicked contributor.
Per collaborative development meeting. We can `rsync` the static site directory to the DHQ server, rather than taking the time to compress and transmit it.
The "generateSite" target uses the generic property to determine where files should be saved. The "makeInternalPreview" target prompts users whether they want to generate the full site or not.
So someone can issue the command `ant -Ddo.proofing.full=true makeInternalPreview` in, for instance, a headless environment.
...it's pretty obviously a Cocoon holdover.
Fixed path to articles from the preview index.
It will be easier to edit the description without having to worry about shifting tags to accommodate character limits per line.
Also, tweaked paths in the help documentation.
Also added documentation for the `compressStatic` target, since `generateSite` no longer calls it.
...so the notice only appears when no Ant targets were explicitly invoked (read: someone just ran `ant`). We may still decide to change the default Ant target before switching to the static site for publication.
Had to add back the "get-vol" template which was needed by template_editorial_article.xsl.
Per meeting with Syd and Julia. The scenario builds only the "editorial" section of the TOC, not any other part of the DHQ site.
New scenarios for the Ant build targets: generateSite, previewArticle, and zipPreviewArticle. All scenarios load the Saxon JARs from `common/lib/`.
Because this is preferable to running "generateSite", I removed that target from the oXygen scenarios.
article_list.xsl produces a single webpage for a given sort method and sort direction. The new stylesheet `article_list_all.xsl` runs 6 transformations to produce every webpage variant of `editorial/articles.html`.
I removed and condensed a lot of repeated code into two templates: one that creates and sorts all the rows of the table, and one that generates all the cells for the row corresponding to an article. Rather than nesting a table of author names into the last cell of each row, I set up an unordered list of names. I also removed the "center" class from the first two cells, because the `display:block;` CSS rule was keeping them from displaying like regular table cells. I also added comments and variables, and re-formatted the whitespace for readability.
Rather than having table headings that serve as both labels and actionable links, I've moved the links to alternative sort pages into a list shown before the table. `<a>` elements aren't used when the link would be to the current page, which makes it easy to see at a glance which sort method is applied. The display of the table and the navigation stay consistent when navigating between pages.
BUILD FAILED
/home/syd/Documents/dhq-journal/build.xml:286: Directory does not exist: /home/syd/Documents/dhq-static/dhq-proofing I am going to create that directory so I can continue testing. (As you might have guessed, I am testing the commandline interface, using bash.) |
For example, if the directory doesn't exist because this is the first time we're running "makeInternalPreview", the <delete> task shouldn't fail. Also, delete the empty `dhq-proofing/vol/` directory created by "generateArticles" when we're not proofing the full site.
@sydb Good catch, thank you! I fixed that bug. |
Fixes a broken link to article 000605's XML.
Rather than starting with "/dhq/", URLs to other articles start with "../../../../" to get back to the root directory. (We could trim the `/vol/` from the full URL to reduce the path, but this seemed simpler and fairly reliable.)
Updated column used to create a relative link to recommended article, and added a fallback message if the URL column doesn't match expectations. (The fallback is very noisy but doesn't terminate the transformation.)
Per DHQ collaborative development meeting. Because DHQ editors are most likely to use the oXygen transformation scenarios rather than the command line, we agreed that it is most helpful for Ant to outline the possible targets when the user hasn't explicitly said which one they want.
...from sidebar.
The `${git(working_copy_path)}` editor variable might be new in oXygen v26; it doesn't work in v25.1.
I've tested the three scenarios and they all seem to work as planned :-) To respond to Ash's questions above:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Besides reviewing my code changes, I’d like my reviewer(s) to try using the
makeInternalPreview
build target in the command line, as well as the exported oXygen scenarios. I’d like to know:Background
The main goal here: to allow DHQ editors and continuous integration to generate a proofing copy of the articles listed in the “editorial” section of the DHQ TOC. This is accomplished with a new Ant build target,
makeInternalPreview
.makeInternalPreview
allows the user to choose between generating a copy of just the unpublished articles (the default), or the entire DHQ site plus the internal preview section. Under the hood, the target customizes the behavior ofgenerateIssues
andgenerateSite
. In either case, the results are saved todhq-proofing
, a new directory insidedhq-static
.Other improvements
Because DHQ editors will use the new Ant build target in oXygen, I’ve made a few improvements:
common/xslt/static-site.scenarios
. Once imported, an oXygen user will be able to run themakeInternalPreview
,previewArticle
, orzipPreviewArticle
scenarios from any file in their local copy ofdhq-journal
.article_list.xsl
, the stylesheet which produces a table of all DHQ articles in the TOC for proofing purposes. The resulting HTML seems cleaner and more useful (to me, anyway), and the stylesheet itself should be significantly easier to read, understand, and maintain.I’ve also tried to aid maintainability by moving the
ant help
documentation into a single<echo>
(making its contents easier to read and edit). I also broke out the Ant property${toDir}
into three settings in thebuild-properties.xml
, so that individual directory names will be easier to edit. And I added a toggle to turn off certain XSLT messages where they would only distract from more useful info or urgent warnings.