Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable python line ending translation #97

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions tools/doc/process_md_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def remove_code_blocks(lines):


def make_toc(file):
with open(file, "r") as f:
with open(file, "r", newline='') as f:
lines = f.readlines()
lines = remove_code_blocks(lines)

Expand All @@ -61,7 +61,7 @@ def is_md_block_end(line):


def extract_md_block(file, md_id):
with open(file, "r") as f:
with open(file, "r", newline='') as f:
lines = f.readlines()
result = ""
md_block_started = False
Expand Down Expand Up @@ -92,7 +92,7 @@ def get_string_between(s, after_what, before_what):


def process_md_file(input_file, output_file):
with open(input_file, "r") as f:
with open(input_file, "r", newline='') as f:
lines = f.readlines()

content = ""
Expand All @@ -108,19 +108,19 @@ def process_md_file(input_file, output_file):
else:
content = content + line

with open(output_file, "w") as f:
with open(output_file, "w", newline='') as f:
f.write(content)


def process_main_readme(repo_dir: str):
with open(repo_dir + "README.src.md", "r") as f:
with open(repo_dir + "README.src.md", "r", newline='') as f:
readme_src_content = f.read()
with open(repo_dir + "/docs_src/intro.md", "r") as f:
with open(repo_dir + "/docs_src/intro.md", "r", newline='') as f:
intro_content = f.read()

readme_content = readme_src_content.replace("<!-- INTRO -->", intro_content)

with open(repo_dir + "README.md", "w") as f:
with open(repo_dir + "README.md", "w", newline='') as f:
f.write(readme_content)


Expand Down
Loading