No description
Find a file
2025-04-06 20:32:09 +03:00
.github/workflows Add workflow for build & release 2025-04-06 20:06:14 +03:00
.gitignore Add some settings 2025-04-06 20:31:06 +03:00
bun.lock Initial 2025-04-06 19:12:17 +03:00
LICENSE Add license 2025-04-06 19:25:13 +03:00
main.ts Add some settings 2025-04-06 20:31:06 +03:00
manifest.json Version 0.0.2 2025-04-06 20:32:09 +03:00
package.json Version 0.0.2 2025-04-06 20:32:09 +03:00
readme.md Add building instructions 2025-04-06 19:59:10 +03:00

bytefield

a simple Obsidian plugin adding support for byte-field diagrams.

usage

a byte-field diagram is one of those tables that show offsets of fields in e.g. network packets:

image

to create one, simply make a codeblock and add your fields.

```bytefield
field1: 3
field2: 4
field3: 1
```
simple diagram as above

every line has to contain the name of the field, : as the delimiter and the length of the field in bytes. lines that do not contain : are silently ignored, so feel free to use them as comments.

also, it is possible to change the offset where the diagram starts:

```bytefield
!curOffset: 7
field1: 5
field2: 3
field3: 4
```
diagram with starting offset set to 7

fields are wrapped around if they're longer than the row:

diagram with one of the fields wrapping around

also, to make an unnamed field that still takes up space (padding), just omit the part before the : :

```bytefield
field1: 3
: 1
field2: 4
```
diagram with one empty/padding byte

building

unlike most, this project is built with Bun. to build the main.js file:

bun run build

to watch:

bun run watch

doing it this way keeps minimal dependencies as Bun supports TypeScript out of the box, and also has a bundler built-in.