---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.ru/support/wiki/en/static-markup/highlight.md
  - https://yandex.ru/support/wiki/ru/static-markup/highlight.md
  - href: en/static-markup/highlight.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/support/wiki/en/llms.txt

# Highlighting code syntax in the old editor

<!-- source: en/_includes/formatter-alert.md -->
{% note warning "" %}

Specially formatted blocks work in both dynamic tables and pages built with the legacy editor. For information on working with diagrams in the new editor, see [Formatting text](https://yandex.ru/support/wiki/en/wysiwyg/diagrams.md).

<!-- source: en/_includes/old-editor-note.md -->
You can no longer create pages using the old editor. However, you can easily convert any existing pages from the legacy editor to the new editor format. For more information, see [Switching a page to the new editor format](https://yandex.ru/support/wiki/en/page-management/convert-page.md).
<!-- endsource: en/_includes/old-editor-note.md -->

{% endnote %}
<!-- endsource: en/_includes/formatter-alert.md -->

You can highlight code syntax in Wiki pages. To do this, use the markup:

```
%%(<сoding_language> nomark nohighlight)
source code
%%
```

| Parameter | Description |
----- | -----
| Coding language | [Programming language](#formatters-name) for highlighting syntax |
| `nomark` | Optional parameter that disables line numbering |
| `nohighlight` | Optional parameter that disables line numbering and syntax highlighting |


Your browser's <q>monospaced</q> font is used for code highlighting in Wiki by default. You can change this font in your browser settings.

## Supported programming languages {#formatters-name}

{% cut "List of supported programming languages" %}

| Programming language | Parameter |
----- | -----
| 1C | 1с, 1c |
| ActionScript | actionscript |
| Apache | apache |
| Applescript | applescript |
| Bash | bash, sh |
| C#| c#, csharp, c-sharp |
| C++ | c, cpp, c++ |
| Closure | closure |
| CMake | cmake |
| Coffeescript | coffeescript |
| CSP | csp |
| Css | css |
| D | d |
| Delphi | delphi |
| Diff | diff |
| DOS | .bat bat, dos |
| Django | django |
| Dockerfile | dockerfile |
| Erlang | erlang |
| Erlang-repl | erlang-repl |
| Go | go |
| Haskell | haskell |
| HTTP | http |
| Ini | ini |
| json | json |
| Java | java |
| Javascript | js, javascript |
| Lisp | lisp |
| Matlab | matlab |
| Nginx | nginx |
| ObjectiveC | objc, objectivec, obj-c, objective-c |
| PHP | php |
| Perl | perl |
| Python | py, python |
| Python | profile profile, profiler, python-profile, python-profiler |
| R | r |
| Ruby | ruby |
| Rust | rust |
| Scala | scala |
| Smalltalk | smalltalk |
| SQL | mysql, sql |
| Swift | swift |
| tex | tex |
| vbscript | vbscript |
| XML | xml |
| YAML | yaml, yml |
| YQL | yql |

{% endcut %}


## Examples of source code formatting {#examples}

#### Standard formatting {#examples-standart}

```
%%(php)
<?
phpinfo();
$s = "Hello, World!\n";
print $s;
%%
```

#### No line numbering {#examples-without-line-numbering}

```
%%(python nomark)
@requires_authorization
def somefunc(param1, param2):
    r'''A docstring'''
    if param1 > param2: # interesting
       print 'Gre\'ater'
       print ''
    return (param2 - param1 + 1) or None

class SomeClass:
  pass
%%
```

#### No syntax highlighting {#examples-without-highlighting}

```
%%(code nohighlight)
@requires_authorization
def somefunc(param1, param2):
    r'''A docstring'''
    if param1 > param2: # interesting
        print 'Gre\'ater'
        print ''
    return (param2 - param1 + 1) or None

class SomeClass:
  pass
%%
```

#### Single-line code {#examples-one-string}

Single-line source code that remains single-line after formatting.

```
%%(css)body {display: none;}%%
```

#### Code line in Markdown style {#examples-markdown-style-string}

``` `body {display: none;}` ```

#### Formatting comments {#examples-comment}

To add a comment to your source code and hide it from a Wiki page, use the following syntax:

`%%(comments) Comment text that is not displayed on the Wiki page%%`
