Try out bitmark - visit the bitmark Playground
bitmark command line tool.
$ npm install -g @gmb/bitmark-cli
$ bitmark COMMAND
running command...
$ bitmark (--version)
@gmb/bitmark-cli/3.11.0 linux-x64 node-v20.18.3
$ bitmark --help [COMMAND]
USAGE
$ bitmark COMMAND
...
bitmark breakscape [INPUT]
bitmark convert [INPUT]
bitmark convertText [INPUT]
bitmark help [COMMAND]
bitmark info [INFO]
bitmark unbreakscape [INPUT]
Breakscape text
USAGE
$ bitmark breakscape [INPUT] [-a -o FILE]
ARGUMENTS
INPUT file to read, or text. If not specified, input will be from <stdin>
FILE OUTPUT FLAGS
-a, --append append to the output file (default is to overwrite)
-o, --output=FILE output file. If not specified, output will be to <stdout>
DESCRIPTION
Breakscape text
EXAMPLES
$ bitmark breakscape '[.article] Hello World'
$ bitmark breakscape input.txt -o output.txt
See code: src/commands/breakscape.ts
Convert between bitmark formats
USAGE
$ bitmark convert [INPUT] [-v 2|3] [-f bitmark|json|ast] [-w] [--indent INDENT -p] [--plainText]
[--excludeUnknownProperties] [--explicitTextFormat] [--cardSetVersion 1|2] [-a -o FILE] [--parser peggy|antlr]
ARGUMENTS
INPUT file to read, or bitmark or json string. If not specified, input will be from <stdin>
FLAGS
-f, --format=<option> output format. If not specified, bitmark is converted to JSON, and JSON / AST is converted to
bitmark
<options: bitmark|json|ast>
-v, --version=<option> version of bitmark to use (default: latest)
<options: 2|3>
-w, --warnings enable warnings in the output
FILE OUTPUT FLAGS
-a, --append append to the output file (default is to overwrite)
-o, --output=FILE output file. If not specified, output will be to <stdout>
JSON FORMATTING FLAGS
-p, --pretty prettify the JSON output with indent
--excludeUnknownProperties exclude unknown properties in the JSON output
--indent=INDENT prettify indent (default:2)
--plainText output text as plain text rather than JSON (default: set by bitmark version)
BITMARK FORMATTING FLAGS
--cardSetVersion=<option> version of card set to use in bitmark (default: set by bitmark version)
<options: 1|2>
--explicitTextFormat include bitmark text format in bitmark even if it is the default (bitmark--)
PARSER OPTIONS FLAGS
--parser=<option> [default: peggy] parser to use
<options: peggy|antlr>
DESCRIPTION
Convert between bitmark formats
EXAMPLES
$ bitmark convert '[.article] Hello World'
$ bitmark convert '[{"bitmark": "[.article] Hello World","bit": { "type": "article", "format": "bitmark--", "body": "Hello World" }}]'
$ bitmark convert input.json -o output.bit
$ bitmark convert input.bit -o output.json
$ bitmark convert -f ast input.json -o output.ast.json
See code: src/commands/convert.ts
Convert between bitmark text formats
USAGE
$ bitmark convertText [INPUT] [-f latex|json|xml|bitmark--|bitmark++] [--indent INDENT -p] [-a -o FILE]
ARGUMENTS
INPUT file to read, or text or json string. If not specified, input will be from <stdin>
FLAGS
-f, --textFormat=<option> [default: bitmark--] conversion format
<options: latex|json|xml|bitmark--|bitmark++>
FILE OUTPUT FLAGS
-a, --append append to the output file (default is to overwrite)
-o, --output=FILE output file. If not specified, output will be to <stdout>
JSON FORMATTING FLAGS
-p, --pretty prettify the JSON output with indent
--indent=INDENT prettify indent (default:2)
DESCRIPTION
Convert between bitmark text formats
EXAMPLES
$ bitmark convertText 'Hello World'
$ bitmark convertText '[{"type":"paragraph","content":[{"text":"Hello World","type":"text"}],"attrs":{}}]'
$ bitmark convertText input.json -o output.txt
$ bitmark convertText input.txt -o output.json
See code: src/commands/convertText.ts
Display help for bitmark.
USAGE
$ bitmark help [COMMAND...] [-n]
ARGUMENTS
COMMAND... Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for bitmark.
See code: @oclif/plugin-help
Display information about bitmark
USAGE
$ bitmark info [INFO] [-f text|json] [--bit <value> | --all | --deprecated] [--indent INDENT -p] [-a -o
FILE]
ARGUMENTS
INFO (list|bit) [default: list] information to return. If not specified, a list of bits will be returned
FLAGS
-f, --format=<option> [default: text] output format. If not specified, the ouput will be text
<options: text|json>
--all output all bits including deprecated
--bit=<value> bit to filter. If not specified, all bits will be returned
--deprecated output deprecated bits
FILE OUTPUT FLAGS
-a, --append append to the output file (default is to overwrite)
-o, --output=FILE output file. If not specified, output will be to <stdout>
JSON FORMATTING FLAGS
-p, --pretty prettify the JSON output with indent
--indent=INDENT prettify indent (default:2)
DESCRIPTION
Display information about bitmark
EXAMPLES
$ bitmark info
$ bitmark info --all
$ bitmark info list --deprecated
$ bitmark info bit --bit=cloze
$ bitmark info -f json -p bit --bit=still-image-film
See code: src/commands/info.ts
Unbreakscape text
USAGE
$ bitmark unbreakscape [INPUT] [-a -o FILE]
ARGUMENTS
INPUT file to read, or text. If not specified, input will be from <stdin>
FILE OUTPUT FLAGS
-a, --append append to the output file (default is to overwrite)
-o, --output=FILE output file. If not specified, output will be to <stdout>
DESCRIPTION
Unbreakscape text
EXAMPLES
$ bitmark unbreakscape '[^.article] Hello World'
$ bitmark unbreakscape input.txt -o output.txt
See code: src/commands/unbreakscape.ts