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 11.DEFAULT_GOAL := all
22
33INPUT_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
57
68.PHONY : linter
79linter :
8- markdownlint $(INPUT_FILE ) --disable MD013 MD025
10+ mdl -r ~ MD013 " $( INPUT_FILE) "
11+ mdl -r ~ MD013 " $( USAGE_FILE) "
912
1013.PHONY : pdf
1114pdf :
12- pandoc $(INPUT_FILE ) \
15+ mkdir -p " $( OUTPUT_DIR) "
16+ pandoc " $( INPUT_FILE) " \
1317 --pdf-engine=xelatex \
1418 -M date=" ` date " +%B%e, %Y" ` " \
15- -o $(OUTPUT_FILE )
19+ -o " $( OUTPUT_FILE) "
1620
1721.PHONY : all
1822all : linter pdf
Original file line number Diff line number Diff line change @@ -20,20 +20,20 @@ Additional material:
2020
2121## Topics
2222
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 )
3737
3838## Primitive Types
3939
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