mirror of
https://github.com/nanotee/nvim-lua-guide
synced 2024-11-11 01:10:31 +00:00
35f047a6a5
* Add scripts to generate vim documentation * Fix markdown table manually
48 lines
623 B
Sed
Executable File
48 lines
623 B
Sed
Executable File
#!/bin/sed -f
|
|
|
|
# Title
|
|
/^# / {
|
|
s/# /*nvim-lua-guide.txt* /
|
|
}
|
|
|
|
# Sections
|
|
/^## / {
|
|
s/[a-z]/\u&/g
|
|
s/## //
|
|
i==============================================================================
|
|
}
|
|
|
|
# Sub-sections, tips and caveats
|
|
/^####\? / {
|
|
s/####\? //
|
|
s/.*/&~/
|
|
}
|
|
|
|
# Markdown links
|
|
/\[.*\](http.*)/ {
|
|
y/[]()/ : /
|
|
}
|
|
|
|
# Todos
|
|
s/\*\*TODO\*\*:/\t*Todo\ttasks:/g
|
|
|
|
# Warnings
|
|
s/\*\*\(WARNING\)\*\*/\1/
|
|
|
|
# Code blocks
|
|
/^```.*$/,/^```$/{
|
|
s/.*/ &/
|
|
s/```.\+/>/
|
|
s/\s*```$/</
|
|
}
|
|
|
|
# Help links
|
|
s/- `:help \(.*\)`/- |\1|/
|
|
|
|
# Trim trailing whitespace
|
|
s/\s\+$//
|
|
|
|
$a\
|
|
\
|
|
vim:tw=78:ts=8:noet:ft=help:norl:
|