If you know emacs I recommend taking a look at org-mode. It's an emacs mode that let's you write in "markdown" (but including tex-syntax for math) and then lets you export to html or pdf (via tex/latex.)
org-mode sounds nice, but I've tried it and it's complicated and annoying. I hate how it folds everything as a default, so that when you open a file it's folded and the content isn't visible. I know I can change this somewhere but not having sane defaults is irritating.