Style

Inline style

Italics

Use italics for:

  • emphasis, e.g. “the best way to do this is…”
  • reference to, rather than use of, a word, e.g. “the word short is itself short“
  • the name of a q function or adverb denoted by a character, e.g. “the adverb over is denoted by /
  • for definitions, e.g. “An adverb takes a function argument and returns a function: the derivative.”
  • citations of books or periodicals (but use double typographers’ quotes for the title of an article) e.g. “see “Functions and shadows” in Vector 23:4”
  • the names of GUI controls, using > to show descent through menus, e.g. “Click File > New to…”

Foreign languages

Avoid using words or phrases in languages other than English. Where one is necessary, set it in italics.

Your editor will try to remove it pour encourager les autres.

Bold

Use bold styling

  • for very strong emphasis, e.g. “Do not ever commit without running the tests.”
  • to mark words that aid a visual search, e.g.

    Where x is

    • a numeric atom, returns the xth product of y and z
    • a symbol vector, returns dictionary y with the keys of x switched with their values

Inline code

Use inline code style for

  • executable expressions, including lambdas
  • the names of functions and variables, including built-in q functions and operators, e.g. over and +
  • numeric values of explicit type, e.g. “the count of an empty list is 0, but the boolean for false is 0b – otherwise set numeric values as plain type

Markdown

These rules apply to Markdown source files for code.kx.com.

Bold and italic

Use underscores for italic and double asterisks for bold. For example,

The _quick_ brown fox jumps over the **lazy** dog.

renders as:

The quick brown fox jumps over the lazy dog.

Do not use single asterisks for italic, nor double underscores for bold, even though MkDocs will render them so.

Code blocks

Use code fences not indentation to mark code blocks. Suffix the opening fence with the lower-case name of the code language. For example,


```q
q)til 3
0 1 2
```

Where a code block is a child of a list item or an admonition, indent it to mark its parentage. This will break the Prism JavaScript that highlights syntax, so it is necessary to replace the backtick code fences with HTML elements. For example, to put the code block above within a list item:

<pre><code class="language-q">
q)til 3
0 1 2
</code></pre>

Lists

Where a list item spans multiple paragraphs, or includes a code block, use indentation to keep all the list item’s children subordinate to it.