DOCX
Prepare a template. Edit a
.docxor.dotxfile in Microsoft Word and define your own styles. — just download it and begin editing.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.
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:
Content placeholder. In the location where article text from Gramax should be inserted, add the
{{gramax_content}}placeholder.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.
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.
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 Title— note headings.Table Title— table title.Picture Title— image caption.Video Title— video caption.Tabs Title— tabs title.Horizontal Line— horizontal separator.Picture— style for image paragraph.Code— inline code.Fence— code block.Formula — block formula.
Formula Inline — inline formula.
Kbd— keyboard shortcut —[kbd:Ctrl+Z]|Ctrl+Z.Button— button —[cmd:This is a button]| .
Gramax table styles:
Note,Lab,Tip,Info,Danger,Quote Table— notes styling (represented as tables in Word).Tabs— tabs styling (represented as a flat table in Word).Table— table styling. Supports propagating Header Row and Header Column settings.Fence Table— code 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, orwordfolders do not exist at this path, create them manually.
After that, users can select the template during export in the interface.
The template must be uploaded to a space.