mirror of
https://github.com/bitcoinbook/bitcoinbook
synced 2024-11-22 08:08:11 +00:00
Add tools/image-report
This commit is contained in:
parent
ab1803246f
commit
3d924b461a
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,3 +7,4 @@ _build/
|
|||||||
dist/
|
dist/
|
||||||
_build/
|
_build/
|
||||||
build/
|
build/
|
||||||
|
book.html
|
||||||
|
14
book.adoc
14
book.adoc
@ -2,32 +2,46 @@
|
|||||||
|
|
||||||
include::preface.asciidoc[]
|
include::preface.asciidoc[]
|
||||||
|
|
||||||
|
//IMAGE_REPORT:NEW_CHAPTER
|
||||||
include::intro.adoc[]
|
include::intro.adoc[]
|
||||||
|
|
||||||
|
//IMAGE_REPORT:NEW_CHAPTER
|
||||||
include::overview.adoc[]
|
include::overview.adoc[]
|
||||||
|
|
||||||
|
//IMAGE_REPORT:NEW_CHAPTER
|
||||||
include::bitcoin-core.adoc[]
|
include::bitcoin-core.adoc[]
|
||||||
|
|
||||||
|
//IMAGE_REPORT:NEW_CHAPTER
|
||||||
include::keys.adoc[]
|
include::keys.adoc[]
|
||||||
|
|
||||||
|
//IMAGE_REPORT:NEW_CHAPTER
|
||||||
include::wallets.adoc[]
|
include::wallets.adoc[]
|
||||||
|
|
||||||
|
//IMAGE_REPORT:NEW_CHAPTER
|
||||||
include::transactions.adoc[]
|
include::transactions.adoc[]
|
||||||
|
|
||||||
|
//IMAGE_REPORT:NEW_CHAPTER
|
||||||
include::authorization-authentication.adoc[]
|
include::authorization-authentication.adoc[]
|
||||||
|
|
||||||
|
//IMAGE_REPORT:NEW_CHAPTER
|
||||||
include::signatures.adoc[]
|
include::signatures.adoc[]
|
||||||
|
|
||||||
|
//IMAGE_REPORT:NEW_CHAPTER
|
||||||
include::fees.adoc[]
|
include::fees.adoc[]
|
||||||
|
|
||||||
|
//IMAGE_REPORT:NEW_CHAPTER
|
||||||
include::network.adoc[]
|
include::network.adoc[]
|
||||||
|
|
||||||
|
//IMAGE_REPORT:NEW_CHAPTER
|
||||||
include::blockchain.adoc[]
|
include::blockchain.adoc[]
|
||||||
|
|
||||||
|
//IMAGE_REPORT:NEW_CHAPTER
|
||||||
include::mining.adoc[]
|
include::mining.adoc[]
|
||||||
|
|
||||||
|
//IMAGE_REPORT:NEW_CHAPTER
|
||||||
include::security.adoc[]
|
include::security.adoc[]
|
||||||
|
|
||||||
|
//IMAGE_REPORT:NEW_CHAPTER
|
||||||
include::applications.adoc[]
|
include::applications.adoc[]
|
||||||
|
|
||||||
include::whitepaper.adoc[]
|
include::whitepaper.adoc[]
|
||||||
|
22
tools/image-report
Executable file
22
tools/image-report
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash -eu
|
||||||
|
|
||||||
|
BUILDDIR=$( mktemp -d )
|
||||||
|
|
||||||
|
# Generate a CSV of all images for sending to O'Reilly
|
||||||
|
|
||||||
|
files=$(
|
||||||
|
grep -A1 IMAGE_REPORT:NEW_CHAPTER book.adoc \
|
||||||
|
| sed '/^--/d; /IMAGE_REPORT/d; s/^include:://; s/\[]$//'
|
||||||
|
)
|
||||||
|
|
||||||
|
chapter=0
|
||||||
|
for file in $files ; do
|
||||||
|
chapter=$(( chapter + 1 ))
|
||||||
|
|
||||||
|
images=$BUILDDIR/$( basename $file )
|
||||||
|
grep ^image:: $file > $images || true
|
||||||
|
for image in $( seq 1 $( cat $images | wc -l ) ) ; do
|
||||||
|
echo -n "${chapter}-${image},"
|
||||||
|
sed -n "${image}{s/^image:://; s/\[.*//; p}" $images
|
||||||
|
done
|
||||||
|
done
|
Loading…
Reference in New Issue
Block a user