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

    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 Top 10 Productivity Tools to Help You Achieve 10x More in Less Time

    Trending in Productivity

    1 10 Steps For Success: Applying The Power Of Your Subconscious Mind 2 How to Lead a Team More Effectively and Be a True Leader at Work 3 How to Live up to Your Full Potential and Succeed in Life 4 How to Flow Your Way to a More Productive Life 5 How to Overcome Limiting Beliefs That Hold You Back from Success

    Read Next

    Advertising
    Advertising

    Last Updated on December 7, 2018

    10 Steps For Success: Applying The Power Of Your Subconscious Mind

    10 Steps For Success: Applying The Power Of Your Subconscious Mind

    How big is the gap between you and your success?

    What is the difference between successful people and unsuccessful people?

    It is as simple as this: successful people think and talk about what they are creating, and unsuccessful people focus on and talk about what they’re lacking.

    So how do you bridge that gap between wanting success and having your success? Let’s make an important distinction. You see, there is a big difference between “Wanting” and “Having” something.

    Wanting: means lacking or absent. Deficient in some part, thing or aspect.

    Advertising

    Having: means to possess, to hold, to get, to receive, to experience.

    You can have one OR the other, but not both at the same time with any particular object of your desire. You either have it or you don’t.

    When it comes to your subconscious, if you’re focusing on the “wanting”, i.e. the not having, guess what, you will build stronger neural networks in your brain around the “wanting.” However, through the power of your subconscious mind, you can focus on the “having” as if it has already happened. Research has shown that your brain doesn’t know the difference between what you’re visualizing inside your mind versus what is happening out there in your reality.

    This is a regular practice of elite athletes. They spend as much timing creating the internal mental imagery of their success playing out as they do actually physically practicing. This helps create both the neural pathways in their brain and the muscle memory to consistently deliver on that success.

    Here are 10 “brain hack” steps for success that you can take to create your version of a happy life. Make these steps a regular habit, and you will be astonished at the results.

    Advertising

    Step 1: Decide exactly what you want to create and have

    This is usually the biggest problem that people have. They don’t know what they want and then they’re surprised when they don’t get it.

    Step 2: Write down your goal clearly in every technicolor detail

    A goal that is not written down is merely a wish. When you write it down in full detail, you signal to your subconscious mind that you really want to accomplish this particular goal.

    Step 3: Write your goal in simple, present tense words

    …that a three year old can understand on a three-by-five index card and carry it with you. Read it each morning after you awake and just before you go to sleep.

    Step 4: Backwards planning

    See your goal achieved and identify all the steps required that it took to bring it to life. Making a list of all these steps intensifies your desire and deepens your belief that the attainment of the goal is already happening.

    Step 5: Resolve to take at least one step every day from one of the items on your list

    Do something every day, even if it is just one baby step, that moves you toward your goal so you can maintain your momentum.

    Advertising

    Step 6: Visualize your goal repeatedly

    See it in your mind’s eye as though it were already a reality. The more clear and vivid your mental picture of your goal, the faster it will come into your life.

    Step 7: Feel the feeling of success as if your goal were realized at this very moment

    Feel the emotion of happiness, satisfaction, and pleasure that you would have once you have achieved your goal. Visualize and feel this success for at least 20 seconds at a time.

    Step 8: “Fake it till you make it!”

    Confidently behave as if your subconscious mind was already bringing your goal into reality. Accept that you are moving toward your goal and it is moving toward you.

    Step 9: Relax your mind

    Take time to breathe, pray or mediate each day. Disengage the stress response and engage the relaxation response. A quiet state of mind allows your brain to access newly formed neural pathways.

    Step 10: Release your goal to your subconscious mind

    When you turn your goal over to the power of the universe and just get out of the way, you will always know the right actions to take at the right time.

    Advertising

    Starting today, try tapping into the incredible power of your subconscious mind.Start with just one goal or idea, and practice it continually until you succeed in achieving that goal. Make it a game and have fun with it! The more lightly you hold it, the easier it will be to achieve. By doing so, you will move from the “positive thinking” of the hopeful person to the “positive knowing” of the totally successful person.

    Hit reply and let me know what you’re creating!

    To your success!

    Featured photo credit: use-your-brain-markgraf via mrg.bz

    Read Next