.nwf
File Format SpecificationVersion: 1.0
License: MIT License
Author & Maintainer: NexussphereQ
Website: nexussphereq.neocities.org
The .nwf
(NexaWrite Format) is a JSON-based file format designed for saving documents created in the NexaWrite editor. It supports embedded media (images, audio, video) and rich text formatting, allowing self-contained, portable documents.
The file is a UTF-8 encoded JSON file with the following top-level structure:
{
"name": "Document Title",
"author": "Author Name",
"date": "ISO 8601 timestamp",
"content": [ ... ]
}
name
(string): The document title.author
(string): The author of the document.date
(string): ISO 8601 timestamp representing the save date/time.content
(array): Array of serialized content nodes representing the document body.The content
array contains nodes representing document content. Nodes can be of two types:
{
"type": "text",
"text": "Sample text here"
}
{
"type": "element",
"tag": "p",
"attributes": {
"class": "highlight"
},
"children": [ ... ]
}
Supported tags include but are not limited to: p, b, i, u, em, strong, h1–h6, img, audio, video, source, ul, ol, li, div, span, br
.
Attributes are key-value pairs corresponding to HTML attributes. For media elements, the src
attribute typically holds a base64 data URI embedding the media content.
Images, audio, and video files embedded in the document must be included as base64-encoded data:
URIs in the src
attribute.
This ensures the document is fully self-contained without external dependencies.
The NexaWrite editor serializes the editable HTML content into the described JSON format on saving, and rebuilds the DOM on loading from a .nwf
file by parsing the JSON and recreating nodes recursively.
To prevent injection of unsafe content, when importing HTML or JSON content, only a safe subset of tags and attributes are allowed.
Sources (src
) must be validated to be data:
URIs or HTTPS/HTTP URLs.
{
"name": "Sample Document",
"author": "NexussphereQ",
"date": "2025-07-02T10:00:00Z",
"content": [
{
"type": "element",
"tag": "p",
"attributes": {},
"children": [
{
"type": "text",
"text": "This is a sample paragraph with an embedded image:"
},
{
"type": "element",
"tag": "img",
"attributes": {
"src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg..."
},
"children": []
}
]
}
]
}
The NexaWrite .nwf
format specification and associated code are released under the MIT License.
Maintained by NexussphereQ.
Visit https://nexussphereq.neocities.org for more info.