2013-04-11 65 views
8

我爲了創建一個表使用降價。我說明列包含很長的文本,爲此它看起來非常糟糕的降價文件,當我換行:降價表排長

Argument   | Description | 
--------   | ----------- | 
appDir    | The top level directory that contains your app. If this 
option is used then it assumed your scripts are in |a subdirectory under this path. This option is not required. If it is not specified, then baseUrl below is the anchor point for finding things. If this option is specified, then all the files from the app directory will be copied to the dir: output area, and baseUrl will assume to be a relative path under this directory. 
baseUrl    | By default, all modules are located relative to this path. If baseUrl is not explicitly set, then all modules are loaded relative to the directory that holds the build file. If appDir is set, then baseUrl should be specified as relative to the appDir. 
dir     | The directory path to save the output. If not specified, then the path will default to be a directory called "build" as a sibling to the build file. All relative paths are relative to the build file. 
modules    | List the modules that will be optimized. All their immediate and deep dependencies will be included in the module's file when the build is done. If that module or any of its dependencies includes i18n bundles, only the root bundles will be included unless the locale: section is set above. 

我想換行,因爲這對我來說更具有可讀性。
有沒有一種方法,使表編輯器更具可讀性?

回答

2

我相信@Naor是正確的:你必須使用HTML創建換行符,雖然未在答案證明。並且顯示的完整表格代碼並非嚴格必要:要實現換行符,您只需要雙倍空間或<br />標記。 From the Markdown spec

Markdown支持「硬包裝」文本段落。這不同於 大多數其他文本到HTML格式化(包括 Movable Type的「轉換斷行」選項),它在每款 換行符轉化爲<br />標籤顯著。

當您確實想要使用Markdown插入<br />分隔標記時,您會在末尾 處有兩個或更多個空格的行,然後鍵入return。

注意,我不得不代碼包裝增加了文字,因爲SO味的降價要求HTML破標籤逃脫 - 所以我們知道<br />作品。

但是,如果你想要做一些更復雜一點,像我*你可以像這樣用HTML設置各種屬性:

<table width="300"> 
    <tr> 
    <td> This is some text </td> 
    <td> This is some somewhat longer block of text </td> 
    <td> This is some very long block of text repeated to make it even longer. This is some very long block of text repeated to make it even longer. This is some very long block of text repeated to make it even longer. </td> 
    </tr> 
</table> 

我嘗試添加style="width:75%"<td> S,無影響。

*我應該注意到我碰到這個來了,因爲我有寫的用GitHub的味降價,這是非常痛苦的表中的代碼類似的問題。但是我注意到這一點,因爲它應該給我給出的例子着色:我所說的任何「作品」或「不起作用」都來自該環境。

編輯:它可能會進一步值得注意,這是無關緊要的,如果你有code塊內的表。這不是降價的問題,但:HTML <code></code>塊導致表伸展。

2

可悲的是,你必須使用HTML這個

<table> 
<tr> 
<th>Argument</th> 
<th>Description</th> 
</tr> 
<tr> 
<td>appDir</td> 
<td>The top level directory that contains your app. If this option is used then 
it assumed your scripts are in</td> 
</tr> 
<tr> 
<td>baseUrl</td> 
<td>By default, all modules are located relative to this path. If baseUrl is not 
explicitly set, then all modules are loaded relative to the directory that holds 
the build file. If appDir is set, then baseUrl should be specified as relative 
to the appDir.</td> 
</tr> 
<tr> 
<td>dir</td> 
<td>The directory path to save the output. If not specified, then the path will 
default to be a directory called "build" as a sibling to the build file. All 
relative paths are relative to the build file.</td> 
</tr> 
<tr> 
<td>modules</td> 
<td>List the modules that will be optimized. All their immediate and deep 
dependencies will be included in the module's file when the build is done. If 
that module or any of its dependencies includes i18n bundles, only the root 
bundles will be included unless the locale: section is set above.</td> 
</tr> 
</table> 
+0

我試圖避免這個..使用html ..有什麼意義?是不是任何字符標記下一行是繼續當前行? – Naor 2013-04-12 14:56:05

1

您好我想知道同樣的事情。我需要這樣一個文檔文件,這是我如何處理這個問題的方法:我在減價假設是「硬包裝」語言上面的問題與山姆同意並有因爲這是

| key | description      | 
| --- | ---        | 
| foo | bla bla blabla bla blabla bla bla | 
|  | bla bla blabla bla bla bla bla bla | 
| bar | something else bla     | 

作弊(我猜這不是一個有效的Markdown)。但例如在幾個Github上項目README.md文件,我看到人們包裝列表項是這樣的:

* foo 
* bla bla bla bla bla bla bla bla bla bla 
    bla bla bla bla bla bla bla bla bla 

而且我的大學指出,http://www.tablesgenerator.com/markdown_tables被包裹 表類似的方式(感謝湯姆)

所以我想如果你正在做一些不會被解析的東西(比如Github文檔),但是如果你正在對HTML解析器或Cucumber測試表進行一些Markdown,則不應該包裝。

但我可能是錯的

+0

該表變體將產生用於第二個「血乳酸血乳酸」行的單獨'tr'(至少,對於化身/ GH-頁面和https://dillinger.io/) ' ​​ ​​血乳酸血乳酸布拉布拉bla bla bla bla bla ' – thybzi 2017-09-30 10:25:40

+0

'我相信Octopress具有相同的解析行爲 – thybzi 2017-09-30 10:35:04

2

還有另一種選擇。既然理念是Markdown應該是輕量級的,而不是標記語言,並且打算用於自然的人類消費(與SGML/HTML風格格式相反),我相信在特殊情況下退回到ASCII藝術是很自然的事情。

對於這個特殊的任務,角色藝術是很自然的。因此,只需用四個空格縮進你的表格,將其格式化爲可讀性良好,Markdown會將其視爲預格式化的文本,並且雙方都可以停止對戰。

例如:

| Sequence | Result              | 
|-------------|---------------------------------------------------------------| 
| `a?c`  | Matches `abc`, `axc`, and `aac`. Does not match `ac`, `abbc`, | 
|    | or `a/c`.              | 
|-------------|---------------------------------------------------------------| 
| `a*c`  | Matches "ac", "abc" and "azzzzzzzc". Does not match "a/c". | 
|-------------|---------------------------------------------------------------| 
| `foo...bar` | Matches "foobar", "fooxbar", and "fooz/blaz/rebar". Does not | 
|    | match "fo/obar", "fobar" or "food/bark".      | 
|-------------|---------------------------------------------------------------| 
| `....obj` | Matches all files anywhere in the current hierarchy that end | 
|    | in ".obj". Note that the first three periods are interpreted | 
|    | as "...", and the fourth one is interpreted as a literal "." | 
|    | character.             | 
|-------------|---------------------------------------------------------------| 

...和做。

+0

**快速閱讀器的警告!**如果您需要獲取HTML「表格」,請不要使用此表格。這一個是生成一種ASCII藝術表。使用它的四個空格縮進塊(或GFM中的'''-wrapped block),你會爲每一行分別得到一個'tr'(在每個連字符後面有一個單獨的'tbody') – thybzi 2017-09-30 10:20:36