Use syntax highlighting in a wiki

You can highlight snippets of text on your Bitbucket Cloud wiki pages. We use the excellent Pygments library to style our code.

The syntax you use to format the code block depends on the language you choose for your wiki. To check the language, click Edit at the top right of you wiki page and look for the Language dropdown.

Then use the appropriate syntax to format the code as shown above:

Markdown

Creole

1 2 3 4 5 6 7 ``` #!python def wiki_rocks(text): formatter = lambda t: "funky"+t return formatter(text) ```
1 2 3 4 5 6 7 {{{ #!python def wiki_rocks(text): formatter = lambda t: "funky"+t return formatter(text) }}}

Textile

reStructuredText

1 2 3 4 bc. #!python def wiki_rocks(text): formatter = lambda t: "funky"+t return formatter(text)
1 2 3 4 5 .. sourcecode :: python def wiki_rocks(text): formatter = lambda t: "funky"+t return formatter(text)

For details on the various languages, see their corresponding documentation on the web. See the library of Pygment lexers. Bitbucket Cloud supports the short name or the mimetype of anything in that library.

Last modified on Dec 5, 2020
Cached at 3:47 PM on Apr 14, 2021 |

Additional Help

Ask the Community