Lightweight DITA(一)

2018-03-02  本文已影响0人  莉莉邓

文章介绍何为Lightweight DITA,以及Lightweight DITA三种基本文件格式的特点和示例。

何为Lightweight DITA

Lightweight DITA,简称LwDITA,故名取义,轻(shou)量(shen)级(hou)的DITA标准。相比于DITA 1.3,LwDITA具有以下特点:

除此基本区别外,LwDITA相较于DITA 1.3最大的一个特点:能建立XML、HTML5、Markdown文件之间的映射。换言之,LwDITA支持建立由三种不同标记语言编写的topic文件组成的map。
从此,你可以:

是不是听着就很赞!!!下面就来细细一探究竟。

支持的文件格式

LwDITA支持三种文件格式:

XDITA

使用XML编写的LwDITA文件格式,是DITA的一个子集,同时在DITA1.3 基础上新增了多媒体元素类型,能与HTML5文件相互转换。
XDITA适用于想使用DITA标准写作技术信息,却无需完整的DITA标准的技术写作者。例如:

XDITA topic示例
<topic id="install-and-setup">
<title>Installing and Setting up Remote Lighting</title>
<shortdesc>Installation of your lighting kit includes installing the light bulbs into light fixtures, preparing the remote control, and programming lighting groups. </shortdesc>
<prolog> <data name="author" value="Kevin Lewis"/> </prolog>
<body>
<section>
<title>Steps</title>
<ul>
<li><p>Install light bulbs.</p></li>
<li><p>Prepare remote control.</p></li>
<li><p>Program lighting groups.</p></li>
</ul>
</section>
<section>
<title>Example</title>
<p>The following video demonstrates a recommended installation:</p>
<video> <media-controls /> <video-poster value="remote-poster.jpg" /> <media-source value="remote.mp4" /> </video></section>
</body> </topic>

XDITA map示例

<map id="remote-main">
<topicmeta> <navtitle>Remote Lighting Network</navtitle> </topicmeta>
<keydef keys="product-name"> <topicmeta> <linktext>Remote Network Lighting</linktext> </topicmeta> </keydef>
<topicref href="introduction.dita"> <topicmeta> <navtitle>Introduction</navtitle> </topicmeta> </topicref>
<topicref href="alternatives.dita"> <topicmeta> <navtitle>Alternative lighting setups</navtitle> </topicmeta> <topicref href="low-power.dita"> <topicmeta> <navtitle>Low power installation</navtitle> </topicmeta> </topicref>
<topicref href="high-power.dita"> <topicmeta> <navtitle>High power installation</navtitle> </topicmeta> </topicref>
</topicref> </map>

HDITA

使用HTML5编写的LwDITA文件格式,包含定制的数据属性,以实现与DITA之间的相互转换。
HDITA特别适合下列群体:

HDITA topic示例
<!DOCTYPE html>
<html>
<head>
<title>Installing and Setting up Remote Lighting</title>
</head>
<body> <article id="install-and-setup">
<h1>Installing and Setting up Remote Lighting</h1>
<p>Installation of your lighting kit includes installing the light bulbs into light fixtures, preparing the remote control, and programming lighting groups.</p>
<h2>Steps</h2>
<ul>
<li> <p>Install light bulbs.</p> </li>
<li> <p>Prepare remote control.</p> </li>
<li> <p>Program lighting groups.</p> </li>
</ul>
<h2>Example</h2>
<p>The following video demonstrates a recommended installation:</p>
<video src="remote.mp4" controls poster="remote.png"></video>
<p data-conref="bulbs-to-groups.dita#bulbs-to-groups/assign-disclaimer"></p>
</article>
</body> </html>

HDITA map示例

<nav>
<h1>Remote Lighting Network</h1>
<div class="keydef"> <span class="linktext" data-keys="product-name">Remote Lighting Network</span> </div>
<ul>
<li><p><a href="introduction.html">Introduction</a><p></li>
<li><p><a href="alternatives.html">Alternative lighting setups</a></p>
<ul>
<li><p><a href="low-power.html">Low power installation</a></p></li>
<li><p><a href="high-power.html">High power installation</a></p></li>
</ul>
</li>
</ul>
</nav>

MDITA

使用Markdown编写的LwDITA文件格式。包含两种类型:

MDITA特别适合下列群体:

MDITA topic示例

MDITA core profile对应Github Flavored Markdown Spec.
以下是一个MDITA core-profile topic的示例:
# Installing and Setting up Remote Lighting

Installation of your lighting kit includes installing the light bulbs into light fixtures, preparing the remote control, and programming lighting groups.

## Steps

1. Install light bulbs.
2. Prepare remote control.
3. Program lighting groups.

## Example
[!(image)]

以下是一个MDITA extended-profile topic示例。
---
id: install-and-setup
author: Kevin Lewis
---

# Installing and Setting up Remote Lighting

Installation of your lighting kit includes installing the light bulbs into light fixtures, preparing the remote control, and programming lighting groups.

Before you attempt to install your lighting kit, please turn off the power in your electrical circuit panel,

## Steps

1. Install light bulbs.
2. Prepare remote control.
3. Program lighting groups.

## Example

The following video demonstrates a recommended installation:

<video src="remote.mp4" controls poster="remote.png"></video>

MDITA map示例
使用Markdown编辑map文件。
# Remote Lighting Network
- [Introduction](introduction.md)
- [Alternative lighting setups](alternatives.md)
- [Low power installation](low-power.md)
- [High power installation](high-power.md)

更多关于LwDITA的源文和详细信息,请戳:
http://docs.oasis-open.org/dita/LwDITA/v1.0/cnprd02/LwDITA-v1.0-cnprd02.html

上一篇 下一篇

猜你喜欢

热点阅读