@@ -2126,6 +2126,7 @@ def save_as_markdown(
21262126 indent : int = 4 ,
21272127 text_width : int = - 1 ,
21282128 page_no : Optional [int ] = None ,
2129+ included_content_layers : set [ContentLayer ] = DEFAULT_CONTENT_LAYERS ,
21292130 ):
21302131 """Save to markdown."""
21312132 artifacts_dir , reference_path = self ._get_output_paths (filename , artifacts_dir )
@@ -2149,6 +2150,7 @@ def save_as_markdown(
21492150 indent = indent ,
21502151 text_width = text_width ,
21512152 page_no = page_no ,
2153+ included_content_layers = included_content_layers ,
21522154 )
21532155
21542156 with open (filename , "w" , encoding = "utf-8" ) as fw :
@@ -2167,6 +2169,7 @@ def export_to_markdown( # noqa: C901
21672169 indent : int = 4 ,
21682170 text_width : int = - 1 ,
21692171 page_no : Optional [int ] = None ,
2172+ included_content_layers : set [ContentLayer ] = DEFAULT_CONTENT_LAYERS ,
21702173 ) -> str :
21712174 r"""Serialize to Markdown.
21722175
@@ -2248,7 +2251,12 @@ def _append_text(text: str, do_escape_html=True, do_escape_underscores=True):
22482251 mdtexts .append (text )
22492252
22502253 for ix , (item , level ) in enumerate (
2251- self .iterate_items (self .body , with_groups = True , page_no = page_no )
2254+ self .iterate_items (
2255+ self .body ,
2256+ with_groups = True ,
2257+ page_no = page_no ,
2258+ included_content_layers = included_content_layers ,
2259+ )
22522260 ):
22532261 # If we've moved to a lower level, we're exiting one or more groups
22542262 if level < previous_level :
@@ -2417,6 +2425,7 @@ def save_as_html(
24172425 page_no : Optional [int ] = None ,
24182426 html_lang : str = "en" ,
24192427 html_head : str = _HTML_DEFAULT_HEAD ,
2428+ included_content_layers : set [ContentLayer ] = DEFAULT_CONTENT_LAYERS ,
24202429 ):
24212430 """Save to HTML."""
24222431 artifacts_dir , reference_path = self ._get_output_paths (filename , artifacts_dir )
@@ -2437,6 +2446,7 @@ def save_as_html(
24372446 page_no = page_no ,
24382447 html_lang = html_lang ,
24392448 html_head = html_head ,
2449+ included_content_layers = included_content_layers ,
24402450 )
24412451
24422452 with open (filename , "w" , encoding = "utf-8" ) as fw :
@@ -2484,6 +2494,7 @@ def export_to_html( # noqa: C901
24842494 page_no : Optional [int ] = None ,
24852495 html_lang : str = "en" ,
24862496 html_head : str = _HTML_DEFAULT_HEAD ,
2497+ included_content_layers : set [ContentLayer ] = DEFAULT_CONTENT_LAYERS ,
24872498 ) -> str :
24882499 r"""Serialize to HTML."""
24892500
@@ -2525,7 +2536,12 @@ def _prepare_tag_content(
25252536 return text
25262537
25272538 for ix , (item , curr_level ) in enumerate (
2528- self .iterate_items (self .body , with_groups = True , page_no = page_no )
2539+ self .iterate_items (
2540+ self .body ,
2541+ with_groups = True ,
2542+ page_no = page_no ,
2543+ included_content_layers = included_content_layers ,
2544+ )
25292545 ):
25302546 # If we've moved to a lower level, we're exiting one or more groups
25312547 if curr_level < prev_level and len (in_ordered_list ) > 0 :
0 commit comments