mirror of
https://github.com/benjaminion/upgrading-ethereum-book.git
synced 2026-01-09 22:47:55 -05:00
Improve workflow for one-page annotated spec
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/gawk -f
|
||||
|
||||
# Split out the annotated spec chapter as a single page doc and update links
|
||||
|
||||
#
|
||||
# Sends output to stdout
|
||||
|
||||
BEGIN {
|
||||
@@ -27,6 +27,8 @@ in_part_3 {
|
||||
# Change the chapter title
|
||||
if (in_part_3 == 1) {
|
||||
print "# One Page Annotated Spec"
|
||||
print ""
|
||||
print "**Note:** This page has been automatically generated from the chapters in [Part 3](/part3). You may find that some internal links are broken."
|
||||
in_part_3 = 2
|
||||
next
|
||||
}
|
||||
@@ -39,5 +41,10 @@ in_part_3 {
|
||||
# Rewrite urls that are internal to the chapter
|
||||
gsub(/]\(\/part3\/[^#)]*/, "](", $0)
|
||||
|
||||
# Remove page path comments from titles
|
||||
if ($0 ~ /^#.*<!--/) {
|
||||
sub(/ <!--.*-->/, "", $0)
|
||||
}
|
||||
|
||||
print
|
||||
}
|
||||
|
||||
@@ -5,5 +5,10 @@
|
||||
|
||||
cd "$(dirname "$0")/../../src"
|
||||
|
||||
# Build the markdown pages
|
||||
rm -rf md/pages/
|
||||
../bin/build/split.awk book.md
|
||||
|
||||
# Build the one page annotated spec
|
||||
rm -f md/annotated.md
|
||||
../bin/build/annotated.awk book.md > md/annotated.md
|
||||
|
||||
Reference in New Issue
Block a user