Created
April 2, 2015 05:11
-
-
Save JenniferMack/aea0f244344f56ccb6f9 to your computer and use it in GitHub Desktop.
A simple table maker that outputs MarkdownXL for Ulysses.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
table = "~~\n~~ <table>\n" | |
ARGF.each_line do |line| | |
table << "~~ <tr>\n" | |
row = table =~ /th/ ? "td" : "th" | |
line.chomp.split('|').each {|cell| table << "~~ <#{row}>#{cell}</#{row}>\n" } | |
table << "~~ </tr>\n" | |
end | |
puts "%% +---------------------------+" | |
puts table + "~~ </table>\n~~\n" | |
puts "%% +---------------------------+" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A table maker for Ulysses.