Homer Wolfe's Markdown Notes

Do you like writing HTML by hand? Probably not.

Markdown is like email "formatting", with stars for bullets, > for quoted text, etc. Then there's a perl script that converts it to HTML.

Then, to make the HTML pretty, you just add The Markdown CSS File. Of course, you can also add your own CSS stuff, such as a HTML boilerplate to the top and bottom:

top:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link href="/path/to/markdowncss/markdown.css" rel="stylesheet"></link>
<style>
body {max-width: 45em;}
ul, ol {
 padding: 0em;
 margin: 1em;
}
</style>
</head>
<body>

bottom:

</body>
</html>

The body max-width stuff makes the text wrap after a reasonable line length. The ul,ol padding and margin make lists indent sort of normally (markdowncss makes them indent weirdly).

Example

Save into a text file
Title
==========================

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce faucibus consequat dolor, sit amet feugiat magna tincidunt id. 

> Praesent nec magna nunc, vitae eleifend turpis. Vivamus sit amet dolor dui, eu mollis est. Duis porta placerat libero vitae facilisis. 
> Nullam eget consequat lacus. Phasellus eu lectus dui. Integer leo velit, auctor in sollicitudin in, convallis ac neque. Suspendisse 
> tellus nibh, pharetra eget scelerisque mattis, posuere a dui. Suspendisse velit justo, dignissim ut tempus nec, cursus id diam. 

   * Donec vel est sit amet metus accumsan pharetra vitae ac neque. Nulla ut orci purus. 
   * Aliquam ac nunc nibh, et vulputate felis. Etiam porttitor nunc in turpis pretium malesuada. 

----------------------------------------------------------------

 ![text](path/to/figure.png "alt-text")

And then run perl Markdown.pl --html4tags foo.text > foo.html

This will make a really stupid looking HTML page. Then just do this:

cat Header.html foo.html Footer.html > bar.html. As long as your markdown.css file is visible, bar.html will look totally rad.

Makefile

all: index.html

index.html: index.txt Header.html Footer.html
   @rm -f index.html index.tmp
   @perl ~/bin/Markdown.pl --html4tags index.txt > index.tmp
   @cat Header.html index.tmp Footer.html > index.html
   @rm -f index.tmp
Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2013-03-03 - HomerWolfe
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback