Ingen beskrivning

ohnonot 00a325d5ee git-check-20220605-0747 2 år sedan
README.md e024e59381 much improvement 3 år sedan
md2bb-existing.sh 00a325d5ee git-check-20220605-0747 2 år sedan

README.md

Convert markdown to BBCode using multiple existing tools

You like to post on forums, but don't like typing out BBCode or pressing toolbar buttons on a javascript editor?

Usage

Bind this script to a hotkey and use it to tranlate highlighted markdown text to BBCode

For example, in a browser text entry window:

  • Type markdown
  • Select all (Ctrl-A)
  • Press hotkey bound to execute md2bb-existing.sh

On the command line

It takes input from a pipe and prints to STDOUT.

$ cat README.md | ./md2bb-existing.sh

Note

Not all BBCOde is implementable in pure, simple markdown. Suitable markdown extensions exist but are hardly less cumbersome to type than BBCode.

Typed BBCode will be left as is.

Some output might not be permissible in some BBCode implementations:

  • [h] (header) is not known by all
  • nested tags are not always possible
  • usage of quotes, e.g. for URLs, seems inconsistent

Dependencies

  • xclip
  • markdown (I use the discount variant)
  • sed
  • perl with the perl-html-parser class, providing the HTML::Entities module

Optional:

  • xdotool (without it, the script won't automatically paste, just copy to the clipboard)

PS

This used to be a larger repo containing a failed rewrite of the original markdown perl script. In its current state it hardly justifies it's own repo anymore, but works much better!