RegExRX2MD

Description

Converts native RegExRX documents to Markdown files containing code snippets that work with Snibbets or any Markdown viewer.

Installation

$ gem install regexrx2md

If you run into errors, try:

$ gem install --user-install regexrx2md

Usage

Run regexrx2md in a directory containing .regexrx files and all matching files will be processed to Markdown files in a markdown subdirectory.

If the argument is a directory, all .regexrx files in the directory will be processed and output to the --output-dir destination (which defaults to markdown). If the argument is a single .regexrx file, only that file will be processed. Markdown filenames will be based on the title of the RegExRX file, either from the built-in name field, or from the filename if it’s untitled.

Options:

Usage: bin/regexrx2md [OPTIONS] [SOURCE FILE/DIR]

Converts RegExRx files to Markdown, optionally with template.
    If source argument is empty, process all .regexrx files in current directory.

Options:
    -o, --output-dir=DIRECTORY       Output folder
                                     Defaults to "./markdown"
    -p, --prefix=PREFIX              Prefix added before output filenames
                                     Space automatically added after prefix
    -t, --template=TEMPLATE          Use alternate ERB template
    -h, --help                       Display this screen
    -x, --example                    Output the default ERB template to STDOUT

You can specify a prefix for filenames using the --prefix option. For example, using --prefix="RX - " would cause URL detector.regexrx to create RX - URL detector.md as the Markdown output file.

The default template outputs notes as block quotes and snippets as Ruby fenced code blocks. You can adjust this by using a custom ERB template. Just output the default template using --example, save it to a new file and edit as needed, then pass the new file using --template=NEW_FILE.erb. The template file must be named with an erb extension.

Changelog

Click to expand

1.0.0

2023-08-20 12:25

  • Initial release

Speaking of RegExRX2MD…

Related Projects