Cybrkyd's Git Repositories

vscode-config - commit: 2aea128

commit 2aea128989d3284456484f14787124ee2c47e58efa51a29edfcb272d3b919bc8
author cybrkyd <noreply@cybrkyd.com> 2026-02-13 10:42:41 +0000
committer cybrkyd <noreply@cybrkyd.com> 2026-02-13 10:42:41 +0000

Commit Message

Workspace tasks

📊 Diffstat

workspace-tasks/rename-md.py 13
workspace-tasks/tasks.json 40
2 files changed, 53 insertions(+), 0 deletions(-)

Diff

diff --git a/workspace-tasks/rename-md.py b/workspace-tasks/rename-md.py
new file mode 100644
index 0000000..3124d34
--- /dev/null
+++ b/workspace-tasks/rename-md.py
@@ -0,0 +1,13 @@
+ #!/usr/bin/env python3
+ import sys, os
+
+ file_path = sys.argv[1]
+ if not file_path.lower().endswith('.md'): sys.exit()
+ with open(file_path, 'r', encoding='utf-8') as f: lines = f.readlines()
+ if len(lines) < 2: sys.exit()
+ second_line = lines[1].strip()
+ if not second_line.lower().startswith('title: '): sys.exit()
+ new_name = second_line[len('title: '):].strip().lower().replace(' ', '-')
+ if not new_name.endswith('.md'): new_name += '.md'
+ os.rename(file_path, os.path.join(os.path.dirname(file_path), new_name))
+
diff --git a/workspace-tasks/tasks.json b/workspace-tasks/tasks.json
new file mode 100644
index 0000000..d5992bf
--- /dev/null
+++ b/workspace-tasks/tasks.json
@@ -0,0 +1,40 @@
+ {
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "Rename Markdown",
+ "type": "shell",
+ "command": "python3",
+ "args": [
+ "${workspaceFolder}/.vscode/rename-md.py",
+ "${file}"
+ ],
+ "problemMatcher": [],
+ "presentation": {
+ "echo": false,
+ "reveal": "never",
+ "focus": false,
+ "panel": "shared"
+ }
+ },
+ {
+ "label": "Wrap lines at 100",
+ "type": "shell",
+ "command": "sh",
+ "args": [
+ "-c",
+ "fold -s -w 100 \"$1\" > \"$1.wrapped\" && mv \"$1.wrapped\" \"$1\"",
+ "--",
+ "${file}"
+ ],
+ "problemMatcher": [],
+ "presentation": {
+ "echo": false,
+ "reveal": "never",
+ "focus": false,
+ "panel": "shared"
+ }
+ }
+ ]
+ }
+