add [TOC] to pdf generation
This commit is contained in:
parent
7f01692124
commit
d081fb4b48
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
|
@ -21,13 +21,15 @@ class Section(models.Model):
|
|||
|
||||
|
||||
def to_pdf():
|
||||
x = ''
|
||||
x = '[TOC]\n'
|
||||
|
||||
for section in Section.objects.all():
|
||||
x += '# ' + section.title
|
||||
x += '\n'
|
||||
x += section.content
|
||||
x += '\n'
|
||||
html = Markdown().convert(x)
|
||||
md = Markdown(extensions=['markdown.extensions.toc'])
|
||||
html = md.convert(x)
|
||||
|
||||
options = {
|
||||
'page-size': 'Letter',
|
||||
|
|
Loading…
Reference in New Issue