Skip to content
/ md-notes Public

A Makefile, a perl script, and a CSS file for writing notes using the Markdown syntax.

Notifications You must be signed in to change notification settings

danui/md-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README.md

This is a directory for writing documents formatted using Markdown and styled using a slightly modified version of markdown.css. The main markdown to HTML conversion script can be found here: Markdown_1.0.1.zip.

Build Process

This directory also contains a make file Makefile. The make file's build target applies the following transformation to all files ending with a .md suffix.

                                      file.html
                                  +----------------+
"<style>" ----------------------> | <style>        |
                                  +----------------+
[ markdown.css ] ----(cat)------> | css stuff      |
                                  +----------------+
"</style>" ---------------------> | </style>       |
                                  +----------------+
[ file.md ] --> (Markdown.pl) --> | generated HTML |
                                  +----------------+

Creating a new Document

To create a new document, use a text editor to create a .md file within the directory. Once the file exists, running make will create a HTML file in the manner described above. View the HTML file using a browser.

Custom Styling

Custom styling for the document is possible. Simply include a STYLE block within .md file that requires styling; since this comes after the styling provided by markdown.css, they override what has been specified before. As a demonstration, this document includes the following which applies some customization to text within HTML CODE blocks.

<style>
code {
  font-family: courier;
  color: #080;
}
</style>
<style> /* If you can see this you are probably reading this on GitHub and the demo has failed! However it should work fine on your own computer. :) */ code { font-family: courier; color: #080; } </style>

Untabify

The number of spaces or tabs at the start of a line is quite important when it comes to code and lists. For example, a code line is a line that is indented four spaces or one tab from the expected indentation of a normal line. Mixing tabs and spaces may lead to unexpected results so there is reason to avoid use of tabs entirely. That being said, it is more convenient to write pseudo code using tabs for indentation. Thus the make file includes an alternative built step that inserts an untabify filter into .md to HTML conversion step.

                                   +----------------+
[ file.md ]      (Markdown.pl) --> | generated HTML |
   |                    ^          +----------------+
   |                    |
   '-- (perl -pe ...) --'

Alternatively, Emacs provides an untabify command. To use it:

  1. Select a region to untabify.
  2. Execute command M-x untabify

This may however leave trailing spaces at the right side of line. To remove those simply use regular expression replacement from the top of the file as follows:

  1. Execute command M-x replace-regexp
  2. Provide as regular expression: '\ +$' (i.e. slash space plus dollar)
  3. Provide as replacement an empty string

There are of course many other tricks to auto-indent code within text files but I think it best that I leave that up to you and your preferred text editor.

Acknowledgements

The Markdown.pl script was obtained from John Gruber's Daring Fireball site and the markdown.css was obtained from Kevin Burke.

About

A Makefile, a perl script, and a CSS file for writing notes using the Markdown syntax.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published