Rand Stats

rawstr4c

zef:ccmywish

rawstr4c

Use this tool when you need to write and maintain complex C language strings (raw strings for C). It saves you from the nightmare of one-off string generation tools, turning you into a professional raw strings maintainer.

By using a separate rawstr4c.md file, you explicitly record raw strings inside code blocks, along with the rules for generating variable names. By checking this file into your repository, you can continuously iterate on it.

The core innovation of rawstr4c is to use a Markdown file — allowing you to take advantage of your editor’s Markdown syntax highlighting feature to highlight your raw strings!

[!NOTE] This tool was originally developed as and now maintained as a subproject of chsrc (which proudly benefits greatly from it)


Install

zef

$ zef install rawstr4c

Usage

$ rawstr4c --help

You need to write a Markdown file (default rawstr4c.md) to record raw strings and configure rawstr4c. See below for configuration syntax.


Convention

A configuration file should use this order:

  1. section title
  2. description of the variable
  3. configuration block (configblock)
  4. configuration block (configblock) comments
  5. code block (codeblock) (raw string)
  6. comments for the content of the code block (codeblock)

Configuration Syntax

- config-item1 = `:mode`

- config-item2 = `true|false|yes|no`

- config-item3 = `string value`

Configuration items always start with -, followed by the configuration item name and an =, and the right-hand value must be wrapped with ``.

Note: if the value is not arbitrarily given by the user, it should be set as a mode type, using : as a prefix.


Configuration Items

Note: unless otherwise specified, the first item is the default value