MCPcopy Create free account
hub / github.com/KnowledgeXLab/LeanRAG / read_markdown

Function read_markdown

tools/io_file.py:280–293  ·  view source on GitHub ↗

读取Markdown文件。 参数: - file_path (str): 文件路径。 - encoding (str): 文件编码格式,默认为 'utf-8'。 返回: - str: 读取的Markdown文件内容。

(file_path, encoding='utf-8')

Source from the content-addressed store, hash-verified

278
279
280def read_markdown(file_path, encoding='utf-8'):
281 """
282 读取Markdown文件。
283
284 参数:
285 - file_path (str): 文件路径。
286 - encoding (str): 文件编码格式,默认为 'utf-8'
287
288 返回:
289 - str: 读取的Markdown文件内容。
290 """
291 with open(file_path, 'r', encoding=encoding) as f:
292 logger.info(f"读取Markdown文件: {file_path}")
293 return f.read()
294
295
296def read_jsonl(file_path, chunk_size, line_threshold, encoding='utf-8'):

Callers 1

readFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected