【问题标题】:how to remove the content of the header file in the head element of the generated HTML files in dita ot如何去除dita ot中生成的HTML文件的head元素中的头文件内容
【发布时间】:2020-09-26 04:37:08
【问题描述】:

在 DITA-OT 中,当我在生成的 HTML 页面中将 dita 文件发布到 html5 时,我得到了 <head> 元素。

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2020">
  <meta name="DC.rights.owner" content="(C) Copyright 2020">
  <link rel="stylesheet" type="text/css" href="commonltr.css">
  <title>Paint</title>
  <link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
</head>

我的要求是我想从生成的 html5 输出的 head 元素中删除一些内容。

例如,如何删除以下 sn-p?

<link rel="stylesheet" type="text/css" href="commonltr.css">

【问题讨论】:

    标签: dita-ot


    【解决方案1】:

    您可以设置参数dita-cssdita-bidi-css 或覆盖topic.xsl 的整个generateCssLinks 模板,请参阅https://github.com/dita-ot/dita-ot/blob/develop/src/main/plugins/org.dita.html5/xsl/topic.xsl

    更新: 您必须覆盖 XSL 样式表。要了解如何覆盖它们,您应该阅读 Customizing HTML outputCustom HTML plug-ins

    【讨论】:

    • override generateCssLinks 模板是什么意思?我们必须在哪里编写逻辑?我们可以创建一些 xsl 文件还是什么?否则可以在dita-css 和dita-bidi-css 上设置什么参数。你能解释一下吗? plzzzz
    • 我已经更新了答案并添加了引用文档的链接。在那里,您可以找到学习如何创建自定义 HTML 插件所需的内容。
    • 我确实覆盖了 generateCssLinks 代码。经过什么修改,我需要更改我无法理解的更改。这里我也得到了错误 。那你能做到吗?请帮我解决这个问题。
    • 对不起,我不明白你的意思。
    猜你喜欢
    • 1970-01-01
    • 2018-07-10
    • 2021-05-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-15
    • 2013-09-03
    • 2018-08-31
    相关资源
    最近更新 更多