Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Exporting with Markdown and HTML Wrapper (Read 6523 times)
Stephane
Full Member
*
Offline



Posts: 71
@istib
Exporting with Markdown and HTML Wrapper
Jan 07th, 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?
Back to top
 
 
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Exporting with Markdown and HTML Wrapper
Reply #1 - 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.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Exporting with Markdown and HTML Wrapper
Reply #2 - 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:  *

Back to top
 
 
WWW   IP Logged
Stephane
Full Member
*
Offline



Posts: 71
@istib
Re: Exporting with Markdown and HTML Wrapper
Reply #3 - 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
Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print