Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

WIP 2.0.2 #17

Merged
merged 5 commits into from

1 participant

Commits on Feb 4, 2013
  1. added man page

    authored
  2. Merge pull request #15 from neocotic/man-page

    authored
    New man page
  3. Merge pull request #16 from neocotic/null-file

    authored
    No more null file
  4. roll v2.0.2

    authored
This page is out of date. Refresh to see the latest.
View
5 CHANGES.md
@@ -1,5 +1,10 @@
# Change Log
+## 2013.02.04, Version 2.0.2
+
+* [#13](https://github.com/neocotic/html.md/issues/13): Add new man page
+* [#14](https://github.com/neocotic/html.md/issues/14): Fix bug with `eval` option
+
## 2012.12.12, Version 2.0.1
* [#8](https://github.com/neocotic/html.md/issues/8): Fix incorrect version
View
2  LICENSE.md
@@ -1,4 +1,4 @@
-Copyright (C) 2012 Alasdair Mercer, http://neocotic.com/
+Copyright (C) 2013 Alasdair Mercer, http://neocotic.com/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
2  bin/md
@@ -109,7 +109,7 @@ parseHtml = (file, input, base) ->
output = md input, opts
if opts.print
console.log output
- else
+ else if file
writeMarkdown file, output, base
catch err
exit 1, err instanceof Error and err.stack or "ERROR: #{err}"
View
6 dist/md.min.js
@@ -1,9 +1,9 @@
-// [html.md](http://neocotic.com/html.md) 2.0.1
-// (c) 2012 Alasdair Mercer
+// [html.md](http://neocotic.com/html.md) 2.0.2
+// (c) 2013 Alasdair Mercer
// Freely distributable under the MIT license.
// Based on [Make.text](http://homepage.mac.com/tjim/) 1.5
// (c) 2007 Trevor Jim
// Licensed under the GPL Version 2 license.
// For all details and documentation:
// <http://neocotic.com/html.md>
-(function(){var t,e,i,s,n,o,r,h,a,u,p,l,c,d,f,E,N,g,y,m,L={}.hasOwnProperty,T=this;t={absolute:!1,debug:!1},s=this.md,o={"\\\\":"\\\\","\\[":"\\[","\\]":"\\]",">":"\\>",_:"\\_","\\*":"\\*","`":"\\`","#":"\\#","([0-9])\\.(\\s|$)":"$1\\.$2","©":"(c)","®":"(r)","™":"(tm)"," ":" ","·":"\\*"," ":" "," ":" "," ":" ","‘":"'","’":"'","“":'"',"”":'"',"…":"...","–":"--","—":"---"},r=/(display|visibility)\s*:\s*[a-z]+/gi,h=/(none|hidden)\s*$/i,a=/^(APPLET|AREA|AUDIO|BUTTON|CANVAS|COMMAND|DATALIST|EMBED|HEAD|INPUT|KEYGEN|MAP|MENU|METER|NOFRAMES|NOSCRIPT|OBJECT|OPTGROUP|OPTION|PARAM|PROGRESS|RP|RT|RUBY|SCRIPT|SELECT|SOURCE|STYLE|TEXTAREA|TITLE|TRACK|VIDEO)$/,u=/^(ADDRESS|ARTICLE|ASIDE|DIV|FIELDSET|FOOTER|HEADER|NAV|P|SECTION)$/,n=function(){f={};for(c in o)L.call(o,c)&&(E=o[c],f[c]=RegExp(c,"g"));return f}(),N="undefined"!=typeof window&&null!==window?window:null,("undefined"==typeof window||null===window)&&(l=require("jsdom"),p=l.jsdom(null,null,{features:{FetchExternalResources:!1}}),N=p.createWindow()),i=null!=(g=N.Node)?g:{},null==(y=i.ELEMENT_NODE)&&(i.ELEMENT_NODE=1),null==(m=i.TEXT_NODE)&&(i.TEXT_NODE=3),e=function(){function e(e,i){var s;this.html=null!=e?e:"",this.options=null!=i?i:{},this.atLeft=this.atNoWS=this.atP=!0,this.buffer="",this.exceptions=[],this.inCode=this.inPre=this.inOrderedList=this.parsed=!1,this.last=null,this.left="\n",this.links=[],this.linkMap={},this.unhandled={},"object"!=typeof this.options&&(this.options={});for(c in t)L.call(t,c)&&(s=t[c],this.options.hasOwnProperty(c)||(this.options[c]=s))}return e.prototype.append=function(t){return null!=this.last&&(this.buffer+=this.last),this.last=t},e.prototype.attr=function(t,e,i){return null==i&&(i=!0),i?t[e]:"function"==typeof t.getAttribute?t.getAttribute(e):void 0},e.prototype.br=function(){return this.append(" "+this.left),this.atLeft=this.atNoWS=!0},e.prototype.code=function(){var t,e=this;return t=this.inCode,this.inCode=!0,function(){return e.inCode=t}},e.prototype.inCodeProcess=function(t){return t.replace(/`/g,"\\`")},e.prototype.isVisible=function(t){var e,i,s,n,o,a,u,p;if(n=this.attr(t,"style",!1),i=null!=n?n.match(r):void 0,a=!0,null!=i)for(u=0,p=i.length;p>u;u++)s=i[u],a=!h.test(s);if(a&&null!=N.getComputedStyle)try{n=N.getComputedStyle(t,null),"function"==typeof(null!=n?n.getPropertyValue:void 0)&&(e=n.getPropertyValue("display"),o=n.getPropertyValue("visibility"),a="none"!==e&&"hidden"!==o)}catch(l){this.thrown(l,"getComputedStyle")}return a},e.prototype.nonPreProcess=function(t){t=t.replace(/\n([ \t]*\n)+/g,"\n"),t=t.replace(/\n[ \t]+/g,"\n"),t=t.replace(/[ \t]+/g," ");for(c in o)L.call(o,c)&&(E=o[c],t=t.replace(n[c],E));return t},e.prototype.ol=function(){var t,e=this;return t=this.inOrderedList,this.inOrderedList=!0,function(){return e.inOrderedList=t}},e.prototype.output=function(t){return t&&(this.inPre||(t=this.atNoWS?t.replace(/^[ \t\n]+/,""):/^[ \t]*\n/.test(t)?t.replace(/^[ \t\n]+/,"\n"):t.replace(/^[ \t]+/," ")),""!==t)?(this.atP=/\n\n$/.test(t),this.atLeft=/\n$/.test(t),this.atNoWS=/[ \t\n]$/.test(t),this.append(t.replace(/\n/g,this.left))):void 0},e.prototype.outputLater=function(t){var e=this;return function(){return e.output(t)}},e.prototype.p=function(){return this.atP?void 0:(this.atLeft||(this.append(this.left),this.atLeft=!0),this.append(this.left),this.atNoWS=this.atP=!0)},e.prototype.parse=function(){var t,e,i,s,n,o,r,h;if(!this.html)return"";if(this.parsed)return this.buffer;if(t=N.document.createElement("div"),"string"==typeof this.html?t.innerHTML=this.html:t.appendChild(this.html),this.process(t),this.links.length)for(this.append("\n\n"),h=this.links,e=o=0,r=h.length;r>o;e=++o)i=h[e],i&&this.append("["+e+"]: "+i+"\n");return this.options.debug&&(n=function(){var t,e;t=this.unhandled,e=[];for(s in t)L.call(t,s)&&e.push(s);return e}.call(this).sort(),n.length?console.log("Ignored tags;\n"+n.join(", ")):console.log("No tags were ignored"),this.exceptions.length?console.log("Exceptions;\n"+this.exceptions.join("\n")):console.log("No exceptions were thrown")),this.append(""),this.parsed=!0,this.buffer=this.buffer.trim()},e.prototype.pre=function(){var t,e=this;return t=this.inPre,this.inPre=!0,function(){return e.inPre=t}},e.prototype.process=function(t){var e,s,n,o,r,h,p,l,c,d,f,E,N,g,y,m;if(this.isVisible(t)){if(t.nodeType===i.ELEMENT_NODE){c=!1;try{if(a.test(t.tagName))c=!0;else if(/^H[1-6]$/.test(t.tagName))l=parseInt(t.tagName.match(/([1-6])$/)[1]),this.p(),this.output(""+function(){var t,e;for(e=[],h=t=1;l>=1?l>=t:t>=l;h=l>=1?++t:--t)e.push("#");return e}().join("")+" ");else if(u.test(t.tagName))this.p();else switch(t.tagName){case"BODY":case"FORM":break;case"DETAILS":this.p(),this.attr(t,"open",!1)||(c=!0,f=t.getElementsByTagName("summary")[0],f&&this.process(f));break;case"BR":this.br();break;case"HR":this.p(),this.output("---"),this.p();break;case"CITE":case"DFN":case"EM":case"I":case"U":case"VAR":this.output("_"),this.atNoWS=!0,e=this.outputLater("_");break;case"DT":case"B":case"STRONG":"DT"===t.tagName&&this.p(),this.output("**"),this.atNoWS=!0,e=this.outputLater("**");break;case"Q":this.output('"'),this.atNoWS=!0,e=this.outputLater('"');break;case"OL":case"PRE":case"UL":s=this.pushLeft(" "),n=function(){switch(t.tagName){case"OL":return this.ol();case"PRE":return this.pre();case"UL":return this.ul()}}.call(this),e=function(){return s(),n()};break;case"LI":this.replaceLeft(this.inOrderedList?"1. ":"* ");break;case"CODE":case"KBD":case"SAMP":this.inPre||(this.output("`"),s=this.code(),n=this.outputLater("`"),e=function(){return s(),n()});break;case"BLOCKQUOTE":case"DD":e=this.pushLeft("> ");break;case"A":if(r=this.attr(t,"href",this.options.absolute),!r)break;E=this.attr(t,"title"),E&&(r+=' "'+E+'"'),null!=this.linkMap[r]?p=this.linkMap[r]:(p=this.links.push(r)-1,this.linkMap[r]=p),this.output("["),this.atNoWS=!0,e=this.outputLater("]["+p+"]");break;case"IMG":if(c=!0,d=this.attr(t,"src",this.options.absolute),!d)break;this.output("!["+this.attr(t,"alt")+"]("+d+")");break;case"FRAME":case"IFRAME":c=!0;try{(null!=(y=t.contentDocument)?y.documentElement:void 0)&&this.process(t.contentDocument.documentElement)}catch(L){this.thrown(L,"contentDocument")}break;case"TR":e=this.p;break;default:this.options.debug&&(this.unhandled[t.tagName]=null)}}catch(L){this.thrown(L,t.tagName)}if(!c)for(m=t.childNodes,N=0,g=m.length;g>N;N++)o=m[N],this.process(o);return null!=e?e.call(this):void 0}return t.nodeType===i.TEXT_NODE?this.inPre?this.output(t.nodeValue):this.inCode?this.output(this.inCodeProcess(t.nodeValue)):this.output(this.nonPreProcess(t.nodeValue)):void 0}},e.prototype.pushLeft=function(t){var e,i=this;return e=this.left,this.left+=t,this.atP?this.append(t):this.p(),function(){return i.left=e,i.atLeft=i.atP=!1,i.p()}},e.prototype.replaceLeft=function(t){return this.atLeft?this.last?this.last=this.last.replace(/[ ]{4}$/,t):void 0:(this.append(this.left.replace(/[ ]{4}$/,t)),this.atLeft=this.atNoWS=this.atP=!0)},e.prototype.thrown=function(t,e){return this.options.debug?this.exceptions.push(""+e+": "+t):void 0},e.prototype.ul=function(){var t,e=this;return t=this.inOrderedList,this.inOrderedList=!1,function(){return e.inOrderedList=t}},e}(),this.md=d=function(t,i){return new e(t,i).parse()},("undefined"!=typeof module&&null!==module?module.exports:void 0)?module.exports=d:"function"==typeof define&&define.amd&&define("md",function(){return d}),d.VERSION="2.0.1",d.noConflict=function(){return T.md=s,d}}).call(this);
+(function(){var t,e,i,s,n,o,r,h,a,u,p,l,c,d,f,E,N,g,y,m,L={}.hasOwnProperty,T=this;t={absolute:!1,debug:!1},s=this.md,o={"\\\\":"\\\\","\\[":"\\[","\\]":"\\]",">":"\\>",_:"\\_","\\*":"\\*","`":"\\`","#":"\\#","([0-9])\\.(\\s|$)":"$1\\.$2","©":"(c)","®":"(r)","™":"(tm)"," ":" ","·":"\\*"," ":" "," ":" "," ":" ","‘":"'","’":"'","“":'"',"”":'"',"…":"...","–":"--","—":"---"},r=/(display|visibility)\s*:\s*[a-z]+/gi,h=/(none|hidden)\s*$/i,a=/^(APPLET|AREA|AUDIO|BUTTON|CANVAS|COMMAND|DATALIST|EMBED|HEAD|INPUT|KEYGEN|MAP|MENU|METER|NOFRAMES|NOSCRIPT|OBJECT|OPTGROUP|OPTION|PARAM|PROGRESS|RP|RT|RUBY|SCRIPT|SELECT|SOURCE|STYLE|TEXTAREA|TITLE|TRACK|VIDEO)$/,u=/^(ADDRESS|ARTICLE|ASIDE|DIV|FIELDSET|FOOTER|HEADER|NAV|P|SECTION)$/,n=function(){f={};for(c in o)L.call(o,c)&&(E=o[c],f[c]=RegExp(c,"g"));return f}(),N="undefined"!=typeof window&&null!==window?window:null,("undefined"==typeof window||null===window)&&(l=require("jsdom"),p=l.jsdom(null,null,{features:{FetchExternalResources:!1}}),N=p.createWindow()),i=null!=(g=N.Node)?g:{},null==(y=i.ELEMENT_NODE)&&(i.ELEMENT_NODE=1),null==(m=i.TEXT_NODE)&&(i.TEXT_NODE=3),e=function(){function e(e,i){var s;this.html=null!=e?e:"",this.options=null!=i?i:{},this.atLeft=this.atNoWS=this.atP=!0,this.buffer="",this.exceptions=[],this.inCode=this.inPre=this.inOrderedList=this.parsed=!1,this.last=null,this.left="\n",this.links=[],this.linkMap={},this.unhandled={},"object"!=typeof this.options&&(this.options={});for(c in t)L.call(t,c)&&(s=t[c],this.options.hasOwnProperty(c)||(this.options[c]=s))}return e.prototype.append=function(t){return null!=this.last&&(this.buffer+=this.last),this.last=t},e.prototype.attr=function(t,e,i){return null==i&&(i=!0),i?t[e]:"function"==typeof t.getAttribute?t.getAttribute(e):void 0},e.prototype.br=function(){return this.append(" "+this.left),this.atLeft=this.atNoWS=!0},e.prototype.code=function(){var t,e=this;return t=this.inCode,this.inCode=!0,function(){return e.inCode=t}},e.prototype.inCodeProcess=function(t){return t.replace(/`/g,"\\`")},e.prototype.isVisible=function(t){var e,i,s,n,o,a,u,p;if(n=this.attr(t,"style",!1),i=null!=n?n.match(r):void 0,a=!0,null!=i)for(u=0,p=i.length;p>u;u++)s=i[u],a=!h.test(s);if(a&&null!=N.getComputedStyle)try{n=N.getComputedStyle(t,null),"function"==typeof(null!=n?n.getPropertyValue:void 0)&&(e=n.getPropertyValue("display"),o=n.getPropertyValue("visibility"),a="none"!==e&&"hidden"!==o)}catch(l){this.thrown(l,"getComputedStyle")}return a},e.prototype.nonPreProcess=function(t){t=t.replace(/\n([ \t]*\n)+/g,"\n"),t=t.replace(/\n[ \t]+/g,"\n"),t=t.replace(/[ \t]+/g," ");for(c in o)L.call(o,c)&&(E=o[c],t=t.replace(n[c],E));return t},e.prototype.ol=function(){var t,e=this;return t=this.inOrderedList,this.inOrderedList=!0,function(){return e.inOrderedList=t}},e.prototype.output=function(t){return t&&(this.inPre||(t=this.atNoWS?t.replace(/^[ \t\n]+/,""):/^[ \t]*\n/.test(t)?t.replace(/^[ \t\n]+/,"\n"):t.replace(/^[ \t]+/," ")),""!==t)?(this.atP=/\n\n$/.test(t),this.atLeft=/\n$/.test(t),this.atNoWS=/[ \t\n]$/.test(t),this.append(t.replace(/\n/g,this.left))):void 0},e.prototype.outputLater=function(t){var e=this;return function(){return e.output(t)}},e.prototype.p=function(){return this.atP?void 0:(this.atLeft||(this.append(this.left),this.atLeft=!0),this.append(this.left),this.atNoWS=this.atP=!0)},e.prototype.parse=function(){var t,e,i,s,n,o,r,h;if(!this.html)return"";if(this.parsed)return this.buffer;if(t=N.document.createElement("div"),"string"==typeof this.html?t.innerHTML=this.html:t.appendChild(this.html),this.process(t),this.links.length)for(this.append("\n\n"),h=this.links,e=o=0,r=h.length;r>o;e=++o)i=h[e],i&&this.append("["+e+"]: "+i+"\n");return this.options.debug&&(n=function(){var t,e;t=this.unhandled,e=[];for(s in t)L.call(t,s)&&e.push(s);return e}.call(this).sort(),n.length?console.log("Ignored tags;\n"+n.join(", ")):console.log("No tags were ignored"),this.exceptions.length?console.log("Exceptions;\n"+this.exceptions.join("\n")):console.log("No exceptions were thrown")),this.append(""),this.parsed=!0,this.buffer=this.buffer.trim()},e.prototype.pre=function(){var t,e=this;return t=this.inPre,this.inPre=!0,function(){return e.inPre=t}},e.prototype.process=function(t){var e,s,n,o,r,h,p,l,c,d,f,E,N,g,y,m;if(this.isVisible(t)){if(t.nodeType===i.ELEMENT_NODE){c=!1;try{if(a.test(t.tagName))c=!0;else if(/^H[1-6]$/.test(t.tagName))l=parseInt(t.tagName.match(/([1-6])$/)[1]),this.p(),this.output(""+function(){var t,e;for(e=[],h=t=1;l>=1?l>=t:t>=l;h=l>=1?++t:--t)e.push("#");return e}().join("")+" ");else if(u.test(t.tagName))this.p();else switch(t.tagName){case"BODY":case"FORM":break;case"DETAILS":this.p(),this.attr(t,"open",!1)||(c=!0,f=t.getElementsByTagName("summary")[0],f&&this.process(f));break;case"BR":this.br();break;case"HR":this.p(),this.output("---"),this.p();break;case"CITE":case"DFN":case"EM":case"I":case"U":case"VAR":this.output("_"),this.atNoWS=!0,e=this.outputLater("_");break;case"DT":case"B":case"STRONG":"DT"===t.tagName&&this.p(),this.output("**"),this.atNoWS=!0,e=this.outputLater("**");break;case"Q":this.output('"'),this.atNoWS=!0,e=this.outputLater('"');break;case"OL":case"PRE":case"UL":s=this.pushLeft(" "),n=function(){switch(t.tagName){case"OL":return this.ol();case"PRE":return this.pre();case"UL":return this.ul()}}.call(this),e=function(){return s(),n()};break;case"LI":this.replaceLeft(this.inOrderedList?"1. ":"* ");break;case"CODE":case"KBD":case"SAMP":this.inPre||(this.output("`"),s=this.code(),n=this.outputLater("`"),e=function(){return s(),n()});break;case"BLOCKQUOTE":case"DD":e=this.pushLeft("> ");break;case"A":if(r=this.attr(t,"href",this.options.absolute),!r)break;E=this.attr(t,"title"),E&&(r+=' "'+E+'"'),null!=this.linkMap[r]?p=this.linkMap[r]:(p=this.links.push(r)-1,this.linkMap[r]=p),this.output("["),this.atNoWS=!0,e=this.outputLater("]["+p+"]");break;case"IMG":if(c=!0,d=this.attr(t,"src",this.options.absolute),!d)break;this.output("!["+this.attr(t,"alt")+"]("+d+")");break;case"FRAME":case"IFRAME":c=!0;try{(null!=(y=t.contentDocument)?y.documentElement:void 0)&&this.process(t.contentDocument.documentElement)}catch(L){this.thrown(L,"contentDocument")}break;case"TR":e=this.p;break;default:this.options.debug&&(this.unhandled[t.tagName]=null)}}catch(L){this.thrown(L,t.tagName)}if(!c)for(m=t.childNodes,N=0,g=m.length;g>N;N++)o=m[N],this.process(o);return null!=e?e.call(this):void 0}return t.nodeType===i.TEXT_NODE?this.inPre?this.output(t.nodeValue):this.inCode?this.output(this.inCodeProcess(t.nodeValue)):this.output(this.nonPreProcess(t.nodeValue)):void 0}},e.prototype.pushLeft=function(t){var e,i=this;return e=this.left,this.left+=t,this.atP?this.append(t):this.p(),function(){return i.left=e,i.atLeft=i.atP=!1,i.p()}},e.prototype.replaceLeft=function(t){return this.atLeft?this.last?this.last=this.last.replace(/[ ]{4}$/,t):void 0:(this.append(this.left.replace(/[ ]{4}$/,t)),this.atLeft=this.atNoWS=this.atP=!0)},e.prototype.thrown=function(t,e){return this.options.debug?this.exceptions.push(""+e+": "+t):void 0},e.prototype.ul=function(){var t,e=this;return t=this.inOrderedList,this.inOrderedList=!1,function(){return e.inOrderedList=t}},e}(),this.md=d=function(t,i){return new e(t,i).parse()},("undefined"!=typeof module&&null!==module?module.exports:void 0)?module.exports=d:"function"==typeof define&&define.amd&&define("md",function(){return d}),d.VERSION="2.0.2",d.noConflict=function(){return T.md=s,d}}).call(this);
View
102 docs/md.1
@@ -0,0 +1,102 @@
+.TH MD 1 "February 2013" "" "General Commands Manual"
+
+.SH NAME
+.B md
+\- HTML to Markdown converter
+
+.SH SYNOPSIS
+
+.B md
+[
+.B \-adlp
+]
+[
+.B \-o
+.I output_dir
+]
+[
+.I paths
+]
+.br
+ [
+.B \-dp
+]
+[
+.B \-e
+.I html
+]
+.br
+ [
+.B \-v
+]
+
+.SH DESCRIPTION
+
+html.md is a JavaScript library which allows HTML to be
+converted into valid Markdown. It also supports file
+systems to provide a complete command line utility.
+
+.SH OPTIONS
+
+.TP 15
+.B \-a/\-\-absolute
+Always use absolute URLs for converted links.
+
+.TP
+.B \-d/\-\-debug
+Debug mode. Causes
+.B md
+to print debugging messages about its progress.
+
+.HP
+.B \-e/\-\-eval
+.I html
+.br
+Specifies the HTML string to be evaluated.
+
+.TP
+.B \-l/\-\-long-ext
+Generated Markdown files should have the long file
+extension. When used, files will be created in the
+.I output_dir
+will have a .markdown file extension.
+
+.HP
+.B \-o/\-\-output
+.I output_dir
+.br
+Specifies the output directory to which generated
+Markdown files will be created.
+
+.TP
+.B \-p/\-\-print
+Print out converted Markdown to the
+.B stdout
+stream.
+
+.TP
+.B \-v/\-\-version
+Display the version number and exit.
+
+.SH BUGS
+
+Inline HTML is not yet supported in the resulting
+Markdown.
+
+.SH CAVEATS
+
+It is always recommended to pair option
+.B \-p
+with
+.B \-e
+otherwise
+.B md
+does all of the work but you won't see the outcome.
+
+.SH AUTHOR
+
+Alasdair Mercer <
+.I mercer.alasdair@gmail.com
+> (
+.I http://neocotic.com
+)
View
6 docs/md.html
@@ -1,5 +1,5 @@
-<!DOCTYPE html> <html> <head> <title>md.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> md.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p><a href="http://neocotic.com/html.md">html.md</a> 2.0.1 <br />
-(c) 2012 Alasdair Mercer <br />
+<!DOCTYPE html> <html> <head> <title>md.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> md.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p><a href="http://neocotic.com/html.md">html.md</a> 2.0.2 <br />
+(c) 2013 Alasdair Mercer <br />
Freely distributable under the MIT license. <br />
Based on <a href="http://homepage.mac.com/tjim/">Make.text</a> 1.5 <br />
(c) 2007 Trevor Jim <br />
@@ -311,7 +311,7 @@
<span class="k">new</span> <span class="nx">HtmlParser</span><span class="p">(</span><span class="nx">html</span><span class="p">,</span> <span class="nx">options</span><span class="p">).</span><span class="nx">parse</span><span class="p">()</span></pre></div> </td> </tr> <tr id="section-37"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-37">&#182;</a> </div> <p>Export <code>md</code> for NodeJS and CommonJS.</p> </td> <td class="code"> <div class="highlight"><pre><span class="k">if</span> <span class="nx">module</span><span class="o">?</span><span class="p">.</span><span class="nx">exports</span>
<span class="nv">module.exports = </span><span class="nx">md</span>
<span class="k">else</span> <span class="k">if</span> <span class="k">typeof</span> <span class="nx">define</span> <span class="o">is</span> <span class="s">&#39;function&#39;</span> <span class="o">and</span> <span class="nx">define</span><span class="p">.</span><span class="nx">amd</span>
- <span class="nx">define</span> <span class="s">&#39;md&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">md</span></pre></div> </td> </tr> <tr id="section-38"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-38">&#182;</a> </div> <h2>Public constants</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-39"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-39">&#182;</a> </div> <p>Current version of html.md.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">md.VERSION = </span><span class="s">&#39;2.0.1&#39;</span></pre></div> </td> </tr> <tr id="section-40"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-40">&#182;</a> </div> <h2>Public functions</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-41"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-41">&#182;</a> </div> <p>Run html.md in <em>noConflict</em> mode, returning the <code>md</code> variable to its
+ <span class="nx">define</span> <span class="s">&#39;md&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">md</span></pre></div> </td> </tr> <tr id="section-38"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-38">&#182;</a> </div> <h2>Public constants</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-39"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-39">&#182;</a> </div> <p>Current version of html.md.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">md.VERSION = </span><span class="s">&#39;2.0.2&#39;</span></pre></div> </td> </tr> <tr id="section-40"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-40">&#182;</a> </div> <h2>Public functions</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-41"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-41">&#182;</a> </div> <p>Run html.md in <em>noConflict</em> mode, returning the <code>md</code> variable to its
previous owner. <br />
Returns a reference to <code>md</code>.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">md.noConflict = </span><span class="o">=&gt;</span>
<span class="vi">@md = </span><span class="nx">PREVIOUS_MD</span>
View
6 lib/md.js
@@ -1,5 +1,5 @@
-// [html.md](http://neocotic.com/html.md) 2.0.1
-// (c) 2012 Alasdair Mercer
+// [html.md](http://neocotic.com/html.md) 2.0.2
+// (c) 2013 Alasdair Mercer
// Freely distributable under the MIT license.
// Based on [Make.text](http://homepage.mac.com/tjim/) 1.5
// (c) 2007 Trevor Jim
@@ -537,7 +537,7 @@
});
}
- md.VERSION = '2.0.1';
+ md.VERSION = '2.0.2';
md.noConflict = function() {
_this.md = PREVIOUS_MD;
View
5 package.json
@@ -1,7 +1,7 @@
{
"name": "html-md"
, "description": "JavaScript library for converting HTML in to valid Markdown"
- , "version": "2.0.1"
+ , "version": "2.0.2"
, "homepage": "http://neocotic.com/html.md"
, "bugs": {
"url": "https://github.com/neocotic/html.md/issues"
@@ -42,8 +42,9 @@
, "scripts": {
"test": "tap ./test"
}
+ , "man": "./docs/md.1"
, "bin": {
"md": "./bin/md"
}
, "main": "./lib/md"
-}
+}
View
6 src/md.coffee
@@ -1,5 +1,5 @@
-# [html.md](http://neocotic.com/html.md) 2.0.1
-# (c) 2012 Alasdair Mercer
+# [html.md](http://neocotic.com/html.md) 2.0.2
+# (c) 2013 Alasdair Mercer
# Freely distributable under the MIT license.
# Based on [Make.text](http://homepage.mac.com/tjim/) 1.5
# (c) 2007 Trevor Jim
@@ -418,7 +418,7 @@ else if typeof define is 'function' and define.amd
# ----------------
# Current version of html.md.
-md.VERSION = '2.0.1'
+md.VERSION = '2.0.2'
# Public functions
# ----------------
Something went wrong with that request. Please try again.