all you need is structure

69
All you need is structure George Bina [email protected] @georgebina #LavaCon

Upload: lavacon

Post on 24-Jan-2017

95 views

Category:

Business


0 download

TRANSCRIPT

Page 1: All You Need is Structure

All you need is structure George Bina

[email protected] @georgebina #LavaCon

Page 2: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

All you need is love structure All you need is love structure

All you need is love structure, love structure Love Structure is all you need

Page 3: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Overview

Page 4: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Overview l  The idea

Page 5: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Overview l  The idea l  The implementation

Page 6: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Overview l  The idea l  The implementation l  Conclusions and Q&A

Page 7: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Cooking & Single Source Publishing

Page 8: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Single Source Publishing

XML

Page 9: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Ingredients

DITA Map DITA Topic 1

Image 1 Image 2 Image 3

DITA Topic 2

ready to use ingredients ready to use DITA resources

Page 10: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Ingredients

DITA Map DITA Topic 1

Image 1 Image 2 Image 3

DITA Topic 2

Page 11: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Getting ready-to-use resources

Manual mill

Copy / Paste Manual conversion

Industrial mill

Conversion process

Small/automatic on-demand mill

Dynamic conversion

Whe

at to

flou

r E

xcel

to D

ITA

Page 12: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

This is what we want to solve! How can we make cookies when we have wheat

but not flour? How can we use DITA publishing when we have

Excel files instead of DITA topics or instead of images?

(or Markdown, HTML, Java, CSV, and so on)

Page 13: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Dynamic conversion

Manual mill

Copy / Paste Manual conversion

Industrial mill

Conversion process

Small/automatic on-demand mill

Dynamic conversion

Whe

at to

flou

r E

xcel

to D

ITA

Page 14: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Structure

Page 15: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Structure

l  Structure is important

Page 16: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Structure

l  Structure is important not necessarily the actual form of encoding that structure not necessarily the actual form of encoding that structure

at a logical level...

Page 17: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Structure

l  Structure is important

Consistent what is really

not necessarily the actual form of encoding that structure not necessarily the actual form of encoding that structure

at a logical level...

Page 18: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Structure l  Structure is important l  Consistent structure → automatic processing

Consistent what is really

not necessarily the actual form of encoding that structure not necessarily the actual form of encoding that structure

at a logical level...

Page 19: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Structure l  Structure is important l  Consistent structure → automatic processing

Consistent what is really

not necessarily the actual form of encoding that structure not necessarily the actual form of encoding that structure

So we can convert from one form of encoding to another

at a logical level...

Page 20: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Consistent structure Can be obtained if we use some sort of validation:

•  for XML we have many options: •  DTD, XML Schema, Relax NG, NVDL •  Schematron •  Custom XSLT/XQuery scripts

•  For other formats not so many options •  Tool specific (for example Excel validation expressions) •  Mostly limited to individual values

Page 21: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Existing structured content

Page 22: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Existing structured content Structured content = XML, for example DITA

Page 23: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Existing structured content Structured content = XML, for example DITA We may have also other structured content

Page 24: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Existing structured content Structured content = XML, for example DITA We may have also other structured content

-  in more or less consistent formats

Page 25: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Existing structured content Structured content = XML, for example DITA We may have also other structured content

-  in more or less consistent formats l  HTML files l  Markdown l  Excel or other spreadsheets l  CSV l  Java source files l  etc.

Page 26: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Existing structured content Structured content = XML, for example DITA We may have also other structured content

-  in more or less consistent formats l  HTML files l  Markdown l  Excel or other spreadsheets l  CSV l  Java source files l  etc.

-  that cannot move to XML/DITA over night

Page 27: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Existing structured content Structured content = XML, for example DITA We may have also other structured content

-  in more or less consistent formats l  HTML files l  Markdown l  Excel or other spreadsheets l  CSV l  Java source files l  etc.

-  that cannot move to XML/DITA over night -  that cannot move to XML/DITA at all

Page 28: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Idea

Page 29: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Use URLs to encode dynamic conversions

Idea

Page 30: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Use URLs to encode dynamic conversions

Idea

sample.xls

Page 31: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Use URLs to encode dynamic conversions

DITA Topic (table) XML

Idea

sample.xls

Page 32: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Use URLs to encode dynamic conversions

http://example.com/convertExcel2DITA?file=sample.xls

DITA Topic (table) XML

Idea

sample.xls

Page 33: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Use URLs to encode dynamic conversions

excel2dita:/sample.xls

DITA Topic (table) XML

Idea

http://example.com/convertExcel2DITA?file=sample.xls

sample.xls

Page 34: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Let’s see this in action! Demonstrate use of an Excel file as a DITA topic

Page 35: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

User perspective Just add

excel2dita:/ in front of a reference to an Excel file to get a

DITA topic!

Page 36: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Not limited to DITA We can use the same idea for different use cases:

-  convert to/from other types of XML documents: DocBook, TEI, XHTML, PI-Mod, etc.

-  generate dynamic SVG images from data in Excel, CSV, etc. formats

-  process an Excel sheet with XML processing languages like XSLT, XQuery and XProc

-  etc.

Page 37: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Cross-format DITA publishing Cross-format publishing using DITA tools of

l  entire documents -  just refer a “virtual” topic from a DITA map

l  parts of a document -  refer the “virtual” topic in a DITA map as resource only -  conref the part that you want from a published topic

Similar concepts can be applied to other XML document types (for example using XInclude)

Page 38: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

The DITA Glass project Moving from idea to implementation

http://www.github.com/oxygenxml/dita-glass

Allows to define conversion pipelines and associate them to a URL scheme

Page 39: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Processors pipeline - read only

P1 P2 ... P(n) Original content Converted content

Support “convert:” URLs: convert:/pipelineStepN/.../pipelineStep1!/targetContentURL URL Handler which converts content via a pipeline of stages

Page 40: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

CSV to DITA convert:/processor=xslt;ss=urn:processors:csvtext2dita.xsl/processor=wrap!/x.csv

Wrap XSL

...

x.csv DITA topic

wrap csvtext2dita.xsl

Page 41: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Processors pipeline – read/write l  A pipeline may also contain reverse processors

which define the processing applied when the file is saved

l  So you can potentially edit content in one format and save in another

P1 P2 ... P(n)

RP1 RP2 ... RP(m) Target file Edited file

Page 42: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

CSV to DITA round-trip

convert:/rprocessor=xslt;ss=urn:processors:dita2csv.xsl/

processor=xslt;ss=urn:processors:csvtext2dita.xsl/processor=wrap!/x.csv

Wrap XSL

RP2 ... RP(m) x.csv DITA topic

dita2csv.xsl

wrap csvtext2dita.xs

Page 43: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

How we get to a simple URL? excel2dita:/sample.xls from a “convert” URL that specifies the processing

pipeline: convert:/processor=xslt;ss=/path/to/excel2d.xsl/

processor=excel!/sample.xls

Page 44: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

URL Syntax Example convert:/processor=xslt;ss=/path/to/excel2d.xsl/processor=excel!/sample.xls

excel2dita:/sample.xls

Page 45: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

URL Syntax Example convert:/processor=xslt;ss=/path/to/excel2d.xsl/processor=excel!/sample.xls

excel2dita:/sample.xls

<rewriteURI rewritePrefix="convert:/processor=xslt;ss=/path/to/excel2d.xsl/processor=excel!/” uriStartString="excel2dita:/” />

XML Catalog

Page 46: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Excel to XML JSON to XML HTML to XHTML Apply XSLT/XQuery processing Apply JavaScript processing Apply Java processing Wrap Text in an XML element

Implemented processors

Page 47: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Examples of original formats

HTML Other XML format Markdown Excel Comma separated values (CSV) Documentation in custom HTML format Documentation embedded directly in code

Page 48: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Excel to DITA

l  Excel to XML l  XML to DITA Topic

<topicref href="convert:/proc=xslt;ss=excel2d.xsl/proc=excel;sn=sample!/sample.xls"/> <topicref href="excel2dita:/sample.xls"/>

Page 49: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Potential Benefits

l  Dynamically create DITA tables from spreadsheet tables

l  Various table column computations are automatically done in Excel.

l  Single source content

Page 50: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

HTML to DITA

l  HTML to XHTML l  XHTML to DITA

<topicref href="convert:/proc=xslt;ss=h2d.xsl/proc=xhtml!/care.html" format="dita"/> <topicref href="html2dita:/care.html" format="dita"/>

Page 51: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Potential Benefits

l  Use online tools to gather content l  Use existing content published by some other

entity l  Single source content

Page 52: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

MarkDown to DITA

l  MarkDown to HTML l  HTML to XHTML l  XHTML to DITA

<topicref href="convert:/proc=xslt;ss=h2d.xsl/proc=xhtml/proc=js;js=converter.js..!/sample.md"/> <topicref href="md2dita:/sample.md"/>

Page 53: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Potential Benefits

l  Gather API-related input from developers l  Single source content

Page 54: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

XML Schema to DITA l  Preserve annotations l  Show content model

<topicref href="convert:/processor=xslt;ss=urn:proc:xsdToTopic.xsl!/personal.xsd"/> <topicref href="xsd2dita:/personal.xsd"/>

<element name="name"> <annotation> <documentation>Specifies the person family and given name.</documentation> </annotation> <complexType> <all> <element ref="p:family"/> <element ref="p:given"/> </all> </complexType> </element>

Page 55: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Potential Benefits

l  Integrate basic XML Schema documentation in DITA-based project.

l  Single source content

Page 56: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Javadoc to DITA l  Javadoc HTML to XHTML l  XHTML to DITA

<topicref href="convert:/proc=xslt;ss=urn:proc:jdToTopic.xsl/proc=xhtml!/ButtonEditor.html"/> <topicref href="javadoc2dita:/ButtonEditor.html"/>

Page 57: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Potential Benefits

l  Publish DITA conversion of Javadoc to PDF l  Single source content

Page 58: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Java to DITA l  Java to XML l  XHTML to DITA

<topicref href="convert:/processor=xslt;ss=urn:processors:javaToTopic.xsl/processor=java;jars=urn:processors:jars;ccn=j.to.xml.JavaToXML!/WSAuthorEditorPage.java"/> <topicref href="javadoc2dita:/WSAuthorEditorPage.java"/>

Page 59: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Potential Benefits

l  Access to source documentation and Java class structure in DITA as syntax diagrams

l  Single source content

Page 60: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Dynamic reports in DITA

l  Excel to XML l  XML to SVG l  SVG referred in DITA topic

<image href="convert:/proc=xslt;ss=sales.xsl/proc=excel;sn=sample!/sales.xls"/>

Page 61: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Potential Benefits l  Publish graphs which dynamically change in

time l  Single source content

Page 62: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

CSV to DITA (and back...)

l  CSV (Comma separated values) to DITA l  DITA to CSV

<topicref href="convert:/rprocessor=xslt;ss=urn:processors:dita2csv.xsl/ processor=xslt;ss=urn:processors:csvtext2dita.xsl/processor=wrap !/sample.csv" format="dita"/>

Page 63: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Potential Benefits l  Convert database exports to DITA tables l  Edit DITA tables and update CSV content

Page 64: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Let’s see all these conversions Demonstrate publishing a map referring Excel,

MarkDown, Java, CSV, etc. to PDF and WebHelp

Demonstrate CSV round-tripping to DITA

Page 65: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

DITA-Glass Project and presentation samples

https://github.com/oxygenxml/dita-glass

Page 66: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Related work DITA-OT Plugins to enable DITA-OT to process

MarkDown and HTML as Lightweight DITA

Page 67: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Other use Define a DITA project in Excel and process that

with XSLT to generate the project structure Related work to this is the model2DITA framework

that uses XML instead of Excel to store the DITA project structure

Page 68: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Conclusions l  DITA Glass can seamlessly bring together

different formats in a single DITA publication l  Simple, yet very powerful idea – just refer a

resource thought a URL l  A generic approach, not limited to DITA - see

the Excel data to SVG graphics example l  Proof of concept implementation available in

oXygen XML Editor

Page 69: All You Need is Structure

@georgebina #LavaCon Copyright @ Syncro Soft, 2016. All rights reserved.

All you need is structure

Thank you

Questions? [email protected] @georgebina http://www.oxygenxml.com