Skip to content

Latest commit

 

History

History
executable file
·
67 lines (45 loc) · 2.95 KB

JatsAdaptation.md

File metadata and controls

executable file
·
67 lines (45 loc) · 2.95 KB

From jQAPI to jatsdoc

This file describes the work that was done to adapt this documentation library from it's original sources in [jqapi|http://github.com/jqapi/jqapi].

I started out trying to do this the "right" way, meaning to migrate the jqapi code such that the same code base could be used with either the original jQuery JSON files or with the JATS Tag Library HTML files. But, I abandoned that after it became clear that there was just too much jQuery-specific code in the originals. The original jqapi library is very tightly integrated with the jQuery docs. So to make the same code base work with either, I'd either have had to include a lot of code into the final JS and CSS libraries that would not apply to JATS, or else re-engineer the entire app, such that the jQuery-specific code was segregated out and then re-layered on when necessary. Such deep refactoring was beyond my technical ability, since I'm very new to Ruby, let alone the Ruby on Rails framework.

So, I created Git tag "cp1" to mark where I abandoned the idea of doing it the right way, in case I ever have time or the skill to go back and refactor.

Major changes

Uses HTML on the server instead of JSON

The jqapi library downloads everything from the server, except the master index.html page, as JSON. I changed it to use HTML on the server everywhere.

Accomodate different document structure

The jqapi documentation is organized differently. Everything at the top level is a "category", which doesn't have an associated page that displays. Under that, all the "subcats" come first, followed by all the entries.

In JATS documentation, every node has a documentation page (an entry) no matter what level it is on. Also, entries and subcats can be mixed in any order. Finally, the documentation can be nested arbitrarily deeply.

There were quite a few changes to the coffeescript code and SASS stylesheets to accommodate this structure. The results, unfortunately, don't look as polished as the original.

This library doesn't generate the documentation content

In jqapi, there are thor tasks to download and generate the documentation content. In this library, I separated that out (into the JatsTagLibrary repo). The reason for doing this is that this library should be reusable for any of many different documentation sets. Not just the JATS Tag Libraries themselves, but also documentation generated by DtdAnalyzer.

Refactoring of deploy:generate

In jqapi, the documentation is copied as part of this task. In jatsdoc, the only things that are deployed are the bundled JS, CSS, and a few related image files.

These are deployed to the "jatsdoc" directory, so they could be zipped up into "jatsdoc.zip", if desired.

Archives - the dtdanalyzer branch

This is the original work I did on this project, before restarting it in October. This is a a dead-end branch, preserved for posterity.

See the changes.