Socket
Book a DemoInstallSign in
Socket

markdown_table

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdown_table

0.1.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

MarkdownTable

This library generate it easy to create Markdown table like CSV library.

Installation

Add this line to your application's Gemfile:

gem 'markdown_table'

And then execute:

$ bundle

Usage

MarkdownTable.generate(header: %w[header1 header2 header3 header4]) do |table|
    table << %w[row1_1 row1_2 row1_3 row1_4]
    table << %w[row2_1 row2_2 row2_3 row2_4]
end

Output:

header1header2header3header4
row1_1row1_2row1_3row1_4
row2_1row2_2row2_3row2_4
|header1|header2|header3|header4|
|-|-|-|-|
|row1_1|row1_2|row1_3|row1_4|
|row2_1|row2_2|row2_3|row2_4|

Set align option

MarkdownTable.generate(header: %w[header1 header2 header3 header4], align: %w[normal center left right]) do |table|
    table << %w[row1_1 row1_2 row1_3 row1_4]
    table << %w[row2_1 row2_2 row2_3 row2_4]
end

Output:

header1header2header3header4
row1_1row1_2row1_3row1_4
row2_1row2_2row2_3row2_4
|header1|header2|header3|header4|
|-|:-:|:-|-:|
|row1_1|row1_2|row1_3|row1_4|
|row2_1|row2_2|row2_3|row2_4|

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kouppu/markdown_table. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the MarkdownTable project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 22 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.