bin/{corehandlers.rc, werc.rc, werclib.rc}: handle .gmi and .gem
This commit is contained in:
parent
bc939071cf
commit
51e19b2266
2 changed files with 9 additions and 1 deletions
|
|
@ -97,6 +97,10 @@ fn get_md_title {
|
|||
sed -n -e '1N; /^.*\n===*$/N; /.*\n===*\n *$/!b' -e 's/\n==*\n//p' < $1
|
||||
}
|
||||
|
||||
fn get_gmi_title {
|
||||
sed -e 's/^# //;q' < $1
|
||||
}
|
||||
|
||||
fn get_html_title {
|
||||
t=`{sed -n '32q; s/^.*<[Tt][Ii][Tt][Ll][Ee]> *([^<]+) *(<\/[Tt][Ii][Tt][Ll][Ee]>.*)?$/\1/p' < $1}
|
||||
|
||||
|
|
@ -110,6 +114,10 @@ fn get_html_title {
|
|||
fn get_file_title {
|
||||
if (~ $1 *.md)
|
||||
get_md_title $1
|
||||
if not if(~ $1 *.gmi)
|
||||
get_gmi_title $1
|
||||
if not if(~ $1 *.gem)
|
||||
get_gmi_title $1
|
||||
if not if(~ $1 *.html)
|
||||
get_html_title $1
|
||||
if not if(~ $1 */) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue