HI,
I know that if I cut-and-paste from a webpage into more, I get beautifully formatted text matching all the sizes and atributes and inline images of the original.
Now, I've been thinking of implementing a markup/markdown type plugin so that one could quickly take some notes like:
!Synthetic Sensor Meeting
!!Agenda
#Discover a new sensing mechanism
#Devlop it
# ???
#Profit
And then the markup plugin would format it with header styles and numbered lists, etc.
However, most of the markup/down languages(Textile, markdown, stx, reStructuredText) output to HTML, so if I had a NSString of HTML that I got back from one of these command-line tools, is there anything already in Mori (like the pasting magic mentioned above) that will convert it to a displayable text. Or does the pasting and servicing from web pages only work because the browser itself already did the formatting work? and likewise, I would have to find something similar (html2rtf or Webkit) to do the work too.
Thanks
NSAttributedString has some
NSAttributedString has some – initWithHTML: methods that will turn HTML into an attributed string. Those might be what you are looking for.
But you might also be able to leverage some work that others have done. Check out HumaneText.service:
http://gu.st/proj/HumaneText.service/
It looks to be free, but not open source at first glace, though there might be a similar project that is open source. But even if the HumaneText.service isn't open source you can still leverage it by using the api (forget name of function at the moment) to invoke a menu item in the service menu.
One interesting (and important) thing that the HumaneText.service seems to support is the ability to reverse the transformation.