Advertising
Advertising

Use Markdown For Easy Web Writing

Use Markdown For Easy Web Writing

    In listening to a bunch of Mac-centric podcasts lately, especially on workflows with the Mac, I have come across a tool that has been around for a while but is still not extremely popular with everyone. The tool is called Markdown and was created by John Gruber (Daring Fireball fame). The best way to explain it is the first paragraph from Markdown’s description on Mr. Gruber’s page:

    Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML).

    Yeah that is it in a nutshell. Before I jump in how to use this awesome tool on Mac and Windows, you may be wondering what the point of a tool like this actually is.

    What’s the point?

    At first I didn’t get the reason for using Markdown. Cool, you can transfer plain text stuff into HTML, but who the hell uses HTML anymore? Well, if you are a web writer you use HTML every single day whether you know it or not and if you have used WordPress or any other CMS for any length of time you have most likely had to tweak some HTML.

    If you are using WordPress there is nothing more agrevating than the WYSIWYG editor becoming too helpful with HTML tags in the background essentially destorying your formatting. Markdown can help you by transforming your text file into valid HTML. This allows you to paste your HTML into the HTML editor thus keeping your hard-won formatting. So nice.

    Advertising

    Also, there is something to say for document portability. HTML is an agnostic type of document markup and can be rendered in pretty much any crappy web browser. With the continued use of many different operating systems and devices out in the wild (iOS, Android, Blackberry, Windows, Mac, Linux, etc) the need for a standard format for text is highly needed. Markdown helps this along by allowing you to standardized all your note formatting without locking you in to some proprietary format. Just HTML and txt files.

    Let’s use it, shall we?

    Markdown is pretty darn easy to use and if you have any experience messing aroudn with software and HTML it will be a snap. Markdown is written in Perl, so if you don’t have Perl on your Windows machine you can download and install Strawberry Perl from here. If you are a Mac user, Perl is already installed for you.

    Next, go over to Daring Fireball and grab the Markdown.pl script, unzip it and put the Markdown.pl file in the directory that you will use to create and tranform your input text files.

    Now the fun part; learning how to use the syntax and creating your input text file.

    Markdown syntax

    I am going to briefly explain some of the most used syntax snippets that will get you off an running with Markdown. If you want the whole shebang, head on over to Daring Fireball to get a detailed list of all the niceties of the Markdown syntax.

    Headers

    Headers tags (h1, h2, h3, etc) are simple to create in your text document. To signify the h1 tag, “underline” the text with the ‘=’ sign:

    Advertising

    This is a h1 header
    ===================
    

    or for h2 use the ‘-‘ character:

    This is a h2 header
    -------------------
    

    You don’t need to put the same amount of ‘=’ or ‘-‘ characters under the heading; any number will due to produce the header tags.

    Bullets and lists

    I think in bullets and lists so it’s nice that Markdown handles them well. To insert a bullet append an asterisk to your line like this:

    * This is my point
    

    You can also use the ‘+’ or ‘-‘ characters as bullets.

    Ordered lists are easy too:

    1. Number one
    2. Number two
    3. Number three... now you got it!
    

    If you want multiple paragraphs under a bullet or number just indent the first line of each paragraph or indent all the lines if you want it to look nicer:

    Advertising

    1. Here is the first point that I am trying to make about numbered lists.
    
       By the way, I should probably mention this too.
    
    2. Next point
    

    Links

    One of my favorite things of Markdown is the easy way to insert links. First, bracket the word or phrase that you would like to be “clickable” and then follow that by a parenthesized URL:

    [click here](http://www.google.com/)
    

    Outputting to HTML

    After you have created your text file it is now time to pass it to the Markdown.pl script to produce your HTML output. If you didn’t create a text file to test, you can download the quick text file that I created to try it out.

    Place your text file in the same directory as the Markdown.pl script (you can pass the arguments with the correct path if you want to, this is just to make it easier). After that is done open up your command prompt in Windows or your terminal on your Mac or Linux and navigate to the folder with your input file.

    To create the output directly in the terminal window use the following command:

    perl Markdown.pl input.txt

    This will then parse the text file and output the valid HTML markup to the terminal. If you want the ouput to be directed towards a totally seperate HTML file type the following command:

    Advertising

    perl Markdown.pl input.txt > output.html

    This will create the HTML file output.html in whatever directory you are currently in.

    Wrapping it up

    Let me just say that if you think Markdown is interesting and understand the utility of it, I highly suggest that if you write anything you should write it with Markdow

    n syntax. It is cross-platform, open source, free, and compatible with everything. To me it is a game changer and I feel like I am a little behind in not utilizing it sooner. Once again, there is much more to the syntax than I have highlighted here, so check out Daring Fireball for more.

    By the way, I wrote this entire article using Markdown and if you want to see the syntax you can download it here.

    More by this author

    CM Smith

    A technologist and writer who shares advice on personal productivity, creativity and how to use technology to get things done.

    Design Is Important: How To Fail At Blogging 7 Tools to Help Keep Track of Goals and Habits Effectively 6 Unexpected Ways Journaling Every Day Will Make Your Life Better Why Getting Things Done is the Best Productivity System For You How to Beat Procrastination: 29 Ways to Beat It Once and for All To Automate or not to Automate Your Personal Productivity System

    Trending in Productivity

    1 The Daily Rituals of 7 Successful CEOs 2 What Does Success Look Like? Revealed by 12 Highly Successful People 3 The Ultimate Night Routine Guide: Sleep Better and Wake Up Productive 4 4 Critical Ways You Can Stop Wasting Time Today 5 Stop Waiting For Your Dream Job and Go Ask For It

    Read Next

    Advertising
    Advertising
    Advertising

    Last Updated on May 16, 2019

    The Daily Rituals of 7 Successful CEOs

    The Daily Rituals of 7 Successful CEOs

    One of my favorite success quotes ever comes from one of the original and most successful ‘CEOs’ of his era: Aristotle. Here’s what he said:

    “We are what we repeatedly do. Excellence, then, is not an act, but a habit.”

    This advice is just as sound today as it was when Aristotle first expressed it, way back when. I’m reminded of this at least once a week, when I interview an inspiring author, leader, or successful CEO on my show. I ask my guests a series of questions about what has contributed to their success and their ability to build something meaningful.

    Advertising

    You want to know what nearly all of them say? Almost every time, they respond by telling me that their success is the result of simple habits  enacted day after day.

    These quotes from seven successful CEOs demonstrate the daily rituals that have contributed to their success:

    1. Promote what you love.

    “It’s so much better to promote what you love than to bash what you hate.” – Jessica Alba, CEO of The Honest Company

    2. Develop a feedback loop.

    “I think it’s very important to have a feedback loop, where you’re constantly thinking about what you’ve done and how you could be doing it better. I think that’s the single best piece of advice: constantly think about how you could be doing things better and questioning yourself.” – Elon Musk, CEO of TESLA Motors

    3. Create things that are better, not just “different.”

    “Our task today is to find singular ways to create the new things that will make the future not just different, but better—to go from 0 to 1. The essential first step is to think for yourself. Only by seeing our world anew, as fresh and strange as it was to the ancients who saw it first, can we both re-create it and preserve it for the future.” – Peter Thiel, CEO of Palantir and best-selling author of Zero To One.

    4. Meditate.

    “Meditate. Breathe consciously. Listen. Pay attention. Treasure every moment. Make the connection.” – Oprah Winfrey, CEO of OWN Network

    5. Read every day.

    “Read 500 pages every day. That’s how knowledge works. It builds up like compound interest.”-Warren Buffet, CEO of investment firm Berkshire-Hathaway

    6. Block time for email.

    “Set aside a 20- to 30-minute chunk of time two or three times a day for email. Do not check continually through the day.” – Doug Camplejohn, CEO of predictive lead marketing company FlipTop.

    7. Make your customers happy.

    “We see our customers as invited guests to a party, and we are the hosts. It’s our job every day to make every important aspect of the customer experience a little bit better.” – Jeff Bezos, CEO of Amazon.com

    Develop the right rituals. Become a successful CEO.

    If the majority of these daily habits are new to you, avoid making the crucial mistake of adopting all of these habits at once. Research on habit-formation indicates that lasting habits are formed one at a time.

    Advertising

    For example, let’s say you’re excited about developing the following daily habits:

    • daily reading,
    • daily meditation, and
    • updating your to-do list every night

    Let’s say that daily reading is the one that excites you the most out of the three habits noted above. It would be wise of you to begin by choosing and scheduling time to read every day, and then sticking to that time until it becomes a habit. Once it feels effortless and automatic, you’ll know that you’ve turned it into a daily habit. Now you’re ready to install the next habit… and the next… Until before you know it, you’ll start looking in the mirror and seeing the reflection of a successful CEO.

    Featured photo credit: Amy Hirschi via unsplash.com

    Advertising

    Read Next