fluffos/docs
Claude 88b21f970b contrib: get_os_env()/set_os_env() with config allow-lists
LPC can now read and set OS environment variables -- the ask from the
dockerization discussion -- gated by two new colon-separated runtime
config allow-lists: 'allowed os environment variables' (readable) and
'writable os environment variables' (writable, implicitly readable).
Both default to empty, so nothing is accessible until the host
administrator opts specific names in. set_os_env(name) with no value
unsets. Windows uses _putenv_s.

Includes efun docs, index registration, regenerated config docs, and a
testsuite case exercising allow/deny/read/write/unset paths (the test
config allow-lists PATH read-only and FLUFFOS_TEST_RW read-write).

Fixes #1045

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016FMBJLkpkpVpZdz6PWzeWe
2026-07-11 00:58:09 -04:00
..
apply Add inherit_program / include_file master applies; auto hot-reload demo (#1230) 2026-07-10 10:27:27 -04:00
archive Move to /docs folder 2018-12-30 17:03:14 -08:00
cli Add local search and documentation guide for docs site (#1221) 2026-07-09 22:09:55 -04:00
concepts Add inherit_program / include_file master applies; auto hot-reload demo (#1230) 2026-07-10 10:27:27 -04:00
driver contrib: get_os_env()/set_os_env() with config allow-lists 2026-07-11 00:58:09 -04:00
efun contrib: get_os_env()/set_os_env() with config allow-lists 2026-07-11 00:58:09 -04:00
lpc Add inherit_program / include_file master applies; auto hot-reload demo (#1230) 2026-07-10 10:27:27 -04:00
src/css setup vitepress 2023-12-02 20:00:33 -08:00
static Add local search and documentation guide for docs site (#1221) 2026-07-09 22:09:55 -04:00
stdlib Add local search and documentation guide for docs site (#1221) 2026-07-09 22:09:55 -04:00
zh-CN dwlib: make the package buildable again (opt-in) 2026-07-10 10:26:58 -04:00
.gitignore Add local search and documentation guide for docs site (#1221) 2026-07-09 22:09:55 -04:00
add_missing_efuns.py Add local search and documentation guide for docs site (#1221) 2026-07-09 22:09:55 -04:00
bug.md Add local search and documentation guide for docs site (#1221) 2026-07-09 22:09:55 -04:00
build-wasm.md wasm: run the full driver in the browser (Emscripten port) (#1231) 2026-07-10 23:33:51 -04:00
build.md build: add pkg-config and libffi to dependency lists (#1235) 2026-07-10 23:26:25 -04:00
build_v2017.md Add local search and documentation guide for docs site (#1221) 2026-07-09 22:09:55 -04:00
CLAUDE.md Add local search and documentation guide for docs site (#1221) 2026-07-09 22:09:55 -04:00
docusaurus.config.ts Add local search and documentation guide for docs site (#1221) 2026-07-09 22:09:55 -04:00
gen_config_docs.py package_ffi: foreign function interface for LPC (libffi), with callbacks 2026-07-09 20:48:48 -04:00
gen_index.py Add local search and documentation guide for docs site (#1221) 2026-07-09 22:09:55 -04:00
index.md Add local search and documentation guide for docs site (#1221) 2026-07-09 22:09:55 -04:00
package-lock.json Add local search and documentation guide for docs site (#1221) 2026-07-09 22:09:55 -04:00
package.json Add local search and documentation guide for docs site (#1221) 2026-07-09 22:09:55 -04:00
README.md Add local search and documentation guide for docs site (#1221) 2026-07-09 22:09:55 -04:00
sidebars.ts wasm: run the full driver in the browser (Emscripten port) (#1231) 2026-07-10 23:33:51 -04:00
update_index.sh Add local search and documentation guide for docs site (#1221) 2026-07-09 22:09:55 -04:00

FluffOS Documentation

This directory contains the source for the FluffOS documentation site, published at https://www.fluffos.info.

The site is built with Docusaurus 3 (@docusaurus/preset-classic). Markdown files live directly in this directory (the docs plugin is configured with path: '.' and routeBasePath: '/'), so docs/efun/strings/explode.md becomes /efun/strings/explode on the site.

This README is for contributors and is excluded from the published site (see exclude in docusaurus.config.ts).

Local Development

Requires Node.js 18+ (Node 22 recommended).

cd docs
npm install
npm run dev       # dev server on http://localhost:3000

Other scripts:

npm run build     # production build → docs/build/
npm run preview   # serve the production build locally
npm run clear     # clear the Docusaurus cache

Full-text search is provided by @easyops-cn/docusaurus-search-local, an offline/local search theme — the index is generated at build time and shipped with the site, so no external search service (e.g. Algolia) is needed.

Notes:

  • The search index is only generated by npm run build. In the dev server (npm run dev) the search bar shows a hint instead of results; use npm run build && npm run preview to test search locally.
  • Both English and Chinese (zh-CN/) pages are indexed (language: ['en', 'zh']).
  • Search options live in the themes section of docusaurus.config.ts.

Layout

Path Contents
docusaurus.config.ts Site config: navbar, footer, docs plugin, search theme
sidebars.ts Sidebar navigation tree (Docusaurus SidebarsConfig format)
src/css/custom.css Infima CSS variable overrides
static/ Files copied verbatim to the site root (CNAME, Google site verification)
apply/ Driver-to-LPC callback (apply) reference
efun/ Built-in function (efun) reference, by category
stdlib/ LPC standard-library reference
driver/ Driver internals & configuration
lpc/ LPC language reference
concepts/ High-level LPC / MUD concepts
cli/ Command-line tool docs
zh-CN/ Chinese documentation
archive/ Historical MudOS-era documents (not published)

Maintenance scripts

Script Purpose
update_index.sh Regenerates all generated index.md listing pages (calls gen_index.py)
gen_index.py Writes an index.md for one doc tree (e.g. ./gen_index.py efun EFUN)
gen_config_docs.py Regenerates driver/config.md from src/base/internal/rc.cc
add_missing_efuns.py Creates stub pages under efun/general/ for undocumented efuns (needs a keywords.json from the generate_keywords tool)

Conventions & Gotchas

  • driver/config.md is auto-generated from src/base/internal/rc.cc — never edit it by hand. Regenerate with python3 docs/gen_config_docs.py; CI fails if it is stale.
  • .md files are treated as standard CommonMark (markdown.format: 'detect'), but bare {...} in prose is still parsed as a JSX expression and breaks the build — escape it as \{...\} outside fenced code blocks.
  • Sidebar entries in sidebars.ts use doc IDs (relative path without extension), not URLs.
  • Generated index.md listing pages (efun/apply/stdlib/cli/concepts/driver/zh-CN) are rewritten by ./update_index.sh — regenerate rather than hand-edit them. lpc/index.md is hand-written and deliberately not regenerated.
  • onBrokenLinks is set to 'throw': a broken internal link fails the build (and the Pages deploy) instead of shipping a 404.

See CLAUDE.md for detailed documentation templates (applies, efuns, CLI tools) and the full contribution workflow.