How to link external javascript file in a DITA-OT HTML5 output
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 3
- Joined: Fri Jul 09, 2021 11:22 am
How to link external javascript file in a DITA-OT HTML5 output
I would like to add a link to an external JavaScript file in my DITA-OT output HTML5 file, how do I achieve this?
|--[js]
| |--custom.js
|--[css]
| |--custom.css
|--index.html
|--topic01.html
|--topic02.html
I want to add a line <script src="custom.js"></script> in the <head> tag of an output html file.
Please advise.
Thank you.
Gevin
|--[js]
| |--custom.js
|--[css]
| |--custom.css
|--index.html
|--topic01.html
|--topic02.html
I want to add a line <script src="custom.js"></script> in the <head> tag of an output html file.
Please advise.
Thank you.
Gevin
-
- Posts: 9421
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to link external javascript file in a DITA-OT HTML5 output
Hi Gevin,
There is a transformation parameter named "args.hdf":
https://www.dita-ot.org/dev/parameters/ ... __args.hdf
you can point it to a file containing inside the "<script src="custom.js"></script>" content.
The publishing will not automatically copy the "custom.js" to your output folder though but the HTML files will contain the updated header.
Regards,
Radu
There is a transformation parameter named "args.hdf":
https://www.dita-ot.org/dev/parameters/ ... __args.hdf
you can point it to a file containing inside the "<script src="custom.js"></script>" content.
The publishing will not automatically copy the "custom.js" to your output folder though but the HTML files will contain the updated header.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 3
- Joined: Fri Jul 09, 2021 11:22 am
Re: How to link external javascript file in a DITA-OT HTML5 output
Hi Radu,
Thank you very much for your suggestion.
Yes, it is really work, and solve my problem.
P.s. I uses the example I found in https://www.dita-ot.org/dev/topics/html ... cript.html to write the XML file for args.hdf. It's working.
Cheers!
Gevin
Thank you very much for your suggestion.
Yes, it is really work, and solve my problem.
P.s. I uses the example I found in https://www.dita-ot.org/dev/topics/html ... cript.html to write the XML file for args.hdf. It's working.
Cheers!
Gevin
-
- Posts: 3
- Joined: Fri Jul 09, 2021 11:22 am
Re: How to link external javascript file in a DITA-OT HTML5 output
Hi Radu,Radu wrote: ↑Fri Jul 09, 2021 12:54 pm
There is a transformation parameter named "args.hdf":
https://www.dita-ot.org/dev/parameters/ ... __args.hdf
you can point it to a file containing inside the "<script src="custom.js"></script>" content.
The publishing will not automatically copy the "custom.js" to your output folder though but the HTML files will contain the updated header.
After successfully using "args.hdf" in my HTML5 transformation, I tried to use same method for 'DITA Map EPUB' transformation. But the transformation fail to add a line in the <head> tag in the pages of the output EPUB.
I did try to use args.hdr and args.ftr, but all fail to write any code within the output pages too.
Do you have any idea?
Thanks & regards,
-
- Posts: 9421
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to link external javascript file in a DITA-OT HTML5 output
Hi,
I reproduced the problem and added an internal issue to investigate this further, if I come up with a possible fix I will reply back on the thread.
In the meantime if you use Oxygen's Archive browser view to edit the XHTML documents from the EPUB archive and add the extra javascript inside them, does that work in an EPUB reader? Because there may be limitations related to this as well.
Regards,
Radu
I reproduced the problem and added an internal issue to investigate this further, if I come up with a possible fix I will reply back on the thread.
In the meantime if you use Oxygen's Archive browser view to edit the XHTML documents from the EPUB archive and add the extra javascript inside them, does that work in an EPUB reader? Because there may be limitations related to this as well.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service