• Document Up to Date
  • Updated On 4.1.2

Documentation Standards

Please view the source of this document to view and follow the template.

Text

Style

monospaced text is done using

``monospace``

italics are done using

*italics*

And finally bold using

**bold**

Anchors

.. _documentation-templates:

Titles, Sections, sub-sections, and sub-subsections

= with overline, for parts

- with overline, for chapters

^ for sections

" for subsections

~ for subsubsections

' for paragraphs

Of course, you are free to use your own marker characters (see the reST documentation), and use a deeper nesting level, but keep in mind that most target formats (HTML, LaTeX) have a limited supported nesting depth.

For example

=====
Title
=====

Text...

-------
Heading
-------

Text...

^^^^^^^
Section
^^^^^^^

Text...

"""""""""""
Sub-section
"""""""""""

Text...

~~~~~~~~~~~~~~~
Sub-sub-section
~~~~~~~~~~~~~~~

Text...

'''''''''
Paragraph
'''''''''

Text...

Images and Figures

Image

We recommend uploaded images be no wider than 1280px.

.. image:: /_static/images/admin-console-link.webp
        :width: 25%
        :alt: Admin Console Link
        :align: center
Figure
.. figure:: /_static/images/create-content-type-3.webp
        :alt: Properties Explorer
        :align: center

Bullets and Numbering

Bullets

* lorem ipsum
* lorem ipsum
* lorem ipsum

Numbered bullets

#. lorem ipsum
#. lorem ipsum
#. lorem ipsum

Notes, Todos and Warnings

.. note:: Important note
.. seealso:: See also this :math:`\alpha`
.. todo:: Todo
.. warning:: Warning!

Tables

Simple Tables

Note

The number of characters per line is no more than 99. Please copy the template and start with it and don’t make the lines any longer.

=============== =================================================================================
Short Column    Long Column
=============== =================================================================================
Row 1 Column 1  Row 1 Column 2

Row 2 Column 1  Row 2 Column 2
=============== =================================================================================

Complex Tables

Note

The number of characters per line is no more than 99. Please copy the template and start with it and don’t make the lines any longer.

+-----------------+------------------------------------------------------------------------------+
|| Short Column   || Long Column                                                                 |
|| (More stuff)   ||                                                                             |
+-----------------+------------------------------------------------------------------------------+
|| Row 1 Column 1 || Row 1 Column 2 Line 1                                                       |
||                || Row 1 Column 2 Line 2                                                       |
+-----------------+                                                                              |
|| Row 2 Column 1 || Row 1 Column 2 Line 3 (merged cell)                                         |
+-----------------+------------------------------------------------------------------------------+

Code Blocks

HTML

.. code-block:: html

<#import "/templates/system/common/cstudio-support.ftl" as studio />

<!DOCTYPE html>
<html lang="en">
    <head>
        <!-- Basic Page Need
            ================================================== -->
            <meta charset="utf-8">
            <title>${contentModel.browser_title}</title>
            <meta name="description" content="${contentModel.meta_description}">
            <meta name="keywords" content="${contentModel.meta_keywords}">
        </head>
        <body>
             <div class="body" <@studio.iceAttr iceGroup="body"/>>
                  ${contentModel.body_html}
             </div>

             <#if (contentModel.analytics_script)??>${contentModel.analytics_script}</#if>
        </body>
</html>

Groovy

.. code-block:: groovy

        import org.craftercms.engine.service.context.SiteContext
        import org.opensearch.client.opensearch.core.SearchRequest
import org.craftercms.search.opensearch.client.OpenSearchClientWrapper
import org.opensearch.client.opensearch._types.SortOrder

        import utils.DateUtils

        def now = DateUtils.formatDateAsIso(new Date())
        def start = 0
        def rows = 1000
def q = "crafterSite:\"${siteContext.siteName}\" AND content-type:\"/component/event\" AND disabled:\"false\" AND date_dt:[${now} TO *]"
def events = []

        // Execute the query
def result = searchClient.search(r -> r
  .query(q -> q
    .queryString(s -> s
      .query(q as String)
    )
  )
  .from(start)
  .size(rows)
  .sort(s -> s
    .field(f -> f
      .field(date_dt)
      .order(SortOrder.Asc)
    )
  )
, Map)

result.hits().hits().each {
  events.add(it.source())
}

        contentModel.events = events

Include Another Document

.. include:: ../includes/unicode-checkmark.rst