Full article: 6 lessons from literate programming
Install noweb with brew (macOS):
brew install nowebTo generate the files:
notangle -Rgo.mod hello.nw > go.mod
mkdir -p mypackage
notangle -R'mypackage/mypackage.go' hello.nw > mypackage/mypackage.go
notangle -Rmain.go hello.nw > main.go
noweave -html hello.nw > hello.htmlTo run the program:
go run main.goTo view docs as HTML (on macOS):
open hello.html