mico (minimalistic config file format) encoder and decoder

Overview

mico

This library implements a parser and emitter for mico (minimalistic config file format).

Format example:

Name: mico
Description: minimalistic config file format

Benefits
 - easy to read and write for everyone
 - ludicrously simple parsing logic (roughly 30 lines of code)

Parsing and emitting mico

There are two convenience functions to parse and emit:

use mico::Mapping;

// parse string
let mappings = mico::from_str("foo: bar");
assert_eq!(mappings[0].key, "foo");
assert_eq!(mappings[0].value, "bar".into());

// emit mappings
let mappings = [Mapping::new("foo", "bar")];
assert_eq!(mico::to_string(&mappings, 0), "foo: bar\n");

Notes

mico is meant for people to write simple config files very fast. There is no indentation, escaping or quoting to worry about, so any text line can simply be pasted to a mico file without further editing.

There are only two types:

  1. A mapping from key to string:

    key: value
    
  2. A mapping from key to a list of strings

    key
     - value 1
     - value 2
    

Here is a mico example:

foo: bar
  indentation is possible: but does not matter
white space  :  will be trimmed
this is a key:this: is:a :value
empty string:

empty lines: will be ignored

list ...
 - keys must not include a colon
 - items start with '-'

this is an empty list, because this line does not include a colon

this is no list because of the colon at the end of this line:
 - this is an empty list

Here is the corresponding JSON example:

[
  { "foo": "bar" },
  { "indentation is possible": "but does not matter" },
  { "white space": "will be trimmed" },
  { "this is a key": "this: is:a :value" },
  { "empty string": "" },
  { "empty lines": "will be ignored" },
  { "list ...": ["keys must not include a colon", "items start with '-'"] },
  { "This is an empty list, because this line does not include a colon": [] },
  { "This is no list because of the colon at the end of this line:": "" },
  { "- this is an empty list": [] }
]
You might also like...
CLI and utilities for converting media files (images/videos) to ascii outputs (output media file or print to console)
CLI and utilities for converting media files (images/videos) to ascii outputs (output media file or print to console)

CLI and utilities for converting media files (images/videos) to ascii outputs (output media file or print to console). Supports most standard image formats, and some video formats.

Add image watermark for multiple file (jpeg, jpg, png, tiff, bmp,etc)

Rust image watermark Add image watermark CLI program for multiple image format (jpeg, jpg, png, tiff, bmp, etc.) manipulation, browser WASM build supp

😱 Dead fast thumbnail library for browser and NodeJs! Built with Rust 🦀 and WebAssembly 🕸

thumbo-core 😱 Dead fast thumbnail library for browser and NodeJs Built with Rust 🦀 & WebAssembly 🕸 📖 About thumbo-core is a thubnail library for b

Takes a folder of images (as a palette), and an image, and figures out how to tile the palette to resemble the image!
Takes a folder of images (as a palette), and an image, and figures out how to tile the palette to resemble the image!

Takes a folder of images (as a palette), and an image, and figures out how to tile the palette to resemble the image!

Encoding and decoding images in Rust
Encoding and decoding images in Rust

Image Maintainers: @HeroicKatora, @fintelia How to contribute An Image Processing Library This crate provides basic image processing functions and met

Classical Rainbow Triangle using Rust and Vulkan via vulkano bindings
Classical Rainbow Triangle using Rust and Vulkan via vulkano bindings

Vulkano Rainbow Triangle Classical Rainbow Triangle using Rust and Vulkan via vulkano bindings. Based on the vulkano triangle example Quick Start $ ca

Lust is a static image server designed to automatically convert uploaded image to several formats and preset sizes
Lust is a static image server designed to automatically convert uploaded image to several formats and preset sizes

What is Lust? Lust is a static image server designed to automatically convert uploaded image to several formats and preset sizes with scaling in mind.

A linear algebra and mathematics library for computer graphics.

cgmath-rs A linear algebra and mathematics library for computer graphics. The library provides: vectors: Vector2, Vector3, Vector4 square matrices: Ma

Signed distance field font and image command line tool based on OpenCL.

SDFTool Signed distance field font and image command line tool based on OpenCL. Build Windows Run cargo build --release in Visual Studio developer x64

Owner
null
Fast encoder/decoder for the lossless DTM 16 bit image format

DTM Image Format Fast encoder/decoder for the DTM image format. The DTM image format is a 16-bit lossless image format supporting one to four channels

Kurt Kühnert 4 Oct 15, 2022
An experimental gif encoder for Windows 10.

giffun An experimental gif encoder for Windows 10. Resources Based on "Techniques for GPU-based Color Quantization" (2019) by Matthias Trapp, Sebastia

Robert Mikhayelyan 3 Dec 22, 2021
Camera RAW to DNG file format converter

DNGLab - A camera RAW to DNG file format converter Command line tool to convert camera RAW files to Digital Negative Format (DNG). It is currently in

null 92 Jan 6, 2023
A simple command-line utility (and Rust crate!) for converting from a conventional image file (e.g. a PNG file) into a pixel-art version constructed with emoji

EmojiPix This is a simple command-line utility (and Rust crate!) for converting from a conventional image file (e.g. a PNG file) into a pixel-art vers

Michael Milton 22 Dec 6, 2022
🖼️Combines a Javascript and WASM file into a single executable polygot PNG+HTML file.

WASIMAGE Combines a Javascript and WASM file into a single executable polygot PNG+HTML file. Usage: cargo install wasimage wasimage --wasm-file my.was

Nervive 2 Mar 30, 2022
Convert and save photomode screenshots from Red Dead Redemption 2 to JPEG format.

RDR2 Screenshot converter Convert and save photomode screenshots from Red Dead Redemption 2 to JPEG format. QuickStart Just download the executable fi

Timofey Gelazoniya 12 Sep 29, 2022
Rust library to get image size and format without loading/decoding

imageinfo-rs Rust library to get image size and format without loading/decoding. The imageinfo don't get image format by file ext name, but infer by f

xiaozhuai, Weihang Ding 47 Dec 30, 2022
Foxtrot is a fast viewer for STEP files, a standard interchange format for mechanical CAD

Foxtrot is a fast viewer for STEP files, a standard interchange format for mechanical CAD. It is an experimental project built from the ground up, including new libraries for parsing and triangulation.

null 160 Jan 3, 2023
Rust port of the Quite Okay Image format

qoi_rs What is this? A pretty boring Rust translation of qoi. Status What's there Encode & Decode works Results agree with the C implementation for al

null 9 Dec 9, 2021
An intel PT trace converter from `perf.data` to Fuchsia trace format.

Introduction Recent Intel processors feature the "Intel Processor Trace" feature, which can be used to capture the full execution trace of a program.

Michał Chojnowski 14 Nov 9, 2022