Skip to content

Commit cbf7187

Browse files
committed
work on pdf transformation script
1 parent 1915a4c commit cbf7187

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

content/pages/02-development-environments/04-sublime-text.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ links should get your editor customized with linters,
4242
* [Using Generators for Fun and Profit - Utility for developers](http://www.sublimetext.com/forum/viewtopic.php?f=6&t=17671)
4343
isn't about setting up your Sublime Text environment but instead how to
4444
create your own plugins using Python. The tutorial is written by the
45-
author of a Sublime Text plugin who uses [generators](/generators.html)
45+
author of a Sublime Text plugin who uses generators
4646
to implement features with Sublime's API.
4747

4848
* [Turning Sublime Text Into a Lightweight Python IDE](https://cewing.github.io/training.codefellows/assignments/day01/sublime_as_ide.html)

transform_book.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
BASE_FSP = "https://www.fullstackpython.com/"
88

99
links = {# chapter 1
10-
"/introduction.html":
11-
"#introduction",
12-
"/learning-programming.html":
13-
"#learning-programming",
10+
'<a href="/introduction.html':
11+
'<a href="#introduction',
12+
'<a href="/learning-programming.html':
13+
'<a href="#learning-programming',
1414
"/python-programming-language":
1515
"#python-programming-language",
1616
"/why-use-python.html":
@@ -232,7 +232,7 @@
232232
"/uvloop.html":
233233
"#uvloop",
234234
"/application-programming-interfaces.html":
235-
"application-programming-interfaces",
235+
"#application-programming-interfaces",
236236
"/microservices.html":
237237
"#microservices",
238238
#"/.html":
@@ -402,7 +402,8 @@ def transform(output_format='pdf'):
402402
# modify all markdown files in directory
403403
files = os.listdir(BASE_DIR + d)
404404
for f in files:
405-
with open(BASE_DIR + d + '/' + f, 'r') as read_f:
405+
with open(BASE_DIR + d + '/' + f, 'r',
406+
encoding="utf-8") as read_f:
406407
all_lines = read_f.readlines()
407408

408409
with open(BASE_DIR + d + '/' + f, 'w') as write_f:

0 commit comments

Comments
 (0)