Skip to content

Instantly share code, notes, and snippets.

@zacparker
Forked from OscarGodson/convert_md_to_html.sh
Created August 20, 2012 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zacparker/3401769 to your computer and use it in GitHub Desktop.
Save zacparker/3401769 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Create the template
read -d '' template <<- EOF
<!DOCTYPE html>
<html>
<head>
<title>HTML6 - The Spec That Brings Us Freedom</title>
<meta name="description" content="HTML5 was a great leap forward for web developers, however there is a missing void that HTML5 has yet to fix and that void is truly semantic markup.">
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
%s
</body>
</html>
EOF
# Save the file
printf "$template" "$(marked --gfm < README.md)" > index.html
@OscarGodson
Copy link

Hey, saw you forked this. I needed to add more and more to the template so I actually ended up change my build to look like this:

#!/bin/bash

# Get the template
template=`cat template.html`

# Save the file
printf "$template" "$(marked --gfm < README.md)" > index.html

echo -e "\033[33m √ Build complete"
echo -e -n "\033[0m"

And In my template.html file I have all my HTML:

<!DOCTYPE html>
<html>
  <head>
    <title>HTML6 - The Spec That Brings Us Freedom</title>
    <meta name="description" content="HTML5 was a great leap forward for web developers, however there is a void that HTML5 has yet to fix and that void is truly semantic markup.">
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <script>var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-4491651-7"]);_gaq.push(["_trackPageview"]);(function(){var a=document.createElement("script");a.type="text/javascript";a.async=true;a.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)})()</script>
  </head>
  <body>
    <a href="https://github.com/OscarGodson/HTML6"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
    %s
    <script src="js/jquery-1.8.0.min.js"></script>
    <script src="js/prettify.js"></script>
    <script src="js/main.js"></script>
  </body>
</html>

from: https://github.com/OscarGodson/HTML6

What were you thinking about doing with this?

@zacparker
Copy link
Author

@OscarGodson Didn't see your comment until now, months later. I want to make a simple CLI for throwing together front end templates for static sites, or even simple one page apps.

Think:

$> init html5 and a basic html5 doc is generated with img, css, & js folders. Also generated by default is a less/sass watcher and a js compiler / minifier.

$> init html5 --backbone and basic scaffolding for backbone is included.

$> init html5 --backbone --jquery and jquery is included too.

Etcetera, etcetera.

All of the current tools out there for this are way too complex, for my intended use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment