Introduction
Nahnu Code and API Block is a free WordPress plugin that renders code samples and API reference content as native WordPress blocks. Instead of hand-formatting a code sample or an endpoint description every time, you drop in a block or a shortcode and it renders consistently, every time.
It is built and maintained by Nahnu Plugins.
What it is for#
If you write developer documentation, an SDK guide, or an API reference on a WordPress site, this plugin gives you purpose-built blocks for that kind of content: syntax-highlighted code, endpoint definitions, parameter tables, request and response examples, status codes, and more. Each block is styled and structured for documentation specifically, not repurposed from a generic content block.
Standalone, or paired with WP Super Docs#
The plugin works on its own. You can place any block directly in a page or post and fill it in by hand.
It also works as a companion to our WP Super Docs plugin. When paired, WP Super Docs can generate these blocks automatically from an OpenAPI specification, so your API reference stays in sync with your actual API instead of drifting out of date. See the OpenAPI section of these docs for how that works.
The blocks#
Content blocks:
- Code Block, a single syntax-highlighted code sample
API reference blocks:
- Endpoint, method, path, and summary for one API operation
- Parameters, a parameter table, including nested objects
- Request / Response, paired request and response examples, often per language
- Response Body, one or more possible responses with schema and headers
- Status Codes, a quick-scan table of status codes an endpoint can return
- Error Codes, a reference table of error codes and what they mean
- Auth, how to authenticate a request
- Servers, the base URLs or environments an API is available on
- Try It, an interactive request builder
Supporting blocks:
- Events, documents webhook or event payloads
- API Navigation, a navigable list of endpoints
What’s next#
Start with Installation and Requirements, then Quick Start to build your first block. If you plan to use WP Super Docs to generate your reference automatically, read the OpenAPI section after that.