Skip to content

Commit 202f017

Browse files
runyagaclaude
andcommitted
docs: add dartdoc categories, topic pages, and generation script
Add `dartdoc_options.yaml` to dart_monty, dart_monty_platform_interface, and dart_monty_bridge with category definitions (Core, Execution, Errors, Configuration, Sessions for the core packages; Bridge, Host Functions, Plugins, Events for bridge). Add `{@category}` tags to all 45+ public types so they appear grouped in the generated docs sidebar. Improve library-level doc comments with key types tables and ecosystem navigation. Hide internal SPI libraries from public docs via `exclude`. Add `tool/dartdoc.sh` for local doc generation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c7b3229 commit 202f017

44 files changed

Lines changed: 294 additions & 10 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dartdoc_options.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
dartdoc:
2+
categories:
3+
"Core":
4+
markdown: doc/categories/core.md
5+
"Execution":
6+
markdown: doc/categories/execution.md
7+
"Errors":
8+
markdown: doc/categories/errors.md
9+
"Configuration":
10+
markdown: doc/categories/configuration.md
11+
"Sessions":
12+
markdown: doc/categories/sessions.md
13+
categoryOrder:
14+
- "Core"
15+
- "Execution"
16+
- "Errors"
17+
- "Configuration"
18+
- "Sessions"

doc/categories/configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Resource limits, usage statistics, and stack frame data.

doc/categories/core.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The main entry point for running Python code. Start here with `Monty` and `MontyResult`.

doc/categories/errors.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Sealed error hierarchy for exhaustive error handling via pattern matching.

doc/categories/execution.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Types for iterative (multi-step) execution with external functions via `start()` / `resume()`.

doc/categories/sessions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Stateful execution sessions and cancellation tokens.

lib/dart_monty.dart

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
/// Pure Dart bindings for the Monty sandboxed Python interpreter.
22
///
3-
/// Backend is selected at compile time via conditional imports:
4-
/// native FFI on desktop/server, WASM in browsers. No Flutter required.
3+
/// This is the main entry point for running sandboxed Python from Dart.
4+
/// The backend (native FFI or browser WASM) is selected at compile time
5+
/// via conditional imports — no Flutter required.
6+
///
7+
/// ## Quick Start
58
///
69
/// ```dart
710
/// import 'package:dart_monty/dart_monty.dart';
@@ -11,6 +14,22 @@
1114
/// print(result.value); // 4
1215
/// await monty.dispose();
1316
/// ```
17+
///
18+
/// ## Key Types
19+
///
20+
/// - [Monty] — create an interpreter and run Python code
21+
/// - [MontyResult] — the return value from [Monty.run]
22+
/// - [MontyProgress], [MontyPending], [MontyComplete] — iterative execution
23+
/// with external functions via [Monty.start] / [Monty.resume]
24+
/// - [MontyError] — sealed error hierarchy for exhaustive error handling
25+
/// - [MontyLimits] — resource constraints (time, memory, stack depth)
26+
/// - [MontySession] — stateful sessions that persist Python globals
27+
///
28+
/// ## Related Packages
29+
///
30+
/// - **dart_monty_bridge** — high-level bridge with host function dispatch,
31+
/// event streaming, and a plugin system. Install separately:
32+
/// `dart pub add dart_monty_bridge`
1433
library;
1534

1635
export 'package:dart_monty_platform_interface/dart_monty_platform_interface.dart';

lib/src/monty.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import 'package:dart_monty_platform_interface/dart_monty_platform_interface.dart
33

44
/// Monty sandboxed Python interpreter.
55
///
6+
/// {@category Core}
7+
///
68
/// Uses compile-time conditional imports to select the backend:
79
/// - Native (macOS, Linux, Windows): Rust FFI via `dart:ffi`
810
/// - Web (browser): WASM via `dart:js_interop`
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
dartdoc:
2+
categories:
3+
"Bridge":
4+
markdown: doc/categories/bridge.md
5+
"Host Functions":
6+
markdown: doc/categories/host_functions.md
7+
"Plugins":
8+
markdown: doc/categories/plugins.md
9+
"Events":
10+
markdown: doc/categories/events.md
11+
categoryOrder:
12+
- "Bridge"
13+
- "Host Functions"
14+
- "Plugins"
15+
- "Events"
16+
exclude:
17+
- "bridge_internals"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
High-level bridge that wraps the start/resume loop and emits a stream of events.

0 commit comments

Comments
 (0)