Working with external files
External files are those that appear—in content or as a download link—in the generated (HTML) content, but which are not in the Heretto repository.
Adding a Download link
Link to external files on a Web server to make those files available for download. This method inserts a link labeled DOWNLOAD, so be sure to provide text before the link that explains to the reader what will happen when the link is clicked.
- Insert the cursor where you want the download link.
- Enter the text DOWNLOAD, in all-caps, and then select that text.
- Click Link and select Insert Xref.
- In the Scope field of the Properties pane, select external.
- in the Output Class field, enter download-link.
Embedding external text files
Any text file can be embedded in the page and presentes on the page with the browser's text viewer, including HTML, JSON, XML, and more. Just rename the file to have a .txt filename extension.
- HTML — http://www.freeformatter.com/html-formatter.html
- XML — http://www.freeformatter.com/xml-formatter.html
- JSON — https://jsonformatter.curiousconcept.com/
To embed a text file:
- If the source file you want to embed is not a .txt file, change the file extension to .txt.
- Add the .txt file to the /files folder of the documentation web server (through Cyberduck).
- In your .dita file, add an object element to reference the file you want to embed. For the object:
- Set the URL to the text file.
- Set the Type attribute to: text/plain.
Note: In Heretto, the object is always presented as if it is a "video" element. See below for examples.
The following example shows a generated HTML page:
The file for the embedded HTML above is in the /files/email-templates folder of the web server:
In the .dita file, the reference is an object element with the Type attribute set to text/plain:
Actual example of an embedded text file:
The default height is 300px. You can override it if needed with the Height attribute.
