Wiki でシンタックス ハイライトを使用する

Bitbucket Cloud の wiki ページではテキストのスニペットをハイライトできます。Bitbucket では、コードの整形に Pygments ライブラリを使用しています。

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

次に上記のように、コードを整形するために適切なシンタックスを使用します。

マークダウン

Creole

```python def wiki_rocks(text): formatter = lambda t: "funky"+t return formatter(text) ```

シバンにトリプル バッククォートを使用した言語の指定はサポートされなくなりました。代わりに、上記の例に示すように、言語にトリプル バッククォートを使用します。

{{{ #!python def wiki_rocks(text): formatter = lambda t: "funky"+t return formatter(text) }}}

Textile

reStructuredText

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

各言語の詳細については、Web 上に公開されている対応するドキュメントをご参照ください。Pygment のレクサーのライブラリもご確認ください。Bitbucket Cloud は、このライブラリにあるすべての短縮名と MIME タイプをサポートします。

さらにヘルプが必要ですか?

アトラシアン コミュニティをご利用ください。