0

我想使用 DITA OT 3.0.3 将 Markdown 样式的 DITA 内容转换为 HTML5 样式的输出。

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

“LwDITA 兼容文档 (MDITA) 的第一段被视为 shortdesc 元素。在通用 Markdown 文档中,所有段落都出现在正文元素内。”

这是我执行的命令。

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

以下是我的示例文件。

序列.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>

输入.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 的链接有悬停文本,但它没有。

我的期望是悬停文本显示“一些描述”。我是怎么了?

我还尝试过其他情况:

三#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>

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

这是 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 呢?还是到目前为止不可能?

参考:

4

1 回答 1

1

从 DITA 映射中引用这样的降价文件:

           <topicref href="input.md" format="mdita" />

似乎可以实现将每个段落都视为简短描述的改进。但是您的 Markdown 文件有一个属性将其标识为 DITA 任务:

  # title {.task}

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

于 2018-05-03T12:07:03.853 回答