mirror of
https://github.com/bitcoinbook/bitcoinbook
synced 2024-11-21 15:48:09 +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/
|
||||
_build/
|
||||
build/
|
||||
book.html
|
||||
|
14
book.adoc
14
book.adoc
@ -2,32 +2,46 @@
|
||||
|
||||
include::preface.asciidoc[]
|
||||
|
||||
//IMAGE_REPORT:NEW_CHAPTER
|
||||
include::intro.adoc[]
|
||||
|
||||
//IMAGE_REPORT:NEW_CHAPTER
|
||||
include::overview.adoc[]
|
||||
|
||||
//IMAGE_REPORT:NEW_CHAPTER
|
||||
include::bitcoin-core.adoc[]
|
||||
|
||||
//IMAGE_REPORT:NEW_CHAPTER
|
||||
include::keys.adoc[]
|
||||
|
||||
//IMAGE_REPORT:NEW_CHAPTER
|
||||
include::wallets.adoc[]
|
||||
|
||||
//IMAGE_REPORT:NEW_CHAPTER
|
||||
include::transactions.adoc[]
|
||||
|
||||
//IMAGE_REPORT:NEW_CHAPTER
|
||||
include::authorization-authentication.adoc[]
|
||||
|
||||
//IMAGE_REPORT:NEW_CHAPTER
|
||||
include::signatures.adoc[]
|
||||
|
||||
//IMAGE_REPORT:NEW_CHAPTER
|
||||
include::fees.adoc[]
|
||||
|
||||
//IMAGE_REPORT:NEW_CHAPTER
|
||||
include::network.adoc[]
|
||||
|
||||
//IMAGE_REPORT:NEW_CHAPTER
|
||||
include::blockchain.adoc[]
|
||||
|
||||
//IMAGE_REPORT:NEW_CHAPTER
|
||||
include::mining.adoc[]
|
||||
|
||||
//IMAGE_REPORT:NEW_CHAPTER
|
||||
include::security.adoc[]
|
||||
|
||||
//IMAGE_REPORT:NEW_CHAPTER
|
||||
include::applications.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