@@ -179,20 +179,28 @@ def _order_by_line_nos(objs: Any, line_nos: List[int]) -> List[str]:
179
179
180
180
181
181
def to_md_file (
182
- string : str , filename : str , out_path : str = "." , watermark : bool = True
182
+ string : str ,
183
+ filename : str ,
184
+ out_path : str = "." ,
185
+ watermark : bool = True ,
186
+ disable_markdownlint : bool = True ,
183
187
) -> None :
184
188
"""Creates an API docs file from a provided text.
185
189
186
190
Args:
187
191
string (str): String with line breaks to write to file.
188
192
filename (str): Filename without the .md
189
193
watermark (bool): If `True`, add a watermark with a timestamp to bottom of the markdown files.
194
+ disable_markdownlint (bool): If `True`, an inline tag is added to disable markdownlint for this file.
190
195
out_path (str): The output directory
191
196
"""
192
197
md_file = filename
193
198
if not filename .endswith (".md" ):
194
199
md_file = filename + ".md"
195
200
201
+ if disable_markdownlint :
202
+ string = "<!-- markdownlint-disable -->\n " + string
203
+
196
204
if watermark :
197
205
string += _WATERMARK_TEMPLATE .format (
198
206
date = datetime .date .today ().strftime ("%d %b %Y" )
@@ -919,7 +927,7 @@ def generate_docs(
919
927
920
928
if hasattr (obj , "__path__" ):
921
929
# Object is a package
922
- for loader , module_name , is_pkg in pkgutil .walk_packages (
930
+ for loader , module_name , _ in pkgutil .walk_packages (
923
931
path = obj .__path__ , # type: ignore
924
932
prefix = obj .__name__ + "." , # type: ignore
925
933
):
0 commit comments