<!ELEMENT doc ((description, intro, release-list, contributor-list)|(config, operation)|
               (description?, variable-list?, host-define*, block-define*, cleanup?, section+))>
    <!ATTLIST doc title CDATA #REQUIRED>
    <!ATTLIST doc subtitle CDATA "">
    <!ATTLIST doc toc CDATA "y">
    <!ATTLIST doc toc-number CDATA "y">
    <!ATTLIST doc cmd-line-len CDATA "80">

<!ELEMENT description (#PCDATA)>

<!ELEMENT intro (text)>

<!ELEMENT operation (description, text?, operation-general, command-list)>
    <!ATTLIST operation title CDATA #REQUIRED>

<!ELEMENT operation-general (option-list)>
    <!ATTLIST operation-general title CDATA #REQUIRED>

<!ELEMENT command-list (text?, command+)>
    <!ATTLIST command-list title CDATA #REQUIRED>

<!ELEMENT command (summary, text, option-list?, command-example-list)>
    <!ATTLIST command id CDATA #REQUIRED>
    <!ATTLIST command name CDATA #REQUIRED>

<!ELEMENT command-example-list (text?, command-example+)>
    <!ATTLIST command-example-list title CDATA "Examples">

<!ELEMENT command-example (text)>
    <!ATTLIST command-example title CDATA "Example">

<!ELEMENT option-list (option+)>

<!ELEMENT option (summary, text, example)>
    <!ATTLIST option id CDATA #REQUIRED>
    <!ATTLIST option name CDATA #REQUIRED>

<!ELEMENT config (description, text, config-section-list)>
    <!ATTLIST config title CDATA #REQUIRED>

<!ELEMENT config-example (text)>
    <!ATTLIST config-example title CDATA #REQUIRED>

<!ELEMENT config-section-list (text?, config-section+)>
    <!ATTLIST config-section-list title CDATA #REQUIRED>

<!ELEMENT config-section (text, config-key-list?)>
    <!ATTLIST config-section id CDATA #REQUIRED>
    <!ATTLIST config-section name CDATA #REQUIRED>

<!ELEMENT config-key-list (config-key+)>

<!ELEMENT config-key (summary, text, default?, allow?, example)>
    <!ATTLIST config-key id CDATA #REQUIRED>
    <!ATTLIST config-key name CDATA #REQUIRED>

<!ELEMENT execute-list (title, execute+)>
    <!ATTLIST execute-list host CDATA #REQUIRED>
    <!ATTLIST execute-list if CDATA "">
    <!ATTLIST execute-list show CDATA "">
<!ELEMENT execute (exe-cmd, exe-cmd-extra?, exe-user?,  exe-var?, exe-retry?, exe-output?, (exe-highlight-type?, exe-highlight)?,
                   exe-err-expect?, exe-err-suppress?, exe-err-suppress-stderr?)>
    <!ATTLIST execute if CDATA "">
    <!ATTLIST execute pre CDATA "">
    <!ATTLIST execute user CDATA "">
    <!ATTLIST execute filter CDATA "">
    <!ATTLIST execute filter-context CDATA "">
    <!ATTLIST execute user-force CDATA "">
    <!ATTLIST execute bash-wrap CDATA "">
    <!ATTLIST execute load-env CDATA "">
    <!ATTLIST execute skip CDATA "">
    <!ATTLIST execute show CDATA "">
    <!ATTLIST execute output CDATA "">
    <!ATTLIST execute err-suppress CDATA "">
    <!ATTLIST execute err-expect CDATA "">
    <!ATTLIST execute retry CDATA "">
    <!ATTLIST execute variable-key CDATA "">
<!ELEMENT exe-cmd (#PCDATA)>
<!ELEMENT exe-cmd-extra (#PCDATA)>
<!ELEMENT exe-highlight (#PCDATA)>
<!ELEMENT exe-highlight-type (#PCDATA)>

<!ELEMENT cleanup (execute+)>

<!ELEMENT variable-list (variable+)>
<!ELEMENT variable (#PCDATA)>
    <!ATTLIST variable key CDATA #REQUIRED>
    <!ATTLIST variable if CDATA "default">
    <!ATTLIST variable eval CDATA "n">

<!ELEMENT backrest-config (title, backrest-config-option+)>
    <!ATTLIST backrest-config host CDATA #REQUIRED>
    <!ATTLIST backrest-config owner CDATA "">
    <!ATTLIST backrest-config show CDATA "">
    <!ATTLIST backrest-config if CDATA "">
    <!ATTLIST backrest-config reset CDATA "">
    <!ATTLIST backrest-config file CDATA #REQUIRED>
<!ELEMENT backrest-config-option (#PCDATA)>
    <!ATTLIST backrest-config-option if CDATA "">
    <!ATTLIST backrest-config-option section CDATA #REQUIRED>
    <!ATTLIST backrest-config-option key CDATA #REQUIRED>
    <!ATTLIST backrest-config-option remove CDATA "n">

<!ELEMENT postgres-config (title, postgres-config-option+)>
    <!ATTLIST postgres-config host CDATA #REQUIRED>
    <!ATTLIST postgres-config file CDATA #REQUIRED>
    <!ATTLIST postgres-config if CDATA "">
    <!ATTLIST postgres-config show CDATA "">
<!ELEMENT postgres-config-option (#PCDATA)>
    <!ATTLIST postgres-config-option if CDATA "">
    <!ATTLIST postgres-config-option key CDATA #REQUIRED>

<!ELEMENT option-description EMPTY>
    <!ATTLIST option-description key CDATA #REQUIRED>

<!ELEMENT cmd-description EMPTY>
    <!ATTLIST cmd-description key CDATA #REQUIRED>

<!ELEMENT section (title?,
                   ((p|list|table|host-add|execute-list|backrest-config|postgres-config|cmd-description|
                     option-description|code-block|block|section|admonition)*))>
    <!ATTLIST section id CDATA #REQUIRED>
    <!ATTLIST section if CDATA "">
    <!ATTLIST section depend CDATA "">
    <!ATTLIST section source CDATA "">
    <!ATTLIST section toc CDATA "">
<!ELEMENT title (#PCDATA|quote|b|i|bi|ul|ol|id|code|host|file|path|cmd|setting|exe|backrest|postgres|br-option|br-setting|
                 pg-option|pg-setting|link|user|proper)*>

<!ELEMENT block-define (
    ((p|list|table|host-add|execute-list|backrest-config|postgres-config|cmd-description|
      option-description|code-block|block|admonition)+|
    ((p|list)*, section+)|(p|list)*))>
    <!ATTLIST block-define id CDATA #REQUIRED>
    <!ATTLIST block-define if CDATA "">

<!ELEMENT block (block-variable-replace*)>
    <!ATTLIST block id CDATA #REQUIRED>
    <!ATTLIST block if CDATA "">
<!ELEMENT block-variable-replace (#PCDATA)>
    <!ATTLIST block-variable-replace key CDATA #REQUIRED>

<!ELEMENT default (#PCDATA)>
<!ELEMENT allow (#PCDATA)>
<!ELEMENT example (#PCDATA)>

<!ELEMENT contributor-list (contributor+)>

<!ELEMENT contributor (contributor-name-display, contributor-id*)>
    <!ATTLIST contributor id CDATA #REQUIRED>

<!ELEMENT contributor-name-display (#PCDATA)>
<!ELEMENT contributor-id (#PCDATA)>
    <!ATTLIST contributor-id type CDATA #REQUIRED>

<!ELEMENT release-list (release+)>

<!ELEMENT release (release-core-list?, release-doc-list?, release-test-list?)>
    <!ATTLIST release date CDATA #REQUIRED>
    <!ATTLIST release version CDATA #REQUIRED>
    <!ATTLIST release title CDATA #REQUIRED>

<!ELEMENT release-core-list (p?, release-bug-list?, release-feature-list?, release-improvement-list?, release-development-list?)>
<!ELEMENT release-test-list (p?, release-feature-list?, release-improvement-list?, release-development-list?)>
<!ELEMENT release-doc-list (p?, release-bug-list?, release-feature-list?, release-improvement-list?, release-development-list?)>

<!ELEMENT release-bug-list (release-item+)>
<!ELEMENT release-feature-list (release-item+)>
<!ELEMENT release-improvement-list (release-item+)>
<!ELEMENT release-development-list (release-item+)>

<!ELEMENT release-item (commit*, release-item-contributor-list?, p+)>

<!ELEMENT release-item-contributor-list (release-item-ideator*, release-item-contributor*, release-item-reviewer*)>

<!ELEMENT release-item-ideator (#PCDATA)>
    <!ATTLIST release-item-ideator id CDATA #REQUIRED>
<!ELEMENT release-item-contributor (#PCDATA)>
    <!ATTLIST release-item-contributor id CDATA #REQUIRED>
<!ELEMENT release-item-reviewer (#PCDATA)>
    <!ATTLIST release-item-reviewer id CDATA #REQUIRED>

<!ELEMENT commit EMPTY>
    <!ATTLIST commit type CDATA "">
    <!ATTLIST commit id CDATA "">
    <!ATTLIST commit subject CDATA #REQUIRED>

<!ELEMENT contribute (text)>
    <!ATTLIST contribute title CDATA #REQUIRED>

<!ELEMENT recognition (text)>
    <!ATTLIST recognition title CDATA #REQUIRED>

<!ELEMENT support (text)>
    <!ATTLIST support title CDATA #REQUIRED>

<!-- Host elements -->
<!ELEMENT host-define (#PCDATA)>
    <!ATTLIST host-define if CDATA "">
    <!ATTLIST host-define image CDATA #REQUIRED>
    <!ATTLIST host-define from CDATA #REQUIRED>

<!ELEMENT host-add (execute*)>
    <!ATTLIST host-add if CDATA "">
    <!ATTLIST host-add id CDATA "">
    <!ATTLIST host-add name CDATA #REQUIRED>
    <!ATTLIST host-add user CDATA #REQUIRED>
    <!ATTLIST host-add image CDATA #REQUIRED>
    <!ATTLIST host-add option CDATA "">
    <!ATTLIST host-add update-hosts CDATA "">
    <!ATTLIST host-add param CDATA "">
    <!ATTLIST host-add os CDATA "">
    <!ATTLIST host-add mount CDATA "">

<!-- Table elements -->
<!ELEMENT table (title?, table-header?, table-data)>
    <!ATTLIST title label CDATA "">

<!ELEMENT table-header (table-column+)>
    <!ATTLIST table-header width CDATA "">
<!ELEMENT table-column (#PCDATA|quote|b|i|id|code|host|file|path|cmd|setting|exe|backrest|postgres|br-option|
                        br-setting|pg-option|pg-setting|link|user|proper)*>
    <!ATTLIST table-column align CDATA "">
    <!ATTLIST table-column fill CDATA "">

<!ELEMENT table-data (table-row+)>
<!ELEMENT table-row (table-cell+)>
<!ELEMENT table-cell (#PCDATA|quote|b|i|ul|ol|id|code|code-block|host|file|path|cmd|setting|exe|backrest|postgres|br-option|
                      br-setting|pg-option|pg-setting|link|user|proper)*>

<!-- Formatted elements -->
<!-- admonition type can be note, important, warning, caution and tip -->
<!ELEMENT admonition ANY>
    <!ATTLIST admonition type CDATA #REQUIRED>
<!ELEMENT summary (#PCDATA|quote|b|i|ul|ol|id|code|code-block|host|file|path|cmd|setting|exe|backrest|postgres|br-option|
                   br-setting|pg-option|pg-setting|link|user|proper)*>
<!ELEMENT p ANY>
    <!ATTLIST p if CDATA "">
<!ELEMENT text ANY>
<!ELEMENT i ANY>
<!ELEMENT b ANY>
<!ELEMENT ul (li+)>
<!ELEMENT ol (li+)>
<!ELEMENT li ANY>
<!ELEMENT list (list-item+)>
    <!ATTLIST list if CDATA "">
<!ELEMENT list-item ANY>
    <!ATTLIST list-item if CDATA "">
<!ELEMENT id (#PCDATA)>
<!ELEMENT code (#PCDATA)>
<!ELEMENT code-block (#PCDATA|exe)*>
    <!ATTLIST code-block title CDATA "">
    <!ATTLIST code-block type CDATA "">

<!ELEMENT host (#PCDATA)>
<!ELEMENT file (#PCDATA)>
<!ELEMENT path (#PCDATA)>
<!ELEMENT cmd (#PCDATA)>
<!ELEMENT user (#PCDATA)>
<!ELEMENT quote (#PCDATA)>
<!ELEMENT proper (#PCDATA)>
<!ELEMENT setting (#PCDATA)>
<!ELEMENT br-option (#PCDATA)>
<!ELEMENT br-setting (#PCDATA)>
<!ELEMENT pg-option (#PCDATA)>
<!ELEMENT pg-setting (#PCDATA)>
<!ELEMENT exe EMPTY>
<!ELEMENT backrest EMPTY>
<!ELEMENT postgres EMPTY>
<!ELEMENT link (#PCDATA)>
    <!ATTLIST link url CDATA "">
    <!ATTLIST link page CDATA "">
    <!ATTLIST link section CDATA "">
