Skip to content

Commit

Permalink
rebase了一下,压缩仓库的大小
Browse files Browse the repository at this point in the history
  • Loading branch information
confucianzuoyuan committed Sep 16, 2020
1 parent 388e3ab commit 21fdc29
Show file tree
Hide file tree
Showing 775 changed files with 100,151 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.DS_Store
target/
.classpath
.idea/
.project
.settings/
.vscode/
*.iml
.metals/
*.aux
*.log
*.toc
*.synctex.gz
_minted-尚硅谷Flink教程/
*.out
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Flink教程
[尚硅谷Flink教材链接](https://confucianzuoyuan.github.io/flink-tutorial)
Binary file added bin/__pycache__/preproc_config.cpython-37.pyc
Binary file not shown.
83 changes: 83 additions & 0 deletions bin/preproc
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/usr/bin/env python3

"""
Concatenates a number of input files into a single output file, while
performing the following regex substitutions:
[[pagebreak]]
[nobr[s]] # Substitute spaces with `\ ` to mark as nonbreaking
# Doesn't work inside code markdown, alas
[nh[x]] \hyphenation{x} # no hyphen, no underscores allowed
[ix[x]] \index{x} # index straight up
[ixtt[x]] \index{x@\texttt{x}} # index tt
fl = footnote link
flx = footnote link to example https://beej.us/guide/bgnet/examples/file
flr = footnote link to redirect https://beej.us/guide/url/id
[fl[link|url]] [link](url)^[url]
[flx[link|file]] [link](https://beej.us/guide/bgnet/examples/file)^[https://beej.us/guide/bgnet/examples/file]
[flr[link|id]] [link](https://beej.us/guide/url/id)^[https://beej.us/guide/url/id]
[flrfc[link|num]] [link](https://tools.ietf.org/html/rfcnum)^[https://tools.ietf.org/html/rfcnum]
Also puts a blank line between files.
"""

import sys
import re
import preproc_config

if len(sys.argv) < 3:
print("usage: preproc infile [infile ... ] outputfile", file=sys.stdout)
sys.exit(1)

infiles = sys.argv[1:-1]
outfile = sys.argv[-1]

filedata = []

def nobr_replace(mo):
return re.sub(r'\s', r'\ ', mo.group(1))

for infile in infiles:
fin = open(infile)
filedata.append(fin.read())
fin.close()

filedata = '\n'.join(filedata)

filedata = re.sub(r'\t', " ", filedata, flags=re.DOTALL)
filedata = re.sub(r'\[nobr\[(.+?)\]\]', nobr_replace, filedata, flags=re.DOTALL)
filedata = re.sub(r'\[\[pagebreak\]\]', r'\\newpage', filedata, flags=re.DOTALL)
filedata = re.sub(r'\[nh\[(.+?)\]\]', r'\\hyphenation{\1}', filedata, flags=re.DOTALL)
filedata = re.sub(r'\[ix\[(.+?)\]\]', r'\\index{\1}', filedata, flags=re.DOTALL)
filedata = re.sub(r'\[ixtt\[(.+?)\]\]', r'\\index{\1@\\texttt{\1}}', filedata, flags=re.DOTALL)
filedata = re.sub(r'\[fl\[(.+?)\|(.+?)\]\]', r'[\1](\2)^[\2]', filedata, flags=re.DOTALL)
filedata = re.sub(r'\[flx\[(.+?)\|(.+?)\]\]', r'[\1](' + preproc_config.EXAMPLE_URL + r'\2)^[' + preproc_config.EXAMPLE_URL + r'\2]', filedata, flags=re.DOTALL)
filedata = re.sub(r'\[flr\[(.+?)\|(.+?)\]\]', r'[\1](https://beej.us/guide/url/\2)^[https://beej.us/guide/url/\2]', filedata, flags=re.DOTALL)
filedata = re.sub(r'\[flrfc\[(.+?)\|(.+?)\]\]', r'[\1](https://tools.ietf.org/html/rfc\2)^[https://tools.ietf.org/html/rfc\2]', filedata, flags=re.DOTALL)

fout = open(outfile, "w")
in_fence = False
this_line_fence = False
number_lines = False

# Go through a line at a time indenting if we're in unnumbered fenced code
for line in filedata.splitlines(True):
if line.strip()[:3] == '```':
number_lines = line.lower().find("numberlines") != -1
this_line_fence = True
in_fence = not in_fence
else:
this_line_fence = False

if in_fence and not this_line_fence and not number_lines:
fout.write(" ") # indent

fout.write(line)

fout.close()

1 change: 1 addition & 0 deletions bin/preproc_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
EXAMPLE_URL = "https://beej.us/guide/bgnet/examples/"
38 changes: 38 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
TITLE="尚硅谷Flink教程"
SUBTITLE="Flink理论与项目实践"
AUTHOR='尚硅谷大数据教学组'
VERSION_DATE="v3.1.2, Copyright © November 13, 2019"

GUIDE_ID=flinktutorial

HTML=$(GUIDE_ID).html

PREPROC=../bin/preproc
PREPROC_MD=$(GUIDE_ID)_temp_preproc.md

COMMON_OPTS= \
--variable title:$(TITLE) \
--variable subtitle:$(SUBTITLE) \
--variable author:$(AUTHOR) \
--variable date:$(VERSION_DATE) \
--toc

HTML_OPTS=$(COMMON_OPTS) \
--metadata title:$(TITLE)

all: $(HTML)

$(GUIDE_ID).html: $(GUIDE_ID).md bg-css.html
$(PREPROC) $< $(PREPROC_MD)
pandoc $(HTML_OPTS) -s $(PREPROC_MD) -o $(GUIDE_ID).html -H bg-css.html
sed 's/src="\(.*\)\.pdf"/src="\1.svg"/g' $(GUIDE_ID).html > $(GUIDE_ID)_temp.html # use svg images
mv $(GUIDE_ID)_temp.html $(GUIDE_ID).html
rm -f $(GUIDE_ID)_temp*

clean:
rm -f $(GUIDE_ID)_temp*

pristine: clean
rm -f $(HTML) $(BOOKS)

.PHONY: all, html, clean, pristine
99 changes: 99 additions & 0 deletions docs/bg-css.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<link href="https://fonts.googleapis.com/css?family=Roboto|Roboto+Mono&display=swap" rel="stylesheet">

<!-- BG custom styling -->
<style type="text/css">
body {
max-width: 800px;
margin-left: auto;
margin-right: auto;
padding: 10px;
font-family: "Roboto", sans-serif;
}

figure {
text-align: center;
font-style: italic;
}

pre {
font-family: "Roboto Mono", monospace;
padding: 10px;
}

/*
pre.shell {
margin-left: 3em;
border-left: 1px solid #aaaaaa;
padding-left: 4px;
}
pre.sourceCode {
margin-left: 3em;
border-left: 1px solid #aaaaaa;
padding-left: 4px;
}
*/

code {
font-family: "Roboto Mono", monospace;
}

td, th {
padding: 0 10px 0 10px;
}

thead {
text-decoration: underline;
}

table {
border-top: 2px solid black;
border-bottom: 2px solid black;
margin-left: auto;
margin-right: auto;
padding: 8px 0 10px 0;
margin-block-start: 1em;
margin-block-end: 1em;
}

div.sourceCode {
overflow: inherit; /* override */
}

pre > code.sourceCode > span > a:first-child::before {
text-decoration: none; /* override */
}

p.subtitle {
font-size: 1.3em;
font-weight: bold;
}

blockquote {
padding: 0 1em;
color: #6a737d;
border-left: .25em solid #dfe2e5;
}

blockquote>:first-child {
margin-top: 0;
}

blockquote>:last-child {
margin-bottom: 0;
}

blockquote {
margin: 0;
}

blockquote {
margin-top: 0;
margin-bottom: 16px;
}

img {
width: 100%;
}

</style>
6 changes: 6 additions & 0 deletions docs/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[book]
authors = ["confucianzuoyuan"]
language = "en"
multilingual = false
src = "src"
title = "尚硅谷Flink教程"
1 change: 1 addition & 0 deletions docs/book/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This file makes sure that Github Pages doesn't process mdBook's output.
218 changes: 218 additions & 0 deletions docs/book/404.html

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/book/FontAwesome/css/font-awesome.css

Large diffs are not rendered by default.

Binary file added docs/book/FontAwesome/fonts/FontAwesome.ttf
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 21fdc29

Please sign in to comment.