Copy link to clipboard
Copied
Hello all,
Let me start by saying I really did try to find this in the Forums but just kept coming up empty. Sorry if I missed it. I also did a chat with Adobe Support and they didn't have any way to assist.
I'm using RH 2017, fully up to date, local projects, using Responsive HTML5 output, merged projects. Everything is working wonderfully.
Now we have determined that we would like to include some extra code and scripts in the code that RH is generating for the start page (and yes, we are using index.htm as the name of our start page so that it loads automatically). I know that I can accomplish what I want by copying in the additional .js scripts into the templates\scripts folder of the output and then manually edit the index.htm file before I publish - but I'd rather not have to do that every time I generate.
Based on what Adobe Support replied, there is no supported way to do this. I thought I'd check here to see if there are any tips that may get me all or part of the way there.
Thanks in advance for your insights,
Stephen
Copy link to clipboard
Copied
I have not seen anyone post such a solution.
The only thing I can think of use Publish as well as Generate. That would save having to upload the js files each time. When you generate, RoboHelp clears the target folder. When you publish, it does not so your js files would stay in the output folders.
You would still have to generate the start page but perhaps a macro program could simplify the editing. If the editing always injects the same text in the same place, it should be possible to set up a find and replace.
See www.grainge.org for free RoboHelp and Authoring information.
Copy link to clipboard
Copied
I cannot test it with RoboHelp 2017 right now, but in RoboHelp 2019 I can just link an external JavaScript file in the <head> section of topic:
<head>
…
<script src="assets/js/MyJavaScript.js"></script>
…
</head>
When generating the Responsive HTML5 help, it gets copied to the output and does what it should do.
Alternatively, I can embed the JavaScript code in the head:
<head>
<title>Test</title>
<script type="text/javascript">
//<![CDATA[
window.onload = function() {funcWriteDate();
function funcWriteDate(){
var vCurrentDate = new Date();
document.getElementById("idCurrentDate").innerHTML = vCurrentDate;
};
}
//]]>
</script>
</head>
<body>
<p id="idCurrentDate">ReplaceMe</p>
</body>
Works as well.