Skip to content

Instantly share code, notes, and snippets.

@OscarGodson
Created August 20, 2012 05:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save OscarGodson/3401308 to your computer and use it in GitHub Desktop.
Save OscarGodson/3401308 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
Author

Also, if you want to read from another file:

#!/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"

just create a template.html file with %s where you want the markdown to be placed.

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