瀏覽代碼

docs: update READMEs for code blocks, debug logger, and missing files

Zander Hawke 1 周之前
父節點
當前提交
56d3cdb629
共有 3 個文件被更改,包括 12 次插入3 次删除
  1. 4 1
      README.md
  2. 2 1
      apps/dev/README.md
  3. 6 1
      packages/editor/README.md

+ 4 - 1
README.md

@@ -13,7 +13,7 @@ Enesis is being built as a complete block-editing substrate:
 | Phase | Feature | Status |
 |---|---|---|
 | 1–5 | Core editor: clean content model, keyboard boundaries, focus/cursor, inline + block decorations, Lezer-only AST pipeline | **Done** |
-| 6 | Code block node views with CodeMirror 6, inline/block LaTeX with KaTeX | Next |
+| 6 | Code block node views with CodeMirror 6, inline/block LaTeX with KaTeX | **Partial** — CM6 done, LaTeX pending |
 | 7 | Toolbar handler API — `toggleBold`, `insertLink`, `setHeading`, `toggleTask` from Lezer tree queries | Planned |
 | 8 | Asset handling — image drop, upload protocol, inline preview | Planned |
 | 9 | Reference interactivity — clickable `[[page]]`, `((block))`, `#tag` chips with preview | Planned |
@@ -55,12 +55,15 @@ Enesis is being built as a complete block-editing substrate:
 │       │   ├── composables/
 │       │   │   ├── useMarkdownDecorations.ts   ProseMirror decoration plugin
 │       │   │   ├── useBlockKeyboardHandlers.ts Keyboard handler (Enter, Backspace, arrows)
+│       │   │   ├── useCodeBlockView.ts         CM6 NodeView for fenced code blocks
 │       │   │   └── usePatternPlugin.ts         Pattern detection ([[, ((, /, #)
 │       │   └── lib/
 │       │       ├── markdown-parser.ts          Lezer parser configuration
 │       │       ├── markdown-extensions.ts      Custom Lezer extensions
 │       │       ├── content-model.ts            Markdown ↔ ProseMirror conversion
 │       │       ├── schema.ts                   Minimal ProseMirror schema
+│       │       ├── auto-close-plugin.ts        Auto-close for ```, **, _
+│       │       ├── logger.ts                   Namespace-based debug logger
 │       │       └── markdown-rules/
 │       │           ├── engine.ts               MarkdownRuleEngine (3-stage pipeline)
 │       │           ├── types.ts                Shared type interfaces

+ 2 - 1
apps/dev/README.md

@@ -14,10 +14,11 @@ Opens at `http://localhost:5173`.
 
 ## What It Demonstrates
 
-- Four `<Block>` instances with different markdown content (headings, bold, callouts, page refs, block refs, tags, links, tasks with state/priority, properties)
+- Four `<Block>` instances with different markdown content (headings, bold, callouts, page refs, block refs, tags, links, tasks with state/priority, properties, fenced code blocks)
 - All block lifecycle events logged to console (`change`, `split`, `merge-previous`, `delete-if-empty`, `indent`, `outdent`, `arrow-up-from-start`, `arrow-down-from-end`, `pattern-open`, `pattern-update`, `pattern-close`, `focus`, `blur`, `selection-change`)
 - `marker-mode="always-visible"` on the first block (markdown delimiters always shown)
 - `marker-mode="live-preview"` (default) on the remaining blocks (delimiters hidden when blurred)
+- `debug` prop for per-instance namespace-based logging (e.g. `debug="CodeBlockView"`)
 - Dark/light mode toggle via Nuxt UI `UColorModeButton`
 - Routing via Vue Router with a single route at `/`
 

+ 6 - 1
packages/editor/README.md

@@ -38,11 +38,12 @@ app.use(EnesisEditor)
 ### Props
 
 | Prop | Type | Default | Description |
-|---|---|---|---|
+|---|---|---|---|---|
 | `content` (v-model) | `string` | required | Markdown content of the block |
 | `focused` | `boolean` | `false` | Whether the block receives focus on mount |
 | `cursorPosition` | `"start" \| "end" \| number` | — | Cursor placement on focus |
 | `markerMode` | `"live-preview" \| "always-visible"` | `"live-preview"` | When to show markdown delimiters |
+| `debug` | `string` | — | Namespace filter for debug logs (e.g. `"CodeBlockView"`, `"*"`) |
 
 ### Emits
 
@@ -114,6 +115,7 @@ Formatting is purely decorative — markdown syntax is stored as plain text in P
 | Callout | `> [!NOTE] text` | `md-callout` |
 | Task | `TODO task text` | `md-task-marker` / `md-task-content` |
 | Property | `key:: value` | `md-property-*` |
+| Fenced Code Block | `` ```python `` / `~~~js` | CM6 node view |
 
 ### Pattern Detection
 
@@ -165,10 +167,13 @@ pnpm dev          # Watch mode rebuild
 | `src/components/Block.vue` | ProseMirror block editor component |
 | `src/composables/useMarkdownDecorations.ts` | Decoration plugin (live-preview, caching) |
 | `src/composables/useBlockKeyboardHandlers.ts` | Keyboard event handler |
+| `src/composables/useCodeBlockView.ts` | CM6 NodeView for fenced code blocks |
 | `src/composables/usePatternPlugin.ts` | Pattern detection plugin |
 | `src/lib/markdown-parser.ts` | Lezer parser configuration |
 | `src/lib/markdown-extensions.ts` | Custom Lezer node definitions |
+| `src/lib/auto-close-plugin.ts` | Auto-close for ```, **, _ |
 | `src/lib/content-model.ts` | Markdown ↔ ProseMirror doc conversion |
+| `src/lib/logger.ts` | Namespace-based debug logger |
 | `src/lib/schema.ts` | ProseMirror schema |
 | `src/lib/markdown-rules/engine.ts` | 3-stage rule engine |
 | `src/lib/markdown-rules/inline-rules.ts` | Inline decoration rules |