Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
e7e5787
docs: add design spec for replacing JSON with XML as primary doc source
deevus Mar 21, 2026
7caedaa
docs: address spec review feedback
deevus Mar 21, 2026
6db2191
docs: address round 2 spec review feedback
deevus Mar 21, 2026
b5f47c6
docs: drop builtin_class distinction from spec
deevus Mar 21, 2026
f5dac87
docs: add implementation plan for XML-only doc source migration
deevus Mar 21, 2026
d904f52
docs: update implementation plan after review feedback
deevus Mar 21, 2026
23da0dc
feat: parse method params, return type, and qualifiers from XML
deevus Mar 21, 2026
49edb8b
feat: parse property type and default value from XML
deevus Mar 21, 2026
158004f
feat: parse constructors and operators from XML
deevus Mar 21, 2026
533abcf
feat: parse constant value and enum attribute from XML
deevus Mar 21, 2026
f9e6846
feat: update EntryKind and Entry for XML doc support
deevus Mar 21, 2026
f64eb05
feat: add loadFromXmlDir to build DocDatabase from XML files
deevus Mar 21, 2026
221b0f4
feat: update markdown generation for inherits, qualifiers, default va…
deevus Mar 21, 2026
6fac96f
refactor: remove all JSON parsing code from DocDatabase
deevus Mar 21, 2026
535e9d3
refactor: remove JSON codepaths, simplify to XML-only architecture
deevus Mar 21, 2026
f15e99c
test: add integration roundtrip test and error-path tests
deevus Mar 21, 2026
15c39a1
docs: update CLAUDE.md to reflect XML-only architecture
deevus Mar 21, 2026
66684ff
chore: remove design docs and implementation plans
deevus Mar 21, 2026
5ce03b4
fix: use makePath for recursive directory creation in cache
deevus Mar 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
**gdoc** is a CLI documentation viewer for Godot API documentation, similar to `zigdoc`. It parses Godot's API documentation and displays it in the terminal with BBCode-to-Markdown conversion.

Key behavior:
- Uses the user's local `godot` executable if available
- Falls back to downloading the latest API JSON from GitHub into cache if Godot is not installed
- Requires `godot` executable to determine version and fetch XML class documentation
- Downloads XML docs from GitHub, parses them, and builds a markdown cache
- Converts BBCode documentation to Markdown using the `bbcodez` library for terminal display

## Build System
Expand Down Expand Up @@ -57,11 +57,14 @@ The build system imports `bbcodez` as a dependency and makes it available to the

### Expected Data Flow
1. Parse CLI arguments for symbol lookup (e.g., `gdoc Node2D.position`)
2. Locate Godot API JSON:
- Check for local `godot` executable → run `godot --dump-extension-api`
- If not found → download from GitHub to cache directory
3. Parse JSON to find requested symbol documentation
4. Convert BBCode documentation to Markdown using `bbcodez`
2. Check if markdown cache is populated (xml_docs/.complete marker + Object/index.md sentinel)
3. If cache is empty:
- Run `godot --version` to determine Godot version
- Download XML class docs tarball from GitHub
- Parse all XML files into DocDatabase via `loadFromXmlDir`
- Convert BBCode descriptions to Markdown
- Generate markdown cache files
4. Read requested symbol's markdown from cache
5. Display formatted output to terminal

### Integration with bbcodez
Expand Down
4 changes: 0 additions & 4 deletions src/Config.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const known_folders = @import("known-folders");

const Config = @This();

no_xml: bool,
cache_dir: []const u8,

pub fn init(allocator: std.mem.Allocator) !Config {
Expand All @@ -18,7 +17,6 @@ pub fn init(allocator: std.mem.Allocator) !Config {
};

return .{
.no_xml = hasEnv("GDOC_NO_XML"),
.cache_dir = cache_dir,
};
}
Expand All @@ -28,7 +26,6 @@ pub fn deinit(self: Config, allocator: std.mem.Allocator) void {
}

pub const testing: Config = .{
.no_xml = true,
.cache_dir = "/tmp/gdoc-test-cache",
};

Expand All @@ -45,6 +42,5 @@ test "init" {
}

test "testing config" {
try std.testing.expect(Config.testing.no_xml);
try std.testing.expectEqualStrings("/tmp/gdoc-test-cache", Config.testing.cache_dir);
}
Loading
Loading