site: begin organising a cookbook
This commit is contained in:
		
							parent
							
								
									f0ad41c49a
								
							
						
					
					
						commit
						e7d459a368
					
				
							
								
								
									
										35
									
								
								Shake.hs
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								Shake.hs
									
									
									
									
									
								
							| @ -60,6 +60,7 @@ usage = unlines | |||||||
| --   ,"./Shake infomanpages     # generate info files for info" | --   ,"./Shake infomanpages     # generate info files for info" | ||||||
| --   ,"./Shake webmanpages      # generate individual web man pages for hakyll" | --   ,"./Shake webmanpages      # generate individual web man pages for hakyll" | ||||||
| --   ,"./Shake webmanall        # generate all-in-one web manual for hakyll" | --   ,"./Shake webmanall        # generate all-in-one web manual for hakyll" | ||||||
|  | --   ,"./Shake cookbookall      # generate all-in-one web cookbook for hakyll" | ||||||
|   ,"./Shake site/doc/VER/.snapshot   # generate and save a versioned web site snapshot" |   ,"./Shake site/doc/VER/.snapshot   # generate and save a versioned web site snapshot" | ||||||
|   ,"./Shake all              # generate everything" |   ,"./Shake all              # generate everything" | ||||||
|   ,"./Shake clean            # clean generated files" |   ,"./Shake clean            # clean generated files" | ||||||
| @ -114,17 +115,33 @@ main = do | |||||||
|         ] |         ] | ||||||
|       -- manuals m4 source, may include other files (hledger/doc/hledger.1.m4.md) |       -- manuals m4 source, may include other files (hledger/doc/hledger.1.m4.md) | ||||||
|       m4manpages = [manpageDir m </> m <.> "m4.md" | m <- manpageNames] |       m4manpages = [manpageDir m </> m <.> "m4.md" | m <- manpageNames] | ||||||
|  | 
 | ||||||
|       -- manuals rendered to nroff, ready for man (hledger/doc/hledger.1) |       -- manuals rendered to nroff, ready for man (hledger/doc/hledger.1) | ||||||
|       nroffmanpages = [manpageDir m </> m | m <- manpageNames] |       nroffmanpages = [manpageDir m </> m | m <- manpageNames] | ||||||
|  | 
 | ||||||
|       -- manuals rendered to text, ready for embedding (hledger/doc/hledger.1.txt) |       -- manuals rendered to text, ready for embedding (hledger/doc/hledger.1.txt) | ||||||
|       txtmanpages = [manpageDir m </> m <.> "txt" | m <- manpageNames] |       txtmanpages = [manpageDir m </> m <.> "txt" | m <- manpageNames] | ||||||
|  | 
 | ||||||
|       -- manuals rendered to info, ready for info (hledger/doc/hledger.1.info) |       -- manuals rendered to info, ready for info (hledger/doc/hledger.1.info) | ||||||
|       infomanpages = [manpageDir m </> m <.> "info" | m <- manpageNames] |       infomanpages = [manpageDir m </> m <.> "info" | m <- manpageNames] | ||||||
|  | 
 | ||||||
|       -- manuals rendered to markdown, ready for web output by hakyll (site/hledger.md) |       -- manuals rendered to markdown, ready for web output by hakyll (site/hledger.md) | ||||||
|       webmanpages = ["site" </> manpageNameToUri m <.>"md" | m <- manpageNames] |       webmanpages = ["site" </> manpageNameToUri m <.>"md" | m <- manpageNames] | ||||||
|  | 
 | ||||||
|       -- manuals rendered to markdown and combined, ready for web output by hakyll |       -- manuals rendered to markdown and combined, ready for web output by hakyll | ||||||
|       webmanall = "site/manual.md" |       webmanall = "site/manual.md" | ||||||
| 
 | 
 | ||||||
|  |       -- cookbook pages in markdown, ready for web output by hakyll (site/csv-import.md) | ||||||
|  |       -- keeping these in the main site directory allows hakyll-std to see them (and simpler urls) | ||||||
|  |       cookbookpages = [ | ||||||
|  |          "site/account-aliases.md" | ||||||
|  |         ,"site/account-separator.md" | ||||||
|  |         ,"site/csv-import.md" | ||||||
|  |         ] | ||||||
|  | 
 | ||||||
|  |       -- cookbook pages combined, ready for web output by hakyll | ||||||
|  |       cookbookall = "site/cookbook.md" | ||||||
|  | 
 | ||||||
|       -- hledger.1 -> hledger/doc, hledger_journal.5 -> hledger-lib/doc |       -- hledger.1 -> hledger/doc, hledger_journal.5 -> hledger-lib/doc | ||||||
|       manpageDir m |       manpageDir m | ||||||
|         | '_' `elem` m = "hledger-lib" </> "doc" |         | '_' `elem` m = "hledger-lib" </> "doc" | ||||||
| @ -209,6 +226,7 @@ main = do | |||||||
|       need $ |       need $ | ||||||
|         webmanpages ++ |         webmanpages ++ | ||||||
|         [webmanall |         [webmanall | ||||||
|  |         ,cookbookall | ||||||
|         ,hakyllstd |         ,hakyllstd | ||||||
|         ] |         ] | ||||||
|       cmd Shell (Cwd "site") "hakyll-std/hakyll-std" "build" |       cmd Shell (Cwd "site") "hakyll-std/hakyll-std" "build" | ||||||
| @ -254,6 +272,21 @@ main = do | |||||||
|           "--filter tools/pandoc-demote-headers" |           "--filter tools/pandoc-demote-headers" | ||||||
|           ">>" webmanall :: Action ExitCode |           ">>" webmanall :: Action ExitCode | ||||||
| 
 | 
 | ||||||
|  |     -- adjust and combine recipe mds for single-page web output, using pandoc | ||||||
|  |     phony "cookbookall" $ need [ cookbookall ] | ||||||
|  | 
 | ||||||
|  |     cookbookall %> \out -> do | ||||||
|  |       need cookbookpages | ||||||
|  |       liftIO $ writeFile cookbookall "* toc\n\n" | ||||||
|  |       forM_ cookbookpages $ \f -> do -- site/csv-import.md, site/account-aliases.md, ... | ||||||
|  |         cmd Shell ("printf '\\n\\n' >>") cookbookall :: Action ExitCode | ||||||
|  |         cmd Shell "pandoc" f "-t markdown --atx-headers" | ||||||
|  |           -- "--filter tools/pandoc-drop-man-blocks" | ||||||
|  |           "--filter tools/pandoc-drop-toc" | ||||||
|  |           -- "--filter tools/pandoc-capitalize-headers" | ||||||
|  |           "--filter tools/pandoc-demote-headers" | ||||||
|  |           ">>" cookbookall :: Action ExitCode | ||||||
|  | 
 | ||||||
|     -- build the currently checked out web docs and save as a named snapshot |     -- build the currently checked out web docs and save as a named snapshot | ||||||
|     "site/doc/*/.snapshot" %> \out -> do |     "site/doc/*/.snapshot" %> \out -> do | ||||||
|       need [ webmanall ] |       need [ webmanall ] | ||||||
| @ -283,7 +316,7 @@ main = do | |||||||
|     phony "clean" $ do |     phony "clean" $ do | ||||||
|       putNormal "Cleaning generated files" |       putNormal "Cleaning generated files" | ||||||
|       removeFilesAfter "." webmanpages |       removeFilesAfter "." webmanpages | ||||||
|       removeFilesAfter "." [webmanall] |       removeFilesAfter "." [webmanall, cookbookall] | ||||||
|       -- removeFilesAfter "." ["site/doc/[0-9]*"] |       -- removeFilesAfter "." ["site/doc/[0-9]*"] | ||||||
|       cmd Shell "rm -rf site/doc/[0-9]*" |       cmd Shell "rm -rf site/doc/[0-9]*" | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										44
									
								
								site/docs.md
									
									
									
									
									
								
							
							
						
						
									
										44
									
								
								site/docs.md
									
									
									
									
									
								
							| @ -26,46 +26,53 @@ Small, guided exercises introducing data entry, reporting, and accounting. | |||||||
| 
 | 
 | ||||||
| #### [FAQ](faq.html) | #### [FAQ](faq.html) | ||||||
| 
 | 
 | ||||||
|  | #### [Misc. links](more-docs.html) | ||||||
|  | A few links not yet moved to...  | ||||||
|  | 
 | ||||||
|  | #### [plaintextaccounting.org](http://plaintextaccounting.org) | ||||||
|  | More overview, tips and tools from the plain text accounting community | ||||||
|  | 
 | ||||||
| </div> | </div> | ||||||
| <div class="col-sm-3"> | <div class="col-sm-3"> | ||||||
| 
 | 
 | ||||||
| ## Reference | ## Reference | ||||||
| 
 | 
 | ||||||
| #### [Big Manual](manual.html) | #### [Big Manual](manual.html) | ||||||
| All manuals combined on one page. | All manuals combined on one page, | ||||||
|  | including: | ||||||
| 
 | 
 | ||||||
| <div style="padding-left:1em;"> | <div style="padding-left:1em;"> | ||||||
| 
 | 
 | ||||||
| **Tool manuals** | **Tool manuals** | ||||||
| 
 | 
 | ||||||
| #### [`hledger`](hledger.html) | ##### [`hledger`](hledger.html) | ||||||
| The main command-line UI. | The command-line UI | ||||||
| Good for precision, flexibility and automation. | , for flexibility and automation. | ||||||
| 
 | 
 | ||||||
| #### [`hledger-ui`](hledger-ui.html) | ##### [`hledger-ui`](hledger-ui.html) | ||||||
| A curses-style UI | A curses-style UI | ||||||
| , for quick review and monitoring. | , for quick review and monitoring. | ||||||
| 
 | 
 | ||||||
| #### [`hledger-web`](hledger-web.html) | ##### [`hledger-web`](hledger-web.html) | ||||||
| A web UI | A web UI | ||||||
| , for browsing, sharing, and collaboration. | , for browsing, sharing, and collaboration. | ||||||
| 
 | 
 | ||||||
| #### [`hledger-api`](hledger-api.html) | ##### [`hledger-api`](hledger-api.html) | ||||||
| A basic web API | A basic web API | ||||||
| , for building client-side apps.  | , for building client-side apps.  | ||||||
| 
 | 
 | ||||||
| **File format manuals** | **File format manuals** | ||||||
| 
 | 
 | ||||||
| #### [Journal](journal.html) | ##### [Journal](journal.html) | ||||||
| hledger's native data format, representing an accounting journal. | hledger's native data format, representing an accounting journal. | ||||||
| 
 | 
 | ||||||
| #### [CSV](csv.html) | ##### [CSV](csv.html) | ||||||
| Comma Separated Values, used for import/export. | Comma Separated Values, used for import/export. | ||||||
| 
 | 
 | ||||||
| #### [Timeclock](timeclock.html) | ##### [Timeclock](timeclock.html) | ||||||
| For time logging, with clock-in/clock-out records. | For time logging, with clock-in/clock-out records. | ||||||
| 
 | 
 | ||||||
| #### [Timedot](timedot.html) | ##### [Timedot](timedot.html) | ||||||
| A more human-friendly time logging format. | A more human-friendly time logging format. | ||||||
| 
 | 
 | ||||||
| </div> | </div> | ||||||
| @ -75,17 +82,18 @@ A more human-friendly time logging format. | |||||||
| 
 | 
 | ||||||
| ## More | ## More | ||||||
| 
 | 
 | ||||||
| #### [How to read CSV files](how-to-read-csv-files.html) | #### [User Cookbook](cookbook.html) | ||||||
|  | Practical day-to-day recipes combined on one page, including: | ||||||
| 
 | 
 | ||||||
| #### [How to use account aliases](how-to-use-account-aliases.html) | <div style="padding-left:1em;"> | ||||||
| 
 | 
 | ||||||
| #### [How to use another account separator character](how-to-use-another-account-separator-character.html) | ##### [How to read CSV files](csv-import.html) | ||||||
| 
 | 
 | ||||||
| #### [More docs](more-docs.html) | ##### [How to use account aliases](account-aliases.html) | ||||||
| Some useful links not yet moved to.. |  | ||||||
| 
 | 
 | ||||||
| #### [plaintextaccounting.org](http://plaintextaccounting.org) | ##### [How to use another account separator character](account-separator.html) | ||||||
| More tips and tools from the plain text accounting community | 
 | ||||||
|  | </div> | ||||||
| 
 | 
 | ||||||
| </div> | </div> | ||||||
| </div> | </div> | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user