Giter Club home page Giter Club logo

dim's Introduction

Dynamic Information Model (DIM)

The DIM project is an implementation of an intelligent style guide that not only describes the rules the content should follow but can also enforce those rules. Another goal is to be auto-discoverable, style guide topics being annotated with meta information that allows this.

Description

The intelligent style guide from the DIM project is implemented in DITA. Rules to enforce the style guide prose are encoded using existing DITA markup, we use a data list (dl) element placed into a section marked with the audience attribute set to styleguide. These embedded rules are instantiations of generic rules defined in a library. To instantiate a rule, we just need to specify the rule name and values for its parameters.

To make the style guide discoverable, we annotate topics with meta information that described what element or attribute use that topic is about. Thus, this information can be used to point the user back to that topic when the user is interested in an element or attribute that topic describes.

Content

The project contains:

  • Sample style guide that can serve as a starting point for your own style guide - in case you do not have one already. This was contributed by Comtech Services

  • Library of generic rules, defined as Schematron abstract patters

  • XSLT script that will generate a Schematron file that contains all the rules defined in the style guide topics, each with a link that points back so the style guide topic where the rule was defined

  • XSLT script that will generate an oXygen configuration file that will make the style guide topics discoverable from the documentation tool tips oXygen presents for elements and attributes

  • oXygen framework that extends DITA support to provide DIM specific actions, that allow to easily define new rules and to annotate topics with meta information

Getting started and deliverables

To get started, clone the DIM project and either use the provided style guide as a starting point, or replace that with your own style guide.

If you open a style guide topic in oXygen make sure you enable the + DIM style from the Styles drop down to see the DIM specific actions. Use the provided DIM specific actions to annotate topics with meta information and to add rules.

Publish the style guide using the oXygen WebHelp transformation into the info-model/styleguide folder. This can be easily done in oXygen using the pre-configured Generate Style Guide transformation scenario.

Run the gen-rules/gen-rules.xsl and gen-rules/gen-mappings.xsl on the style guide DITA map in order to generate the rules.sch Schematron file and the contentCompletionElementsMap.xml configuration file.

The generated style guide output, the schematron file and the configuration file are the deliverables of this project. You can use them to provide the integrated style guide experience to your authors in your real project.

Setting up oXygen to use the style guide

To be able to use the intelligent style guide in oXygen, we need to use the generated Schematron schema to validate the documents we want to enforce the style guide rules on, we need to make the published style guide form accessible and to setup the configuration file so that elements and attribute tool tips will point to the style guide topics that describe their usage.

  • Associate Schematron schema with files

    A Schematron schema can be associated with an XML document either within the document itself, using an xml-model processing instruction, or it can be associated externally, at the application level.

    A Schematron validation can be set outside the document, at the framework level. Each framework configuration has a Validation tab where you can specify a validation scenario. If no scenario is available, create one containing a validation unit that validates the document with the detected schemas. Then add a new validation unit that validates the document with the generated Schematron schema and depending on your preference, you can add that to be part of the automatic validation, or just leave it to be applied only when the authors trigger the validation action themselves, using the validate action.

  • Make the published style guide accessible

    You can place the generated WebHelp form of the style guide either locally or you may publish that on a web server. In the later case you may consider also generating Feedback-enabled WebHelp, rather than simple WebHelp, to allow authors to send you feedback on the style guide content.

    Then, you need to edit the info-model/rules/catalog.xml file to update the rewritePrefix value to point to the base location of your published style guide

    <rewriteURI uriStartString="http://example.com/styleguide/webhelp/" rewritePrefix="styleguide/webhelp/"/>

  • Setup oXygen to show tool tips for elements and attributes

    This setting can be done as part of a framework, like the DITA framework for example, which is used to provide DITA editing support in oXygen. Let's say you customized the DITA framework by extending it in a framework named dita-my-project. Then you need to edit the catalog file to update the http://www.oxygenxml.com/dita_dim/styleguide/contentCompletionElementsMap.xml in

    <uri name="http://www.oxygenxml.com/dita/styleguide/contentCompletionElementsMap.xml" uri="contentCompletionElementsMap.xml"/>

    to replace dita with dita-my-project.

    For each framework, oXygen will try to load this configuration file from such an URL, and if that is mapped by the catalog to some actual configuration file, then that will be automatically used to provide links to style guide topics from the element and attribute tooltips.

    Note

    These deliverables can be used also with other tools, the style guide can be published to other formats and you can generate different tools configuration file and then set everything up as you want. The DIM project is about generic ideas but it provides a specific implementation using DITA and oXygen.

License

The DIM project is licensed for use under the Apache License 2.0.

Copyright © 2015, Syncro Soft SRL

dim's People

Contributors

dependabot[bot] avatar dunamariuscosmin avatar florinavram avatar georgebina avatar nkutsche avatar octaviann avatar raducoravu avatar stefanvasile avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dim's Issues

More details about how users with the Oxygen plugin for Eclipse can use this project

One of out customers using the Oxygen plugin for Eclipse wanted to use this project but it's description seems to be more oriented towards Oxygen standalone users, for example all the transformation scenarios stored at project ".xpr" level need to be manually created on Eclipse.
As a starter here's what I told our specific client:

This particular "dim" project's documentation is mostly for using it with the Oxygen standalone version but it should also work with the Oxygen Eclipse plugin.
Let's say you start with a clean Eclipse installation + Oxygen XML plugin installed.
Then you download the entire "https://github.com/oxygenxml/dim" project somewhere on your local drive.
After this you can start Eclipse, and in the Preferences->Oxygen plugin->Document Types->Locations page you can add a new framework location pointing to the folder "dim/frameworks".
Then in the Preferences->Oxygen plugin->XML catalogs you should add a reference to the XML catalog located in "info-model/rules/catalog.xml".
After this you can open the DITA Map "info-model/styleguide.ditamap" in the Oxygen DITA Maps Manager view. Each of the topics referenced in it besides containing a description for a particular problem also contains automatic checking rules for that specific problem, rules which can be automatically converted to Schematron.
If you create an XSLT transformation scenario and apply the XSLT stylesheet "gen-rules/dim2sch.xsl" over the "info-model/styleguide.ditamap", it will generate a Schematron file containing all rules described in the topics and which can be used to validate your DITA topics.

restrictCharacter params inconsistent & bug in message text

the other rules have 'parent' as their parameter name, restrictCharacters uses 'parentElement'. This cost me 30 minutes trying to figure out what I was doing wrong!

Also, when it errors it says 'you are recommended to have at least X words', instead of saying 'X characters'

Error scope

When you have multiple errors at multiple element scopes, it's unclear. For example, when you have an error in the body ("short desc missing") and you get another error in the title, say, too many words, then you have two errors in the hoverbox with no indication where the wordcount error is referring to. It would be good to have the parentElement in front of the error so you know where to look to resolve the issue.

Specify path to Oxygen Maven repository in pom.xml

Feedback from one of our customers:

I could not get the pom file to work at this location dim-master/oxygen-sdk-workspace/sdkExtensions/pom.xml. I had to add this:

<repositories>
  <repository>
    <id>oxygenxml</id>
    <name>oXygen XML SDK Maven Repository</name>
    <url>https://oxygenxml.com/maven/</url>
  </repository>
</repositories>

before I could build it properly.

conditional rules: if attribute = then apply rule

I'd like to be able to set conditional chains of rules. e.g if I insert a paragraph attribute is set to "twitter", then I want to trigger my restrictCharacter rule, but if it's not set, or set to something else, I'd like to not trigger it (or trigger another rule).

Avoid word in Elements, avoid word pair, and contractions

Hi George, team,

I was talking to George at Lavacon Dublin and he told me I should put in a request for this feature:

What would really speed up the implementation of my style guide in schematron is a hack that allows me to implement these items with the current set of rules, or adding new rules to implement the following:

Avoid word in Elements - allows us to stop repeating a dita entry for the same word across all elements.

Contractions - I cannot use AvoidWordInElement with contractions like can't don't etc, it breaks when I try and transform. It would be great if there were instructions on how to wrap the apostrophes so they don't break DIM.

Avoid phrases in Elements. I want to target words, for example, "pull up" and post a message with the suggested word "lift". However, two words don't seem to work.

I appreciate you taking the time to help with this.

All the best,

Melanie

Add Business Rule Action has disappeared

There used to be a button to add a new business rule when I was working in the styleguide map. I upgraded (as instructed) to Oxygen 16.1 and the button disappeared. I can't see how to get it back.

Mysterious rules

I am getting rules that I can't find the source of in the informationModel bookmap for example: concepts require prolog, and topic information types are not allowed at all.

AvoidWordInElement is case sensitive

Hi all,

In my testing, I have found that I have to create an entry for each word with and without a capital letter.

For example, I want to exclude the word "typically" but I must create two entries for "Typically" and "typically".

Is there any way around this?

Thanks,

Melanie

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.