Git Product home page Git Product logo

dita-clj's Introduction

dita-clj

Clojure+leiningen build of DITA Open Toolkit (DITA-OT) java implemenation of the OASIS Darwin Information Typing Architecture (DITA) specification, and XML vocabulary for authoring and publishing.

WARNING Pre-alpha - just getting started. Not usable. If you're interested in helping out you can compare the code here with the DITA-OT code and get the idea.

Prelims

This project is based on Dita-OT, but is not just a wrapper. It reorganizes the code to make it more conformant to standard practices and work with leiningen. In particular, it replaces the ant-based job control system of DITA-OT with leiningen tasks implemented in Clojure.

Differences from DITA-OT

Task Management

DITA-OT uses ant to manage the DITA processing pipeline. ant is basically a partial XML encoding of Java syntax. Broadly speaking, DITA-OT tasks are encoded as ant tasks, which run Java or XSLT processes.

dita-clj replaces ant tasks with leiningen tasks, which are implemented in Clojure.

Codebase Organization

The primary goal of this project is to clojurize the dita-ot. But while we're at it, the current DITA-OT source tree is a little unusual in some respects, so this project does some reorganizing. For example, the src tree contains lots of stuff that is not source code. It also puts things in strange places; for example, configuration files in lib/, and essential DTD and XSD files in a plugin subdirectory.

dita-clj tries to normalize, modularize, and simplify things. The src/java tree contains java source code; src/dita contains DITA document sources. Documentation goes in the doc directory. Config files go in etc/. And so forth.

User Interface

DITA-OT requires requires that the user run a startcmd from within the installation root directory in order to do any processing.

dita-clj adopts a more orthodox approach which allows the user to easily run the tools from any directory. To process dita source docs, you create a simple project.clj file in the source root directory and then run $ lein dita pdf or $ lein dita html, etc.

XML Catalog

dita-clj follows DITA-OT in using XML Catalogs; see e.g. XML file associations with DTDs and XML schemas

The library is Apache Commons' xml-resolver. The catalog files go in /etc/xml. This makes them available to any application that needs them. The CatalogManager.properties file, which controls the resolver, goes in /etc/dita-clj.d or ~/.dita-clj.d.

We try to follow standard practice, insofar as there is such a thing. Examples: Debian Catalog Hierarchy

See also libxml2 catalog support

Schema and DTD files

DITA-OT keeps them in a plugins subdir. I don't know why, but since the DITA schema files are central to the whole enterprise, and are specific neither to DITA-OT nor to a DITA-OT plugin, we put them in /etc/xml.

Plugins

The plugin architecture is central to DITA-OT. But installing a plugin alters the state of the toolkit itself. That seems like a bad idea. E.g. plugin config files use "pre-defined extension points to locate changes, and integrates those changes into the core code." I'm not sure yet what "integrates .. into core code" means exactly but I don't much like the sound of it; I should think the better idea is to extend the core functionality by adding stuff outside, not injecting outside stuff into it.

To be clear: it's not that adding a plugin should not change some kind of state, it's just that such mutable data should be isolated from the immutable "kernel" of the toolkit, and it should be easy to examine and fix.

dita-clj support for plugins: to be determined; see doc/plugins.md. But ideally, follow the standard pattern: put system level stuff somewhere like /etc, local stuff somewher in /usr/local, and user stuff somewhere in ~/, like ~/.dita. (Presumably there is some kind of analogous best-practice for Windows.)

Usage

See the lein-dita plugin. The idea is to process dita source by running:

$ lein dita pdf

License

The DITA Open Toolkit is licensed for use, at the user's election, under the Common Public License 1.0 (CPL) or Apache License 2.0.

The Clojure and leiningen portions of dita-clj are Copyright © 2013 Gregg Reynolds and distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.