Include cargo version in the generated manual

pull/263/head
Wilfred Hughes 2022-04-21 00:31:06 +07:00
parent fb846bd904
commit 80429e9697
4 changed files with 12 additions and 1 deletions

@ -13,6 +13,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install jq
run: sudo apt-get install -y jq
- uses: actions-rs/toolchain@v1
with:
profile: minimal

@ -15,3 +15,6 @@ git-repository-url = "https://github.com/wilfred/difftastic"
[output.html.playground]
copyable = false
[preprocessor.replace-version-placeholder]
command = "./replace_version_placeholder.sh"

@ -0,0 +1,5 @@
#!/bin/bash
DFT_VERSION=$(cargo read-manifest | jq -r .version)
jq .[1] | jq '.sections[0].Chapter.content |= sub("DFT_VERSION_HERE"; "'$DFT_VERSION'")'

@ -6,7 +6,7 @@ Difftastic is a diff tool that understands syntax. It supports [over
Difftastic is open source software (MIT license) and [available on
GitHub](https://github.com/wilfred/difftastic).
This manual tracks the bleeding edge version of difftastic. The
This copy of the manual describes version DFT_VERSION_HERE. The
[changelog](https://github.com/Wilfred/difftastic/blob/master/CHANGELOG.md)
records which features and bug fixes are in each version.