Created
April 28, 2010 03:19
-
-
Save marksweiss/381680 to your computer and use it in GitHub Desktop.
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
# Convert a line of a block to textile | |
def make_textile(line) | |
j = 0 | |
prefix = '' | |
while line[j] == 32 | |
prefix.concat " " | |
j += 1 | |
end | |
line = line.strip | |
if line.length > 0 | |
prefix + '@' + line + "@<br/>" | |
else | |
"<br/>" | |
end | |
end | |
# Iterate lines of script block, redirect to file or stdout to just copy out of shell | |
def make_block_textile(lines) | |
lines.each do |line| | |
puts(make_textile(line)) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment