MCPcopy Index your code
hub / github.com/KnowledgeXLab/LeanRAG / write_markdown

Function write_markdown

tools/io_file.py:688–700  ·  view source on GitHub ↗

写入Markdown文件。 参数: - file_path (str): 文件路径。 - data (str): 要写入的Markdown内容。 - mode (str): 写入模式,默认为 'a'(追加模式),可以选择 'w'(覆盖模式)。 - encoding (str): 写入文件的编码格式,默认为 'utf-8'。

(file_path, data, mode, encoding='utf-8')

Source from the content-addressed store, hash-verified

686
687
688def write_markdown(file_path, data, mode, encoding='utf-8'):
689 """
690 写入Markdown文件。
691
692 参数:
693 - file_path (str): 文件路径。
694 - data (str): 要写入的Markdown内容。
695 - mode (str): 写入模式,默认为 'a'(追加模式),可以选择 'w'(覆盖模式)。
696 - encoding (str): 写入文件的编码格式,默认为 'utf-8'
697 """
698 logger.info(f"写入Markdown文件: {file_path}")
699 with open(file_path, mode, encoding=encoding) as f:
700 f.write(data)

Callers 1

writeFunction · 0.85

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected