BBCode writer for Pandoc

Geranium

Kincora; Dutroux; Epstein
True & Honest Fan
kiwifarms.net
Joined
Apr 22, 2022
I wrote a basic Kiwi Farms-flavored BBCode writer for Pandoc, so (for example) you can write your posts in your editor and format of choice, and then convert them to BBCode to be pasted into the post box.

Things to note:
  • Not everything on the BBCode help page is supported.
  • It is only a writer, so you can't feed BBCode in and convert it to another format.
  • It may choke on Pandoc elements I haven't considered (it'll print "Unimplemented $elementName" on stderr).
  • The output has blank lines between all blocks which you may want to tidy up manually for a neater appearance.
  • The Lua code is shit; first time etc etc.

How do I use it?​

Install Pandoc, download the bbkf.lua file from the repo to somewhere convenient, write your post, invoke like so:
Bash:
pandoc tony-dox.md --to /path/to/bbkf.lua > tony-dox.bbcode

Most formatting will work as you'd expect, I hope, with the exceptions being spoiler and private blocks. These should be written as code blocks with the language attribute set to spoiler or private as appropriate. Eg:
Markdown (GitHub flavored):
```spoiler
This is a spoiler block.

The insides will be re-interpreted in whatever format you're using,
you're not stuck with plain text.

> For example, this will render as a quote block.

- And this will
- be a real list.
```

Why another BBCode writer for Pandoc?​

While there's a bunch of BBCode writers at lilydjwg/2bbcode, they don't produce output in exactly the format needed here, as there seem to be lots of minor variations of BBCode which are not always compatible. This writer is only written to target Kiwi Farms BBCode.

Problems, questions, insults​

Aside from replies in this thread, feel free to message me privately. Issues and PRs welcome on the repo itself, but please try not to dox yourself.
 
Last edited:
Back