在 Markdown 資訊方塊中使用 Markdown

如要在文字資訊方塊中使用 Markdown,請在建立資訊方塊時,從資訊主頁的「新增」選單中選取「Markdown」文字資訊方塊是一種新型態的 Looker 文字資訊方塊,不使用 Markdown,而是提供視覺編輯體驗

您可以在資訊主頁上使用文字資訊方塊來說明其他資訊方塊,協助觀眾瞭解這些資訊方塊顯示的資訊。Looker 的 Markdown 資訊方塊支援文字資訊方塊中的 Markdown 標記語言 (僅支援部分功能),可讓您設定文字格式,或加入連結和圖片,讓資訊主頁更醒目。

Markdown 資訊方塊支援的 Markdown 語法

本頁面列出 Markdown 資訊方塊支援的 Markdown 語法,每個範例會先顯示在程式碼區塊中,然後再顯示結果。

資訊主頁資訊方塊中 Markdown 元素的顯示樣式,可能與這裡顯示的樣式不同。

標頭

資訊主頁支援標題層級 1 到 6:

## Header level 1

### Header level 2

#### Header level 3

##### Header level 4

###### Header level 5

####### Header level 6

資料表

資料表欄的大小會根據最寬的資料值調整。您可以使用   為欄位新增寬度。

| Tables        | Are           | Cool  |
| ------------- | ------------- | ----- |
| leopards      | have spots    | $1600 |
| zebras        | have stripes      | $12   |
| polar bears        | are white     | $1    |

文字圖塊:顯示 Markdown 表格。

表格欄僅支援左對齊。

強調

Emphasis (italics) with *asterisks* or _underscores_.

Strong emphasis (bold) with **double asterisks** or __double underscores__.

Combined emphasis with **asterisks and _underscores_**.

文字圖塊顯示粗體字型和斜體文字。

編號清單

1. First ordered list item
1. Another item
1. Actual numbers don't matter, just that it's a number
1. And another item

顯示編號清單的文字圖塊。

未排序清單

* Unordered lists can use asterisks
- or minuses
+ or pluses

文字資訊方塊:顯示無序清單。

你可以透過多種方式新增連結,如下列 Markdown 所示:

[Inline-style link](https://www.looker.com)
[Reference-style link](Case-insensitive reference text)
[Relative reference to a public repository](../assets/images/dashboard-add-text.png)
[Number used for a reference-style link definition][1]

系統會自動將角括號中的網址轉換為連結。例如 <looker.com>looker.com

圖片

圖片可透過路徑或網址參照。

Here's our logo:

URL-style:

<img src="url/to/image.png">

Inline-style:

![alt text](path/to/image.png)

Reference-style:

![alt text][logo]


文字圖塊顯示 Google Cloud 標誌,並以三種方式引用。

如要控制圖片與圖塊大小的關係,請使用 HTML 呼叫圖片,並新增百分比大小參數。以下範例使用 width="50%" 參數變更大小:


<img src="path/to/image.png" width="50%">

Google Cloud 標誌寬度設為 50%。

或者,您也可以提供明確的高度和寬度上限,如下所示:


<img src="path/to/image.png" width="500px" height="30px">

寬度設為 500 像素的 Google Cloud 標誌。

高度和寬度像素參數不會將圖片設為這些確切的尺寸,而是將圖片的顯示比例設為「最佳化」這些限制。舉例來說,如果在原本尺寸為 200px x 20px 的圖片上設定「width=100px height=30px」的尺寸,結果會是 100px x 10px,因為邏輯大致是「圖片寬度超過上限 > 縮小至達到寬度上限」。

程式碼醒目顯示

`<script>Some code</script>.`

文字圖塊以程式碼字型樣式顯示程式碼。

水平線

Three or more hyphens

---

Asterisks

***

Underscores

___

文字圖塊顯示文字和水平規則。


段落式引文

> Blockquotes are very handy.
> This line is part of the same quote.

文字資訊方塊:顯示引文。

引文插播

> This is a very long line that will be quoted properly when it wraps. I will keep writing to make sure this is long enough to actually wrap for everyone. Also, you can *put* **Markdown** into a blockquote.

文字資訊方塊:顯示長引文。

不支援的 Markdown 語法

資訊主頁 Markdown 資訊方塊「不」支援下列 Markdown 語法:

  • 數學
  • 含有替代文字的圖片
  • 含有替代文字的連結
  • 語言專屬的語法醒目顯示
  • 使用兩個 tilde 字元進行刪除線
  • 子清單
  • 縮排