Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 10b86ff

Browse files
add pdf suport for sh file (shell) highlighting
1 parent 8690b3b commit 10b86ff

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

‎pdf/generate_latex.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#define t_section tuple<string, string, bool>
44
using namespace std;
55

6-
const bool USE_HASH = true;
6+
const bool USE_HASH = false;
77
const int HASH_LEN = 3;
88

99
const vector<string> IGNORED_LINES = {
@@ -309,6 +309,7 @@ string get_style(const string& filename) {
309309
if (ext == "java") return "java";
310310
if (ext == "py") return "py";
311311
if (ext == "tex") return "tex";
312+
if (ext == "sh") return "sh";
312313
return "txt";
313314
}
314315

‎pdf/generate_pdf.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ mv notebook.tex _notebook.tex
1313
rm notebook.*
1414
mv _notebook.tex notebook.tex
1515
rm genLatex.exe
16-
mv hsh.temp ./temp/h
17-
mv temp.cpp ./temp/h
16+
mv hsh.temp ./temp/h||true
17+
mv temp.cpp ./temp/h||true
1818
rm ./temp -r
1919

2020
echo "

‎pdf/notebook.tex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@
7070
identifierstyle=\color{blue},
7171
stringstyle=\color{orange},
7272
}
73+
\lstdefinestyle{sh}{
74+
style=shared,
75+
language=bash,
76+
keywordstyle=\bfseries\color{green!40!black},
77+
commentstyle=\itshape\color{purple!40!black},
78+
identifierstyle=\color{blue},
79+
stringstyle=\color{orange},
80+
}
7381
\lstdefinestyle{txt}{
7482
style=shared,
7583
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /