;doc: change flags marker in command helps to suit latest pandoc

From _FLAGS_ to $FLAGS$, since latest pandoc strips the underscores
at a certain point in our docs rendering.
This commit is contained in:
Simon Michael 2020-01-04 18:29:01 -08:00
parent 412ea86a2d
commit c186eb6084
61 changed files with 69 additions and 68 deletions

View File

@ -209,6 +209,7 @@ The journal file path when not specified with `-f`.
Default: `~/.hledger.journal` (on windows, perhaps `C:/Users/USER/.hledger.journal`). Default: `~/.hledger.journal` (on windows, perhaps `C:/Users/USER/.hledger.journal`).
}} )m4_dnl }} )m4_dnl
m4_dnl m4_dnl
m4_dnl Dummy macro to strip _FLAGS_ marker in command docs. m4_dnl Dummy macro to strip $FLAGS$ marker in command docs.
m4_define({{_FLAGS_}}, {{}})m4_dnl m4_dnl Not using underscore here, because latest pandoc strips those.
m4_define({{$FLAGS$}}, {{}})m4_dnl
m4_dnl m4_dnl

View File

@ -303,9 +303,9 @@ hledgerCommandMode doc unnamedflaggroup namedflaggroups hiddenflaggroup argsdesc
-- --
-- - First line: the command name then any aliases, as one or more space or comma-separated words -- - First line: the command name then any aliases, as one or more space or comma-separated words
-- --
-- - Second line to a line containing just _FLAGS_, or the end: the short help -- - Second line to a line containing just $FLAGS$, or the end: the short help
-- --
-- - Any lines after _FLAGS_: the long help (split into lines for cmdargs) -- - Any lines after $FLAGS$: the long help (split into lines for cmdargs)
-- --
-- The CLI help displays the short help, then the cmdargs-generated -- The CLI help displays the short help, then the cmdargs-generated
-- flags list, then the long help (which some day we might make -- flags list, then the long help (which some day we might make
@ -319,7 +319,7 @@ parseCommandDoc t =
(l:ls) -> Just (names, shorthelp, longhelplines) (l:ls) -> Just (names, shorthelp, longhelplines)
where where
names = words $ map (\c -> if c `elem` [',','\\'] then ' ' else c) l names = words $ map (\c -> if c `elem` [',','\\'] then ' ' else c) l
(shorthelpls, longhelpls) = break (== "_FLAGS_") ls (shorthelpls, longhelpls) = break (== "$FLAGS$") ls
shorthelp = unlines $ reverse $ dropWhile null $ reverse shorthelpls shorthelp = unlines $ reverse $ dropWhile null $ reverse shorthelpls
longhelplines = dropWhile null $ drop 1 longhelpls longhelplines = dropWhile null $ drop 1 longhelpls

View File

@ -1,7 +1,7 @@
accounts, a\ accounts, a\
Show account names. Show account names.
_FLAGS_ $FLAGS$
This command lists account names, either declared with account directives This command lists account names, either declared with account directives
(--declared), posted to (--used), or both (the default). (--declared), posted to (--used), or both (the default).

View File

@ -1,7 +1,7 @@
accounts, a accounts, a
Show account names. Show account names.
_FLAGS_ $FLAGS$
This command lists account names, either declared with account This command lists account names, either declared with account
directives (--declared), posted to (--used), or both (the default). With directives (--declared), posted to (--used), or both (the default). With

View File

@ -1,7 +1,7 @@
activity\ activity\
Show an ascii barchart of posting counts per interval. Show an ascii barchart of posting counts per interval.
_FLAGS_ $FLAGS$
The activity command displays an ascii histogram showing transaction The activity command displays an ascii histogram showing transaction
counts by day, week, month or other reporting interval (by day is the counts by day, week, month or other reporting interval (by day is the

View File

@ -1,7 +1,7 @@
activity activity
Show an ascii barchart of posting counts per interval. Show an ascii barchart of posting counts per interval.
_FLAGS_ $FLAGS$
The activity command displays an ascii histogram showing transaction The activity command displays an ascii histogram showing transaction
counts by day, week, month or other reporting interval (by day is the counts by day, week, month or other reporting interval (by day is the

View File

@ -1,7 +1,7 @@
add\ add\
Prompt for transactions and add them to the journal. Prompt for transactions and add them to the journal.
_FLAGS_ $FLAGS$
Many hledger users edit their journals directly with a text editor, or generate them from CSV. Many hledger users edit their journals directly with a text editor, or generate them from CSV.
For more interactive data entry, there is the `add` command, For more interactive data entry, there is the `add` command,

View File

@ -1,7 +1,7 @@
add add
Prompt for transactions and add them to the journal. Prompt for transactions and add them to the journal.
_FLAGS_ $FLAGS$
Many hledger users edit their journals directly with a text editor, or Many hledger users edit their journals directly with a text editor, or
generate them from CSV. For more interactive data entry, there is the generate them from CSV. For more interactive data entry, there is the

View File

@ -1,7 +1,7 @@
balance, bal, b\ balance, bal, b\
Show accounts and their balances. Show accounts and their balances.
_FLAGS_ $FLAGS$
The balance command is hledger's most versatile command. The balance command is hledger's most versatile command.
Note, despite the name, it is not always used for showing real-world account balances; Note, despite the name, it is not always used for showing real-world account balances;

View File

@ -1,7 +1,7 @@
balance, bal, b balance, bal, b
Show accounts and their balances. Show accounts and their balances.
_FLAGS_ $FLAGS$
The balance command is hledger's most versatile command. Note, despite The balance command is hledger's most versatile command. Note, despite
the name, it is not always used for showing real-world account balances; the name, it is not always used for showing real-world account balances;

View File

@ -8,7 +8,7 @@ Note this report shows all account balances with normal positive sign
(like conventional financial statements, unlike balance/print/register) (like conventional financial statements, unlike balance/print/register)
(experimental). (experimental).
_FLAGS_ $FLAGS$
Example: Example:

View File

@ -8,7 +8,7 @@ Note this report shows all account balances with normal positive sign
(like conventional financial statements, unlike balance/print/register) (like conventional financial statements, unlike balance/print/register)
(experimental). (experimental).
_FLAGS_ $FLAGS$
Example: Example:

View File

@ -2,7 +2,7 @@ balancesheetequity, bse\
Just like [balancesheet](#balancesheet), but also reports Equity Just like [balancesheet](#balancesheet), but also reports Equity
(which it assumes is under a top-level `equity` account). (which it assumes is under a top-level `equity` account).
_FLAGS_ $FLAGS$
Example: Example:
```shell ```shell

View File

@ -2,7 +2,7 @@ balancesheetequity, bse
Just like balancesheet, but also reports Equity (which it assumes is Just like balancesheet, but also reports Equity (which it assumes is
under a top-level equity account). under a top-level equity account).
_FLAGS_ $FLAGS$
Example: Example:

View File

@ -7,7 +7,7 @@ Note this report shows all account balances with normal positive sign
(like conventional financial statements, unlike balance/print/register) (like conventional financial statements, unlike balance/print/register)
(experimental). (experimental).
_FLAGS_ $FLAGS$
Example: Example:
```shell ```shell

View File

@ -6,7 +6,7 @@ contain receivable or A/R in their name. Note this report shows all
account balances with normal positive sign (like conventional financial account balances with normal positive sign (like conventional financial
statements, unlike balance/print/register) (experimental). statements, unlike balance/print/register) (experimental).
_FLAGS_ $FLAGS$
Example: Example:

View File

@ -5,4 +5,4 @@ With --strict, dates must also be unique.
With a query, only matched transactions' dates are checked. With a query, only matched transactions' dates are checked.
Reads the default journal file, or another specified with -f. Reads the default journal file, or another specified with -f.
_FLAGS_ $FLAGS$

View File

@ -4,4 +4,4 @@ checks secondary dates instead. With --strict, dates must also be
unique. With a query, only matched transactions' dates are checked. unique. With a query, only matched transactions' dates are checked.
Reads the default journal file, or another specified with -f. Reads the default journal file, or another specified with -f.
_FLAGS_ $FLAGS$

View File

@ -3,6 +3,6 @@ Reports account names having the same leaf but different prefixes.
In other words, two or more leaves that are categorized differently. In other words, two or more leaves that are categorized differently.
Reads the default journal file, or another specified as an argument. Reads the default journal file, or another specified as an argument.
_FLAGS_ $FLAGS$
An example: http://stefanorodighiero.net/software/hledger-dupes.html An example: http://stefanorodighiero.net/software/hledger-dupes.html

View File

@ -3,6 +3,6 @@ Reports account names having the same leaf but different prefixes. In
other words, two or more leaves that are categorized differently. Reads other words, two or more leaves that are categorized differently. Reads
the default journal file, or another specified as an argument. the default journal file, or another specified as an argument.
_FLAGS_ $FLAGS$
An example: http://stefanorodighiero.net/software/hledger-dupes.html An example: http://stefanorodighiero.net/software/hledger-dupes.html

View File

@ -5,7 +5,7 @@ Useful for bringing asset/liability balances forward into a new journal file,
or for closing out revenues/expenses to retained earnings at the end of a or for closing out revenues/expenses to retained earnings at the end of a
period. period.
_FLAGS_ $FLAGS$
The closing transaction transfers balances to "equity:closing balances", The closing transaction transfers balances to "equity:closing balances",
and the opening transaction transfers balances from "equity:opening balances", and the opening transaction transfers balances from "equity:opening balances",

View File

@ -5,7 +5,7 @@ Useful for bringing asset/liability balances forward into a new journal
file, or for closing out revenues/expenses to retained earnings at the file, or for closing out revenues/expenses to retained earnings at the
end of a period. end of a period.
_FLAGS_ $FLAGS$
The closing transaction transfers balances to "equity:closing balances", The closing transaction transfers balances to "equity:closing balances",
and the opening transaction transfers balances from "equity:opening and the opening transaction transfers balances from "equity:opening
@ -51,8 +51,8 @@ Examples:
Carrying asset/liability balances into a new file for 2019, all from Carrying asset/liability balances into a new file for 2019, all from
command line: command line:
_Warning: we use >> here to append; be careful not to type a single > Warning: we use >> here to append; be careful not to type a single >
which would wipe your journal!_ which would wipe your journal!
$ hledger close -f 2018.journal -e 2019 assets liabilities --opening >>2019.journal $ hledger close -f 2018.journal -e 2019 assets liabilities --opening >>2019.journal
$ hledger close -f 2018.journal -e 2019 assets liabilities --closing >>2018.journal $ hledger close -f 2018.journal -e 2019 assets liabilities --closing >>2018.journal

View File

@ -1,4 +1,4 @@
commodities\ commodities\
List all commodity/currency symbols used or declared in the journal. List all commodity/currency symbols used or declared in the journal.
_FLAGS_ $FLAGS$

View File

@ -1,4 +1,4 @@
commodities commodities
List all commodity/currency symbols used or declared in the journal. List all commodity/currency symbols used or declared in the journal.
_FLAGS_ $FLAGS$

View File

@ -1,7 +1,7 @@
descriptions descriptions
Show descriptions. Show descriptions.
_FLAGS_ $FLAGS$
This command lists all descriptions that appear in transactions. This command lists all descriptions that appear in transactions.

View File

@ -1,6 +1,6 @@
descriptions Show descriptions. descriptions Show descriptions.
_FLAGS_ $FLAGS$
This command lists all descriptions that appear in transactions. This command lists all descriptions that appear in transactions.

View File

@ -15,7 +15,7 @@ from your bank (eg as CSV data). When hledger and your bank disagree
about the account balance, you can compare the bank data with your about the account balance, you can compare the bank data with your
journal to find out the cause. journal to find out the cause.
_FLAGS_ $FLAGS$
Examples: Examples:

View File

@ -14,7 +14,7 @@ your bank (eg as CSV data). When hledger and your bank disagree about
the account balance, you can compare the bank data with your journal to the account balance, you can compare the bank data with your journal to
find out the cause. find out the cause.
_FLAGS_ $FLAGS$
Examples: Examples:

View File

@ -2,4 +2,4 @@ files\
List all files included in the journal. With a REGEX argument, List all files included in the journal. With a REGEX argument,
only file names matching the regular expression (case sensitive) are shown. only file names matching the regular expression (case sensitive) are shown.
_FLAGS_ $FLAGS$

View File

@ -2,4 +2,4 @@ files
List all files included in the journal. With a REGEX argument, only file List all files included in the journal. With a REGEX argument, only file
names matching the regular expression (case sensitive) are shown. names matching the regular expression (case sensitive) are shown.
_FLAGS_ $FLAGS$

View File

@ -1,7 +1,7 @@
help\ help\
Show any of the hledger manuals. Show any of the hledger manuals.
_FLAGS_ $FLAGS$
The `help` command displays any of the main [hledger manuals](/docs.html), in one of several ways. The `help` command displays any of the main [hledger manuals](/docs.html), in one of several ways.
Run it with no argument to list the manuals, or provide a full or partial manual name to select one. Run it with no argument to list the manuals, or provide a full or partial manual name to select one.

View File

@ -1,7 +1,7 @@
help help
Show any of the hledger manuals. Show any of the hledger manuals.
_FLAGS_ $FLAGS$
The help command displays any of the main hledger manuals, in one of The help command displays any of the main hledger manuals, in one of
several ways. Run it with no argument to list the manuals, or provide a several ways. Run it with no argument to list the manuals, or provide a

View File

@ -4,7 +4,7 @@ the main journal file. Or with --dry-run, just print the transactions
that would be added. Or with --catchup, just mark all of the FILEs' that would be added. Or with --catchup, just mark all of the FILEs'
transactions as imported, without actually importing any. transactions as imported, without actually importing any.
_FLAGS_ $FLAGS$
The input files are specified as arguments - no need to write -f before each one. The input files are specified as arguments - no need to write -f before each one.
So eg to add new transactions from all CSV files to the main journal, it's just: So eg to add new transactions from all CSV files to the main journal, it's just:

View File

@ -4,7 +4,7 @@ the main journal file. Or with --dry-run, just print the transactions
that would be added. Or with --catchup, just mark all of the FILEs' that would be added. Or with --catchup, just mark all of the FILEs'
transactions as imported, without actually importing any. transactions as imported, without actually importing any.
_FLAGS_ $FLAGS$
The input files are specified as arguments - no need to write -f before The input files are specified as arguments - no need to write -f before
each one. So eg to add new transactions from all CSV files to the main each one. So eg to add new transactions from all CSV files to the main

View File

@ -7,7 +7,7 @@ Note this report shows all account balances with normal positive sign
(like conventional financial statements, unlike balance/print/register) (like conventional financial statements, unlike balance/print/register)
(experimental). (experimental).
_FLAGS_ $FLAGS$
This command displays a simple This command displays a simple
[income statement](http://en.wikipedia.org/wiki/Income_statement). It [income statement](http://en.wikipedia.org/wiki/Income_statement). It

View File

@ -6,7 +6,7 @@ forms also allowed). Note this report shows all account balances with
normal positive sign (like conventional financial statements, unlike normal positive sign (like conventional financial statements, unlike
balance/print/register) (experimental). balance/print/register) (experimental).
_FLAGS_ $FLAGS$
This command displays a simple income statement. It currently assumes This command displays a simple income statement. It currently assumes
that you have top-level accounts named income (or revenue) and expense that you have top-level accounts named income (or revenue) and expense

View File

@ -1,7 +1,7 @@
notes notes
Show notes. Show notes.
_FLAGS_ $FLAGS$
This command lists all notes that appear in transactions. This command lists all notes that appear in transactions.

View File

@ -1,6 +1,6 @@
notes Show notes. notes Show notes.
_FLAGS_ $FLAGS$
This command lists all notes that appear in transactions. This command lists all notes that appear in transactions.

View File

@ -1,7 +1,7 @@
payees payees
Show payee names. Show payee names.
_FLAGS_ $FLAGS$
This command lists all payee names that appear in transactions. This command lists all payee names that appear in transactions.

View File

@ -1,6 +1,6 @@
payees Show payee names. payees Show payee names.
_FLAGS_ $FLAGS$
This command lists all payee names that appear in transactions. This command lists all payee names that appear in transactions.

View File

@ -5,4 +5,4 @@ With --inverted-costs, also print inverse prices based on transaction prices.
Prices (and postings providing prices) can be filtered by a query. Prices (and postings providing prices) can be filtered by a query.
Price amounts are always displayed with their full precision. Price amounts are always displayed with their full precision.
_FLAGS_ $FLAGS$

View File

@ -5,4 +5,4 @@ synthetic market prices based on transaction prices. With
Prices (and postings providing prices) can be filtered by a query. Price Prices (and postings providing prices) can be filtered by a query. Price
amounts are always displayed with their full precision. amounts are always displayed with their full precision.
_FLAGS_ $FLAGS$

View File

@ -1,7 +1,7 @@
print, txns, p\ print, txns, p\
Show transaction journal entries, sorted by date. Show transaction journal entries, sorted by date.
_FLAGS_ $FLAGS$
The print command displays full journal entries (transactions) from The print command displays full journal entries (transactions) from
the journal file in date order, tidily formatted. the journal file in date order, tidily formatted.

View File

@ -1,7 +1,7 @@
print, txns, p print, txns, p
Show transaction journal entries, sorted by date. Show transaction journal entries, sorted by date.
_FLAGS_ $FLAGS$
The print command displays full journal entries (transactions) from the The print command displays full journal entries (transactions) from the
journal file in date order, tidily formatted. With --date2, transactions journal file in date order, tidily formatted. With --date2, transactions

View File

@ -1,7 +1,7 @@
print-unique\ print-unique\
Print transactions which do not reuse an already-seen description. Print transactions which do not reuse an already-seen description.
_FLAGS_ $FLAGS$
Example: Example:

View File

@ -1,7 +1,7 @@
print-unique print-unique
Print transactions which do not reuse an already-seen description. Print transactions which do not reuse an already-seen description.
_FLAGS_ $FLAGS$
Example: Example:

View File

@ -58,12 +58,12 @@ Here are more special features/conventions of command doc files (see
markdown formatting though, eg to define a list. markdown formatting though, eg to define a list.
- After the short help, there should be a paragraph containing just - After the short help, there should be a paragraph containing just
_FLAGS_. This marks the end of the short help, and it will be $FLAGS$. This marks the end of the short help, and it will be
replaced in command line help by the flags list. (Without it, the replaced in command line help by the flags list. (Without it, the
flags list appears at the end of command line help.) The flags list flags list appears at the end of command line help.) The flags list
will not appear in the hledger manual. will not appear in the hledger manual.
- Long help (as many paragraphs as needed) follows the _FLAGS_ marker. - Long help (as many paragraphs as needed) follows the $FLAGS$ marker.
This often ends with one or more examples. This often ends with one or more examples.

View File

@ -1,7 +1,7 @@
register, reg, r\ register, reg, r\
Show postings and their running total. Show postings and their running total.
_FLAGS_ $FLAGS$
The register command displays postings in date order, one per line, The register command displays postings in date order, one per line,
and their running total. This is typically used with a and their running total. This is typically used with a

View File

@ -1,7 +1,7 @@
register, reg, r register, reg, r
Show postings and their running total. Show postings and their running total.
_FLAGS_ $FLAGS$
The register command displays postings in date order, one per line, and The register command displays postings in date order, one per line, and
their running total. This is typically used with a query selecting a their running total. This is typically used with a query selecting a
@ -32,7 +32,7 @@ the whole report period). This flag implies --empty (see below). It is
affected by --historical. It works best when showing just one account affected by --historical. It works best when showing just one account
and one commodity. and one commodity.
The --related/-r flag shows the _other_ postings in the transactions of The --related/-r flag shows the other postings in the transactions of
the postings which would normally be shown. the postings which would normally be shown.
The --invert flag negates all amounts. For example, it can be used on an The --invert flag negates all amounts. For example, it can be used on an

View File

@ -5,4 +5,4 @@ If there are multiple equally good matches, it shows the most recent.
Query options (options, not arguments) can be used to restrict the search space. Query options (options, not arguments) can be used to restrict the search space.
Helps ledger-autosync detect already-seen transactions when importing. Helps ledger-autosync detect already-seen transactions when importing.
_FLAGS_ $FLAGS$

View File

@ -5,4 +5,4 @@ matches, it shows the most recent. Query options (options, not
arguments) can be used to restrict the search space. Helps arguments) can be used to restrict the search space. Helps
ledger-autosync detect already-seen transactions when importing. ledger-autosync detect already-seen transactions when importing.
_FLAGS_ $FLAGS$

View File

@ -2,7 +2,7 @@ rewrite\
Print all transactions, rewriting the postings of matched transactions. Print all transactions, rewriting the postings of matched transactions.
For now the only rewrite available is adding new postings, like print --auto. For now the only rewrite available is adding new postings, like print --auto.
_FLAGS_ $FLAGS$
This is a start at a generic rewriter of transaction entries. This is a start at a generic rewriter of transaction entries.
It reads the default journal and prints the transactions, like print, It reads the default journal and prints the transactions, like print,

View File

@ -3,7 +3,7 @@ Print all transactions, rewriting the postings of matched transactions.
For now the only rewrite available is adding new postings, like print For now the only rewrite available is adding new postings, like print
--auto. --auto.
_FLAGS_ $FLAGS$
This is a start at a generic rewriter of transaction entries. It reads This is a start at a generic rewriter of transaction entries. It reads
the default journal and prints the transactions, like print, but adds the default journal and prints the transactions, like print, but adds

View File

@ -2,7 +2,7 @@ roi\
Shows the time-weighted (TWR) and money-weighted (IRR) rate of return Shows the time-weighted (TWR) and money-weighted (IRR) rate of return
on your investments. on your investments.
_FLAGS_ $FLAGS$
This command assumes that you have account(s) that hold nothing but This command assumes that you have account(s) that hold nothing but
your investments and whenever you record current appraisal/valuation your investments and whenever you record current appraisal/valuation

View File

@ -2,7 +2,7 @@ roi
Shows the time-weighted (TWR) and money-weighted (IRR) rate of return on Shows the time-weighted (TWR) and money-weighted (IRR) rate of return on
your investments. your investments.
_FLAGS_ $FLAGS$
This command assumes that you have account(s) that hold nothing but your This command assumes that you have account(s) that hold nothing but your
investments and whenever you record current appraisal/valuation of these investments and whenever you record current appraisal/valuation of these

View File

@ -1,7 +1,7 @@
stats\ stats\
Show some journal statistics. Show some journal statistics.
_FLAGS_ $FLAGS$
The stats command displays summary information for the whole journal, or The stats command displays summary information for the whole journal, or
a matched part of it. With a [reporting interval](#reporting-interval), a matched part of it. With a [reporting interval](#reporting-interval),

View File

@ -1,7 +1,7 @@
stats stats
Show some journal statistics. Show some journal statistics.
_FLAGS_ $FLAGS$
The stats command displays summary information for the whole journal, or The stats command displays summary information for the whole journal, or
a matched part of it. With a reporting interval, it shows a report for a matched part of it. With a reporting interval, it shows a report for

View File

@ -4,4 +4,4 @@ only tag names matching the regular expression (case insensitive) are shown.
With QUERY arguments, only transactions matching the query are considered. With QUERY arguments, only transactions matching the query are considered.
With --values flag, the tags' unique values are listed instead. With --values flag, the tags' unique values are listed instead.
_FLAGS_ $FLAGS$

View File

@ -5,4 +5,4 @@ shown. With QUERY arguments, only transactions matching the query are
considered. With --values flag, the tags' unique values are listed considered. With --values flag, the tags' unique values are listed
instead. instead.
_FLAGS_ $FLAGS$

View File

@ -1,7 +1,7 @@
test\ test\
Run built-in unit tests. Run built-in unit tests.
_FLAGS_ $FLAGS$
This command runs the unit tests built in to hledger and hledger-lib, This command runs the unit tests built in to hledger and hledger-lib,
printing the results on stdout. If any test fails, the exit code will printing the results on stdout. If any test fails, the exit code will

View File

@ -1,7 +1,7 @@
test test
Run built-in unit tests. Run built-in unit tests.
_FLAGS_ $FLAGS$
This command runs the unit tests built in to hledger and hledger-lib, This command runs the unit tests built in to hledger and hledger-lib,
printing the results on stdout. If any test fails, the exit code will be printing the results on stdout. If any test fails, the exit code will be