vault backup: 2025-11-07 12:48:54

This commit is contained in:
2025-11-07 12:48:54 -05:00
parent 277e2e5dab
commit 618cf9dcc2
5 changed files with 123 additions and 35 deletions
+42
View File
@@ -0,0 +1,42 @@
---
id:
aliases: []
tags: []
title: Converting Documents to Markdown
---
# Converting Documents to Markdown
```powershell
param(
[string]$Path
)
$content = Get-Content -Path $Path
$newContent = $content
$newContent -replace "foos", "ball"
$newContent -replace "foo", "bar"
# ...
Set-Content -Path $Path -Value $newContent
```
## Converting NFPA Code
```powershell
# "210.17(B)(3)" -> h5
$newContent -replace '^(\d{3}\.\d+\([A-Z]\)\(\d\) .+)$', '\n##### $1\n'
# "210.17(B)" -> h4
$newContent -replace '^(\d{3}\.\d+\([A-Z]\) .+)$', '\n#### $1\n'
# "210.17" -> h3
$newContent -replace '^(\d{3}\.\d+ .+)$', '\n### $1\n'
# "(1)" -> "1."
$newContent -replace '^\((\d)\)', '$1\.'
```
## Semantic Line Breaks
[[semantic-line-breaks]]