[TxMt] Re: Using PHP Markdown Extras with TextMate?

Brooks Seymore bseymore at gmail.com
Sat Aug 19 01:11:42 UTC 2006


Reading this post tonight, it struck me I was asking for a solution  
without properly defining what I was after. What I would like is a  
way for the Preview option markup both HTML and Markdown content when  
the two are mixed.

Previewing the first example the Markdown will render correctly, the  
word Markdown will become a hyperlink. Previewing the second example  
in HTML, the markdown will not render at all, but it will appear in  
its own paragraph block.

My understanding is the second example is not working, as I would  
like, because Markdown syntax isn't processed within block-level  
tags. From the description of PHP Markdown Extra, it sounds as if  
that might provide a workaround.

What I would like is for Preview to display HTML formated segments as  
HTML and Markdown formated segments to render as Markdown should. I  
prefer to draft posts for my website on a local version of my  
index.html file, WYSIWYG style. If I could somehow have TextMate  
render the HTML portion of my document according to the rules of HTML  
and the Markdown portion render according to the rules of Markdown,  
that would be absolutely ideal.

Aside from the PHP Markdown Extra code, which may or may not allow me  
to do what I would like, I wonder if there is a way to have different  
language settings within the document, each displaying in Preview  
according to the rules of that language?

Hopefully this presents what I am looking to do easier to understand,  
as well as teaches me not to write mailing list posts at trying to  
watch subtitled Hungarian films at the same time.

**Example 1 | Markdown**
[markdown][1]
[1]:http://somesite.com/

<p>
Example 2 | Markdown Inside HTML
[markdown][1]
[1]:http://somesite.com/
</p>

On Aug 18, 2006, at 12:21 AM, Brooks Seymore wrote:

> Tinkered around with Markdown today, found it quite enjoyable to use.
> Mostly. Where I found it lacking is when Markdown formatted text is
> within a div block, what with Markdown not working within block-level
> tags.
>
> Lookign for a workaround, I discovered [PHP Markdown Extra][1] by
> Michel Fortin, a script which expands the Markdown syntax to allow one
> to use Markdown within block-level tags. Is there a way to use that
> script within TextMate?
>
> [1]:http://www.michelf.com/projects/php-markdown/extra/
>
> For those interested in seeing the problem, I've included the samples
> below. Pop them into a TextMate document composed in the Markdown
> langauage. The first will convert as I would like properly, the
> second, well, not so much.
>
> **Markdown, Working**
> example
> =======
> [markdown][1]
> [1]:http://somesite.com/
>
> **Markdown, Not Quite Working**
> <div>
> example
> =======
> [markdown][1]
> [1]:http://somesite.com/
> </div>
>
> Regards,
>
> Brooks




More information about the textmate mailing list