1

Does anyone have or know of a Ruby script that converts text to html?

Example:

I have a file that contains the following text:

Host Name

Info1
Line1
Info2
Line2

I want to have ruby convert it to the following html output

Host Name

Info1
Line1
Info2
Line2

I tried running RedCloth but got the following error:

The program can't start because msvcrt-ruby18.dll is missing

Thanks

Thanks

7
  • 3
    Convert it by doing what exactly? Commented Sep 27, 2010 at 16:44
  • 1
    Ehrm, converting to html == adding asterisks on every second line? Commented Sep 27, 2010 at 16:47
  • I wanted to put in an H1 header on hostname and want to bold and Italicize the info1 line. Commented Sep 27, 2010 at 16:47
  • Sorry the asterisks were suppose to be bold and Italics Commented Sep 27, 2010 at 16:48
  • @goruby - please edit this question enclose the 2 code samples using the 'Code Sample' button in the rich text editor or by indenting each line by 4 spaces in addition to any existing indentation. Commented Sep 27, 2010 at 16:56

1 Answer 1

2

That depends upon what you mean by "text to HTML." There are several "web text generators" that convert easy-to-read free text with minimal markup (asterisks to indicate bold, double-spaced paragraphs get surrounded in <p> tags, etc). The most common, for Ruby, are Redcloth, which implements Textile free text, and Bluecloth, which implements Markdown.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the recommendations, I tried running RedCloth, but got the following error: program can't start because msvcrt-ruby18.dll is missing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.