Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/build_all_exercises_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

print("\nBuilding all_exercises_challenges.html...")

path_to_notebooks = '/srv/projects/intro_programming/intro_programming/notebooks/'
path_to_notebooks = '../notebooks/'

# Work through notebooks in the order listed here.
filenames = ['var_string_num.html', 'lists_tuples.html',
Expand Down
8 changes: 4 additions & 4 deletions scripts/build_index.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from jinja2 import Environment, FileSystemLoader

# Load index template.
my_template_path = '/srv/projects/intro_programming/intro_programming/notebooks/my_templates'
my_template_base_path = '/srv/projects/intro_programming/intro_programming/notebooks'
ipython_template_path = '/srv/projects/intro_programming/venv/lib/python3.4/site-packages/IPython/nbconvert/templates/html'
my_template_path = '../notebooks/my_templates'
my_template_base_path = '../notebooks'
ipython_template_path = '../../venv/lib/python3.4/site-packages/IPython/nbconvert/templates/html'

my_loader = FileSystemLoader(
[my_template_path, my_template_base_path, ipython_template_path])
Expand All @@ -12,7 +12,7 @@
index_template = my_loader.load(env, 'index.tpl')

# Render template to file.
notebooks_path = '/srv/projects/intro_programming/intro_programming/notebooks/'
notebooks_path = '../notebooks/'
filepath = notebooks_path + 'index.html'
with open(filepath, 'w') as f:
f.write(index_template.render())
4 changes: 2 additions & 2 deletions scripts/highlight_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

# Find all files to work with.
# Replace with your path.
path_to_notebooks = '/srv/projects/intro_programming/intro_programming/notebooks/'
path_to_notebooks = '../notebooks/'

filenames = []
for filename in os.listdir(path_to_notebooks):
Expand All @@ -52,7 +52,7 @@
for filename in filenames:

# Grab the lines from this html file.
f = open(path_to_notebooks + filename, 'r')
f = open(path_to_notebooks + filename, 'r', encoding='utf8')
lines = f.readlines()
f.close()

Expand Down
4 changes: 2 additions & 2 deletions scripts/remove_input_references.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
print("\nStripping input reference numbers from code cells...")

# Find all files to work with.
path_to_notebooks = '/srv/projects/intro_programming/intro_programming/notebooks/'
path_to_notebooks = '../notebooks/'
filenames = []
for filename in os.listdir(path_to_notebooks):
if '.html' in filename and filename != 'index.html':
Expand All @@ -20,7 +20,7 @@

for filename in filenames:

f = open(path_to_notebooks + filename, 'r')
f = open(path_to_notebooks + filename, 'r', encoding='utf8')
lines = f.readlines()
f.close()

Expand Down
6 changes: 3 additions & 3 deletions scripts/show_hide_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys

# Find all files to work with.
path_to_notebooks = '/srv/projects/intro_programming/intro_programming/notebooks/'
path_to_notebooks = '../notebooks/'
filenames = []
for filename in os.listdir(path_to_notebooks):
if '.html' in filename and filename != 'index.html':
Expand Down Expand Up @@ -35,7 +35,7 @@ def generate_show_hide_all_buttons():
# Determine which files have output. Only add buttons to files with output.
files_with_output = []
for filename in filenames:
f = open(path_to_notebooks + filename, 'r')
f = open(path_to_notebooks + filename, 'r', encoding='utf8')
lines = f.readlines()
f.close()

Expand All @@ -51,7 +51,7 @@ def generate_show_hide_all_buttons():
# This is after second div.container element
for filename in files_with_output:
container_number = 0
f = open(path_to_notebooks + filename, 'r')
f = open(path_to_notebooks + filename, 'r', encoding='utf-8')
lines = f.readlines()
f.close()

Expand Down