DOCX

  1. Prepare a template. Edit a .docx or .dotx file in Microsoft Word and define your own styles. — just download it and begin editing.

  2. Upload the template to Gramax. If you use the open source version, go to step 3. If you use Enterprise, see the article on catalog management.

  3. Export content. When exporting an article or section, select a template from the list.

Step 1: Prepare a template in Word

To create a compatible template, follow these rules.

Required elements

Your .docx or .dotx file must include two key elements:

  1. Content placeholder. In the location where article text from Gramax should be inserted, add the {{gramax_content}} placeholder.

  2. List styles. For correct list rendering, create and configure Word list styles with the following names (Multilevel list → Define New List Style...):

    • OrderedList — for ordered lists.

    • BulletList — for bulleted lists.

    • TaskList — for task lists.

    Exporting content that contains lists without these styles in the template causes an error.

Set up headers/footers and a title page

To add dynamic data to the document (for example, an article title in a header/footer), use standard Word fields (Insert → Quick Parts → Field...). Gramax fills them automatically during export.

Fields updated by Gramax
  • Title — article/section title.

  • CreateDate — article export time.

When you open the generated document for the first time, Word asks for permission to update fields. Click "Yes" to display up-to-date values.

Step 2: Configure style library

Elements in Gramax (headings, notes, code) have specific style names. To render correctly in Word, your template must contain styles with exactly the same names.

  • If a style exists in the template — the element is formatted according to your settings.

  • If a style is missing — the element is inserted as normal text (Normal).

You can configure only the styles you actually use.

Style library for Word

Make sure style names in your template match this list exactly.

Standard Word styles:

  • Normal — regular text.

  • Heading1-Heading9 — article headings in a catalog.

  • Hyperlink — hyperlink.

  • Strong — bold.

  • Emphasis — emphasis/italic.

  • ListParagraph — list paragraph.

Custom Gramax styles:

  • H2, H3, H4 — subheadings inside an article.

  • Info Title, Danger Title, Hotfixes Title, Lab Title, Note Title, Quote Title, Tip Titlenote headings.

  • Table Titletable title.

  • Picture Titleimage caption.

  • Video Titlevideo caption.

  • Tabs Titletabs title.

  • Horizontal Line — horizontal separator.

  • Picture — style for image paragraph.

  • Codeinline code.

  • Fencecode block.

  • Formula — block formula.

  • Formula Inline — inline formula.

  • Kbdkeyboard shortcut[kbd:Ctrl+Z] |

    Ctrl+Z
    .

  • Buttonbutton[cmd:This is a button] | .

Gramax table styles:

  • Note, Lab, Tip, Info, Danger, Quote Tablenotes styling (represented as tables in Word).

  • Tabstabs styling (represented as a flat table in Word).

  • Tabletable styling. Supports propagating Header Row and Header Column settings.

  • Fence Tablecode block.

Step 3: Upload template to Gramax

Go to the catalog and place the template file in this path:

[space folder]/.workspace/assets/word/

  • Templates are uploaded separately for each space.

  • If .workspace, assets, or word folders do not exist at this path, create them manually.

After that, users can select the template during export in the interface.

For Gramax Enterprise Server

The template must be uploaded to a space.