wcampbell0x2a / bintex Goto Github PK
View Code? Open in Web Editor NEWCreate bytefield latex digrams with the use of rust proc-macros and deku
License: Apache License 2.0
Create bytefield latex digrams with the use of rust proc-macros and deku
License: Apache License 2.0
Support the following struct:
#[derive(BinTex)]
#[bintex(bit_width = 8)]
struct Example {
#[bintex(bits = "12")]
a: u8,
#[bintex(bits = "6")]
b: u8,
}
As a bonus feature, this could also use the \bitbox[bltr]
bottom,left,top,right notation for not having lines between fields.
Other examples:
The following has the u32 = 32 bits, which would fill 4-8 bit levels
#[derive(BinTex)]
#[bintex(bit_width = "8")]
struct Testing {
#[deku(bits = "4")]
a: u8,
#[deku(bits = "4")]
b: u8,
c: u32,
}
#[derive(BinTex)]
#[bintex(bit_width = 8)]
struct Example {
#[bintex(bits = "12", ident = "The A Field is used for Anti Gravity")]
a: u8,
#[bintex(bits = "6")]
b: u8,
}
This is pretty trivial for normal Enums:
#[deku(type = "u8", bits = "4")]
enum DekuTest {
#[deku(id = "0b1001")]
VariantA,,
#[deku(id = "0b0110")]
VariantB,,
}
That would just emit the enum table.
field | id |
---|---|
VariantA | 0b1001 |
VariantB | 0b0110 |
This will be difficult for advanced enums:
#[deku(type = "u8", bits = "4")]
enum DekuTest {
#[deku(id = "0b1001")]
VariantA( #[deku(bits = "4")] u8, u8),
}
That latex_output
would emit one enum table, and another bytefield for the VariantA
.
field | id |
---|---|
VariantA | 0b1001 |
Example form bytefield docs:
\bitbox{8}[bgcolor=lightgreen]{Exponent}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.