topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday December 13, 2024, 4:31 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: convert rich text formatting to user-specified markup/markdown  (Read 5054 times)

dr_andus

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 851
    • View Profile
    • Dr Andus's toolbox
    • Donate to Member
I'd need a little app that lives in the system tray area (where its options can be accessed) and which can be operated using a hotkey to copy to clipboard, convert the following rich text formatting into markup specified by the user (set up beforehand in the options), and keep it in the clipboard. Ideally there would be an option for the user to save a variety of markups for different applications (such as wiki markup or Markdown).

I wouldn't need the full set of rich text formatting converted, but, in order of importance (for me, but it doesn't mean they need to be in this order in the app), the following:

1. Convert italics to //italics//

2. Convert bold to **bold**

3. Convert superscript2 to superscript^^2^^

4. Convert subscript2 to subscript;;2;;

5. Convert underline to __underline__  (that's 2x underscore on both sides)

6. Convert strikethrough to --strikethrough--

(Sorry, didn't know how to do the superscript2 and subscript2 with DC's forum software.)

It would be mainly used to copy and convert text from PDFs, webpages, and MS Word. Lines copied from a PDF would be broken, but that's not a big deal as I can join the lines in a text editor before pasting it into its final destination.

The above markup is for a desktop wiki (ConnectedText), but one could manually change (or set up other instances for) the markup to other wikis or for Markdown.

Option to deselect some of the above (e.g. when one doesn't want strikethrough to be converted but everything else) would be also nice.

Does this sound feasible? (AutoHotkey would be fine.)
« Last Edit: November 06, 2014, 05:26 PM by dr_andus »

dr_andus

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 851
    • View Profile
    • Dr Andus's toolbox
    • Donate to Member
Re: IDEA: convert rich text formatting to user-specified markup/markdown
« Reply #1 on: November 06, 2014, 05:22 PM »
If it wouldn't be a big additional step, it would be also nice to have

"text highlighted in yellow" to be converted to  %%background-color=#ffff00%%text highlighted in yellow%%%%

(again, sorry, didn't know how to highlight text as yellow in the forum software)

dr_andus

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 851
    • View Profile
    • Dr Andus's toolbox
    • Donate to Member
Re: IDEA: convert rich text formatting to user-specified markup/markdown
« Reply #2 on: November 06, 2014, 05:32 PM »
P.S. While I presented the above to match my specific needs (which are mainly for converting to ConnectedText markup), I thought that by making the markup user-specifiable, it would become more useful to others as well (and occasionally I may want to convert it to Markdown myself). However, if making it a universal app is a lot more hassle for the programmer, I'd be very satisfied with just having a ConnectedText-specific solution as well.
« Last Edit: November 06, 2014, 06:46 PM by dr_andus »

dr_andus

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 851
    • View Profile
    • Dr Andus's toolbox
    • Donate to Member
Re: IDEA: convert rich text formatting to user-specified markup/markdown
« Reply #3 on: November 10, 2014, 05:43 PM »
Did a bit more research on whether something like this exists and whether there any major obstacles. Similar efforts include:

- Wiky: A Bidirectional Markup Converter and WikyBox - no rich text, only Wiky markup to HTML and back;

- HTML to DokuWiki Converter - no rich text;

- Mark It Down: convert rich text to Markdown this one does convert some rich text, but not consistently.

One problem concerns how to copy rich text from a PDF, and then how to convert that into HTML, so that a tool like one of the above would recognise it. The only workflow that sort of worked was the following:

1) use PDF-XChange Editor's "Copy as rich text" feature.

2) paste into MS Word.

3) copy and paste into Mark It Down;

4) convert to Markdown. Except of course Markdown is not what I'm after. I'd prefer to set my own markup to be able customise the basic formatting options (such as for ConnectedText).

I have also found that there is at least one other person  on this planet that might be interested in a solution to this problem (in his case it would be for Zim wiki).  :)