Skip to content

Commit 694a9e6

Browse files
committed
Improve docs by using mandoc and adding txt versions
1 parent c346f04 commit 694a9e6

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

.github/workflows/build_and_deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
run: |
3030
mkdir -p build/doc
3131
nix build .#doc-ledger
32-
cp result/share/doc/ledger/ledger* build/doc
32+
cp result/share/doc/ledger/ledger* build/doc/
3333
nix build .#doc-ledger-mode
34-
cp result/ledger-mode.* build/doc
34+
cp result/ledger-mode.* build/doc/
3535
nix build .#doc-ledger-api
3636
cp -R result/share/doc/ledger/html build/doc/api/
3737
- name: Upload artifact

flake.nix

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
src = ledger;
8888

8989
nativeBuildInputs = with pkgs; [
90-
cmake groff ghostscript texinfo tex
90+
cmake mandoc ghostscript texinfo tex
9191
];
9292

9393
enableParallelBuilding = false;
@@ -99,16 +99,9 @@
9999
buildFlags = "doc";
100100

101101
postBuild = ''
102-
# Create print version of ledger manpage
103-
pdfroff -man -dpaper=letter -P-pletter $src/doc/ledger.1 > ledger.1.pdf
104102
# Patch web version of ledger manual to support dark mode
105103
sed -e 's@</style>@&\n<link rel="stylesheet" type="text/css" href="https://www.gnu.org/software/gnulib/manual.css"><link rel="stylesheet" type="text/css" href="/stylesheets/doc.css">@' ledger3.html -i
106104
'';
107-
108-
postInstall = ''
109-
# Install print version of ledger manpage
110-
cp ledger.1.pdf $out/share/doc/ledger
111-
'';
112105
};
113106

114107
doc-ledger-mode = pkgs.stdenvNoCC.mkDerivation rec {
@@ -128,6 +121,7 @@
128121
runHook preBuild
129122
texi2pdf --batch ledger-mode.texi
130123
makeinfo --force --html --no-split ledger-mode.texi
124+
makeinfo --force --plaintext --no-split -o ledger-mode.txt ledger-mode.texi
131125
# Patch web version of ledger mode manual to support dark mode
132126
sed -e 's@</style>@&\n<link rel="stylesheet" type="text/css" href="https://www.gnu.org/software/gnulib/manual.css"><link rel="stylesheet" type="text/css" href="/stylesheets/doc.css">@' ledger-mode.html -i
133127
runHook postBuild
@@ -136,7 +130,7 @@
136130
installPhase = ''
137131
runHook preInstall
138132
mkdir -p $out
139-
cp ledger-mode.html ledger-mode.pdf $out/
133+
cp ledger-mode.html ledger-mode.pdf ledger-mode.txt $out/
140134
runHook postInstall
141135
'';
142136
};

source/docs.html.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ title: Documentation - Ledger
44

55
# Documentation
66

7-
* [**Ledger 3 manual**](doc/ledger3.html) and [pdf](doc/ledger3.pdf) ([changes](https://git.ledger-cli.org/ledger/commits/master/doc/ledger3.texi))
8-
* [Ledger 3 man page](doc/ledger.1.html) and [pdf](doc/ledger.1.pdf) ([changes](https://git.ledger-cli.org/ledger/commits/master/doc/ledger.1))
7+
* [**Ledger 3 manual**](doc/ledger3.html) as [pdf](doc/ledger3.pdf) or [txt](doc/ledger3.txt) ([changes](https://git.ledger-cli.org/ledger/commits/master/doc/ledger3.texi))
8+
* [Ledger 3 man page](doc/ledger.1.html) as [pdf](doc/ledger.1.pdf) ([changes](https://git.ledger-cli.org/ledger/commits/master/doc/ledger.1))
99
* [Ledger 3 API documentation](doc/api)
10-
* [ledger-mode manual](doc/ledger-mode.html) and [pdf](doc/ledger-mode.pdf) ([changes](https://git.ledger-cli.org/ledger-mode/commits/master/doc/ledger-mode.texi))
10+
* [ledger-mode manual](doc/ledger-mode.html) as [pdf](doc/ledger-mode.pdf) or [txt](doc/ledger-mode.txt) ([changes](https://git.ledger-cli.org/ledger-mode/commits/master/doc/ledger-mode.texi))
1111

1212
## External links
1313

0 commit comments

Comments
 (0)