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.

    5 Project Management Tools to Get Your Team on Track To Automate or not to Automate Your Personal Productivity System How to Beat Procrastination: 29 Simple Tweaks to Make 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

    Trending in Productivity

    1 13 Productive Things to Do on a Sunday 2 Delegation of Authority: The Complete Guide for Effective Leaders 3 How to Be Successful Even When Others Don’t Think You Can Be 4 5 Steps to Building Confidence That Is Unshakeable 5 A Complete Guide to Goal Setting for Personal Success

    Read Next

    Advertising
    Advertising
    Advertising

    Published on October 16, 2020

    13 Productive Things to Do on a Sunday

    13 Productive Things to Do on a Sunday

    Sunday’s are amazing days. For most of us, Sunday’s are a day of rest — a chance to relax, spend time with our family and friends and step away from work. Yet, for many people, Sunday’s can be a day of gloom. The thought of having to go back to work the next day and rejoin the hustle and bustle of everyday working life creates a dark cloud over a day that should be a joy.

    With the right approach, though, Sunday’s can be days of rejuvenation—a chance to recharge our batteries—and to set ourselves up for a fantastic week. It is just a matter of the way you look at Sundays.

    Sunday’s give me a chance to take stock of how my week has gone and decide what I want to achieve the following week. Each Sunday allows me to step back from the everyday grind and to measure my progress against the plan I had for the week and to reset that plan to make the next week even better.

    Here are 13 ways you can turn Sunday’s into amazingly productive days:

    1. Wake up at Your Normal Time

    I grew up thinking Sunday’s were a great day to ‘catch-up on my sleep’. The problem here is by over-sleeping on a Sunday, you often find it difficult to get to sleep Sunday night and that begins the cycle of sleep debt you want to avoid.[1]

    Waking up at your normal time maintains regular sleep patterns and this helps to make sure your sleep schedule is consistent throughout the week. When you are in a perpetual sleep debt all week, your productivity will sink. Ensuring you have a good night sleep every night, keeps you in a highly productive state.

    2. Start the Day With “Me-Time”

    “Me-time” is time you give to yourself.[2] It’s time you can spend doing all the things you love doing without the fear of being interrupted. That could be exercise, reading, going for a long walk or meditation.

    Before Google and smartphones, people in the U.K. used to wake up on a Sunday morning, take a short walk to the local newsagent to buy the Sunday papers. The Sunday papers had all sort of supplements on books, lifestyle, gardening and fashion.

    Advertising

    You would get home, settle into your favourite armchair and spend an hour or two reading through all these supplements. For me, I would put on some relaxing music and just relax with a nice cup of tea. It was a wonderful way to spend Sunday morning. No stress, no pressure, just me and the Sunday papers.

    Decide what you want to do with your Sunday morning, make sure it is focused on you and start this week. You will thank yourself for it.

    3. Do Some Exercise

    Now, this does not mean you go out and do a 10-mile run or spend one or two hours in the gym. What this means is to get outside and move.

    Our lifestyles today have taken away a lot of natural movement. This has become particularly prominent this year with many of us having to work from home. Those walks to the bus stop, train station and the office have gone. Now we get up, move from one room to another, sit down and start work.

    Sunday’s give you a chance to move. Take that opportunity. Get yourself outside for an hour or two. Enjoy nature. Go with your family or friends and just have a relaxing hour or two in nature. This is possibly one of the best ways to reduce stress, get some healthy exercise and set yourself up for a wonderful week.

    4. Plan the Day

    Not having a plan for the day will leave you at the mercy of outside events. Instead, decide on Saturday evening what you will do the next day. Make sure you wake up at your normal time, indulge in your favourite morning drink and start your day.

    Having no plan for the day, will likely result in you waking up late, making it difficult to get a good night’s sleep the next evening and you will waste the opportunity to make the day count.

    Your plan does not have to be too detailed. Something similar to:

    Advertising

    • Wake up and make coffee
    • Put on some great music
    • Sit down and enjoy coffee
    • Take a 2-hour walk
    • Read for an hour or two
    • Spend some time with the kids

    Just make sure you have a rough plan for the day, but keep things as flexible as possible.

    5. Watch a Sports Game

    This is a great way to get yourself away from thinking about work and your troubles. I’m a big rugby and motorsport fan and even in these difficult pandemic times, there are plenty of sports events I can watch on YouTube.

    Whatever sport you enjoy, take some time on Sunday to watch a game. Just getting into the game, enjoying the skills on show and marvelling at the professionalism removes you from your everyday world for a while. It’s a great way to give your brain some much-needed relaxation and provides a wonderful distraction from your everyday normal life.

    6. Make Sure You Do Something Different

    Doing the same things day after day will eventually turn every day into a grind. You want to be looking forward to your Sunday’s. Plan to go out for a drive in the countryside, or a walk in an unfamiliar park, or go to the cinema or an outside concert.

    Do anything that breaks up your routine. Like watching a sports game, it takes you away from the normal everyday life you lead and gives you something refreshingly different to enjoy and experience.

    7. Clean Up

    I know, most people hate doing house chores but having a clean, ordered home does wonders for your overall mental wellbeing. I love ending Sunday with a beautifully clean home, knowing everything is in its place, the floors are clean and all my laundry is put away and ready for the following week.

    It can be hard to find the time to stay on top of all the cleaning during the week, so setting aside some time each Sunday to do a cleanup leaves you feeling refreshed, energized and ready for whatever the following week will throw at you.

    8. Prepare You Clothes for the Following Week

    This may seem a bit excessive, but it saves so much time and cognitive overload. All it takes is one bad night’s sleep and you wake up and find yourself rushing around trying to get yourself ready for your first appointment.

    Advertising

    In that state, trying to decide what clothes to wear in another decision you just don’t need. It’s far better to make a rough plan on a Sunday what you will wear for work and have all these clothes ready, washed and ironed.

    It also prevents discovering the shirt you want to wear for the early morning meeting is still in the laundry basket when you need it. Plan ahead. It saves so much time and stress.

    9. Do a Weekly Planning Session

    I’ve experimented doing a weekly planning session on different days but by far, the best day to plan is Sunday. I find that Sunday evenings are the best times to open up my calendar and to-do list, and to plan for the week ahead. It sets me up for the week ahead.

    It also helps me to sleep better on Sunday evening, knowing exactly what I need to accomplish the following week. I can start Monday morning without wasting time trying to figure out where things were left the previous Friday.

    What I am looking for are where all my meetings are, which days I can focus on my deep and project work and to make sure I have everything processed from the week before.

    10. Clear Out Your Email

    What? Doing email on a Sunday? Yes. Why? Because the worst thing you can do is start the new week with an inbox full of last week’s unreplied-to emails.

    For most of us, Monday morning is likely to be the one day in the week we do not have a lot of email in our inboxes, so we can begin the day on our most important project work. If you spend an hour or two cleaning up your email from last week, you miss a tremendous opportunity to start with a clean slate.

    We don’t get a lot of email in on a Sunday, so you can process your inbox and actionable folders to make sure when the new week begins, you not only have a set of outcomes you want to achieve that week, but also begin the new week with no hangovers from the week before.

    Advertising

    11. Do Some Work on Your Side Project

    Now, this does not mean work. This means your own personal projects. It could be a DIY project, doing something in your garden, restoring an old car or writing your book.

    Sunday’s give you incredible opportunities to do all those things you dream of doing but never seem to find time to do them. Just getting on and doing these side projects removes you from your everyday work, and allows you a few hours to do the things you love doing.

    12. Read a Book

    During the week, it can be hard to read a good book. We get up, rush out the door to get to work (or move to our home work station and start the computer). When we finish the day, we are exhausted and just want to vegetate in front of the TV.

    Don’t waste Sunday’s. They give you a great opportunity to spend time with the books you want to read.

    13. Prepare You Meals for the Following Week

    This is a great one for those of you who are following a healthy diet and exercise plan. Preparing meals for the following week not only saves a lot of time, it also encourages you to eat healthy on those exhausting days when all you want to do is eating pizza and flopping down on the sofa.

    Having a set of pre-prepared meals reduces the temptation during the week when your willpower is at its lowest. It’s quick, healthy and easy to do. It makes sure you are sticking to your diet plan.

    Bottom Line

    I am not suggesting you try and fit all these things into Sunday. Just pick a few that resonate with you. Do those that will give you the biggest benefit and most joy.

    Sunday’s need to be restful, relaxing and give you a chance to do those things you do not normally have time to do. It’s an incredible day, so don’t waste it laying in bed watching endless episodes of your favourite TV series.

    More of What You Can Do During Weekend

    Featured photo credit: Priscilla Du Preez via unsplash.com

    Reference

    Read Next