File tree Expand file tree Collapse file tree 5 files changed +62
-18
lines changed Expand file tree Collapse file tree 5 files changed +62
-18
lines changed Original file line number Diff line number Diff line change
1
+ FROM ubuntu:22.10
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ RUN apt-get update && \
6
+ # Set timezone
7
+ ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \
8
+ apt-get install -y tzdata && \
9
+ dpkg-reconfigure --frontend noninteractive tzdata && \
10
+ # Install `pandoc` and `markdownlint`
11
+ apt-get install make pandoc ruby texlive-xetex --yes && \
12
+ gem install mdl
13
+
14
+ COPY Makefile /repo/
15
+ COPY USAGE.md /repo/
16
+ COPY README.md /repo/
17
+
18
+ RUN mkdir /repo/artifacts
19
+
20
+ WORKDIR /repo
Original file line number Diff line number Diff line change 1
1
.DEFAULT_GOAL := all
2
2
3
3
INPUT_FILE = README.md
4
- OUTPUT_FILE = artifacts/python-for-coding-interview.pdf
4
+ USAGE_FILE = USAGE.md
5
+ OUTPUT_DIR = artifacts
6
+ OUTPUT_FILE = $(OUTPUT_DIR ) /python-for-coding-interview.pdf
5
7
6
8
.PHONY : linter
7
9
linter :
8
- markdownlint $(INPUT_FILE ) --disable MD013 MD025
10
+ mdl -r ~ MD013 " $( INPUT_FILE) "
11
+ mdl -r ~ MD013 " $( USAGE_FILE) "
9
12
10
13
.PHONY : pdf
11
14
pdf :
12
- pandoc $(INPUT_FILE ) \
15
+ mkdir -p " $( OUTPUT_DIR) "
16
+ pandoc " $( INPUT_FILE) " \
13
17
--pdf-engine=xelatex \
14
18
-M date=" ` date " +%B%e, %Y" ` " \
15
- -o $(OUTPUT_FILE )
19
+ -o " $( OUTPUT_FILE) "
16
20
17
21
.PHONY : all
18
22
all : linter pdf
Original file line number Diff line number Diff line change @@ -20,20 +20,20 @@ Additional material:
20
20
21
21
## Topics
22
22
23
- 1 . [ Primitive Types] ( #primitive-types ) .
24
- 1 . [ Tuples] ( #tuples ) .
25
- 1 . [ Lists] ( #lists ) .
26
- 1 . [ Strings] ( #strings ) .
27
- 1 . [ Stacks] ( #stacks ) .
28
- 1 . [ Queues] ( #queues ) .
29
- 1 . [ Sets] ( #sets ) .
30
- 1 . [ Hash Tables] ( #hash-tables ) .
31
- 1 . [ Heaps] ( #heaps ) .
32
- 1 . [ Collections] ( #collections ) :
33
- 1 . [ namedtuple] ( #collectionsnamedtuple ) .
34
- 1 . [ defaultdict] ( #collectionsdefaultdict ) .
35
- 1 . [ Counter] ( #collectionscounter ) .
36
- 1 . [ OrderedDict] ( #collectionsordereddict ) .
23
+ 1 . [ Primitive Types] ( #primitive-types )
24
+ 1 . [ Tuples] ( #tuples )
25
+ 1 . [ Lists] ( #lists )
26
+ 1 . [ Strings] ( #strings )
27
+ 1 . [ Stacks] ( #stacks )
28
+ 1 . [ Queues] ( #queues )
29
+ 1 . [ Sets] ( #sets )
30
+ 1 . [ Hash Tables] ( #hash-tables )
31
+ 1 . [ Heaps] ( #heaps )
32
+ 1 . [ Collections] ( #collections )
33
+ 1 . [ namedtuple] ( #collectionsnamedtuple )
34
+ 1 . [ defaultdict] ( #collectionsdefaultdict )
35
+ 1 . [ Counter] ( #collectionscounter )
36
+ 1 . [ OrderedDict] ( #collectionsordereddict )
37
37
38
38
## Primitive Types
39
39
Original file line number Diff line number Diff line change
1
+ # Usage
2
+
3
+ ## With docker
4
+
5
+ ``` text
6
+ docker build -t pfci:latest .
7
+ # Linter
8
+ docker run --rm pfci:latest make linter
9
+ # Generate PDF
10
+ docker run --rm -v %cd%\artifacts:/repo/artifacts pfci:latest make pdf
11
+ ```
12
+
13
+ docker run --rm pfci: latest "make pdf &> /dev/null && ls /repos/" > ./artifacts/python-for-coding-interview.pdf
14
+
15
+ ## Without docker
16
+
17
+ ``` text
18
+ make linter
19
+ make pdf
20
+ ```
You can’t perform that action at this time.
0 commit comments