Skip to content

Commit

Permalink
;doc: use cli not shell for command-line examples
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichael committed Nov 26, 2023
1 parent a198854 commit 0c85b48
Show file tree
Hide file tree
Showing 32 changed files with 181 additions and 181 deletions.
10 changes: 5 additions & 5 deletions bin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ $ fin # list the scripts available
is a way to organise your finance-related reports and scripts using standard bash.
(See also [justfile](#justfile) below.)

```shell
```cli
$ alias f=~/src/hledger/bin/ft
$ f
--------------------------------------------------------------------------------"; }
Expand Down Expand Up @@ -103,7 +103,7 @@ Add hledger options to customise reports.
[`tt`](https://github.com/simonmichael/hledger/blob/master/bin/tt)
is a similar bash multi-script for time reports.

```shell
```cli
$ alias t=~/src/hledger/bin/tt
$ t
--------------------------------------------------------------------------------
Expand Down Expand Up @@ -141,7 +141,7 @@ More on [hledger and just](just.md).
Here is a [justfile](https://github.com/simonmichael/hledger/blob/master/bin/justfile)
reimplementing the `ft` and `tt` scripts more simply:

```shell
```cli
$ brew install just # eg
$ alias j=just
$ cd ~/finance
Expand Down Expand Up @@ -268,7 +268,7 @@ The [hledger-utils python package](https://pypi.org/project/hledger-utils/) prov
a `hledger-edit` command to edit the queried transactions in your `$EDITOR` no matter what file they reside in.

Install or upgrade:
```shell
```cli
$ pip install -U hledger-utils # might be slightly different on your system
```

Expand All @@ -292,7 +292,7 @@ The [hledger-utils python package](https://pypi.org/project/hledger-utils/) prov
a `hledger-plot` command for generating charts with matplotlib.

Install or upgrade:
```shell
```cli
$ pip install -U hledger-utils # might be slightly different on your system
```
Examples:
Expand Down
12 changes: 6 additions & 6 deletions doc/BENCHMARKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This installs haskell dependencies (but not system dependencies) and rebuilds as
then runs [hledger/bench/bench.hs](https://github.com/simonmichael/hledger/blob/master/hledger/bench/bench.hs),
which by default shows quick elapsed-time measurements for several operations on a standard data file:

```shell
```cli
$ stack bench hledger
NOTE: the bench command is functionally equivalent to 'build --bench'
...
Expand All @@ -35,7 +35,7 @@ Benchmark bench: FINISH
bench.hs has some other modes, which you can use by compiling and running it directly.
`--criterion` reports more detailed and dependable measurements, but takes longer:

```shell
```cli
$ cd hledger; stack exec -- ghc -ibench bench/bench && bench/bench --criterion
...
Linking bench/bench ...
Expand Down Expand Up @@ -80,7 +80,7 @@ variance introduced by outliers: 16% (moderately inflated)
It can also show the results for multiple h/ledger executables side by side, if you tweak the bench.hs code.
Unlike the other modes, it does not link with the hledger code directly, but runs the "hledger" executable found in $PATH (so ensure that's the one you intend to test).

```shell
```cli
$ cd hledger; stack exec -- ghc -ibench bench/bench && bench/bench --simplebench
Benchmarking /Users/simon/.local/bin/hledger in /Users/simon/src/hledger/hledger with simplebench and shell
Using bench/default.bench
Expand All @@ -107,12 +107,12 @@ simplebench.hs is a generic benchmarker of one or more executables (specified on
It has a better command-line interface than bench.hs, so you may find it more convenient
for comparing multiple hledger versions, or hledger and ledger. Eg:

```shell
```cli
$ stack exec -- ghc tools/simplebench
[1 of 1] Compiling Main ( tools/simplebench.hs, tools/simplebench.o )
Linking tools/simplebench ...
```
```shell
```cli
$ tools/simplebench -h
tools/simplebench -h
simplebench: at least one executable needed
Expand All @@ -133,7 +133,7 @@ Tips:
- tests can be commented out with #
- results are saved in benchresults.{html,txt}
```
```shell
```cli
cd hledger; $ ../tools/simplebench -f bench/default.bench hledger ledger
Using bench/default.bench
Running 4 tests 2 times with 2 executables at 2015-08-24 04:24:37.257068 UTC:
Expand Down
6 changes: 3 additions & 3 deletions doc/CODE.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Here are some ways to run it during development:

- `yesod devel`: runs in developer mode, rebuilds automatically when config, template, static or haskell files change
(but only files in the hledger-web package):
```shell
```cli
$ (cd hledger-web; yesod devel)
```

Expand All @@ -176,15 +176,15 @@ $ (cd hledger-web; yesod devel)
- `stack ghci`: runs the server in developer mode from GHCI.
Changes to static files like hledger.js will be visible on page reload;
to see other changes, restart it as shown.
```shell
```cli
$ (cd hledger-web; stack ghci hledger-web)
hledger-web> :main --serve # restart: ctrl-c, :r, enter, ctrl-p, ctrl-p, enter
```

- `make ghci-web`: runs the server in developer mode from GHCI, also
interprets the hledger-lib and hledger packages so that :reload picks
up changes in those packages too:
```shell
```cli
$ make ghci-web
ghci> :main --serve
```
Expand Down
2 changes: 1 addition & 1 deletion doc/EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The numbers describe the number of transactions, number of accounts, and maximum
They are generated by [`tools/generatejournal.hs`](https://github.com/simonmichael/hledger/blob/master/tools/generatejournal.hs).
They should get built automatically as needed, if not you can use `make samplejournals`:

```shell
```cli
$ make samplejournals
ghc tools/generatejournal.hs
[1 of 1] Compiling Main ( tools/generatejournal.hs, tools/generatejournal.o )
Expand Down
6 changes: 3 additions & 3 deletions doc/MAKE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The Makefile contains a fair amount of obsolete cruft and needs cleanup. Some ta

The Makefile is self-documenting. Run `make` to see a list of the main make rules:

```shell
```cli
$ make
Makefile:37: -------------------- hledger make rules --------------------
Makefile:39: make [help] -- list documented rules in this makefile. make -n RULE shows more detail.
Expand All @@ -23,11 +23,11 @@ Makefile:304: make hledgerdev -- quickly build the hledger executable (with ghc

To see what a make rule will do without actually doing it, use the `-n` flag:

```shell
```cli
$ make build -n
stack build
```
```shell
```cli
$ make test -n
(stack test \
&& echo pkgtest PASSED) || echo pkgtest FAILED
Expand Down
2 changes: 1 addition & 1 deletion hledger-ui/hledger-ui.m4.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ This is very useful when reconciling. A good workflow is to have
your bank's online register open in a browser window, for reference;
the journal file open in an editor window;
and hledger-ui in watch mode in a terminal window, eg:
```shell
```cli
$ hledger-ui --watch --register checking -C
```
As you mark things cleared in the editor,
Expand Down
10 changes: 5 additions & 5 deletions hledger-web/hledger-web.m4.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ In addition to the web UI, hledger-web also serves a JSON API that can be
used to get data or add new transactions.
If you want the JSON API only, you can use the `--serve-api` flag. Eg:

```shell
```cli
$ hledger-web -f examples/sample.journal --serve-api
...
```
Expand All @@ -227,7 +227,7 @@ You can get JSON data from these routes:
Eg, all account names in the journal (similar to the [accounts](hledger.html#accounts) command).
(hledger-web's JSON does not include newlines, here we use python to prettify it):

```shell
```cli
$ curl -s http://127.0.0.1:5000/accountnames | python -m json.tool
[
"assets",
Expand All @@ -248,7 +248,7 @@ $ curl -s http://127.0.0.1:5000/accountnames | python -m json.tool

Or all transactions:

```shell
```cli
$ curl -s http://127.0.0.1:5000/transactions | python -m json.tool
[
{
Expand Down Expand Up @@ -294,7 +294,7 @@ The payload must be the full, exact JSON representation of a hledger transaction
You can get sample JSON from hledger-web's `/transactions` or `/accounttransactions`,
or you can export it with hledger-lib, eg like so:

```shell
```cli
.../hledger$ stack ghci hledger-lib
>>> writeJsonFile "txn.json" (head $ jtxns samplejournal)
>>> :q
Expand Down Expand Up @@ -395,7 +395,7 @@ and related data types):

And here's how to test adding it with curl. This should add a new entry to your journal:

```shell
```cli
$ curl http://127.0.0.1:5000/add -X PUT -H 'Content-Type: application/json' --data-binary @txn.json
```

Expand Down
4 changes: 2 additions & 2 deletions hledger/Hledger/Cli/Commands/Accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ account name, or if none can be found, it fails with a non-zero exit code.

Examples:

```shell
```cli
$ hledger accounts
assets:bank:checking
assets:bank:saving
Expand All @@ -50,7 +50,7 @@ income:gifts
income:salary
liabilities:debts
```
```shell
```cli
$ hledger accounts --undeclared --directives >> $LEDGER_FILE
$ hledger check accounts
```
2 changes: 1 addition & 1 deletion hledger/Hledger/Cli/Commands/Activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ counts by day, week, month or other reporting interval (by day is the
default). With query arguments, it counts only matched transactions.

Examples:
```shell
```cli
$ hledger activity --quarterly
2008-01-01 **
2008-04-01 *******
Expand Down
2 changes: 1 addition & 1 deletion hledger/Hledger/Cli/Commands/Aregister.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ causing it to be different from the account's real-world running balance.
An example: this shows the transactions and historical running balance
during july, in the first account whose name contains "checking":

```shell
```cli
$ hledger areg checking date:jul
```

Expand Down
Loading

0 comments on commit 0c85b48

Please sign in to comment.