2013-04-11 5 views
8

मैं तालिका बनाने के लिए मार्कडाउन का उपयोग कर रहा हूं। मेरे विवरण कॉलम में बहुत लंबे ग्रंथों में शामिल है और वजह यह markdown फ़ाइल पर बहुत बुरा लग रहा है जब मैं रेखाओं को रैप:लंबी लाइनों के साथ मार्कडाउन तालिका

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

के लिए HTML का उपयोग करना चाहिए मेरा मानना ​​है कि @Naor सही है: आप पंक्ति विराम बनाने के लिए HTML का उपयोग करना चाहिए, हालांकि यह है कि इस सवाल का जवाब में प्रदर्शन नहीं कर रहा है। और प्रदर्शित पूर्ण तालिका कोड कड़ाई से जरूरी नहीं है: लाइन ब्रेक प्राप्त करने के लिए आपको केवल डबल स्पेस या <br /> टैग की आवश्यकता है। From the Markdown spec:

मार्कडाउन "हार्ड-लिपटे" टेक्स्ट पैराग्राफ का समर्थन करता है। यह से अधिकतर अन्य टेक्स्ट-टू-एचटीएमएल फॉर्मेटर्स ( मूवबल टाइप की "कनवर्ट लाइन ब्रेक" विकल्प) से काफी भिन्न है, जो <br /> टैग में अनुच्छेद में प्रत्येक लाइन ब्रेक कैरेक्टर का अनुवाद करता है।

जब आप मार्कडाउन का उपयोग करके <br /> ब्रेक टैग डालना चाहते हैं, तो आप को दो या दो से अधिक रिक्त स्थान वाली एक पंक्ति समाप्त करें, फिर वापसी टाइप करें।

ध्यान दें कि मुझे टेक्स्ट में कोड रैपर जोड़ना था क्योंकि एसओ-स्वाद वाले मार्कडाउन को 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%" जोड़ने की कोशिश की, करने के लिए कोई प्रभावित करते हैं ।

* मुझे ध्यान रखना चाहिए कि मैं इस पर आया क्योंकि मुझे गिटहब-स्वाद वाले मार्कडाउन का उपयोग करके तालिकाओं के भीतर कोड लिखने में समान समस्याएं आ रही हैं, जो बहुत दर्दनाक है। लेकिन मैं इसे इसलिए देख रहा हूं क्योंकि इसे मेरे द्वारा दिए गए उदाहरणों को रंगना चाहिए: किसी भी चीज जो मैं कहता हूं 'काम करता है' या 'काम नहीं करता' उस पर्यावरण से आता है।

संपादित करें: यदि आपके पास code आपकी तालिका के भीतर ब्लॉक हैं तो यह अप्रासंगिक है। हालांकि मार्कडाउन के साथ यह कोई समस्या नहीं है: HTML <code></code> ब्लॉक तालिका को फैलाने का कारण बनता है।

2

दुख की बात है तो आप इस

<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

हाय मैं वही चीज़ सोच रहा था। मैं एक प्रलेखन फ़ाइल के लिए इस की जरूरत है और इस तरह से कैसे मैं इस के साथ काम कर रहा हूँ है:

| 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 तालिका समान तरीके से (धन्यवाद टॉम)

तो मैं क्या सोचता लपेटकर था मेरे उदाहरण का उपयोग करना ठीक है अगर आप ऐसा कुछ कर रहे हैं जिसे पार्स नहीं किया जाएगा (जैसे कि गितब दस्तावेज) लेकिन यदि आप HTML पार्सर या ककड़ी परीक्षण तालिका में कुछ मार्कडाउन कर रहे हैं तो आपको लपेटना नहीं चाहिए।

लेकिन मैं गलत हो सकता हूं

+0

इस तालिका संस्करण दूसरी "bla bla" लाइन के लिए एक अलग 'tr' उत्पन्न होगा (कम से कम, Jekyll/gh-पृष्ठों और https://dillinger.io/ के लिए) ' bla bla blabla bla bla bla bla bla ' – thybzi

+0

मेरा मानना ​​है कि ऑक्टोप्रेस का एक ही पार्सिंग व्यवहार – thybzi

2

एक और विकल्प है। चूंकि दर्शन यह है कि मार्कडाउन हल्का वजन होना चाहिए, न कि मार्कअप भाषा, और प्राकृतिक मानव उपभोग (एसजीएमएल/एचटीएमएल-शैली प्रारूपों के विपरीत) के लिए, मुझे विश्वास है कि विशेष मामलों के लिए एएससीआईआई कला में वापस आना ठीक और स्वाभाविक है ।

इस विशेष कार्य के लिए, चरित्र कला प्राकृतिक है। इस प्रकार, बस अपनी तालिका को चार रिक्त स्थान के साथ इंडेंट करें, इसे पठनीयता के लिए अच्छी तरह से प्रारूपित करें, और मार्कडाउन इसे प्री-फॉर्मेटेड टेक्स्ट के रूप में ही व्यवहार करेगा, और दोनों पक्ष एक-दूसरे से लड़ना बंद कर सकते हैं।

उदाहरण के लिए:

| 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- कला तालिका उत्पन्न करना है। इसका उपयोग चौड़ा चार स्पेस इंडेंट ब्लॉक (या ''' '- जीएफएम में लपेटा गया ब्लॉक) का उपयोग करके, आपको प्रत्येक पंक्ति के लिए एक अलग' tr' मिलेगा (और प्रत्येक हाइफ़न लाइन के बाद एक अलग' टैब ') – thybzi

संबंधित मुद्दे