tfm28 downloadsSyntax highlighting for Protocol Buffers and nanopb options in fenced code blocks.
Syntax highlighting for Protocol Buffers and nanopb code blocks in Obsidian. Supports Reading view, Live Preview, and Source mode, using your active theme's code colors. No configuration required.
Repository name: obsidian-protobuf-nanopb · Plugin ID: protobuf-nanopb
(nanopb).max_length and (nanopb).max_count..options blocks with field patterns, wildcards, and # comments.Add a supported language identifier to a fenced Markdown code block:
| Identifier | Content |
|---|---|
proto, protobuf, nanopb |
Protocol Buffers syntax, including nanopb extensions |
nanopb-options |
Separate nanopb .options file syntax |
```proto
syntax = "proto2";
import "nanopb.proto";
message Sensor {
optional string name = 1 [(nanopb).max_length = 32];
repeated float values = 2 [(nanopb).max_count = 8];
}
```
For separate nanopb options:
```nanopb-options
Sensor.name max_length:32
Sensor.values max_count:8
Sensor.* type:FT_STATIC
```
See examples/demo.md for more examples.
Requires Obsidian 1.8.7 or later. The plugin is not yet listed in the official Community directory.
Once a release is available:
main.js, manifest.json, and styles.css from the repository's GitHub Releases page..obsidian/plugins/protobuf-nanopb/ inside your vault.Requires Node.js 22 and npm. In a local checkout of obsidian-protobuf-nanopb, run:
npm install
npm test
npm run build
Then follow the manual installation steps above using the generated main.js and the repository's manifest.json and styles.css.
| Command | Purpose |
|---|---|
npm run dev |
Rebuild on changes; reload the plugin in Obsidian to apply them |
npm run build |
Type-check and generate main.js |
npm test |
Test tokenization and Markdown code block detection |
Reading view renders code as DOM text nodes. A CodeMirror 6 extension adds editor highlighting. Markdown is parsed when the document changes; tokenization is limited to code blocks intersecting the visible editor area.
Before releasing, use examples/demo.md to check Reading view, Live Preview, Source mode, light and dark themes, editing, scrolling, and disabling the plugin in Obsidian. Automated tests do not replace these UI checks.
This plugin provides syntax highlighting. It does not validate or compile Protocol Buffers, provide code completion, or register standalone .proto files as a new Obsidian file type. It uses no desktop-specific APIs; mobile behavior should be verified separately before release.
Release notes are maintained in CHANGELOG.md. The current release version is 0.1.2.
The Release GitHub Action runs when manifest.json or the release workflow changes on main. It installs dependencies, runs tests, builds the plugin, validates version consistency, and publishes a GitHub release tagged exactly like the manifest version, without a v prefix. The release includes main.js, manifest.json, and styles.css as individual assets. Already published releases are left unchanged.
To publish a new version:
manifest.json, package.json, and package-lock.json, and add the minimum Obsidian version to versions.json.CHANGELOG.md and test the plugin in Obsidian.main.You can also run Actions → Release → Run workflow on main to retry publication. The workflow uses GitHub's built-in token with repository contents write permission; no personal access token is needed.
For the first Community directory submission, sign in at community.obsidian.md, link your GitHub account, and submit the repository. Commit the current manifest to the default branch and publish the matching release before requesting review.
See the official submission guide for the publication process and requirements.
MIT.