Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation of args.hdf #98

Closed
stefan-jung opened this issue May 19, 2016 · 2 comments
Closed

Improve documentation of args.hdf #98

stefan-jung opened this issue May 19, 2016 · 2 comments
Assignees
Labels
coverage Incomplete information in existing topics
Milestone

Comments

@stefan-jung
Copy link
Contributor

It is possible to inject code into the HTML header using a hdf file, that can be passed using the args.hdf parameter. A hdf file must be a valid XML file. Therefore it needs to have a root element. So it is not possible to inject multiple elements.

Valid:

<link rel="stylesheet" type="text/css" href="flag-icon.min.css"><!----></link>

Invalid:

<link rel="stylesheet" type="text/css" href="flag-icon.min.css"><!----></link>
<script src="jquery.min.js"><!----></script>

But there is a template in dita2htmlImpl.xsl which unwraps a root <div> element, if it exists.

<!-- For header file processing, pull out the wrapping DIV if one is there -->
<xsl:template match="/div" mode="add-HDF">
  <xsl:apply-templates select="*|comment()|processing-instruction()|text()" mode="add-HDF"/>
</xsl:template>

Valid:

<div>
  <link rel="stylesheet" type="text/css" href="flag-icon.min.css"><!----></link>
  <script src="jquery.min.js"><!----></script>
</div>

Currently this is not explained in the docs, see HTML-based output parameters -> args.hdf.

@infotexture: Could you please explain that in the docs?

@infotexture infotexture added the coverage Incomplete information in existing topics label May 20, 2016
@infotexture infotexture added this to the 2.3 milestone May 20, 2016
@infotexture infotexture self-assigned this May 20, 2016
@infotexture
Copy link
Member

See the updated topic in Development version of the documentation.

@stefan-jung
Copy link
Contributor Author

Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coverage Incomplete information in existing topics
Projects
None yet
Development

No branches or pull requests

2 participants