44

テーブルを作成するためにマークダウンを使用しています。私の説明列には非常に長いテキストが含まれているため、行を折り返すとマークダウン ファイルで非常に見栄えが悪くなります。

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. 

読みやすいので、行を折り返したいと思います。
エディタがテーブルを読みやすくする方法はありますか?

4

5 に答える 5

12

別のオプションがあります。Markdown は軽量であり、マークアップ言語ではなく、(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.                                                    |
|-------------|---------------------------------------------------------------|

...そして完了。

于 2016-10-18T07:24:21.197 に答える
7

@Naorが正しいと思います.HTMLを使用して改行を作成する必要がありますが、回答には示されていません。また、表示される完全なテーブル コードは厳密には必要ありません。改行を行うには、ダブル スペースまたは<br />タグのみが必要です。Markdown仕様から

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

Markdown を使用して改行タグを挿入する場合は<br />、2 つ以上のスペースで行を終了してから、return を入力します。

SO フレーバーの Markdown では 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>

s に追加style="width:75%"してみました<td>が、影響はありません。

*GitHub 風の Markdown を使用してテーブル内にコードを記述する際に同様の問題が発生しているため、これに遭遇したことに注意してください。これは非常に苦痛です。しかし、私が与える例に色を付ける必要があるため、これに注意しています。「機能する」または「機能しない」と言うものはすべて、その環境から来ています。

code編集:テーブル内にブロックがある場合、これは無関係であることに注意する価値があるかもしれません。ただし、これは Markdown の問題ではありません。HTML<code></code>ブロックによってテーブルが引き伸ばされます。

于 2013-11-12T10:04:05.963 に答える
1

残念ながら、これには 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>
于 2013-04-11T19:47:21.983 に答える