Language

The language rule is used to inform Æsthetic on the type of input that has been provided. By default, Æsthetic will attempt to detect the language of content provided. It is discouraged to omit this rule and rely upon the automatic detection of languages based on input because the internal detection logic may not always be correct.

The language reference is used to determine the lexical process operation code is to be handled.


text

The text option refers to a Plain Text document, wherein the content will be formatted according to only a couple of global rules.

{
  "language": "text"
}
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
cupidatat non proident, sunt in culpa qui officia deserunt mollit anim
id est laborum.

liquid

The liquid option refers to the Liquid Template Language and uses the markup lexer.

{%if condition %}
<div class="xxx" id="some-id">
<ul>

  {%-unless condition ==something%}
<li class="some-class" data-attr ="xxx"
 {% if xxx %}id="{{ object.prop }}"{% endif %}>
<ul>
{% for i in list%}
  <li data-attr="{{ i.xxx }}">
  {{
  i.something|filter:'some-filter'
  |append:'some-append'|prepend:'some-prepend'
| example: one: 1,two: 2, three: 3,four: 4
}}
</li>
{% endfor %}
</ul>
</li>
{% endunless%}
</ul>
</div>
{% endif %}
{% if condition %}
  <div
    class="xxx"
    id="some-id">
    <ul>

      {%- unless condition == something %}
        <li
          class="some-class"
          data-attr="xxx"
          {% if xxx %}
            id="{{ object.prop }}"
          {% endif %}>
          <ul>
            {% for i in list %}
              <li data-attr="{{ i.xxx }}">
                {{
                  i.something
                  | filter: 'some-filter'
                  | append: 'some-append'
                  | prepend: 'some-prepend'
                  | example:
                    one: 1
                    , two: 2
                    , three: 3
                    , four: 4
                }}
              </li>
            {% endfor %}
          </ul>
        </li>
      {% endunless %}
    </ul>
  </div>
{% endif %}

html

The html option refers to the Hyper Text Markup Language and uses the markup lexer.

<!DOCTYPE html>
<html lang="en">
<head><meta
 charset="UTF-8"><meta
  http-equiv="X-UA-Compatible"     content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>  <main id  ="xxx"
class="foo bar baz"    data-one="1"   data-two="2"
></main></body>
</html>
<!DOCTYPE html>
<html lang="en">
  <head><meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document
    </title>
  </head>
  <body>
    <main
      id="xxx"
      class="foo bar baz"
      data-one="1"
      data-two="2"></main>
  </body>
</html>

xml

The xml options refers to the Extensible Markup Language and uses the markup lexer.

<?xml version="1.0" encoding="UTF-8"?>
<table summary="Product Sales Summary" border="1">
  <!--list products-->
      <tr align="center">
          <xsl:for-each select="//product">
            <th><b><xsl:value-of select="."/></b></th>
          </xsl:for-each></tr>
                                            <!--list customers-->
      <xsl:for-each select="/sales/record/customers">
        <xsl:variable name="customer" select="."/>
        <tr align="right"><td><xsl:value-of select="@num"/></td>
          <xsl:for-each select="//product">   <!--each product-->
            <td><xsl:value-of select="$customer"/>
            </td></xsl:for-each>
        </tr>
        </xsl:for-each>
    </table>
<? xml version="1.0" encoding="UTF-8" ?>
  <table
  summary="Product Sales Summary"
  border="1">
  <!-- list products -->
  <tr align="center">
    <xsl:for-each select="//product">
      <th>
        <b><xsl:value-of select="." />
        </b>
      </th>
    </xsl:for-each>
  </tr>
  <!-- list customers -->
  <xsl:for-each select="/sales/record/customers">
    <xsl:variable
      name="customer"
      select="." />
    <tr align="right">
      <td><xsl:value-of select="@num" />
      </td>
      <xsl:for-each select="//product">
        <!-- each product -->
        <td><xsl:value-of select="$customer" />
        </td>
      </xsl:for-each>
    </tr>
  </xsl:for-each>
</table>

css

The css options refers to Cascading Style Sheets and uses the style lexer.

.e-class,
.a-class,
.b-class>.foo> .bar,
.d-baz,
.c-something {
  background-image: url("barn.jpg");
  z-index: 999;   font-style: bold; min-inline-size: inherit;
    width: 200px;
  background-repeat  : no-repeat;background-position  : right top;
  color:    #fff;
  background-attachment
  : fixed;
  font-weight: 100;
}

.a-class,
.b-class>.foo> .bar,
.c-something,
.d-baz,
.e-class {
  background-attachment: fixed;
  background-image: url("barn.jpg");
  background-position: right top;
  background-repeat: no-repeat;
  color: #fff;
  font-style: bold;
  font-weight: 100;
  min-inline-size: inherit;
  width: 200px;
  z-index: 999;
}