~sungo/nanoblogger

ref: d47e3d89ce00bf7fcae9c867a36cd0453e2643a5 nanoblogger/plugins/entry/format/markdown.sh -rw-r--r-- 589 bytes
d47e3d89 — sungo reformat the feed links 1 year, 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# NanoBlogger plugin to render Markdown format entries
# Markdown is documented and implemented at
#   <URL:http://daringfireball.net/projects/markdown/>

: ${MARKDOWN_CMD:=markdown}
: ${MARKDOWN_OPTS:= }

# most markdown implementations expect input right away, so we always pipe to it
# first to avoid hangups
echo . | nb_null $MARKDOWN_CMD && MARKDOWN_INPATH=true
	
if [ "$MARKDOWN_INPATH" = "true" ]; then
	# nb_msg "$plugins_entryfilteraction `basename $nb_plugin` ..."
	NB_MetaBody=$(echo "$NB_MetaBody" | ${MARKDOWN_CMD} ${MARKDOWN_OPTS})
else
	die "$nb_plugin: $plugins_abort"
fi