a technical notebook
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.5 KiB

  1. Wednesday, January 7, 2014
  2. ==========================
  3. local webservers and static html generation
  4. -------------------------------------------
  5. I haven't always run an httpd on my main local machine, but I've been doing it
  6. again for the last year or two now, and it feels like a major help. I started
  7. by setting up a development copy of [display][1] under Apache, then noticed
  8. that it was kind of nice to use it for static files. I'm not sure why it's any
  9. better than accessing them via the filesystem, except maybe that
  10. `localhost/foo` is easier to type than `file://home/brennen/something/foo`, but
  11. it has definitely made me better at checking things before I publish them.
  12. (Why Apache? Well, it was easier to re-derive the configuration I needed for
  13. p1k3 things under Apache than write it from scratch under nginx, although one
  14. of these days I may make the leap anyway. I don't see any reason Perl FastCGI
  15. shouldn't work under nginx. I also still think Apache has its merits, though
  16. most of my domain knowledge has evaporated over the last few years of doing
  17. mainly php-fpm under nginx.)
  18. I've resisted the static blog engine thing for a long time now, but lately my
  19. favorite way to write things is a super-minimal `Makefile`, some files in
  20. Markdown, and a little bit of Perl wrapping `Text::Markdown::Discount`. I
  21. haven't yet consolidated all these tools into a single generically reusable
  22. piece of software, but it would probably be easy enough, and I'll probably go
  23. for it when I start a third book using this approach.
  24. I'd like to be able to define something like a standard `book/` dir that would
  25. be to a given text what `.git/` is to the working copy of a repo. I suppose
  26. you wouldn't need much.
  27. book/
  28. authors
  29. title
  30. description
  31. license
  32. toc
  33. `toc` would just be an ordered list of files to include as "chapters" from the
  34. root of the project. You'd just organize it however you liked and optionally
  35. use commands like
  36. book add chapter/index.md after other_chapter/index.md
  37. book move chapter/index.md before other_chapter/index.md
  38. to manage it, though really a text editor should be enough. (Maybe I'm
  39. overthinking this. Maybe there should just be a directory full of chapters
  40. sorted numerically on leading digits or something, but I've liked being able to
  41. reorder things in an explicit list.)
  42. Before long I might well add handling for some
  43. I should add a feature to Display.pm for outputting all of its content
  44. statically.
  45. [1]: https://github.com/brennen/display