Re: initial release of DITA-plugin-utilities


Mark Giffin
 

Thanks for this Chris. Just so I understand, is this a simplified method for making DITA specializations using RelaxNG schemas?

Regards,
Mark Giffin
Mark Giffin Consulting, Inc.
http://www.markgiffin.com/

On 23-May-19 9:28 AM, chrispitude@... [dita-users] wrote:
 

Hi everyone,


I'm happy to announce the initial release of my DITA-plugin-utilities github repo:


https://github.com/chrispy-snps/DITA-plugin-utilities


There are two linux-based utilities provided:

  • make_dita_grammar.pl - make DITA RelaxNG grammar plugin modules from high-level descriptions
  • content_model.pl - show the content model of a DITA RelaxNG topicshell or mapshell module

make_dita_grammar.pl lets you create DITA grammars from high-level XML descriptions. For example,



The output is a plugin directory that is ready to be placed in your DITA-OT plugins/ directory and installed/integrated.


content_model.pl lets you report the content model of DITA topicshell and mapshell modules:


$ content_model.pl ex1/rng/myTopicShell.rng -attributes none
abstract = element abstract { (text | dl | \div | fig | fig1 | image | lines | lq | note | object | ol | p | pre | simpletable | sl | table | ul | boolean | cite | keyword | ph | q | term | \text | tm | xref | state | data | data-about | foreign | unknown | shortdesc | draft-comment | fn | indextermref | indexterm | r
equired-cleanup)+ }
alt = element alt { (text | data | data-about | foreign | unknown | keyword | term | \text | draft-comment | required-cleanup | ph)+ }
audience = element audience { empty }
author = element author { (text | data | data-about | foreign | unknown | keyword | term | \text)+ }
body = element body { (dl | \div | fig | fig1 | image | lines | lq | note | object | ol | p | pre | simpletable | sl | table | ul | data | data-about | draft-comment | foreign | unknown | required-cleanup | bodydiv | example | section)* }
...omitted...
topic = element topic { title, titlealts?, (shortdesc | abstract)?, prolog?, body?, related-links?, topic* }
ul = element ul { (data | data-about)*, li+ }
unknown = element unknown { (topic? | _1 | text)+ }
vrm = element vrm { empty }
vrmlist = element vrmlist { vrm+ }
xref = element xref { (text | boolean | keyword | ph | q | term | \text | tm | state | cite | data | data-about | draft-comment | foreign | unknown | required-cleanup | image | desc)+ }


To better understand how grammar creation works, have a look at the input XML files and resulting output DITA plugin directories at


https://github.com/chrispy-snps/DITA-plugin-utilities/tree/master/examples


This is an initial release, so expect bugs and rough edges. But, it's working enough that we're using it in-house for grammar creation.


Feel free to reply with questions!


 - Chris



Join main@dita-users.groups.io to automatically receive all group messages.