<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Joan Ramio</title>
    <description>The latest articles on DEV Community by Joan Ramio (@joan_ramio_9e4f7ba5ced8a0).</description>
    <link>https://dev.to/joan_ramio_9e4f7ba5ced8a0</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3543768%2F2d93b788-d958-47ec-84e6-a9b90c790767.png</url>
      <title>DEV Community: Joan Ramio</title>
      <link>https://dev.to/joan_ramio_9e4f7ba5ced8a0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joan_ramio_9e4f7ba5ced8a0"/>
    <language>en</language>
    <item>
      <title>piotrmurach/tty-table to markdown</title>
      <dc:creator>Joan Ramio</dc:creator>
      <pubDate>Fri, 03 Oct 2025 13:43:55 +0000</pubDate>
      <link>https://dev.to/joan_ramio_9e4f7ba5ced8a0/piotrmurachtty-table-to-markdown-37om</link>
      <guid>https://dev.to/joan_ramio_9e4f7ba5ced8a0/piotrmurachtty-table-to-markdown-37om</guid>
      <description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I will suggest to &lt;a class="mentioned-user" href="https://dev.to/piotrmurach"&gt;@piotrmurach&lt;/a&gt; to add a method to tty-table to generate markdown. It can ba called .to_md&lt;/p&gt;

&lt;p&gt;It is similar to the actual&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;table.render(:ascii, alignments: [:center, :right])
# =&amp;gt;
#  +-------+-------+
#  |header1|header2|
#  +-------+-------+
#  |  a1   |     a2|
#  |  b1   |     b2|
#  +-------+-------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;.to_md should remove first and last lines and adapt the line under the headers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;table.to_md(alignments: [:center, :right])
# =&amp;gt;
#  |header1|header2|
#  |:-----:|------:| 
#  |  a1   |     a2|
#  |  b1   |     b2|
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is important to align text also in markdown, because it is more readable than:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#  |header1|header2|
#  |:-----:|------:| 
#  |a1|a2|
#  |b1|b2|
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thank you,&lt;br&gt;
Joan Ramió.&lt;/p&gt;

</description>
      <category>markdown</category>
      <category>ruby</category>
    </item>
  </channel>
</rss>
