forked from andonome/lk
		
	show website example with lowdown
This commit is contained in:
		| @@ -9,6 +9,14 @@ Turn a markdown file into a pdf: | ||||
| lowdown -stms "$FILE".md | pdfroff -itk -mspdf > "$FILE".pdf | ||||
| ``` | ||||
|  | ||||
| *Example:* put [this Makefile](lowdown/example.txt) in a directory, rename it `Makefile`, then do: | ||||
|  | ||||
|  | ||||
| ```bash | ||||
| make example | ||||
| make | ||||
| ``` | ||||
|  | ||||
| To give the document a title, put that title in the metadata: | ||||
|  | ||||
| ```bash | ||||
|   | ||||
							
								
								
									
										36
									
								
								vision/lowdown/example.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								vision/lowdown/example.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | ||||
| output: all | ||||
|  | ||||
| .PHONY: example | ||||
| example: html/foot.html html/head.html | ||||
| 	mkdir -p articles/ | ||||
| 	fortune > articles/fort_1.md | ||||
| 	fortune > articles/fort_2.md | ||||
|  | ||||
| HTML = $(patsubst articles/%.md,public/%.html,$(wildcard articles/*.md)) | ||||
|  | ||||
| $(HTML): public/ articles/ $(wildcard html/*) | ||||
|  | ||||
| html/head.html: | ||||
| 	@mkdir $(@D) | ||||
| 	echo '<head> Something about CSS probably </head>' > $@ | ||||
| 	echo '<body>' >> $@ | ||||
|  | ||||
| html/foot.html: html/head.html | ||||
| 	echo '</body>' >> $@ | ||||
|  | ||||
| public/%.html : articles/%.md | ||||
| 	cat html/head.html > $@ | ||||
| 	lowdown $< >> $@ | ||||
| 	cat html/foot.html >> $@ | ||||
|  | ||||
| .PHONY: all | ||||
| all : $(HTML) | ||||
|  | ||||
| articles/: | ||||
| 	mkdir $@ | ||||
|  | ||||
| public/: | ||||
| 	mkdir $@ | ||||
|  | ||||
| clean : | ||||
| 	rm -rf public | ||||
		Reference in New Issue
	
	Block a user