Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Exporting from Tinderbox >> Exporting with Markdown and HTML Wrapper
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1325956682

Message started by Stephane R on Jan 7th, 2012, 12:18pm

Title: Exporting with Markdown and HTML Wrapper
Post by Stephane R on Jan 7th, 2012, 12:18pm

Hi all,

I'm trying to export notes for a weblog. Posts are exported via a wrapper html template.

Now, I wanted to use markdown encoding for writing posts. It is easy to export the text directly using HTMLExportCommand="/usr/local/bin/Markdown.pl". But if I use said HMTL template, then the markdown encoding applies for all of the exported file (including wrapper), instead of just the ^text^ as I'd like to.
Do anyone have an idea?

Title: Re: Exporting with Markdown and HTML Wrapper
Post by Mark Anderson on Jan 7th, 2012, 12:27pm

MMD is a bit outside my immediate expertise but how about this: rRemove the template's $HTMLCommand. Now, instead of calling ^text^, call an ^action()^ that does a runCommand to pass ^text^ to your MMD script. The gotcha to watch for is the $Text or ^value($Text)^ is not the same as ^text^ as only the latter does the inline evaluation of quicklists, inline ^ code, etc. If you don't use the latter then you can probably safely pass $Text to the runCommand.

Title: Re: Exporting with Markdown and HTML Wrapper
Post by Mark Bernstein on Jan 7th, 2012, 4:32pm

What you want, I think, is for ^text for some notes to export markup like

    This is *bold*

instead of HTML

    This is <b>bold</b>.

If that's what you want, let those notes all inherit from a prototype MarkdownNote, and for the prototype set appropriate "HTML" export tags.  For example

   $HTMLExportBoldStart: *
   $HTMLExportBoldEnd:  *


Title: Re: Exporting with Markdown and HTML Wrapper
Post by Stephane R on Jan 9th, 2012, 4:56am

Thanks to both, Mark A's tip did the trick. I use an intermediary tmp string value, populated by an ^action^ call to Markdown.pl

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.