DocLang FrontMatter Configuration
FrontMatter is a YAML block at the top of DocLang files that defines metadata and global configuration for documents. This block is delimited by three dashes (---) and is crucial for defining the operating mode and document-specific features.
π― Differences from ZiraDocs
Section titled βπ― Differences from ZiraDocsβDocLang extends ZiraDocsβs FrontMatter with fields specific to documents:
| Field | ZiraDocs | DocLang |
|---|---|---|
doctype |
Not required | Required (document) |
page |
Not applicable | Page configuration |
toc |
Not applicable | Table of contents |
numbering |
Not applicable | Section numbering |
references |
Not applicable | Reference system |
π Quick Example
Section titled βπ Quick Exampleβ---mode: flexdoctype: documenttitle: "Technical Specification"author: "Engineering Team"output: format: [html, pdf]page: size: "A4" orientation: "portrait"toc: enabled: true depth: 3---
# Document content starts here...π§ Essential Fields
Section titled βπ§ Essential Fieldsβmode (required)
Section titled βmode (required)βSpecifies the syntax mode for the document body.
mode: flex # or "strict"Values:
flex- Extended Markdown syntaxstrict- Formal syntax with keywords
doctype (required for DocLang)
Section titled βdoctype (required for DocLang)βSpecifies that a document is being created instead of a presentation.
doctype: documentValues:
document- Continuous document (DocLang)presentation- Slide presentation (ZiraDocs) [default]
title (string)
Section titled βtitle (string)βMain title of the document.
title: "System Architecture Specification"subtitle (string)
Section titled βsubtitle (string)βOptional subtitle of the document.
subtitle: "Version 2.0 - Technical Documentation"author (string)
Section titled βauthor (string)βPrimary author of the document.
author: "Dr. Jane Smith"authors (array)
Section titled βauthors (array)βList of multiple authors with detailed information.
authors: - name: "Dr. Jane Smith" affiliation: "University of Technology" email: "jane.smith@university.edu" orcid: "0000-0001-2345-6789" - name: "John Doe" affiliation: "Research Institute" email: "john.doe@research.org" role: "Contributing Author"date (string)
Section titled βdate (string)βDocument date.
date: "October 8, 2024"# or ISO formatdate: "2024-10-08"version (string)
Section titled βversion (string)βDocument version.
version: "2.0.0"status (string)
Section titled βstatus (string)βDocument status.
status: "Draft" # Draft, Review, Final, Publishedπ Output Configuration
Section titled βπ Output Configurationβoutput (object)
Section titled βoutput (object)βConfiguration of output formats and destinations.
output: format: [html, pdf, docx] path: "./dist/documents" filename: "technical-spec-v2"Properties:
format(array) - Output formats:html,pdf,docx,markdownpath(string) - Output directoryfilename(string) - Base file name (without extension)
π Page Configuration
Section titled βπ Page Configurationβpage (object)
Section titled βpage (object)βPage format and margin configuration.
page: size: "A4" orientation: "portrait" margins: top: "2.5cm" bottom: "2.5cm" left: "3cm" right: "3cm" gutter: "0cm"page.size (string):
A4(210 x 297 mm)Letter(8.5 x 11 in)Legal(8.5 x 14 in)A3(297 x 420 mm)A5(148 x 210 mm)B5(176 x 250 mm)- Custom:
"21cm x 29.7cm"
page.orientation (string):
portrait- Vertical (default)landscape- Horizontal
page.margins (object):
Margins in units: cm, mm, in, pt, px
π Headers and Footers
Section titled βπ Headers and Footersβheader (object)
Section titled βheader (object)βDocument header configuration.
header: enabled: true odd_pages: "{{title}} - v{{version}}" even_pages: "Chapter {{chapter_number}}: {{chapter_title}}" logo: src: "./assets/company-logo.png" height: "30px" position: "left" # left, center, right text: position: "right" style: "minimal" # minimal, standard, detailed divider: true first_page: false # Do not show on the first pageProperties:
enabled(boolean) - Enable/disable headersodd_pages(string) - Content for odd pageseven_pages(string) - Content for even pageslogo(object) - Logo configurationdivider(boolean) - Separator line below the headerfirst_page(boolean) - Show on the first page
footer (object)
Section titled βfooter (object)βDocument footer configuration.
footer: enabled: true page_numbers: enabled: true format: "Page {{current}} of {{total}}" alignment: "center" # left, center, right start_from: 1 exclude_first: true odd_pages: "{{company}} - {{confidentiality}}" even_pages: "{{author}} - {{date}}" divider: truepage_numbers.format - Available variables:
{{current}}- Current page number{{total}}- Total number of pages{{section}}- Current section number{{chapter}}- Current chapter number
π Table of Contents
Section titled βπ Table of Contentsβtoc (object)
Section titled βtoc (object)βTable of contents configuration.
toc: enabled: true depth: 3 title: "Table of Contents" position: "before-content" # before-content, after-cover, custom page_numbers: true hyperlinks: true style: "detailed" # simple, detailed, nested exclude: - "Appendix" - "References"Properties:
enabled(boolean) - Generate TOCdepth(integer) - Heading levels to include (1-6)title(string) - TOC titleposition(string) - Position in the documentpage_numbers(boolean) - Show page numbershyperlinks(boolean) - Clickable linksstyle(string) - Display styleexclude(array) - Sections to exclude
π’ Numbering
Section titled βπ’ Numberingβnumbering (object)
Section titled βnumbering (object)βAutomatic numbering configuration.
numbering: enabled: true style: "hierarchical" # hierarchical, sequential, custom prefix: "" suffix: "." separator: "." sections: enabled: true start_from: 1 format: "{{number}}." figures: enabled: true prefix: "Figure" format: "{{prefix}} {{number}}:" tables: enabled: true prefix: "Table" format: "{{prefix}} {{number}}:" charts: enabled: true prefix: "Chart" format: "{{prefix}} {{number}}:" equations: enabled: true prefix: "Eq." format: "({{prefix}} {{number}})"numbering.style:
hierarchical- 1, 1.1, 1.1.1, 1.1.2, 1.2, 2, 2.1β¦sequential- 1, 2, 3, 4, 5, 6β¦custom- Custom format
π References and Citations
Section titled βπ References and Citationsβreferences (object)
Section titled βreferences (object)βBibliographic reference system.
references: enabled: true style: "apa" # apa, mla, chicago, ieee, harvard footnotes: enabled: true position: "bottom" # bottom, end-of-section, end-of-document numbering: "sequential" # sequential, per-section, per-page bibliography: enabled: true title: "References" sort: "author" # author, year, title, citation-order position: "end"Supported citation styles:
apa- American Psychological Association (7th ed.)mla- Modern Language Association (9th ed.)chicago- Chicago Manual of Style (17th ed.)ieee- Institute of Electrical and Electronics Engineersharvard- Harvard referencing style
π¨ Themes and Styles
Section titled βπ¨ Themes and Stylesβtheme (string)
Section titled βtheme (string)βVisual theme of the document.
theme: "professional"Available themes:
professional- Formal corporate styleacademic- Academic/scientific styletechnical- Technical documentationminimal- Minimalist and cleanmodern- Modern designlegal- Legal/contractual formatreport- Corporate reportsmanuscript- Academic manuscript
custom_css (string | array)
Section titled βcustom_css (string | array)βCustom CSS stylesheets.
custom_css: "./styles/custom-document.css"
# or multiple filescustom_css: - "./styles/base.css" - "./styles/print.css" - "./styles/custom.css"fonts (object)
Section titled βfonts (object)βTypography configuration.
fonts: body: "Georgia, serif" headings: "Arial, sans-serif" code: "Courier New, monospace" size: base: "12pt" small: "10pt" large: "14pt" line_height: 1.6π Language Configuration
Section titled βπ Language Configurationβlanguage (string)
Section titled βlanguage (string)βMain language of the content.
language: "en-US"Common values:
en-US- English (United States)en-GB- English (United Kingdom)es-ES- Spanish (Spain)es-MX- Spanish (Mexico)fr-FR- Frenchde-DE- Germanpt-BR- Portuguese (Brazil)
localization (object)
Section titled βlocalization (object)βLocalized text for automatic elements.
localization: toc_title: "Table of Contents" figure_prefix: "Figure" table_prefix: "Table" chart_prefix: "Chart" page_label: "Page" chapter_label: "Chapter" section_label: "Section"π Metadata and Security
Section titled βπ Metadata and Securityβmetadata (object)
Section titled βmetadata (object)βAdditional document metadata.
metadata: keywords: - "software architecture" - "microservices" - "API design" subject: "Technical Specification" category: "Software Engineering" confidentiality: "Internal Use Only" classification: "Confidential" distribution: "Limited" copyright: "Β© 2024 TechCorp Inc. All rights reserved." license: "CC BY-NC-SA 4.0"security (object)
Section titled βsecurity (object)βSecurity and permissions configuration.
security: watermark: enabled: true text: "CONFIDENTIAL - {{company}}" opacity: 0.1 position: "diagonal" # diagonal, header, footer pdf: permissions: print: true copy: false modify: false annotate: true password_protection: enabled: false password: ""π Custom Variables
Section titled βπ Custom Variablesβvariables (object)
Section titled βvariables (object)βReusable variables throughout the document.
variables: company: "TechCorp Inc." product: "CloudAPI Platform" version: "3.1.0" api_version: "v3" base_url: "https://api.techcorp.com" support_email: "support@techcorp.com" copyright_year: "2024" confidentiality: "Internal Use Only"Usage in the document:
Welcome to {{company}}'s {{product}} documentation.
API Base URL: {{base_url}}/{{api_version}}βοΈ Advanced Features
Section titled ββοΈ Advanced Featuresβfeatures (object)
Section titled βfeatures (object)βOptional document features.
features: search: enabled: true index_content: true include_code: false print_friendly: enabled: true page_breaks: "auto" # auto, manual, none orphan_control: true widow_control: true responsive: enabled: true breakpoints: mobile: "768px" tablet: "1024px" desktop: "1440px" dark_mode: enabled: false auto_switch: false accessibility: aria_labels: true alt_text_required: true color_contrast: "AAA" # AA, AAAplugins (array)
Section titled βplugins (array)βPlugins and extensions.
plugins: - name: "doclang-charts-advanced" version: "^1.0" config: default_colors: ["#4285F4", "#34A853", "#FBBC04", "#EA4335"] - name: "doclang-latex-math" version: "^2.0" config: renderer: "katex" - name: "doclang-citations" version: "^1.5"π Full Example - Academic Document
Section titled βπ Full Example - Academic Documentβ---# Basic configurationmode: flexdoctype: document
# Metadatatitle: "Microservices Architecture Patterns"subtitle: "A Comprehensive Analysis of Modern Software Design"authors: - name: "Dr. Jane Smith" affiliation: "Department of Computer Science, Tech University" email: "j.smith@techuniversity.edu" orcid: "0000-0001-2345-6789" - name: "Prof. John Doe" affiliation: "Software Engineering Institute" email: "jdoe@sei.org" role: "Principal Investigator"date: "October 8, 2024"version: "1.0.0"status: "Published"
# Outputoutput: format: [pdf, html, docx] path: "./publications" filename: "microservices-architecture-2024"
# Page configurationpage: size: "A4" orientation: "portrait" margins: top: "2.5cm" bottom: "2.5cm" left: "3cm" right: "3cm"
# Headers and footersheader: enabled: true odd_pages: "{{title}}" even_pages: "{{authors[0].name}} et al." divider: true first_page: false
footer: enabled: true page_numbers: enabled: true format: "{{current}}" alignment: "center" start_from: 1 exclude_first: true divider: true
# Table of contentstoc: enabled: true depth: 3 title: "Contents" position: "before-content" page_numbers: true hyperlinks: true style: "detailed"
# Numberingnumbering: enabled: true style: "hierarchical" sections: enabled: true figures: enabled: true prefix: "Figure" tables: enabled: true prefix: "Table"
# Referencesreferences: enabled: true style: "apa" footnotes: enabled: true position: "bottom" numbering: "per-page" bibliography: enabled: true title: "References" sort: "author"
# Themetheme: "academic"
# Language configurationlanguage: "en-US"localization: toc_title: "Contents" figure_prefix: "Figure" table_prefix: "Table"
# Metadatametadata: keywords: - "microservices" - "software architecture" - "distributed systems" - "design patterns" subject: "Software Engineering" category: "Research Paper" copyright: "Β© 2024 Authors. CC BY 4.0" license: "Creative Commons Attribution 4.0 International"
# Variablesvariables: institution: "Tech University" department: "Computer Science" project: "Software Architecture Research Project" funding: "National Science Foundation Grant #12345"
# Featuresfeatures: search: enabled: true index_content: true print_friendly: enabled: true page_breaks: "auto" orphan_control: true widow_control: true accessibility: aria_labels: true alt_text_required: true color_contrast: "AAA"
# Pluginsplugins: - name: "doclang-latex-math" config: renderer: "katex" - name: "doclang-citations" config: style: "apa"---π Full Example - Technical Document
Section titled βπ Full Example - Technical Documentβ---# Basic configurationmode: flexdoctype: document
# Metadatatitle: "System Architecture Specification"subtitle: "CloudAPI Platform v3.1"author: "Platform Engineering Team"date: "2024-10-08"version: "3.1.0"status: "Final"
# Outputoutput: format: [html, pdf] path: "./docs/architecture" filename: "system-architecture-v3.1"
# Page configurationpage: size: "A4" orientation: "portrait" margins: top: "2.5cm" bottom: "2.5cm" left: "3cm" right: "3cm"
# Headers and footersheader: enabled: true odd_pages: "{{title}} v{{version}}" even_pages: "Section {{section_number}}: {{section_title}}" logo: src: "./assets/company-logo.png" height: "30px" position: "left" style: "professional" divider: true first_page: false
footer: enabled: true page_numbers: enabled: true format: "Page {{current}} of {{total}}" alignment: "center" odd_pages: "{{company}}" even_pages: "{{confidentiality}}" divider: true
# Table of contentstoc: enabled: true depth: 3 title: "Table of Contents" page_numbers: true hyperlinks: true style: "detailed"
# Numberingnumbering: enabled: true style: "hierarchical" sections: enabled: true figures: enabled: true tables: enabled: true charts: enabled: true
# Themetheme: "technical-documentation"
# Variablesvariables: company: "TechCorp Inc." product: "CloudAPI Platform" api_version: "v3.1" base_url: "https://api.techcorp.com" confidentiality: "Confidential - Internal Use Only"
# Metadatametadata: keywords: - "architecture" - "microservices" - "API" - "cloud platform" confidentiality: "Internal Use Only" classification: "Confidential" copyright: "Β© 2024 TechCorp Inc. All rights reserved."
# Securitysecurity: watermark: enabled: true text: "CONFIDENTIAL - {{company}}" opacity: 0.1 position: "diagonal"
# Featuresfeatures: search: enabled: true print_friendly: enabled: true page_breaks: "auto" responsive: enabled: true dark_mode: enabled: false---π― Best Practices
Section titled βπ― Best Practicesβ- Include
doctype: document- Required for DocLang - Configure the page appropriately - Adjust margins and size according to use
- Enable TOC for long documents - Improves navigation
- Use hierarchical numbering - Facilitates cross-references
- Define variables for repeated content - Maintains consistency
- Configure headers/footers - Adds professionalism
- Specify complete metadata - Improves organization