Markdown processor for skEdit

This script is an enhancement for skEdit and Nuggit, that will let you process John Grubers Markdown Text file into a HTML file.
Send Snippet To: Save this snippet to Code Collector Pro -- view all jemstart's snippets
language: Python
license: Other

Code for Snippet:

                
#! /usr/bin/python
#
# markdown.py - runs the text through the markdown processor
#
# -- PB User Script Info --
# %%%{PBXName=Markdown All}%%%
# %%%{PBXInput=AllText}%%%
# %%%{PBXOutput=Discard}%%%
#
#
 
import sys
import string
import re
import os
 
# Important paths
markdownPath = "/usr/local/Markdown_1.0.1/Markdown.pl "
markdownFlags = "--html4tags"
outputPath = "/tmp/mark_out.html"
inputPath = "/tmp/mark_in.text"
 
## Build the string to test
mytext = """%%%{PBXAllText}%%%"""
 
## let's create the temporary input file
f = open( inputPath, 'w' )
f.write( mytext )
f.close()
 
## now to run it through the markdown engine
os.system("perl " + markdownPath + " " + markdownFlags + " " + inputPath + " > " + outputPath)
 
os.system("open " + outputPath)
 
comments powered by Disqus

Info

Tags: skEdit-Scripts nuggit-scripts Markdown

Link to this snippet:


Download to Code Collector

To use the direct link to your snippet on CodeCollector.net either copy the html from the above section or drag the Download to Code Collector to where you would like to use it.

More Info:

Times Viewed: 865
Date Added: 2013-07-16 15:17:17
Last Modified: 2014-10-24 16:51:39

Web Analytics