Files in the top-level directory from the latest check-in of branch trunk
- Makefile
- README.md
- tasvideos_forum.lua
- test.lua
- test.png
Pandoc custom writer for TASVideos forum markup, which is based on BBCode. With this, you can convert from many document formats to the format used for forum posts and direct messages on TASVideos.
Usage
Download the file tasvideos_forum.lua.
Run pandoc, passing it the option -t tasvideos_forum.lua
(using the name of the custom writer file as if it were a format name).
For example, to convert a Markdown file to TASVideos forum markup:
pandoc -f markdown -t tasvideos_forum.lua README.md
The tasvideos_forum.lua filename may be given as a path, or the file may be stored under the Pandoc user data directory. See https://pandoc.org/MANUAL.html#custom-readers-and-writers.
Accessing special features with classes and attributes
Some features of TASVideos forum markup can be accessed by
setting classes and attributes
on parts of the input.
This is easiest to do with HTML input, or Markdown with the
fenced_divs and
bracketed_spans extensions.
For example, this HTML:
<div class="mark">
highlighted <span class="spoiler">and spoilered</span>
</div>
or this Markdown:
::: {.mark}
highlighted [and spoilered]{.spoiler}
:::
Renders to the following forum markup:
[highlight]highlighted [spoiler]and spoilered[/spoiler][/highlight]
These are the understood classes and what BBCode elements they correspond to:
| Class | Alternative HTML | BBCode |
|---|---|---|
mark |
<mark> |
[highlight] |
spoiler |
[spoiler] |
The download filename for code blocks may be provided by a filename attribute, like so:
``` {filename=test.lua}
print("hello")
```
You can use "note" and "warning" alerts.
The below Markdown input (with the alerts extension turned on):
> [!NOTE]
> A note
> [!WARNING]
> A warning
renders to:
[note]A note[/note]
[warning]A warning[/warning]
Raw output
To output TASVideos-specific markup such as [movie] and [post],
use Pandoc raw attributes
with a format name of tasvideos_forum:
This is `[frames]100[/frames]`{=tasvideos_forum} faster than `[movie]1234[/movie]`{=tasvideos_forum}.
``` {=tasvideos_forum}
[center]
More details are in [post=1234]this post[/post].
[/center]
```
Extensions
To enable an extension,
provide it after the custom writer filename with a + sign.
To disable, use a - sign.
pandoc -f markdown -t tasvideos_forum.lua+embed_resources README.md
Supported extensions:
| Extension | Effect |
|---|---|
embed_resources |
Embed image data for the [img] tag as a data URI, rather than a link. (Like the --embed-resources option of pandoc.) Default disabled. |
To clone this repository
fossil clone https://chiselapp.com/user/Sand/repository/tasvideos-pandoc
See the Fossil quick start.