doc: Merge branch 'doc-files-cleanup'

Move package manual files out of doc/, and remove the man section
number from all but the nroff files.
This commit is contained in:
Simon Michael 2017-12-06 18:56:45 -08:00
commit 66f01ff466
101 changed files with 206 additions and 189 deletions

View File

@ -150,10 +150,10 @@ CABALFILES:= \
MANUALSOURCEFILES:= \
doc/lib.m4 \
*/*/*.m4.md \
*/*.m4.md \
MANUALGENFILES:= \
hledger*/doc/hledger*.[15]{,.info,.txt} \
hledger*/hledger*.{1,5,info,txt} \
# site/*.md includes website source files and generated web manual files
# WEBDOCFILES:= \
@ -1399,8 +1399,8 @@ genmanuals: Shake #$(call def-help,genmanuals, regenerate embedded manuals (migh
./Shake manuals
updatemanuals: genmanuals $(call def-help,updatemanuals, regenerate embedded manuals and commit (might need -B) )
@read -p "please review changes then press enter to commit: $(shell ls hledger*/doc/*.[15]*)"
git commit -m "update embedded manuals" hledger*/doc/*.[15]*
@read -p "please review changes then press enter to commit: $(shell ls hledger*/hledger*.{1,5,info,txt})"
git commit -m "update embedded manuals" hledger*/hledger*.{1,5,info,txt}
tagrelease: \

View File

@ -112,17 +112,33 @@ main = do
,"hledger_timeclock.5"
,"hledger_timedot.5"
]
-- manuals m4 source, may include other files (hledger/doc/hledger.1.m4.md)
m4manpages = [manpageDir m </> m <.> "m4.md" | m <- manpageNames]
-- manuals rendered to nroff, ready for man (hledger/doc/hledger.1)
manualNames = map manpageNameToManualName manpageNames
-- hledger.1 -> hledger, hledger_journal.5 -> hledger_journal
manpageNameToManualName = dropNumericSuffix
where
dropNumericSuffix s = reverse $
case reverse s of
c : '.' : cs | isDigit c -> cs
cs -> cs
-- hledger -> hledger.1, hledger_journal -> hledger_journal.5
manualNameToManpageName s
| '_' `elem` s = s <.> "5"
| otherwise = s <.> "1"
-- manuals m4 source; may include other source files (hledger/hledger.m4.md)
m4manpages = [manualDir m </> m <.> "m4.md" | m <- manualNames]
-- manuals rendered to nroff, ready for man (hledger/hledger.1)
nroffmanpages = [manpageDir m </> m | m <- manpageNames]
-- manuals rendered to text, ready for embedding (hledger/doc/hledger.1.txt)
txtmanpages = [manpageDir m </> m <.> "txt" | m <- manpageNames]
-- manuals rendered to text, ready for embedding (hledger/hledger.txt)
txtmanpages = [manualDir m </> m <.> "txt" | m <- manualNames]
-- manuals rendered to info, ready for info (hledger/doc/hledger.1.info)
infomanpages = [manpageDir m </> m <.> "info" | m <- manpageNames]
-- manuals rendered to info, ready for info (hledger/hledger.info)
infomanpages = [manualDir m </> m <.> "info" | m <- manualNames]
-- manuals rendered to markdown, ready for web output by hakyll (site/hledger.md)
webmanpages = ["site" </> manpageNameToUri m <.>"md" | m <- manpageNames]
@ -154,8 +170,13 @@ main = do
-- hledger.1 -> hledger/doc, hledger_journal.5 -> hledger-lib/doc
manpageDir m
| '_' `elem` m = "hledger-lib" </> "doc"
| otherwise = dropExtension m </> "doc"
| '_' `elem` m = "hledger-lib"
| otherwise = dropExtension m
-- hledger -> hledger, hledger_journal -> hledger-lib
manualDir m
| '_' `elem` m = "hledger-lib"
| otherwise = m
-- hledger.1 -> hledger, hledger_journal.5 -> journal
manpageNameToUri m | "hledger_" `isPrefixOf` m = dropExtension $ drop 8 m
@ -183,8 +204,8 @@ main = do
-- use m4 and pandoc to process macros, filter content, and convert to nroff suitable for man output
phony "manpages" $ need nroffmanpages
nroffmanpages |%> \out -> do -- hledger/doc/hledger.1
let src = out <.> "m4.md"
nroffmanpages |%> \out -> do -- hledger/hledger.1
let src = manpageNameToManualName out <.> "m4.md"
lib = "doc/lib.m4"
dir = takeDirectory out
tmpl = "doc/manpage.nroff"
@ -204,15 +225,15 @@ main = do
-- render man page nroffs to fixed-width text for embedding in executables, with nroff
phony "txtmanpages" $ need txtmanpages
txtmanpages |%> \out -> do -- hledger/doc/hledger.1.txt
let src = dropExtension out
txtmanpages |%> \out -> do -- hledger/hledger.txt
let src = dropExtension out <.> "m4.md"
need [src]
cmd Shell groff "-t -e -mandoc -Tascii" src "| col -bx >" out -- http://www.tldp.org/HOWTO/Man-Page/q10.html
-- use m4 and pandoc to process macros, filter content, and convert to info, suitable for info viewing
phony "infomanpages" $ need infomanpages
infomanpages |%> \out -> do -- hledger/doc/hledger.1.info
infomanpages |%> \out -> do -- hledger/hledger.info
let src = out -<.> "m4.md"
lib = "doc/lib.m4"
dir = takeDirectory out
@ -249,11 +270,12 @@ main = do
phony "webmanpages" $ need webmanpages
webmanpages |%> \out -> do -- site/hledger.md
let m = manpageUriToName $ dropExtension $ takeFileName out -- hledger.1
dir = manpageDir m
src = dir </> m <.> "m4.md"
let manpage = manpageUriToName $ dropExtension $ takeFileName out -- hledger
manual = manpageNameToManualName manpage
dir = manpageDir manpage
src = dir </> manual <.> "m4.md"
lib = "doc/lib.m4"
heading = let h = dropExtension m
heading = let h = manual
in if "hledger_" `isPrefixOf` h
then drop 8 h ++ " format"
else h

View File

@ -24,7 +24,7 @@ These are in the respective package directories:
hledger*/package.yaml source for package metadata (description, etc.)
hledger*/README package readme, displayed on hackage
hledger*/CHANGES package changelog, displayed on hackage
hledger*/doc/hledger*.m4.md package manual source file(s)
hledger*/hledger*.m4.md package manual source file(s)
4. The project website and additional docs - home page, FAQ, tutorials,
how-tos, developer guide, etc. These are in the site directory:
@ -45,12 +45,17 @@ such as m4:
$ ./Shake manuals
Then render the website. This copies the manuals' markdown files into
the website, edits them for web display, concatenates them to form the
one-page manual, and runs hakyll-std (a generic hakyll script, included)
to render everything as html and add site header/footer,
tables of contents, etc.:
The text/man/info manuals are embedded in the hledger executable, so a
rebuild of that now will pick up the latest manuals:
$ stack build hledger
The website uses the markdown manuals. This copies them into the
website, edits them for web display, concatenates them to form the
one-page manual, and runs hakyll-std (a generic hakyll script,
included) which adds tables of contents and renders everything as html
with the site header/footer.
$ ./Shake website
View the rendered website ("open" is mac-specific; use your equivalent):

View File

@ -1,2 +0,0 @@
Documentation for this package, used to generate manual(s) in multiple
formats (see Shake.hs). *.m4.md are the master files.

View File

@ -33,9 +33,9 @@ extra-source-files:
README
data-files:
doc/hledger-api.1
doc/hledger-api.1.info
doc/hledger-api.1.txt
hledger-api.1
hledger-api.info
hledger-api.txt
source-repository head
type: git

View File

@ -27,9 +27,9 @@ extra-source-files:
- examples/*.html
data-files:
- doc/hledger-api.1
- doc/hledger-api.1.txt
- doc/hledger-api.1.info
- hledger-api.1
- hledger-api.txt
- hledger-api.info
dependencies:
- hledger-lib >= 1.4 && < 1.5

View File

@ -1,2 +0,0 @@
Documentation for this package, used to generate manual(s) in multiple
formats (see Shake.hs). *.m4.md are the master files.

View File

@ -30,18 +30,18 @@ extra-source-files:
README
data-files:
doc/hledger_csv.5
doc/hledger_csv.5.info
doc/hledger_csv.5.txt
doc/hledger_journal.5
doc/hledger_journal.5.info
doc/hledger_journal.5.txt
doc/hledger_timeclock.5
doc/hledger_timeclock.5.info
doc/hledger_timeclock.5.txt
doc/hledger_timedot.5
doc/hledger_timedot.5.info
doc/hledger_timedot.5.txt
hledger_csv.5
hledger_csv.info
hledger_csv.txt
hledger_journal.5
hledger_journal.info
hledger_journal.txt
hledger_timeclock.5
hledger_timeclock.info
hledger_timeclock.txt
hledger_timedot.5
hledger_timedot.info
hledger_timedot.txt
source-repository head
type: git

View File

@ -25,18 +25,18 @@ extra-source-files:
- README
data-files:
- doc/hledger_csv.5
- doc/hledger_csv.5.txt
- doc/hledger_csv.5.info
- doc/hledger_journal.5
- doc/hledger_journal.5.txt
- doc/hledger_journal.5.info
- doc/hledger_timedot.5
- doc/hledger_timedot.5.txt
- doc/hledger_timedot.5.info
- doc/hledger_timeclock.5
- doc/hledger_timeclock.5.txt
- doc/hledger_timeclock.5.info
- hledger_csv.5
- hledger_csv.txt
- hledger_csv.info
- hledger_journal.5
- hledger_journal.txt
- hledger_journal.info
- hledger_timedot.5
- hledger_timedot.txt
- hledger_timedot.info
- hledger_timeclock.5
- hledger_timeclock.txt
- hledger_timeclock.info
dependencies:
- base >=4.8 && <5

View File

@ -1,2 +0,0 @@
Documentation for this package, used to generate manual(s) in multiple
formats (see Shake.hs). *.m4.md are the master files.

View File

@ -32,9 +32,9 @@ extra-source-files:
README
data-files:
doc/hledger-ui.1
doc/hledger-ui.1.info
doc/hledger-ui.1.txt
hledger-ui.1
hledger-ui.info
hledger-ui.txt
source-repository head
type: git

View File

@ -27,9 +27,9 @@ extra-source-files:
- README
data-files:
- doc/hledger-ui.1
- doc/hledger-ui.1.txt
- doc/hledger-ui.1.info
- hledger-ui.1
- hledger-ui.txt
- hledger-ui.info
flags:
threaded:

View File

@ -1,2 +0,0 @@
Documentation for this package, used to generate manual(s) in multiple
formats (see Shake.hs). *.m4.md are the master files.

View File

@ -95,9 +95,9 @@ extra-source-files:
templates/default-layout.hamlet
data-files:
doc/hledger-web.1
doc/hledger-web.1.info
doc/hledger-web.1.txt
hledger-web.1
hledger-web.info
hledger-web.txt
source-repository head
type: git

View File

@ -43,9 +43,9 @@ extra-source-files:
- templates/*.hamlet
data-files:
- doc/hledger-web.1
- doc/hledger-web.1.txt
- doc/hledger-web.1.info
- hledger-web.1
- hledger-web.txt
- hledger-web.info
flags:
library-only:

View File

@ -1,4 +1,4 @@
A local copy of all the other hledger packages' rendered manuals,
Symbolic links to all the other hledger packages' rendered manuals,
for embedding into the hledger program via Hledger/Cli/DocFiles.hs.
(Because you can only embed relative file paths which are under
the current package directory, IIRC).

View File

@ -0,0 +1 @@
../../hledger-api/hledger-api.1

View File

@ -0,0 +1 @@
../../hledger-api/hledger-api.info

View File

@ -0,0 +1 @@
../../hledger-api/hledger-api.txt

View File

@ -0,0 +1 @@
../../hledger-ui/hledger-ui.1

View File

@ -0,0 +1 @@
../../hledger-ui/hledger-ui.info

View File

@ -0,0 +1 @@
../../hledger-ui/hledger-ui.txt

View File

@ -0,0 +1 @@
../../hledger-web/hledger-web.1

View File

@ -0,0 +1 @@
../../hledger-web/hledger-web.info

View File

@ -0,0 +1 @@
../../hledger-web/hledger-web.txt

View File

@ -0,0 +1 @@
../../hledger-lib/hledger_csv.5

View File

@ -0,0 +1 @@
../../hledger-lib/hledger_csv.info

View File

@ -0,0 +1 @@
../../hledger-lib/hledger_csv.txt

View File

@ -0,0 +1 @@
../../hledger-lib/hledger_journal.5

View File

@ -0,0 +1 @@
../../hledger-lib/hledger_journal.info

View File

@ -0,0 +1 @@
../../hledger-lib/hledger_journal.txt

View File

@ -0,0 +1 @@
../../hledger-lib/hledger_timeclock.5

View File

@ -0,0 +1 @@
../../hledger-lib/hledger_timeclock.info

View File

@ -0,0 +1 @@
../../hledger-lib/hledger_timeclock.txt

View File

@ -0,0 +1 @@
../../hledger-lib/hledger_timedot.5

View File

@ -0,0 +1 @@
../../hledger-lib/hledger_timedot.info

View File

@ -0,0 +1 @@
../../hledger-lib/hledger_timedot.txt

View File

@ -35,44 +35,44 @@ type Topic = String
docFiles :: IsString a => [(Topic, (a, a, a))]
docFiles = [
("hledger",
($(makeRelativeToProject "doc/hledger.1" >>= embedStringFile)
,$(makeRelativeToProject "doc/hledger.1.txt" >>= embedStringFile)
,$(makeRelativeToProject "doc/hledger.1.info" >>= embedStringFile)
($(makeRelativeToProject "hledger.1" >>= embedStringFile)
,$(makeRelativeToProject "hledger.txt" >>= embedStringFile)
,$(makeRelativeToProject "hledger.info" >>= embedStringFile)
))
,("hledger-ui",
($(makeRelativeToProject "doc/other/hledger-ui.1" >>= embedStringFile)
,$(makeRelativeToProject "doc/other/hledger-ui.1.txt" >>= embedStringFile)
,$(makeRelativeToProject "doc/other/hledger-ui.1.info" >>= embedStringFile)
($(makeRelativeToProject ".otherdocs/hledger-ui.1" >>= embedStringFile)
,$(makeRelativeToProject ".otherdocs/hledger-ui.txt" >>= embedStringFile)
,$(makeRelativeToProject ".otherdocs/hledger-ui.info" >>= embedStringFile)
))
,("hledger-web",
($(makeRelativeToProject "doc/other/hledger-web.1" >>= embedStringFile)
,$(makeRelativeToProject "doc/other/hledger-web.1.txt" >>= embedStringFile)
,$(makeRelativeToProject "doc/other/hledger-web.1.info" >>= embedStringFile)
($(makeRelativeToProject ".otherdocs/hledger-web.1" >>= embedStringFile)
,$(makeRelativeToProject ".otherdocs/hledger-web.txt" >>= embedStringFile)
,$(makeRelativeToProject ".otherdocs/hledger-web.info" >>= embedStringFile)
))
,("hledger-api",
($(makeRelativeToProject "doc/other/hledger-api.1" >>= embedStringFile)
,$(makeRelativeToProject "doc/other/hledger-api.1.txt" >>= embedStringFile)
,$(makeRelativeToProject "doc/other/hledger-api.1.info" >>= embedStringFile)
($(makeRelativeToProject ".otherdocs/hledger-api.1" >>= embedStringFile)
,$(makeRelativeToProject ".otherdocs/hledger-api.txt" >>= embedStringFile)
,$(makeRelativeToProject ".otherdocs/hledger-api.info" >>= embedStringFile)
))
,("journal",
($(makeRelativeToProject "doc/other/hledger_journal.5" >>= embedStringFile)
,$(makeRelativeToProject "doc/other/hledger_journal.5.txt" >>= embedStringFile)
,$(makeRelativeToProject "doc/other/hledger_journal.5.info" >>= embedStringFile)
($(makeRelativeToProject ".otherdocs/hledger_journal.5" >>= embedStringFile)
,$(makeRelativeToProject ".otherdocs/hledger_journal.txt" >>= embedStringFile)
,$(makeRelativeToProject ".otherdocs/hledger_journal.info" >>= embedStringFile)
))
,("csv",
($(makeRelativeToProject "doc/other/hledger_csv.5" >>= embedStringFile)
,$(makeRelativeToProject "doc/other/hledger_csv.5.txt" >>= embedStringFile)
,$(makeRelativeToProject "doc/other/hledger_csv.5.info" >>= embedStringFile)
($(makeRelativeToProject ".otherdocs/hledger_csv.5" >>= embedStringFile)
,$(makeRelativeToProject ".otherdocs/hledger_csv.txt" >>= embedStringFile)
,$(makeRelativeToProject ".otherdocs/hledger_csv.info" >>= embedStringFile)
))
,("timeclock",
($(makeRelativeToProject "doc/other/hledger_timeclock.5" >>= embedStringFile)
,$(makeRelativeToProject "doc/other/hledger_timeclock.5.txt" >>= embedStringFile)
,$(makeRelativeToProject "doc/other/hledger_timeclock.5.info" >>= embedStringFile)
($(makeRelativeToProject ".otherdocs/hledger_timeclock.5" >>= embedStringFile)
,$(makeRelativeToProject ".otherdocs/hledger_timeclock.txt" >>= embedStringFile)
,$(makeRelativeToProject ".otherdocs/hledger_timeclock.info" >>= embedStringFile)
))
,("timedot",
($(makeRelativeToProject "doc/other/hledger_timedot.5" >>= embedStringFile)
,$(makeRelativeToProject "doc/other/hledger_timedot.5.txt" >>= embedStringFile)
,$(makeRelativeToProject "doc/other/hledger_timedot.5.info" >>= embedStringFile)
($(makeRelativeToProject ".otherdocs/hledger_timedot.5" >>= embedStringFile)
,$(makeRelativeToProject ".otherdocs/hledger_timedot.txt" >>= embedStringFile)
,$(makeRelativeToProject ".otherdocs/hledger_timedot.info" >>= embedStringFile)
))
]

View File

@ -1,2 +0,0 @@
Documentation for this package, used to generate manual(s) in multiple
formats (see Shake.hs). *.m4.md are the master files.

View File

@ -1 +0,0 @@
../../../hledger-api/doc/hledger-api.1

View File

@ -1 +0,0 @@
../../../hledger-api/doc/hledger-api.1.info

View File

@ -1 +0,0 @@
../../../hledger-api/doc/hledger-api.1.txt

View File

@ -1 +0,0 @@
../../../hledger-ui/doc/hledger-ui.1

View File

@ -1 +0,0 @@
../../../hledger-ui/doc/hledger-ui.1.info

View File

@ -1 +0,0 @@
../../../hledger-ui/doc/hledger-ui.1.txt

View File

@ -1 +0,0 @@
../../../hledger-web/doc/hledger-web.1

View File

@ -1 +0,0 @@
../../../hledger-web/doc/hledger-web.1.info

View File

@ -1 +0,0 @@
../../../hledger-web/doc/hledger-web.1.txt

View File

@ -1 +0,0 @@
../../../hledger-lib/doc/hledger_csv.5

View File

@ -1 +0,0 @@
../../../hledger-lib/doc/hledger_csv.5.info

View File

@ -1 +0,0 @@
../../../hledger-lib/doc/hledger_csv.5.txt

View File

@ -1 +0,0 @@
../../../hledger-lib/doc/hledger_journal.5

View File

@ -1 +0,0 @@
../../../hledger-lib/doc/hledger_journal.5.info

View File

@ -1 +0,0 @@
../../../hledger-lib/doc/hledger_journal.5.txt

View File

@ -1 +0,0 @@
../../../hledger-lib/doc/hledger_timeclock.5

View File

@ -1 +0,0 @@
../../../hledger-lib/doc/hledger_timeclock.5.info

View File

@ -1 +0,0 @@
../../../hledger-lib/doc/hledger_timeclock.5.txt

View File

@ -1 +0,0 @@
../../../hledger-lib/doc/hledger_timedot.5

View File

@ -1 +0,0 @@
../../../hledger-lib/doc/hledger_timedot.5.info

View File

@ -1 +0,0 @@
../../../hledger-lib/doc/hledger_timedot.5.txt

View File

@ -34,30 +34,30 @@ extra-source-files:
test/test.hs
data-files:
doc/hledger.1
doc/hledger.1.info
doc/hledger.1.txt
doc/other/hledger-api.1
doc/other/hledger-api.1.info
doc/other/hledger-api.1.txt
doc/other/hledger-ui.1
doc/other/hledger-ui.1.info
doc/other/hledger-ui.1.txt
doc/other/hledger-web.1
doc/other/hledger-web.1.info
doc/other/hledger-web.1.txt
doc/other/hledger_csv.5
doc/other/hledger_csv.5.info
doc/other/hledger_csv.5.txt
doc/other/hledger_journal.5
doc/other/hledger_journal.5.info
doc/other/hledger_journal.5.txt
doc/other/hledger_timeclock.5
doc/other/hledger_timeclock.5.info
doc/other/hledger_timeclock.5.txt
doc/other/hledger_timedot.5
doc/other/hledger_timedot.5.info
doc/other/hledger_timedot.5.txt
.otherdocs/hledger-api.1
.otherdocs/hledger-api.info
.otherdocs/hledger-api.txt
.otherdocs/hledger-ui.1
.otherdocs/hledger-ui.info
.otherdocs/hledger-ui.txt
.otherdocs/hledger-web.1
.otherdocs/hledger-web.info
.otherdocs/hledger-web.txt
.otherdocs/hledger_csv.5
.otherdocs/hledger_csv.info
.otherdocs/hledger_csv.txt
.otherdocs/hledger_journal.5
.otherdocs/hledger_journal.info
.otherdocs/hledger_journal.txt
.otherdocs/hledger_timeclock.5
.otherdocs/hledger_timeclock.info
.otherdocs/hledger_timeclock.txt
.otherdocs/hledger_timedot.5
.otherdocs/hledger_timedot.info
.otherdocs/hledger_timedot.txt
hledger.1
hledger.info
hledger.txt
source-repository head
type: git

View File

@ -5,13 +5,13 @@
m4_dnl This man page is composed from multiple files as follows:
m4_dnl
m4_dnl hledger.1.m4.md
m4_dnl examples.m4.md
m4_dnl options.m4.md
m4_dnl queries.m4.md
m4_dnl commands.m4.md
m4_dnl balance.m4.md
m4_dnl addons.m4.md
m4_dnl troubleshooting.m4.md
m4_dnl hledger_examples.m4.md
m4_dnl hledger_options.m4.md
m4_dnl hledger_queries.m4.md
m4_dnl hledger_commands.m4.md
m4_dnl hledger_balance.m4.md
m4_dnl hledger_addons.m4.md
m4_dnl hledger_troubleshooting.m4.md
_web_({{
_docversionlinks_({{hledger}})
@ -71,10 +71,10 @@ To get started, you can either save some entries like the above in
try some commands like `hledger print` or `hledger balance`.
Run `hledger` with no arguments for a list of commands.
_include_(examples.m4.md)
_include_(options.m4.md)
_include_(queries.m4.md)
_include_(commands.m4.md)
_include_(hledger_examples.m4.md)
_include_(hledger_options.m4.md)
_include_(hledger_queries.m4.md)
_include_(hledger_commands.m4.md)
_man_({{
# ENVIRONMENT
@ -104,6 +104,6 @@ Not all of Ledger's journal file syntax is supported. See [file format differenc
On large data files, hledger is slower and uses more memory than Ledger.
_include_(troubleshooting.m4.md)
_include_(hledger_troubleshooting.m4.md)
}})

View File

@ -168,7 +168,7 @@ Starting the next transaction (. or ctrl-D/ctrl-C to quit)
Date [2015/05/22]: <CTRL-D> $
}})
_include_({{balance.m4.md}})
_include_({{hledger_balance.m4.md}})
## balancesheet
Show a balance sheet. Alias: bs.
@ -783,4 +783,4 @@ With a regular expression argument, it selects only tests with matching names.
It's mainly used in development, but it's also nice to be able to
check your hledger executable for smoke at any time.
_include_(addons.m4.md)
_include_(hledger_addons.m4.md)

Some files were not shown because too many files have changed in this diff Show More