如何使用DITA开放工具包在DITA markdownn上启用shortdesc输出?

时间:2018-05-01 07:58:09

标签: markdown dita dita-ot

我想用DITA OT 3.0.3将我的降价风格的DITA内容转换为HTML5风格的输出。

我检查了语法页面,我理解为第1段将是shortdesc。

  

" LwDITA兼容文档(MDITA)第一段被视为   一个短片元素。在通用Markdown文档中的所有段落   出现在body元素内。"

这是我执行的命令。

dita --input=sequence.ditamap --format html5

以下是我的示例文件。

sequence.ditamap:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">

<map>
  <title>Working in the garage</title>
  <topicref href="input.md" format="markdown" />
</map>

input.md:

# title {.task}

Some Description

1. steps1

    step1 content

2. steps2

    step2 content

This is step result.

它会在out目录下生成index.html和input.html。我希望index.html上的input.html链接有悬停文本,但它没有。

我的期望是悬停文字显示&#34;一些描述&#34;。我有什么问题?

在其他情况下我也尝试过:

Tri#1 input.md:

Some Description(new)

# title {.task}

    Some Description

它说[filter] Content is not allowed in prolog.

尝试#2 sequence.ditamap:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">

<map>
  <title>Working in the garage</title>
  <topicref href="input.md" format="markdown">
    <topicmeta>
        <shortdesc>Some Description(2nd new)</shortdesc>
    </topicmeta>
</topicref>
</map>

在这种情况下,没有错误,但这些简短描述不会出现在输出中。

以下是input.html输出的一部分。

<head>
:
:
<meta name="DC.Type" content="task">
<meta name="DC.Format" content="HTML5">
<meta name="DC.Identifier" content="title">
<link rel="stylesheet" type="text/css" href="commonltr.css">
<title>title</title></head>
<body id="title">
:
:
    <h1 class="title topictitle1" id="ariaid-title1">title </h1>
    <div class="body taskbody">
    <section class="section context"></section>
    <ol class="ol steps">
    </ol>
    <section class="section result"></section></div>
:
:
</body>

那么,如何启用HTML5输出的shortdesc?或者到目前为止不可能吗?

参考文献:

1 个答案:

答案 0 :(得分:1)

从DITA Map:

引用这样的markdown文件
           <topicref href="input.md" format="mdita" />

似乎可以实现将每个段落视为shortdesc的改进。 但是你的Markdown文件有一个属性,可以将其标识为DITA任务:

  # title {.task}

这不再适用于&#34; mdita&#34;格式,可能是因为LightWeight DITA标准没有提供声明某个Markdown文件应该转换为DITA任务的可能性。 我将尝试与创建Markdown DITA转换器的Jarno Elovirta取得联系,看看他对此有何看法。

相关问题