shell script to manually make nginx ebook

Recently, I was watching the development of Nginx from entry to master. There is only a web version, which does not seem very convenient, so I want to make it into an electronic version of pdf. The web page has a ready-made interface, and it is done with a few lines of code. Download it, and then output it to a file. Since the content is in markdown format, it is easy to convert it to pdf. The

address is here http://

tengine.taobao.org /book/
code```
#!/bin/bash

file= "Nginx development from entry to proficient.md"

function download() {
curl http://tengine.taobao.org/book/_sources/$1 | tee -a $file
}

# There are only 14 chapters now, so I just took them all
for (( i = 1; i < 14; i++ )); do
download "chapter_$i.txt"
done

# here is download appendix A,B,C
download "appendix_a.txt"
download "appendix_b.txt"
download "appendix_c. txt"

```

Then you can use the online markdown editor, copy the content in, choose to export PDF, um, you need to log in, just register one, you need VIP to export PDF, but if you understand web technology, you should know how to do it . Anyway, I don't need money for export.

Originally, there was a Mou editor on the computer before, but after the mac was upgraded, it was not supported -- otherwise, it would not need to be transferred online. .

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327033266&siteId=291194637