Markdown 構文ガイド

Bitbucket Server は CommonMark に従い (いくつかの拡張機能を追加済み)、テキストの書式設定に Markdown を使用します。Markdown は次の場所で使用できます。

  • あらゆるプル リクエストの説明、コメント、または
  • README ファイル (.md ファイル拡張子の場合)

マークダウンをプレビューするには、Control + Shift + P または Command + Shift + P を使用します。

マークダウン構文

以下のページでは、Markdown 構文の例について説明します。すべての Markdown 構文の一覧については、CommonMark のヘルプまたは仕様を参照してください。

このページの内容

見出し

# This is an H1
## This is an H2
###### This is an H6

This is also an H1
==================

This is also an H2
------------------

段落

段落は空白行で区切られます。新しい段落を作成するには、<return> を 2 回押します。

Paragraph 1

Paragraph 2

文字のスタイル

*Italic characters* 
_Italic characters_
**bold characters**
__bold characters__
~~strikethrough text~~

番号なしのリスト

*  Item 1
*  Item 2
*  Item 3
    *  Item 3a
    *  Item 3b
    *  Item 3c

番号付きリスト

1.  Step 1
2.  Step 2
3.  Step 3
    1.  Step 3.1
    2.  Step 3.2
    3.  Step 3.3

リスト内のリスト

1.  Step 1
2.  Step 2
3.  Step 3
    *  Item 3a
	*  Item 3b
	*  Item 3c

引用

Introducing my quote:

> Neque porro quisquam est qui 
> dolorem ipsum quia dolor sit amet, 
> consectetur, adipisci velit...

インライン コード文字

Use the backtick to refer to a `function()`.
 
There is a literal ``backtick (`)`` here.

コード ブロック

Indent every line of the block by at least 4 spaces.

This is a normal paragraph:

    This is a code block.
    With multiple lines.

Alternatively, you can use 3 backtick quote marks before and after the block, like this:

```
This is a code block
```

To add syntax highlighting to a code block, add the name of the language immediately
after the backticks: 

```javascript
var oldUnload = window.onbeforeunload;
window.onbeforeunload = function() {
    saveCoverage();
    if (oldUnload) {
        return oldUnload.apply(this, arguments);
    }
};
```

Bitbucket Server は CodeMirror を使用して、コメント、README、おちびプル リクエストの説明でレンダリングされた markdown に、シンタックス ハイライトを適用します。一般的なすべてのコーディング言語がサポートされます (C、C++、Java、Scala、Python および JavaScript を含む)。「ファイル拡張子でのシンタックス ハイライトの構成」を参照してください。

コード ブロック内では、アンパサンド (&) と山括弧 (< および>) は自動的に HTML エンティティに変換されます。

外部 Web サイトへのリンク

This is [an example](http://www.example.com/) inline link.

[This link](http://example.com/ "Title") has a title attribute.

Links are also auto-detected in text: http://example.com/

課題キーを Jira アプリケーションにリンク

コメントやプル リクエストの説明で (既定形式の) Jira アプリケーションの課題キーを使用すると、Bitbucket Server はそれらを自動的に Jira アプリケーション インスタンスにリンクします。

The default Jira application issue key format is two or more uppercase letters ([A-Z][A-Z]+), followed by a hyphen and the issue number, for example TEST-123.

プル リクエストへのリンク

Bitbucket Server 4.9 以降では、他のプル リクエストのコメントや説明からプル リクエストを参照することができます。プル リクエストにリンクするための構文は次のようになります。 

projectkey/repo-slug#pr_id

同じプロジェクトおよびリポジトリ内でプル リクエストにリンクするには、プル リクエスト ID を含めます。 

#123

同じプロジェクト別のリポジトリのプル リクエストにリンクするには、プル リクエスト ID の前にリポジトリのスラッグを含めます。

example-repo#123

別のプロジェクトおよびリポジトリのプル リクエストにリンクするには、プル リクエスト ID の前にプロジェクト キーとリポジトリのスラッグを含めます。

PROJ/example-repo#123

画像

インライン画像の構文は次のようになります。

![Alt text](/path/to/image.jpg)
![Alt text](/path/to/image.png "Optional title attribute")
![Alt text](/url/to/image.jpg)

例:

...
![Mockup for feature A](http://monosnap.com/image/bOcxxxxLGF.png)
...

参照画像のリンクは次のようになります。

![Alt text][id]

Where 'id' is the name of a previously defined image reference, using syntax similar to link references:

[id]: url/to/image.jpg "Optional title attribute"

An example using reference image links:

...
<--Collected image definitions-->
[MockupA]: http://monosnap.com/image/bOcxxxxLGF.png "Screenshot of Feature A mockup" 
...
<!--Using an image reference-->
![Mockup for feature A][MockupA]
...

You can specify image height and width as key=value pairs inside curly braces { } after the applicable image node. For example:

![text](/url.png){width=640 height=480}


| Day     | Meal    | Price |
| --------|---------|-------|
| Monday  | pasta   | $6    |
| Tuesday | chicken | $8    |

バックスラッシュ エスケープ

特定の文字の前にバックスラッシュを追加し、特別なマークダウンの意味ではなく文字どおりに表示できます。これは次の文字に適用されます。

\  backslash
`  backtick
*  asterisk
_  underscore
{} curly braces
[] square brackets
() parentheses
#  hash mark
>  greater than
+  plus sign
-  minus sign (hyphen)
.  dot
!  exclamation mark

README ファイル

If your repository contains a README.md file at the root level, Bitbucket Server displays its contents on the repository's Source page if the file has the .md extension. The file can contain Markdown and a restricted set of HTML tags.

最終更新日: 2021 年 2 月 2 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.