Giter VIP home page Giter VIP logo

md2bb's Introduction

MD2BB

Build Status

The tool translates Markdown files into BB code.

Downloads

At releases section

Usage

# translates text.md to text.bb
md2bb
curl 'https://raw.githubusercontent.com/White-Oak/md2bb/master/README.md' | md2bb | tee text.bb
md2bb -o README.bb README.md
md2bb -r rules.csv -o README.bb README.md

-h flag will print help notes.

Compilation

Requirements: Rust 1.5+, Cargo.

# Builds to ./target/release/md2bb
cargo build --release

Spoilers in Markdown

There are no spoilers in MD, though, they can be useful when formatting your article in BB. The following shows how to use neat MD text and convert it to spoilers in BB.

#### Spoiler name here
That's a spoiler text. It's not very big, but it has great ambitions.

Just a casual text here.
[spoiler Spolier name here]
That's a spoiler text. It's not very big, but it has great ambitions.[/spoiler]
Just a casual text here.

Note that an empty newline should follow spoiler text in Markdown.

Rules

Rules are described as a pair of regex, replacement string in rules.csv. Edit them to your likes. Note that rules.csv is included in binary, when building from sources, so there is no need to carry it around.

md2bb's People

Contributors

white-oak avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

md2bb's Issues

Wrong BB-code output

Here's a few examples that produces wrong bb-code

md code bb code
***bold-italic*** [b][i]bold-italic[/b][/i]
## (A Tiny) Bytecode Refresher [/b][/center]enter][b[/url] Bytecode Refresher
```java
class Point {}
```
[code rust]java
class Point {}
[/code]
It also includes information about the variable *types*... There is another, similar table called [LocalVariableTypeTable](http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html) that contains similar information... It also includes information about the variable [url=http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html]i]types[/i]... There is another, similar table called [LocalVariableTypeTable[/url] that contains similar information...

_bold-italic_

(A Tiny) Bytecode Refresher

class Point {}

It also includes information about the variable types... There is another, similar table called LocalVariableTypeTable that contains similar information...

  • bold-italic
  • Incorrect order of rules
  • different languages for code blocks
  • Incorrect order of rules (Still shouldn't have been a problem, hope tests will cover that one as well)
  • Tests (I hope I could go without them, I'm wrong! Shame on me)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.