-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
9,900 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
*.bkp | ||
*.venv | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 9, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import os\n", | ||
"\n", | ||
"# Define the directory where the Markdown files are located\n", | ||
"DIR = \"../docs\" # Replace with the actual directory path\n", | ||
"\n", | ||
"# List of Markdown files to merge, in the desired order\n", | ||
"FILES = [\n", | ||
" \"catalog.md\",\n", | ||
" \"notation.md\",\n", | ||
" \"chapter1.md\",\n", | ||
" \"chapter2.md\",\n", | ||
" \"chapter3.md\",\n", | ||
" \"chapter4.md\",\n", | ||
" \"chapter5.md\",\n", | ||
" \"chapter6.md\",\n", | ||
" \"chapter7.md\",\n", | ||
" \"chapter8.md\",\n", | ||
" \"appendix.md\",\n", | ||
" \"reference.md\"\n", | ||
"]\n", | ||
"\n", | ||
"# Merge Markdown file content\n", | ||
"merged_content = \"\"\n", | ||
"for file in FILES:\n", | ||
" file_path = os.path.join(DIR, file)\n", | ||
" if os.path.isfile(file_path):\n", | ||
" with open(file_path, \"r\", encoding=\"utf-8\") as f:\n", | ||
" merged_content += f.read() + \"\\n\\n\" # Add an empty line as a separator\n", | ||
" else:\n", | ||
" print(f\"Warning: File {file_path} does not exist and will be skipped.\")\n", | ||
"\n", | ||
"# Write the merged content to a temporary file\n", | ||
"merged_file = f\"{os.getcwd()}/preview.md\"\n", | ||
"with open(merged_file, \"w\", encoding=\"utf-8\") as f:\n", | ||
" f.write(merged_content)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": ".venv", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.12.6" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |