smdparse
smdparse is a small perl script to parse samuel's markdown files into html. It also acts as the only standing specification of samuel's markdown. This is what I used to use to generate this website before suckparse.
Sample .smd files can be found anywhere on the site by changing index.html to index.smd.
As of 1.2 smdparse can include files inside your specified docroot. These files will be parsed as if they were a part of the file you were already parsing, completely transparently. This makes for easy menu synchronisation.
Version 2.0 added support for header files, multiple command line arguments (both directories and files), the ability to omit sections, as well as a general code cleanup.
Releases
- smdparse-2.0 - 2009-08-08
- smdparse-1.2 - 2009-08-06
- smdparse-1.1 - 2009-04-26
- smdparse-1.0 - 2009-04-25
Usage
Running smdparse will convert all the .smd files to .html in ./ and all the subdirectories, recursively.
You can also specify directories and files you want smdparse to operate on by passing them to it at runtime. The document root, used to find header and included files, can also be specified on the command line with --docroot. It is also possible to directly specify the header file you wish to use wih --header.
Included files should be called filename.smi (any .smd files will be parsed into html, which is probably not what you want), and header files should be called filename.smh.
The header file is parsed before each %.smd% file in the directory you specify. By default, smdparse will use the header.smh file if it is found in your docroot.
By default your docroot is whatever directory is currently being operated on, but you can override this with --docroot.
The following command will convert all the .smd files in public_html/ and website/ to .html:
smdparse public_html website
The following command will use the header file pizza.smh when parsing all the .smd files in public_html/:
smdparse --header pizza.smh public_html/
To include a file that is inside your docroot, enclose it in [include] tags:
[include]menus.smi[/include]
This assumes menus.smi is found at the top level of your docroot, which you can specify with --docroot:
smdparse --docroot /home/samuel/public_html
If you need to include a file that is outside of your docroot, use ../, but be warned, this is very insecure.
The title, icon, and style tags must appear before any others (or not at all). After that, the header and subheader tags must appear (if at all). Then the menu and quote tags, afterwhich you're free to use the sub, list, and code tags. An include tag can come at any point after the first three (title, icon, and stile). Any of the tags may be ommitted and smdparse will still do The Right Thing.
License
smdparse is released under the MIT/X Consortium License. A copy of the license can be found in the release tarballs.