archive
/
md-pdf
Archived
1
Fork 0

Add config key for toc

This commit is contained in:
Jake Howard 2017-05-17 20:29:03 +01:00
parent 2c7679fb2f
commit 00badaa7e2
2 changed files with 10 additions and 1 deletions

View File

@ -69,12 +69,20 @@ def validate_context(config):
raise ConfigValidationException("Context keys must be plain. Invalid values: {}".format(", ".join(invalid_values)))
def validate_toc(config):
if 'toc' not in config:
return
if type(config['toc']) != bool:
raise ConfigValidationException("Table of contents key should be either true or false")
def validate_config(config):
for validator in [
check_required_keys,
test_input,
test_output,
validate_bibliography,
validate_context
validate_context,
validate_toc
]:
validator(config)

View File

@ -12,3 +12,4 @@ context:
student_number: 123456
turnitin_number: 789123
title: test title
toc: true