Skip to content

Commit

Permalink
* chase upstream 0X-0Y => X-Y
Browse files Browse the repository at this point in the history
  • Loading branch information
audreyt committed Mar 14, 2024
1 parent c04c2ac commit 789ebfd
Show file tree
Hide file tree
Showing 36 changed files with 12 additions and 12 deletions.
File renamed without changes.
12 changes: 6 additions & 6 deletions scripts/make-book-zh-tw.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
---
HEADER

$all .= (read_file($_) =~ s/^#+\s+(.+)/\n**$1**/rg). "\n\n" for glob("contents/traditional-mandarin/00-0[13]-*.md");
$all .= (read_file($_) =~ s/^#+\s+(.+)/\n**$1**/rg). "\n\n" for glob("contents/traditional-mandarin/0-[13]-*.md");

sub read_file {
my $filename = shift;
Expand All @@ -46,7 +46,7 @@ sub write_file {
6 => "六、影響",
7 => "七、前行",
);
for (sort <contents/traditional-mandarin/0[1234567].md>) {
for (sort <contents/traditional-mandarin/[1234567]*.md>) {
my $basename = s,.*/([-\d]+)-.*,$1,r;
my $s = int($basename =~ s/-.*//r);
if (my $section_name = delete $Sections{$s}) {
Expand All @@ -68,9 +68,9 @@ sub write_file {
write_file('traditional-mandarin.md', $all);
write_file(
'00-01.tex', (
'0-1.tex', (
map { read_file($_) =~ s/\*\*(.*?)\*\*/\\textbf{$1}/rg =~ s/^#+\s+(.+)/\\textbf{$1}/rg =~ s/&/\\&/rg }
glob 'contents/traditional-mandarin/00-02-*.md'
glob 'contents/traditional-mandarin/0-2-*.md'
)
);
Expand All @@ -84,7 +84,7 @@ sub write_file {
.
system << '.';
docker run --rm --volume "$(pwd):/data" --user $(id -u):$(id -g) audreyt/pandoc-plurality-book traditional-mandarin.md -o tmp.pdf --include-before-body=00-01.tex --toc --toc-depth=2 -s --pdf-engine=xelatex -V CJKmainfont='Noto Sans CJK TC' -V fontsize=20pt -V documentclass=extreport -f markdown-implicit_figures --filter=/data/scripts/emoji_filter.js
docker run --rm --volume "$(pwd):/data" --user $(id -u):$(id -g) audreyt/pandoc-plurality-book traditional-mandarin.md -o tmp.pdf --include-before-body=0-1.tex --toc --toc-depth=2 -s --pdf-engine=xelatex -V CJKmainfont='Noto Sans CJK TC' -V fontsize=20pt -V documentclass=extreport -f markdown-implicit_figures --filter=/data/scripts/emoji_filter.js
.
system << '.';
Expand All @@ -99,4 +99,4 @@ sub write_file {
unlink 'tmp.pdf';
unlink 'tmp.tex';
unlink '01-01.tex';
unlink '1-1.tex';
12 changes: 6 additions & 6 deletions scripts/make-book.pl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
---
HEADER

$all .= (read_file($_) =~ s/^#+\s+(.+)/\n**$1**/rg). "\n\n" for glob("contents/english/00-0[13]-*.md");
$all .= (read_file($_) =~ s/^#+\s+(.+)/\n**$1**/rg). "\n\n" for glob("contents/english/0-[13]-*.md");

sub read_file {
my $filename = shift;
Expand All @@ -47,7 +47,7 @@ sub write_file {
6 => "Section 6: Impact",
7 => "Section 7: Forward",
);
for (sort <contents/english/0[1234567]*.md>) {
for (sort <contents/english/[1234567]*.md>) {
my $basename = s,.*/([-\d]+)-.*,$1,r;
my $s = int($basename =~ s/-.*//r);
if (my $section_name = delete $Sections{$s}) {
Expand All @@ -66,9 +66,9 @@ sub write_file {
write_file('english.md', $all);
write_file(
'00-01.tex', (
'0-1.tex', (
map { read_file($_) =~ s/\*\*(.*?)\*\*/\\textbf{$1}/rg =~ s/^#+\s+(.+)/\\textbf{$1}/rg =~ s/&/\\&/rg }
glob 'contents/english/00-02-*.md'
glob 'contents/english/0-2-*.md'
)
);
Expand All @@ -81,7 +81,7 @@ sub write_file {
.
system << '.';
docker run --rm --volume "$(pwd):/data" --user $(id -u):$(id -g) audreyt/pandoc-plurality-book english.md -o tmp.pdf --include-before-body=00-01.tex --toc --toc-depth=2 -s --pdf-engine=xelatex -V CJKmainfont='Noto Sans CJK TC' -V fontsize=18pt -V documentclass=extreport -f markdown-implicit_figures --filter=/data/scripts/emoji_filter.js
docker run --rm --volume "$(pwd):/data" --user $(id -u):$(id -g) audreyt/pandoc-plurality-book english.md -o tmp.pdf --include-before-body=0-1.tex --toc --toc-depth=2 -s --pdf-engine=xelatex -V CJKmainfont='Noto Sans CJK TC' -V fontsize=18pt -V documentclass=extreport -f markdown-implicit_figures --filter=/data/scripts/emoji_filter.js
.
system << '.';
Expand All @@ -96,4 +96,4 @@ sub write_file {
unlink 'tmp.pdf';
unlink 'tmp.tex';
unlink '01-01.tex';
unlink '1-1.tex';

0 comments on commit 789ebfd

Please sign in to comment.