Copy and Paste Minimal Dependencies

Sometimes less is more

Dependency management is one of the most complex and onerous parts of programming. One issue that makes it complex, is that all the different dependencies will have different versions, and each has their own process for releasing new versions, etc. Sometimes these updates are critical, like security threats.

Another option is to simply minimize dependencies altogether. That was my goal with this project: Simple Markdown Example

Sometimes you don’t actually need to do as much as you think you do. Minimalism works very well if your goals are more abstract than concrete.

var md_subs = [
/\n(\s*)[\*\-](.*)/g, '\n<ul><li>$2</li></ul>',
/\n+\n(?=[^#\n])/g, "\n\n<p>", /\n+\n/g, "\n",
/(\n|^)# (.*)/g, "\n<h1 id=\"$2\">$2</h1><hr>",
/(\n|^)## (.*)/g, "\n<h1 id=\"$2\">$2</h2>",
/(\n|^)### (.*)/g, "\n<h2 id=\"$2\">$2</h3>",
/(\n|^)#### (.*)/g, "\n<h3 id=\"$2\">$2</h3>", /(\n|^)##### (.*)/g, "\n<h4 id=\"$2\">$2</h4>",
/(\n|^)###### (.*)/g, "\n<h5 id=\"$2\">$2</h5>", /__([^_\n]*)__/g, "<b>$1</b>",
/\*\*([^_\n]*)\*\*/g, "<b>$1</b>",
/_([^_\n]*)_/g, "<i>$1</i>", /\*([^_\n]*)\*/g, "<i>$1</i>", /\[([^\]\n]*)\]\(([^\)\n]*)\)/g, "<a href=\"$2\">$1</a>", ]; window.addEventListener("load", browser_init); function markdown(text){ for(var i=0; i<md_subs.length-1; i += 2){ var search = md_subs[i]; var replace = md_subs[i+1]; text = text.replace(search, replace); } return text; } function browser_init(){ var elems = document.getElementsByClassName("markdown-text"); for(var i=0; i<elems.length; ++i){ var elem = elems[i]; elem.innerHTML = markdown(elem.innerHTML); } } </script></head><body class="markdown-text"># Standalone Markdown## Example This is a standalone markdown example</body></html>



Technology, programming, and social economy.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store