;doc: cli: reorder command docs; clean up includes

This commit is contained in:
Simon Michael 2020-12-18 17:30:23 -08:00
parent 6b4be651af
commit ad3b5ef2fb
3 changed files with 96 additions and 173 deletions

View File

@ -22,6 +22,13 @@ m4_define({{_notweb_}}, m4_ifdef({{WEB}},,{{$1}}) )m4_dnl
m4_define({{_info_}}, m4_ifdef({{INFO}},{{$1}}) )m4_dnl m4_define({{_info_}}, m4_ifdef({{INFO}},{{$1}}) )m4_dnl
m4_define({{_notinfo_}}, m4_ifdef({{INFO}},,{{$1}}) )m4_dnl m4_define({{_notinfo_}}, m4_ifdef({{INFO}},,{{$1}}) )m4_dnl
m4_dnl m4_dnl
m4_dnl A command's heading and included doc source.
m4_dnl Usage: _command_(## commandname, Markdownfilebasename)
m4_define({{_command_}},
{{$1
_include_(Hledger/Cli/Commands/$2.md)
}})m4_dnl
m4_dnl
m4_dnl Two side-by-side columns. m4_dnl Two side-by-side columns.
m4_define({{_col2_}}, m4_define({{_col2_}},
{{<div class="container-fluid"> {{<div class="container-fluid">

View File

@ -156,6 +156,7 @@ builtinCommands = [
-- --
commandsList :: String -> [String] -> [String] commandsList :: String -> [String] -> [String]
commandsList progversion othercmds = [ commandsList progversion othercmds = [
-- keep synced with hledger.m4.md -> Commands -->
"-------------------------------------------------------------------------------" "-------------------------------------------------------------------------------"
,progversion ,progversion
,"Usage: hledger COMMAND [OPTIONS] [-- ADDONCMDOPTIONS]" ,"Usage: hledger COMMAND [OPTIONS] [-- ADDONCMDOPTIONS]"

View File

@ -1574,60 +1574,102 @@ Related:
hledger provides a number of commands for producing reports and managing your data. hledger provides a number of commands for producing reports and managing your data.
Run `hledger` with no arguments to list the commands available. Run `hledger` with no arguments to list the commands available.
To run a command, write its name as hledger's first argument (eg: `hledger balance`). To run a command, write its name (or its abbreviation shown in the commands list,
Or, you can write one of the standard short aliases which are or any unambiguous prefix of the name) as hledger's first argument.
shown in parentheses in the command list (eg: `hledger bal`); Eg: `hledger balance` or `hledger bal`.
or, any unambiguous prefix of a command name.
Each command's detailed help is available as one or more of: ## Built-in commands
<!-- keep synced with Hledger.Cli.Commands.commandsList -->
**Data entry (these modify the journal file):**
- [add](#add) - add transactions using guided prompts
- [import](#import) - add any new transactions from other files (eg csv)
**Data management**:
- [check](#check) - check for various kinds of issue in the data
- [close](#close) (equity) - generate balance-resetting transactions
- [diff](#diff) - compare account transactions in two journal files
- [rewrite](#rewrite) - generate extra postings, similar to print --auto
**Financial statements:**
- [aregister](#aregister) (areg) - show transactions in a particular account
- [balancesheet](#balancesheet) (bs) - show assets, liabilities and net worth
- [balancesheetequity](#balancesheetequity) (bse) - show assets, liabilities and equity
- [cashflow](#cashflow) (cf) - show changes in liquid assets
- [incomestatement](#incomestatement) (is) - show revenues and expenses
- [roi](#roi) - show return on investments
**Miscellaneous reports:**
- [accounts](#accounts) (a) - show account names
- [activity](#activity) - show postings-per-interval bar charts
- [balance](#balance) (b, bal) - show balance changes/end balances/budgets in accounts
- [codes](#codes) - show transaction codes
- [commodities](#commodities) - show commodity/currency symbols
- [descriptions](#descriptions) - show unique transaction descriptions
- [files](#files) - show input file paths
- [notes](#notes) - show unique note segments of transaction descriptions
- [payees](#payees) - show unique payee segments of transaction descriptions
- [prices](#prices) - show market price records
- [print](#print) (p, txns) - show transactions (journal entries)
- [print-unique](#print-unique) - show only transactions with unique descriptions
- [register](#register) (r, reg) - show postings in one or more accounts & running total
- [register-match](#register-match) - show a recent posting that best matches a description
- [stats](#stats) - show journal statistics
- [tags](#tags) - show tag names
- [test](#test) - run self tests
## Command documentation
Each command's detailed docs are available as one or more of:
- command line help, eg: `hledger balance --help` - command line help, eg: `hledger balance --help`
<!-- - man pages, eg: `man hledger-balance` --> <!-- - man pages, eg: `man hledger-balance` -->
- info manuals, eg: `hledger help --info hledger` -> Commands -> balance - info manuals, eg: `hledger help --info hledger` -> Commands -> balance
- web manuals, eg: <https://hledger.org/hledger.html#balance> - web manuals, eg: <https://hledger.org/hledger.html#balance>
## Built-in commands _man_({{
(Detailed command docs are omitted here for brevity;
if you need them please use one of the above.)
}})
_notman_({{
Here are the detailed command docs, in alphabetical order:
**Data entry (these modify the journal file):** m4_dnl commandnameheading: Commandmdfile:
_command_({{### accounts}} ,{{Accounts}})
- [add](#add) add transactions using guided prompts _command_({{### activity}} ,{{Activity}})
- [import](#import) add any new transactions from other files (eg csv) _command_({{### add}} ,{{Add}})
_command_({{### aregister}} ,{{Aregister}})
**Data management**: _command_({{### balance}} ,{{Balance}})
_command_({{### balancesheet}} ,{{Balancesheet}})
- [check](#check) check for various kinds of issue in the data _command_({{### balancesheetequity}} ,{{Balancesheetequity}})
- [close](#close) (equity) generate balance-resetting transactions _command_({{### cashflow}} ,{{Cashflow}})
- [diff](#diff) compare account transactions in two journal files _command_({{### check}} ,{{Check}})
- [rewrite](#rewrite) generate extra postings, similar to print --auto _command_({{### close}} ,{{Close}})
_command_({{### codes}} ,{{Codes}})
**Financial statements:** _command_({{### commodities}} ,{{Commodities}})
_command_({{### descriptions}} ,{{Descriptions}})
- [aregister](#aregister) (areg) show transactions in a particular account _command_({{### diff}} ,{{Diff}})
- [balancesheet](#balancesheet) (bs) show assets, liabilities and net worth _command_({{### files}} ,{{Files}})
- [balancesheetequity](#balancesheetequity) (bse) show assets, liabilities and equity _command_({{### help}} ,{{Help}})
- [cashflow](#cashflow) (cf) show changes in liquid assets _command_({{### import}} ,{{Import}})
- [incomestatement](#incomestatement) (is) show revenues and expenses _command_({{### incomestatement}} ,{{Incomestatement}})
- [roi](#roi) show return on investments _command_({{### notes}} ,{{Notes}})
_command_({{### payees}} ,{{Payees}})
**Miscellaneous reports:** _command_({{### prices}} ,{{Prices}})
_command_({{### print}} ,{{Print}})
- [accounts](#accounts) (a) show account names _command_({{### print-unique}} ,{{Printunique}})
- [activity](#activity) show postings-per-interval bar charts _command_({{### register}} ,{{Register}})
- [balance](#balance) (b, bal) show balance changes/end balances/budgets in accounts _command_({{### register-match}} ,{{Registermatch}})
- [codes](#codes) show transaction codes _command_({{### rewrite}} ,{{Rewrite}})
- [commodities](#commodities) show commodity/currency symbols _command_({{### roi}} ,{{Roi}})
- [descriptions](#descriptions) show unique transaction descriptions _command_({{### stats}} ,{{Stats}})
- [files](#files) show input file paths _command_({{### tags}} ,{{Tags}})
- [notes](#notes) show unique note segments of transaction descriptions _command_({{### test}} ,{{Test}})
- [payees](#payees) show unique payee segments of transaction descriptions }})
- [prices](#prices) show market price records
- [print](#print) (p, txns) show transactions (journal entries)
- [print-unique](#print-unique) show only transactions with unique descriptions
- [register](#register) (r, reg) show postings in one or more accounts & running total
- [register-match](#register-match) show a recent posting that best matches a description
- [stats](#stats) show journal statistics
- [tags](#tags) show tag names
- [test](#test) run self tests
## Add-on commands ## Add-on commands
@ -1695,133 +1737,6 @@ Add-ons are a relatively easy way to add local features or experiment with new i
They can be written in any language, but haskell scripts have a big advantage: They can be written in any language, but haskell scripts have a big advantage:
they can use the same hledger library functions that built-in commands use for command-line options, parsing and reporting. they can use the same hledger library functions that built-in commands use for command-line options, parsing and reporting.
_notman_({{
## Detailed command help
Here are the detailed command docs, in alphabetical order.
## accounts
_include_(Hledger/Cli/Commands/Accounts.md)
## activity
_include_(Hledger/Cli/Commands/Activity.md)
## add
_include_(Hledger/Cli/Commands/Add.md)
## aregister
_include_(Hledger/Cli/Commands/Aregister.md)
## balance
_include_({{Hledger/Cli/Commands/Balance.md}})
## balancesheet
_include_({{Hledger/Cli/Commands/Balancesheet.md}})
## balancesheetequity
_include_({{Hledger/Cli/Commands/Balancesheetequity.md}})
## cashflow
_include_({{Hledger/Cli/Commands/Cashflow.md}})
## check
_include_({{Hledger/Cli/Commands/Check.md}})
## close
_include_({{Hledger/Cli/Commands/Close.md}})
## codes
_include_({{Hledger/Cli/Commands/Codes.md}})
## commodities
_include_({{Hledger/Cli/Commands/Commodities.md}})
## descriptions
_include_({{Hledger/Cli/Commands/Descriptions.md}})
## diff
_include_({{Hledger/Cli/Commands/Diff.md}})
## files
_include_({{Hledger/Cli/Commands/Files.md}})
## help
_include_({{Hledger/Cli/Commands/Help.md}})
## import
_include_({{Hledger/Cli/Commands/Import.md}})
## incomestatement
_include_({{Hledger/Cli/Commands/Incomestatement.md}})
## notes
_include_({{Hledger/Cli/Commands/Notes.md}})
## payees
_include_({{Hledger/Cli/Commands/Payees.md}})
## prices
_include_({{Hledger/Cli/Commands/Prices.md}})
## print
_include_({{Hledger/Cli/Commands/Print.md}})
## print-unique
_include_({{Hledger/Cli/Commands/Printunique.md}})
## register
_include_({{Hledger/Cli/Commands/Register.md}})
## register-match
_include_({{Hledger/Cli/Commands/Registermatch.md}})
## rewrite
_include_({{Hledger/Cli/Commands/Rewrite.md}})
## roi
_include_({{Hledger/Cli/Commands/Roi.md}})
## stats
_include_({{Hledger/Cli/Commands/Stats.md}})
## tags
_include_({{Hledger/Cli/Commands/Tags.md}})
## test
_include_({{Hledger/Cli/Commands/Test.md}})
}})
# ENVIRONMENT # ENVIRONMENT