

Line Numbers Select this to include line numbers to the left of each line of code. The syntax highlighting changes for formatting appropriate for JavaScript.

This time you apply the JavaScript style class to MadCap|codeSnippetBody. You insert another snippet containing JavaScript. But after you apply the CSS style class to MadCap|codeSnippetBody, the syntax highlighting automatically changes to show the formatting appropriate for CSS. Initially, the code displays as plain text. When you insert a new code snippet containing CSS, you leave the Language field set to (inherit). On the "CSS" class you set the mc-code-lang property to CSS.Īnd on the "JavaScript" class, you set the mc-code-lang property to JavaScript. See Editing the Styles for Code Snippets.Įxample In your stylesheet, you create a class of the style MadCap|codeSnippetBody, naming it "CSS." Then you create another class and name it "JavaScript." You can also create classes of that style and assign different languages to those classes. So if you change the setting to a specific language, that language will automatically be used when you first insert a new code snippet. If you select "(inherit)," the code uses whichever language is selected for the MadCap|codeSnippetBody style (the default setting is "PlainText"). The code will be formatted appropriately, with syntax highlighting. Repeat If you select "Repeat," the caption will be displayed where page breaks are encountered in print-based output (except Microsoft Word). Position Select whether to place the caption above or below the code. Caption Enter a caption (or title) for the code snippet.(Optional) On the right side of the editor, complete any of the options.On the left side of the Code Editor, enter or paste code.Place your cursor in an empty paragraph.How to Edit the Styles for Code Snippets.How to Edit the Content for Code Snippets.
