Documentation Builder Commands (Template Language)

Documentation builder commands of Software Ideas Modeler template language.
Command Result Type Description
SwitchBold Void

Toggles bold formatting for the forthcoming text in the current context. No parameters are needed.

SwitchItalic Void

Toggles italic formatting for the forthcoming text. No parameters are needed.

SwitchUnderline Void

Toggles underline formatting for the forthcoming text. No parameters are needed.

SwitchStrikethrough Void

Toggles strikethrough formatting for the forthcoming text. No parameters are needed.

SwitchStrikeout Void

Toggles strikeout formatting for the forthcoming text, similar to strikethrough. No parameters are needed.

SetFontSize(size:Number) Void

Sets the font size for the forthcoming text.

Parameter: The desired font size as a number.

Example: SetFontSize(14) sets the font size to 14 points for subsequent text.

SetFontName(fontName:String) Void

Sets the font name for the forthcoming text.

Parameter: The name of the font to use.

Example: SetFontName("Arial") sets Arial as the font for subsequent text.

SetTextColor(colorInRgbHex:String) Void

Sets the text color for the forthcoming text using an RGB hex code.

Parameter: The color in RGB hex format (e.g., #FF0000 for red).

Example: SetTextColor("#FF0000") sets the text color to red for subsequent text.

SetBackgroundColor(colorInRgbHex:String) Void

Sets the background color for the forthcoming text using an RGB hex code.

Parameter: The background color in RGB hex format.

Example: SetBackgroundColor("#FFFF00") sets the background color to yellow for subsequent text.

AddTable(cols:Number, rows:Number, width:Number, height:Number) Void

Creates a new table with the specified number of columns and rows, and starts its editing. The width and height parameters define the table's dimensions.

Parameters:

  • cols: Number of columns in the table.
  • rows: Number of rows in the table.
  • width: The overall width of the table.
  • height: The overall height of the table.

Example: AddTable(3, 2, 500, 300) creates and begins editing a table with 3 columns, 2 rows, and dimensions of 500x300.

EndTable Void

Exits table editing mode, finalizing the changes made to the current table.

SetTableColumnSize(columnIndex:Number, relativeSize:Number) Void

Sets the size of a specific column in the current table relative to the table's total width.

Parameters:

  • columnIndex: The index of the column (starting from 0).
  • relativeSize: The relative size of the column (as a fraction of the total table width).

Example: SetTableColumnSize(0, 0.5) sets the first column to occupy half the table's width.

SetTableStyle(styleName:String) Void

Applies a predefined style to the current table.

Parameter: The name of the style to apply.

Example: SetTableStyle("MyCustomStyle") applies "MyCustomStyle" to the current table.

SetCellBackgroundColor(colorInRgbHex:String) Void

Sets the background color of the current cell using an RGB hexadecimal color code.

Parameter: The RGB hexadecimal color code for the background color.

Example: SetCellBackgroundColor("#FF5733") sets the current cell's background color to a specific shade of orange.

SetCellBorders(borders:BorderDefinition) Void

Defines the border properties for the current cell, including style, thickness, and color.

Parameter: A border definition object specifying the desired border styles and properties.

Example: Usage context implies this command requires a structured definition, such as SetCellBorders({top: "solid", topColor: "#000000", topWidth: "1px"}) to specify the top border style.

AddNewTableRow Void

Creates a new table row, adds it to the current table, and sets it as the current context for further editing.

This command does not require parameters.

AddNewTableColumn Void

Creates a new table column, adds it to the current table, and sets it as the current context for further modifications.

This command does not require parameters.

GoToNextTableCell Void

Navigates to the next cell in the current table, setting it as the current editing context.

This command enables sequential cell editing within a table.

GoToPreviousTableCell Void

Navigates to the previous cell in the current table, allowing for backward navigation in the table editing process.

This command is useful for revisiting and editing cells in a non-linear order.

AddNewParagraph Void

Adds a new paragraph to the document and sets it as the current editing context. This command facilitates structured text formatting and organization.

No parameters are needed for this command.

AddNewPage Void

Adds a new page to the document and sets it as the current editing context, allowing for multi-page document creation and management.

No parameters are needed for this command.

AddText(text:String) Void

Adds plain text to the current paragraph. This command allows for the insertion of unformatted text content.

Parameter: The text string to add.

Example: AddText("This is plain text.") appends the specified text to the current paragraph.

AddText(text:FormattedText) Void

Adds formatted text to the current paragraph. This variant of the AddText command is designed for text that includes formatting specifications.

Parameter: The formatted text object to add.

Example: AddText(Diagram.Documentation)

AddTextLine(text:String) Void

Adds text followed by a line break to the current paragraph, effectively starting a new line after the text.

Parameter: The text string to add.

Example: AddTextLine("This is text with a line break.") adds the text and moves to the next line.

AddTemplateText(text:String) Void

Adds template text to the current paragraph. This command is useful for inserting text that includes template variables.

Parameter:

  • text: The template variable to add.

Supported template variables includes:

  • Page.Number
  • Document.TableOfContents
  • Document.HeadingNumber
  • Bookmark.Page:BookmarkId

Example: AddTemplateText("Page.Number")

AddImage(image:Image, [width:Number], [height:Number]) Void

Adds an image to the current paragraph. Optional width and height parameters allow for size customization of the inserted image.

Parameters:

  • image: Image - The image object to insert.
  • width: Number (optional) - The width to set for the inserted image. If not specified, the image's original width is used.
  • height: Number (optional) - The height to set for the inserted image. If not specified, the image's original height is used.

Example: AddImage(Diagram.Image, Cm(10), Cm(5)) inserts the diagram image with a width of 10 cm and a height of 5 cm.

SetPageSize(width:Number, height:Number) Void

Sets the dimensions of the pages in the document. This command allows for customization of the page size to suit different standards or preferences.

Parameters:

  • width: The width of the page, in millimeters (use unit command to use another unit).
  • height: The height of the page, in millimeters.

Example: SetPageSize(Cm(21), Cm(29.7)) sets the page size to A4 (21x29.7 cm).

SetPageMargins(left:Number, right:Number, top:Number, bottom:Number) Void

Defines the margins of the pages in the document, allowing for precise control over the layout and the amount of white space around the page content.

Parameters:

  • left: The size of the left margin.
  • right: The size of the right margin.
  • top: The size of the top margin.
  • bottom: The size of the bottom margin.

Example: SetPageMargins(50, 50, 72, 72) sets the margins to 50 mm on the left and right, and 72 mm at the top and bottom.

SetPageHeaderOffset(value:Number) Void

Sets the distance between the top of the page and the header. This command is useful for adjusting the position of headers in relation to the top page margin.

Parameter: The offset value for the header.

Example: SetPageHeaderOffset(Cm(3)) positions the header 3 cm from the top of the page.

SetPageFooterOffset(value:Number) Void

Sets the distance between the bottom of the page and the footer. This adjustment is key for customizing the footer's location relative to the bottom page margin.

Parameter: The offset value for the footer.

Example: SetPageFooterOffset(Inch(2)) places the footer 2 inches from the bottom of the page.

SetParagraphLineSpacing(value:Number) Void

Sets the line spacing for the current paragraph, affecting the vertical space between lines of text.

Parameter: The line spacing value, typically as a multiplier (e.g., 1.5 for one-and-a-half spacing).

Example: SetParagraphLineSpacing(1.5) applies one-and-a-half line spacing to the current paragraph.

SetParagraphLeftIndent(value:Number) Void

Sets the left indent for the current paragraph, adjusting the horizontal start position of the text.

Parameter: The size of the left indent in millimeters.

Example: SetParagraphLeftIndent(36) indents the paragraph 36 mm from the left margin.

SetParagraphRightIndent(value:Number) Void

Sets the right indent for the current paragraph, controlling the end margin of the text on the page.

Parameter: The size of the right indent.

Example: SetParagraphRightIndent(36) indents the paragraph 36 mm from the right margin.

SetParagraphFirstLineIndent(value:Number) Void

Sets the indent of the first line of the current paragraph, typically used to distinguish the beginning of new paragraphs.

Parameter: The size of the indent for the first line.

Example: SetParagraphFirstLineIndent(18) indents the first line of the paragraph 18 mm from the left indent.

SetParagraphSpaceBefore(value:Number) Void

Adds space before the current paragraph, affecting the vertical gap between this paragraph and the one preceding it.

Parameter: The size of the space before the paragraph.

Example: SetParagraphSpaceBefore(12) adds 12 mm of space before the paragraph.

SetParagraphSpaceAfter(value:Number) Void

Adds space after the current paragraph, influencing the vertical separation between this paragraph and the following one.

Parameter: The size of the space after the paragraph.

Example: SetParagraphSpaceAfter(12) adds 12 mm of space after the paragraph.

SetLeftAlignment Void

Sets the alignment of the current paragraph to left. This is the default text alignment in most document formats.

No parameters are needed for this command.

SetRightAlignment Void

Sets the alignment of the current paragraph to right. Useful for aligning text to the right margin of the document.

No parameters are needed for this command.

SetCenterAlignment Void

Centers the current paragraph's text. This alignment is often used for headings, titles, or any text that needs to be emphasized by centering.

No parameters are needed for this command.

SetJustifiedAlignment Void

Sets the alignment of the current paragraph to justified. This alignment option adjusts the spacing of words so that the text aligns with both the left and right margins, creating a clean and formal appearance.

No parameters are needed for this command.

SetParagraphHeading(level:Number) Void

Sets the current paragraph as a heading of the specified level. Heading levels typically range from 1 (main heading) to 6 (lowest subheading), similar to HTML heading tags (h1 to h6).

Parameter: The heading level.

Example: SetParagraphHeading(2) marks the current paragraph as a level 2 heading, akin to an HTML h2 tag.

SetParagraphBackgroundColor(colorInRgbHex:String) Void

Sets the background color of the current paragraph using an RGB hexadecimal color code. This command can highlight or differentiate paragraphs visually.

Parameter: The RGB hexadecimal color code for the background color.

Example: SetParagraphBackgroundColor("#FFFF00") sets the paragraph's background color to yellow.

SetParagraphBorders(colorInRgbHex:String) Void

Applies border styling to the current paragraph with the specified color. This command is useful for emphasizing or separating paragraphs visually.

Parameter: The RGB hexadecimal color code for the border color.

Example: SetParagraphBorders("#000000") sets the paragraph borders to black.

SetParagraphNormalText Void

Defines the current paragraph as normal text, resetting any heading or title styles applied previously. This command is used to ensure standard text formatting is applied.

No parameters are needed for this command.

SetParagraphTitle Void

Sets the current paragraph to the title type, applying pre-defined formatting suitable for document titles. This command is typically used once per document for the main title.

No parameters are needed for this command.

SetParagraphSubtitle Void

Defines the current paragraph as a subtitle, applying a specific style that differentiates it from the title and normal text. Suitable for document sections or subheadings.

No parameters are needed for this command.

SetParagraphStyle(style:String) Void

Applies a predefined paragraph style to the current paragraph. This command allows for the customization and consistent application of text styles throughout a document.

Parameter: The name of the style to apply.

Example: SetParagraphStyle("MyCustomStyle") applies the style named "MyCustomStyle" to the current paragraph.

ContinueNumberedList Void

Continues numbering from the previous numbered list. This command is useful for resuming list numbering after interruptions by text or other elements.

StartNumberedList Void

Begins a new numbered list. This command is used to start enumerating items, typically for ordered lists.

StartBulletedList Void

Initiates a new bulleted list. Use this command for unordered lists where items are marked with bullets.

SetParagraphNumbering(numberingName:String) Void

Applies a specific numbering style to the current paragraph. This allows for customized list numbering formats.

Parameter: The name of the numbering style to apply.

SetParagraphNumberingLevel(level:Number) Void

Sets the indentation level of the current list item, affecting its hierarchy within nested lists.

Parameter: The indentation level for the list item.

EditHeader Void

Switches the editing context to the header of the document, allowing for header customization.

EditFooter Void

Switches the editing context to the footer of the document, enabling footer customization.

EditBody Void

Changes the editing context back to the main document body from other contexts such as header, or footer.

Px(value:Number) Measurement

Returns a length set in pixels. Useful for specifying measurements in commands that require length values.

Parameter: The length in pixels.

Cm(value:Number) Measurement

Returns a length set in centimeters. Useful for specifying measurements in commands that require length values.

Parameter: The length in centimeters.

Mm(value:Number) Measurement

Returns a length set in millimeters. Useful for specifying measurements in commands that require length values.

Parameter: The length in millimeters.

Inch(value:Number) Measurement

Returns a length set in inches. Useful for specifying measurements in commands that require length values.

Parameter: The length in inches.

CreateTableStyle TableStyle Creates and returns a new, empty table style object. This object can be customized and applied to tables within the document to standardize their appearance.
CreateParagraphStyle ParagraphStyle Generates and returns a new, empty paragraph style object. This allows for the definition and application of consistent text formatting and styling throughout the document.
CreateBordersDefinition(width:Number, colorInRgbHex:String) BorderDefinition

Creates and returns a border definition with uniform width and color. This definition can be applied to elements like tables and paragraphs to add borders around them.

Parameters:

  • width: The width of the border, specified in pixels.
  • colorInRgbHex: The color of the border, represented as a hexadecimal RGB color code.
CreateBordersDefinition(leftWidth:Number, leftColor:String, rightWidth:Number, rightColor:String, topWidth:Number, topColor:String, bottomWidth:Number, bottomColor:String) BorderDefinition

Creates and returns a border definition that allows for different widths and colors for each side of an element. This enables detailed customization of borders for enhanced visual appeal.

Parameters:

  • leftWidth: The width of the left border.
  • leftColor: The color of the left border.
  • rightWidth: The width of the right border.
  • rightColor: The color of the right border.
  • topWidth: The width of the top border.
  • topColor: The color of the top border.
  • bottomWidth: The width of the bottom border.
  • bottomColor: The color of the bottom border.
DocumentBodyWidth Number Returns the width of the document body in the current document's default unit of measurement. This information is useful for sizing and aligning elements within the document layout.
ChangeFontName(input:FormattedText, fontName:String) FormattedText

Applies a new font name to the input text, returning a copy of the text with the updated font setting.

Parameters:

  • input: The FormattedText to modify.
  • fontName: The new font name to apply.
ChangeFontSize(input:FormattedText, fontSize:Number) FormattedText

Modifies the font size of the input text, producing a copy with the new size.

Parameters:

  • input: The FormattedText to modify.
  • fontSize: The desired font size.
ChangeFontBold(input:FormattedText, value:Boolean) FormattedText

Toggles the bold styling of the input text based on the provided boolean value.

Parameters:

  • input: The FormattedText to modify.
  • value: A boolean indicating whether to apply bold styling.
ChangeFontItalic(input:FormattedText, value:Boolean) FormattedText

Applies or removes italic styling from the input text, depending on the boolean value provided.

Parameters:

  • input: The FormattedText to modify.
  • value: A boolean indicating whether to apply italic styling.
ChangeFontUnderline(input:FormattedText, value:Boolean) FormattedText

Applies or removes underline styling from the input text based on the provided boolean value.

Parameters:

  • input: The FormattedText to modify.
  • value: A boolean for the underline option.
ChangeFontStrikeout(input:FormattedText, value:Boolean) FormattedText

Applies or removes strikeout styling from the input text, as indicated by the boolean value.

Parameters:

  • input: The FormattedText to modify.
  • value: A boolean for the strikeout option.
ChangeFontStrikethrough (alias for ChangeFontStrikeout) FormattedText Alias for ChangeFontStrikeout; performs the same function of applying or removing strikeout styling.
ChangeTextColor(input:FormattedText, colorInRgbHex:String) FormattedText

Changes the text color of the input formatted text to the specified RGB hexadecimal value.

Parameters:

  • input: The FormattedText to modify.
  • colorInRgbHex: The new color in RGB hexadecimal format.
ChangeTextBackgroundColor(input:FormattedText, colorInRgbHex:String) FormattedText

Modifies the background color of the input text using the specified RGB hexadecimal color code.

Parameters:

  • input: The FormattedText to modify.
  • colorInRgbHex: The new background color.
SetTextStyle(styleName:String) Void

Applies a named text style to the current editing context.

Parameter: styleName - The name of the text style to apply.

SetTextStyle(style:TextStyle) Void

Applies a text style object to the current editing context.

Parameter: style - The TextStyle object to apply.

GetTextStyle(styleName:String) TextStyle

Retrieves a named text style.

Parameter: styleName - The name of the text style to retrieve.

ChangeTextStyle(input:FormattedText, style:TextStyle) FormattedText

Changes the style of the provided formatted text to the specified TextStyle.

Parameters:

  • input: The text to modify.
  • style: The new TextStyle to apply.
ChangeTextStyle(input:FormattedText, styleName:String) FormattedText

Modifies the style of the provided formatted text to a style identified by name.

Parameters:

  • input: The text to change.
  • styleName: The name of the text style to apply.
ChangeTextAlign(input:FormattedText, alignment:String) FormattedText

Changes the alignment of the provided formatted text.

Parameters:

  • input: The text whose alignment is to be changed.
  • alignment: The new alignment ("Left", "Center", "Right", "Justified").
AddParagraphTab(offset:Number, alignment:String, leaderChar:String) Void

Adds a tab stop to the current paragraph with specified offset, alignment, and leader character.

Parameters:

  • offset: The tab stop position.
  • alignment: Alignment of the tab ("Left", "Center", "Right").
  • leaderChar: A character to fill the space to the tab stop.
SetDefaultTab(offset:Number) Void

Sets the default tab stop offset for the document.

Parameter: offset - The default tab stop position.

ClearParagraphTabs Void

Clears all custom tab stops from the current paragraph, reverting to the document's default tab settings.

No parameters are needed for this command.

New Comment

Comment