OurBigBook logoOurBigBook Docs OurBigBook logoOurBigBook.comSite Source code
vim/snippets/ourbigbook.snippets
# https://docs.ourbigbook.com#vim
# For these snippets, you have to first copy the header text to the clipboard.
# The expansion result then calculates the ID for that header and injects it.
snippet {c
	{chid=`@+`}
snippet {d
	{description=$1}
snippet \I
	\\Image[`@+`]
	{title=$1}
snippet {p
	{parent=`@+`}
snippet {t
	{tag=`@+`}
snippet \V
	\\Video[`@+`]
	{title=$1}
snippet \x
	\\x[`substitute(substitute(tolower(@+), '[^a-z0-9]\\+', '-', 'g'), '^-\\|-$', '', 'g')`]
snippet <
	<`substitute(substitute(tolower(@+[0]) . @+[1:], '[<> ]\\+', ' ', 'g'), '^ \\| $', '', 'g')`>
snippet >
	<`substitute(substitute(@+, '[<> ]\\+', ' ', 'g'), '^ \\| $', '', 'g')`>

# Standard format for the web archive of something which must be present in the clipboard, e.g.
# ``
# see this link: http://example.com (http/archive.is/XXX[archive])
# ``
snippet arch
	(`@+`[archive])