0

Want a dedicated tool For Achieving the below-mentioned result fast

Edit and Work visually to make a styled text or importing from MS-Word or RTF and get it's markaup HTML(the text with inline coding)

What I want to get is something similar :

<p class="home">
  <Span style="xxxxx">
    blah blah blah
  </span>
</p>

Although it is HTML, but I want just the HTML's source of the text want to get it with a fast way

Any Tools/Tricks is appreciated

thanks

Kasrak
  • 123

3 Answers3

1

In Word you can save as HTML, which will produce something not entirely unlike your example.

Later versions of Word produce better HTML (early versions produced usable but unreadably repetitive and overcomplicated HTML) so you might want to clean it up

Some people like to create both HTML and RTF/DOC/DOCX from a Plain Text Markup using something like Pandoc

0

You could try unRTF.

  • Linux versions are provided at the above link.
  • Windows versions are here.
  • OS X lets you install it using Homebrew and brew install unrtf.

For example, let's create an RTF document.

enter image description here

Then convert it to HTML (which is the default setting).

unrtf test.rtf 

This is the output:

<!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN>
<html>
<head>
<meta http-equiv=content-type content=text/html charset=utf-8>
<!-- Translation from RTF performed by UnRTF, version 0.21.2 -->
<!--font table contains 0 fonts total-->
<!--invalid font number 0-->
</head>
<body><b><font size="3"><font color="#000000">This is a bold text<br>
<br>
<i>This is italics</i><br>
<br>
<u>This is underlined!</u></font></font></b></body>
</html>
Glorfindel
  • 4,158
slhck
  • 235,242
0

On OS X, TextEdit can edit RTF and save as html. Here is an example of the sort of HTML it spits out:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <meta http-equiv="Content-Style-Type" content="text/css">
   <title></title>
   <meta name="Generator" content="Cocoa HTML Writer">
   <meta name="CocoaVersion" content="1138.23">
   <style type="text/css">
      p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
   </style>
</head>
<body>
    <p class="p1">this is a <b>test</b></p>
</body>
</html>
dsanson
  • 46