सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
बारबीक्यू एक फ्लटर/डार्ट पैकेज है जिसका उपयोग कमांड-लाइन एप्लिकेशन में फॉर्मेटेड टेक्स्ट टेबल दिखाने के लिए किया जाता है। इसमें कस्टमाइज़ेबल बॉर्डर, पैडिंग, टेक्स्ट स्पैन और एनएसआई रंग कोड का समर्थन है जिससे विजुअल आउटपुट को बेहतर बनाया जा सकता है। CLI टूल्स के लिए बहुत उपयुक्त जिन्हें संरचित, पढ़ने में आसान डेटा प्रस्तुति की आवश्यकता होती है, यह सभी प्रमुख प्लेटफॉर्म जैसे Android, iOS, Web, macOS, Windows और Linux पर काम करता है। यह पैकेज डेवलपर्स को न्यूनतम प्रयास में प्रोफेशनल लुक वाले कंसोल आउटपुट बनाने में सक्षम बनाता है।
उपयोग
CLI एप्लिकेशन में टेबलर डेटा प्रदर्शित करना
प्रारूपित संरचना के साथ लॉग बनाना
इंटरैक्टिव कमांड-लाइन डैशबोर्ड बनाना
विन्यास या स्थिति की जानकारी प्रस्तुत करना
कमांड-लाइन आधारित रिपोर्टिंग उपकरण बनाना
मुख्य विशेषताएँ
कस्टमाइज़ किए गए तालिका सीमाएं
ANSI रंग समर्थन
टेक्स्ट स्पैन प्रारूपण
लचीले पैडिंग विकल्प
क्रॉस-प्लेटफॉर्म संगतता
इनके लिए उपयुक्त
CLI एप्लिकेशन डेवलपर्स
कंसोल-आधारित टूल निर्माता
टर्मिनल वातावरण में डेटा विज़ुअलाइज़ेशन
DevTools और निदान उपकरण
शैक्षिक या डिबगिंग कमांड-लाइन टूल्स
विचार योग्य बातें
एनएसआई रंग समर्थन वाले टर्मिनल की आवश्यकता है
पाठ-आधारित आउटपुट तक सीमित
GUI एप्लिकेशन के लिए उपयुक्त नहीं
जटिल लेआउट के लिए अतिरिक्त स्टाइलिंग की आवश्यकता हो सकती है
कंसोल पर्यावरण क्षमताओं पर निर्भर
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
barbecue
Render text tables for CLI-based dart applications.
Ported from Kotlin to Dart from Jake Wharton's picnic.
Features:
Borders (with custom styling)
Padding
Styling on table- row- or cell-level
Text alignment (bottom/middle/top - left/middle/right)
Row and column spans
ANSI Colors and backgrounds! (see example)
LIMITED support for emojis and other wide characters
By default, the layout algorithm assumes a real monospaced font, where every character is the exact same
width as other characters. Most modern "Mono" fonts don't work like that.
See for example this "monospaced" block:
😊😊😊
123
In a fully monospaced font, the first line with the emojis would be exactly as wide as the second line.
Chances are, that you see this block rendered like this (this depends on the font used):
Text based table layouts don't work if some characters are wider than others.
Luckily, most fonts used in terminals just render most emojis twice as wide as other characters:
Something like:
😊😊😊|
123456|
Will likely render like that in your terminal:
With the assumption that emojis are rendered twice as wide, we can build a valid text-table again.
Unfortunately, this is not going to work with all fonts, and not with all characters.
Some characters are rendered with a fractional width of a default character.
See for example bold unicode characters:
𝗛𝗲𝗮𝗱𝗲𝗿|
123456|
For emojis and other wide characters, you can use the experimental EmojiAwareLayout.
Your milage may wary. It is recommended not to use any unicode full-width or half-width characters
with barbecue, as there are many platform, font or even terminal specific differences in how
their glyphs are rendered, and this breaks the monospace-assumption of this package.
There is no way of drawing text tables if the glyphs are rendered with fractional widths of 1.5x.