Saturday, March 13, 2010

Wiki and Markdown

Having spent some time last week looking at Simplenote, Notational Velocity, and some of the other minimalist alternatives, I noticed that many "Mac-centric" people claim they are most productive using a text editor of some sort, plus a lightweight markup language like Markdown or MultiMarkdown, also used by Scrivener.

As John Gruber says, "Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML). - Thus, “Markdown” is two things: (1) a plain text formatting syntax; and (2) a software tool, written in Perl, that converts the plain text formatting to HTML."

It occurred to me that Wiki Markup and lightweight markup languages have a great deal in common and that I have essentially been following the same approach for years: I write most everything first in ConnectedText, and then convert it to RTF, in order to finish it up in a word processor (which has been Atlantis for some time now).

There is no reason why I cannot convert ConnectedText's markup into HTML. In fact, it's easier than RTF. ConnectedText supports exporting to HTML and XML for some time now. I just have to choose Topic|Export and choose the format.

It would also be easy to export fragments of text by adapting the RTF script I talked about in Wiki Markup to RTL.

1 comment:

MK said...

Here is a beginning for HTML fragments with AhK:

F10 & s:: ;ConnectedText to HTML
clipboard :=
Send ^c
ClipWait
clipboard = %clipboard%

StringReplace, clipboard, clipboard, %A_SPACE%`/`/, %A_SPACE%`, All
StringReplace, clipboard, clipboard, %A_SPACE%`(`/`/, %A_SPACE%`, All
StringReplace, clipboard, clipboard, `/`/%A_EndChar%, <`/i`>, All
StringReplace, clipboard, clipboard, `/`/%A_SPACE%, `<`/i`>, All

StringReplace, clipboard, clipboard, `/`/`n`r, `<`/i`>`n`r, All

StringReplace, clipboard, clipboard, %A_SPACE%`*`*, %A_SPACE%`, All
StringReplace, clipboard, clipboard, `*`*%A_SPACE%, `<`/b`>%A_SPACE%, All
StringReplace, clipboard, clipboard, `*`*%A_EndChar%, All

StringReplace, clipboard, clipboard, `*`*`n`r, `<`/b`>`n`r, All

StringReplace, clipboard, clipboard, `=, `


StringReplace, clipboard, clipboard, `n`r, `, All
Run, Notepad.exe
Winwait, Untitled - Notepad
SendInput ^v
Sleep, 900
Send ^{Home}
Send {Enter}
Send ^{End}
Send {Enter}
return