Documentation Generator

Origam.DocGenerator.dll is a command line utility that allows you to generate documentation from ORIGAM model.

Usage of dotnet Origam.DocGenerator.dll

-x, --xslt Required. Xslt template
-r, --rootfilename Required. Root File
-m, --xmlfilename Xml File for export source tree.
-s, --schema Required. Input Origam project directory.
-p, --packageid Required. Guidid of package.
-o, --output Required. Output directory
-l, --language Required Localization(ie. cs-CZ).

Create Source Xml

This example exports the documentation in an XML format. You can use it or start building an XSLT transformation on top of this data.

dotnet Origam.DocGenerator.dll xml -s D:\Projects\ProjectName -p 0fe05b88-11e4-4f28-81bc-7762afa76dc8 -o D:\aprace\export\ -m index.xml -l de-DE

Use XSLT to transform the documentation

This example produces a documentation in Markdown format by using an XSLT transformation.

dotnet Origam.DocGenerator.dll -s D:\Projects\ProjectName -p 0fe05b88-11e4-4f28-81bc-4762afa76dc8 -o D:\Project\export\ -x null -m index.xml -l de-DE

EXAMPLE XML

<?xml version="1.0" encoding="UTF-8"?>
<!--This file is generated by the program.(12.11.2018 00:53:21)-->
<Menu>
   <Menuitem DisplayName="Adresář" Id="b2a2194c-c2a4-4236-837a-08c1b720fc96" Type="FormReferenceMenuItem">
      <Section DisplayName="Adresář" Id="197a6d71-c154-4c1c-a963-b68b7647469c" Type="ControlItem">
         <entity>
            <entityid>4f2505a4-8312-420c-bfb8-6af3d4ad8bf0</entityid>
            <entityname>BEBusinessPartner</entityname>
         </entity>
         <Field DisplayName="Příjmení" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Jméno" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Účetní typ kontaktu" Id="aebc5761-339d-4787-9289-704f7ed7ecbe" Type="ControlItem" />
         <Field DisplayName="Typ kontaktu" Id="aebc5761-339d-4787-9289-704f7ed7ecbe" Type="ControlItem" />
         <Field DisplayName="Tituly" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Firma" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Ulice" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Číslo pop./or." Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Číslo orientační" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Město" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="PSČ" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Kraj" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Stát" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Telefon Mobilní" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Telefon Další" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Email Hlavní" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Email Další" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Jazyk komunikace" Id="aebc5761-339d-4787-9289-704f7ed7ecbe" Type="ControlItem" />
         <Field DisplayName="IČO" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="DIČ" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Plátce DPH" Id="48dc8d6a-21c1-4e12-96de-c3a5eb67434d" Type="ControlItem" />
         <Field DisplayName="Datová schránka" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Obchodní rejstřík" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="WWW stránky" Id="7d1ec946-017e-4d38-9d92-d4d6b9fabffc" Type="ControlItem" />
         <Field DisplayName="Preferovaný způsob komunikace" Id="aebc5761-339d-4787-9289-704f7ed7ecbe" Type="ControlItem" />
         <Field DisplayName="Zasílané informace" Id="91f24905-44d2-46e9-b040-80e3f64eefea" Type="ControlItem" />
      </Section>
   </Menuitem>
</Menu>

Example Markdown output

filename = doc_Adresář.md

## Adresář
####
|Adresář||
|-------|--------|
| Jméno | |
| Příjmení | |
| Účetní typ kontaktu | |
| Typ kontaktu | |
| Tituly | |
| Firma | |
| Ulice | |
| Číslo pop./or. | |
| Číslo orientační | |
| Město | |
| PSČ | |
| Kraj | |
| Stát | |
| Telefon Mobilní | |
| Telefon Další | |
| Email Hlavní | |
| Email Další | |
| Jazyk komunikace | |
| IČ | |
| DIČ | |
| Plátce DPH | |
| Datová schránka | |
| Obchodní rejstřík | |
| WWW stránky | |
| Poznámky | |
| Preferovaný způsob komunikace | |
| Zasílané informace | |

Xslt

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" version="1.0">
   <xsl:output method="text" />
   <xsl:template match="/">
      <xsl:for-each select="/Menu/Menuitem">
         <exsl:document href="doc_{@DisplayName}.md">
            ##
            <xsl:value-of select="@DisplayName" />
            <xsl:if test="description != ''">
               - *
               <xsl:value-of select="description" />
               *
            </xsl:if>
            ####
            <xsl:for-each select="Section">
               |
               <xsl:value-of select="@DisplayName" />
               |
               <xsl:if test="description != ''">
                  <xsl:value-of select="description" />
               </xsl:if>
               |
|-------|--------|
               <xsl:for-each select="Field">
                  |
                  <xsl:value-of select="@DisplayName" />
                  |
                  <xsl:if test="description != ''">
                     <xsl:value-of select="description" />
                  </xsl:if>
                  |
               </xsl:for-each>
            </xsl:for-each>
         </exsl:document>
      </xsl:for-each>
   </xsl:template>
</xsl:stylesheet>

How to run on Linux

  1. Install dotnet here:Install .NET on Linux Distributions | Microsoft Docs
  2. Install dotnet-sdk-2.1
  3. Run sudo apt-get install dotnet-sdk-2.1
  4. Run dotnet --list-sdks the result should be 2.1.X [/usr/share/dotnet/sdk]
  5. If Origam.DocGenerator.runtimeconfig.json does not exist in the app folder then create it

How to run on Windows

  1. install dotnet from here: Download .NET (Linux, macOS, and Windows)
  2. Install .NET Core Runtime and .NET Framework Runtime.
  3. If Origam.DocGenerator.runtimeconfig.json does not exist in the app folder then create it.

Example Origam.DocGenerator.runtimeconfig.json`

{
   "runtimeOptions": {
      "framework": {
         "name": "Microsoft.NETCore.App",
         "version": "2.1.0"
      }
   }
}