2013-04-11 5 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. 

それは私のために、より読みやすいので、私は行を折り返すたいです。
エディタでテーブルを読みやすくする方法はありますか?あなたは改行を作成するためにHTMLを使用する必要があり、それは答えで実証されていないにもかかわらず:

答えて

2

のためのHTMLを使用する必要があります。また、表示されるテーブルコード全体が厳密には必要ではありません。改行を達成するには、ダブルスペースまたは<br />タグが必要です。 From the Markdown spec

マークダウンは「ハードラップ」のテキスト段落をサポートします。これは、段落内の 改行文字を<br />タグに変換する と、ほとんどの他のテキストとHTMLのフォーマッタ( Movable Typeの "改行改行"オプションを含む)とは大きく異なります。

Markdownを使用して<br />区切りタグを挿入する場合は、末尾に という行を2つ以上のスペースで区切り、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> 

をノー影響を与えるには、<td>秒にstyle="width:75%"を追加してみました。

* GitHub風味のMarkdownを使ってテーブル内にコードを書くのと同様の問題が発生しているので、私はこのことに気づくべきです。非常に苦痛です。しかし、私はそれが私が与える例を色付けする必要があるため、これに注目しています:私が「作品」または「働かない」と言うものは、その環境から来ています。

編集:テーブル内にcode個のブロックがある場合、これは無関係です。これはMarkdownの問題ではありません。HTML <code></code>ブロックはテーブルを伸ばす原因になります。

2

悲しいことに私は@Naorが正しいと信じている。この

<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

1

こんにちは、私は同じことを思っていました。私は、ドキュメントファイルのためにこれを必要とし、これは私がこれに対処していますどのような方法である:私はこれがあるためにそこに「-ハードラップ」の言語であることを仮定しているMarkdownを上記の質問にサムに同意し、

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

不正行為(私はそれが有効なMarkdownではないと思う)。また、私の大学はhttp://www.tablesgenerator.com/markdown_tablesは、だから私は何を考えて テーブル同様の方法(感謝トム)

をラップしていることを指摘し

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

:しかし、例えば、いくつかのGithubに私はこのようなリスト項目を包む人を見たREADME.mdファイルを投写(Githubのドキュメントのように)解析されないものを実行している場合は私の例を使用しても問題ありませんが、HTMLパーサーまたはキュウリのテストテーブルにMarkdownを行っている場合はラップしないでください。

しかし、私は間違っている可能性があります

+0

このテーブル変異体は、(少なくとも、ジキル/ GH-ページとhttps://dillinger.io/用) '​​ ​​BLA BLA blabla "BLA BLA" セカンドラインに対して個別の' tr'を生成しますbla bla bla bla bla – thybzi

+0

私はOctopressの構文解析の動作が同じであると信じています – thybzi

2

別のオプションがあります。マークダウンはマークアップ言語ではなく、人間が自然に使うことを意図しているという考え方から、SGML/HTML形式のフォーマットとは対照的に、特別なケースではASCIIアートに落ちるのは自然で良いと思います。

この特定のタスクでは、文字アートは自然です。したがって、あなたのテーブルを4つのスペースでインデントするだけで、読みやすさを考慮してうまく書式を設定してください。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の 'table'を取得する必要がある場合はこれを使用しないでください。これは、一種のASCIIアートテーブルを生成することです。 ousideの4つのスペースをインデントされたブロック(またはGFMの '' -wrappedブロック)を使用すると、各行に対して別々の 'tr 'が得られます(各ハイフン行の後に別の' tbody') – thybzi

関連する問題