logoalt Hacker News

spicyjpeg • today at 2:52 PM • 0 replies • view on HN

When deciding on a style for documentation, I typically draw the line between tutorials and references. The linear top-down flow of an introductory guide lends itself well to inserting additional context throughout it even if not completely on-topic, while in an API or hardware reference you generally want to keep each section reasonably self-contained, trivially searchable for (minimizing false hits by carefully choosing keywords) and readable independently of the others. I have found the literate programming approach [1] of writing entire tutorials as code to work pretty well for this purpose, which I've used to great effect in some of my pet projects [2].

[1] https://en.wikipedia.org/wiki/Literate_programming

[2] https://github.com/spicyjpeg/ps1-bare-metal