markslider installer improvement, and dont break slides in code tags
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
# coding=utf-8
|
||||
#
|
||||
# Copyright 2016 Ville Rantanen
|
||||
@@ -20,7 +20,7 @@
|
||||
'''Markslider: a slideshow engine based on markdown.'''
|
||||
|
||||
__author__ = "Ville Rantanen <ville.q.rantanen@gmail.com>"
|
||||
__version__ = "1.2"
|
||||
__version__ = "1.2.1"
|
||||
|
||||
import sys,os,argparse,re,datetime
|
||||
from argparse import ArgumentParser
|
||||
@@ -81,6 +81,7 @@ class slide_reader:
|
||||
first_slide_found = False
|
||||
f=open(fname,'r')
|
||||
new_page=[]
|
||||
in_code = False
|
||||
for row in f:
|
||||
if not row:
|
||||
continue
|
||||
@@ -89,11 +90,13 @@ class slide_reader:
|
||||
if row == EOS:
|
||||
break
|
||||
# find header to start a new page
|
||||
if row.startswith("#") and not row.startswith("##"):
|
||||
if row.startswith("#") and not row.startswith("##") and not in_code:
|
||||
first_slide_found=True
|
||||
if len(new_page)>0:
|
||||
self.data.append(new_page)
|
||||
new_page=[]
|
||||
if row.startswith("```"):
|
||||
in_code = not in_code
|
||||
# if first slide havent been found yet:
|
||||
if not first_slide_found:
|
||||
self.background.append(row)
|
||||
|
||||
Reference in New Issue
Block a user