Filter out some slides
This commit is contained in:
parent
bb699bf2ee
commit
7377037c1a
|
@ -212,6 +212,25 @@ def main():
|
||||||
else:
|
else:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
def filter_outlines(headers_list, max_level=None):
|
||||||
|
filtered_outlines = []
|
||||||
|
buffered_header = None
|
||||||
|
default_max_level = max([hl[1] for hl in headers_list])
|
||||||
|
if not max_level:
|
||||||
|
max_level = default_max_level
|
||||||
|
temp_max_level = default_max_level
|
||||||
|
filtered_out = ['Pratique', 'Plan', 'Licence du document']
|
||||||
|
|
||||||
|
for header in headers_list:
|
||||||
|
if header[1] <= min(max_level, default_max_level, temp_max_level):
|
||||||
|
if header[2] in filtered_out:
|
||||||
|
temp_max_level = header[1] + 1
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
temp_max_level = default_max_level
|
||||||
|
filtered_outlines.append(header)
|
||||||
|
return filtered_outlines
|
||||||
|
|
||||||
def outline_format(headers_list):
|
def outline_format(headers_list):
|
||||||
levels = list(set([hl[1] for hl in headers_list]))
|
levels = list(set([hl[1] for hl in headers_list]))
|
||||||
levels.sort()
|
levels.sort()
|
||||||
|
@ -234,12 +253,11 @@ def main():
|
||||||
sections = section_re.finditer(master)
|
sections = section_re.finditer(master)
|
||||||
subsections = subsection_re.finditer(master)
|
subsections = subsection_re.finditer(master)
|
||||||
includes = SKBINPUT_RE.finditer(master)
|
includes = SKBINPUT_RE.finditer(master)
|
||||||
print(document_class)
|
|
||||||
parts_list = [(part.start(), part_level, part.group('name')) for part in parts]
|
parts_list = [(part.start(), part_level, part.group('name')) for part in parts]
|
||||||
sections_list = [(section.start(), section_level, section.group('name')) for section in sections]
|
sections_list = [(section.start(), section_level, section.group('name')) for section in sections]
|
||||||
includes_list = [element for skbinput in includes for element in outline_from_include(file_path_from_skbinput(skbinput, args.master, skbconfig), skbinput.start(), document_class)]
|
includes_list = [element for skbinput in includes for element in outline_from_include(file_path_from_skbinput(skbinput, args.master, skbconfig), skbinput.start(), document_class)]
|
||||||
subsections_list = [(subsection.start(), subsection_level, subsection.group('name')) for subsection in subsections]
|
subsections_list = [(subsection.start(), subsection_level, subsection.group('name')) for subsection in subsections]
|
||||||
print(outline_format(reorder_lists(parts_list, sections_list, includes_list, subsections_list)))
|
print(outline_format(filter_outlines(reorder_lists(parts_list, sections_list, includes_list, subsections_list))))
|
||||||
|
|
||||||
|
|
||||||
jinja_loader = FileSystemLoader('./templates')
|
jinja_loader = FileSystemLoader('./templates')
|
||||||
|
|
Loading…
Reference in New Issue