Files
prosperon/docs/api/modules/doc.md
John Alanbrook 83b798e365 Add Hugo website and rewrite docs to match current engine
New Hugo site in website/ with prosperon.dev theme (blue/gold/castle
aesthetic), docs sidebar navigation, and content pages. Rewrote all
doc files to align with the actual codebase: compositor+film2d
rendering, use() modules (no global prosperon object), Pit language,
script+JSON entity model. Added entities.md, front matter to all
70+ API docs, and updated API index for current module architecture.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 18:09:55 -06:00

976 B

title, type
title type
doc docs

doc

Provides a consistent way to create documentation for prosperon elements. Objects are documented by adding docstrings directly to object-like things (functions, objects, ...), or to an object's own "doc object".

Docstrings are set to the symbol cell.DOC

// Suppose we have a module that returns a function
function greet(name) { log.console("Hello, " + name) }

// We can attach a docstring
greet.doc = `
Greets the user by name.
`

// A single function is a valid return!
return greet
// Another way is to add a docstring object to an object
var greet = {
hello() { log.console('hello!') }
}

greet[cell.DOC] = {}
greet[cell.DOC][cell.DOC] = 'An object full of different greeter functions'
greet[cell.DOC].hello = 'A greeter that says, "hello!"'

name: The name of the person to greet.

writeDocFile(obj, title) function

Return a markdown string for a given obj, with an optional title.