Code Monkey home page Code Monkey logo

inliner's Introduction

Inliner

inliner takes a file and outputs a Rust const variable declaration containing all the bytes in that file. This declaration can then be pasted into your Rust code.

"How about include_bytes!()?"

This macro requires you to have non source files in your source tree, which is not always desirable (the build can break if you move these files around, you might want to make these binary files not searchable, etc...).

Usage: inliner.exe [OPTIONS] <FILE_NAME>

Arguments:
  <FILE_NAME>

Options:
  -c, --columns <COLUMNS>              Max number of columns [default: 80]
  -i, --indent <INDENT>                Number of spaces for indentation [default: 4]
  -v, --variable <VARIABLE>  Name of the variable [default: derived from the file name]
  -h, --help                           Print help
  -V, --version                        Print version

For example:

$ inliner --columns 60 --indent 2 --variable ROM dsk.rom 

const ROM: [u8; 237] = [
  0x23, 0x47, 0x68, 0x69, 0x64, 0x72, 0x61, 0x20, 0x4C,
  0x6F, 0x63, 0x6B, 0x20, 0x46, 0x69, 0x6C, 0x65, 0x0D,
  ...
];

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.