Source Editor Overview
The Source Editor is a tool used to view DITA topics and maps in their source language. The Source Editor enables advanced DITA authors to edit with more precision. To help you navigate the code, the Source Editor colors syntax and your cursor position with a gray line in the scroll bar. While some content may have a preview, knowledge of the code is recommended.
If multiple users collaborate on a resource, Heretto CCMS places a collaboration lock on the topic and the XML code is not editable.
Map XML Code
Heretto CCMS enables you to edit the map XML source in the Source Editor.
Topic XML Code
The Source Editor enables you to edit the topic XML source side-by-side with the user-friendly editor rendering.
OpenAPI Code
Heretto CCMS enables you to edit the OpenAPI code saved in a JSON file in the Source Editor.
Markdown Code
Heretto CCMS enables you to edit the Markdown code in the Source Editor.
XML Code Validation
The Source XML Invalid window appears if Heretto CCMS detects that something is wrong with the XML code that you edited.
If you plan to fix the invalid XML code later and you don't want to lose your changes, you can save the invalid XML code. Heretto CCMS notifies you about invalid XML files by displaying the Invalid File icon in the Content Library.
XML Code Autocompletion
Heretto CCMS suggests and automatically completes new XML elements for you.
You can quickly add an XML element by starting to enter the XML element code and
selecting the relevant option from the Autocomplete menu. In the following
example, the <se
was typed and the Autocomplete menu suggested to insert a
section element.
In the following example, the section element was selected
from the Autocomplete menu. Heretto CCMS automatically closes the XML elements
for you (in this example, the </section>
closing tag was
added).
If this feature is disabled for your organization, contact your Customer Success Manager.
XML Code Formatting
When you edit the XML code, it may become disorganized because you focus on writing and not formatting the code.
The following example shows a slightly disorganized piece of code in the Source Editor.
You can make your code more readable by clicking the Format source . This makes Heretto CCMS automatically indent and position the code for you. It is useful if you don't want to waste your time on formatting the code on your own. The following example shows a code that was automatically formatted by Heretto CCMS.
Find and Replace Code
The Source Editor enables you to quickly find and replace code.
With your cursor placed in the editor, you can press Find dialog.
(Windows) or (Mac) to open theYou can set the search to:
- Match case
- Match whole words
- Analyze a part of the file
- Use regular expression
You can replace your search results with a particular expression. To do so, in the Find dialog, you click the Toggle Replace mode button that expands it to the Find and Replace dialog.
You can replace all search results at once or do it one by one. All search results are highlighted.
Collapse and Expand Code
Some XML files may be very complex, especially if you view their source. Heretto CCMS enables you to collapse and expand elements in the Source Editor.
Collapsing some code parts enables you to focus on a given part of the code. By default, all elements are expanded when you open a file in the Source Editor. The following example shows a concept topic with every element expanded.
Imagine that you want to focus only on the first section element in this concept topic. You can collapse irrelevant elements to limit distractions and increase readability. The following example shows the same concept topic with some elements collapsed, in this case the second section element.