cli/docs/framework/help.md
Snider a57fb4273d docs: restructure for VitePress with flat layout and examples
- Remove mkdocs files (requirements.txt, CNAME)
- Add CLI documentation: build.md, release.md, php.md, run.md
- Add configuration.md with full reference
- Add examples/ directory with sample configurations:
  - go-cli-release.yaml
  - wails-desktop-release.yaml
  - php-laravel-release.yaml
  - linuxkit-server.yml
  - linuxkit-docker-format.yml
  - full-release.yaml
  - minimal-release.yaml
  - official-repos.yaml
- Flatten existing framework docs into framework/
- Update index.md as CLI entry point

Ready for VitePress integration with core-php/docs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 00:38:49 +00:00

2.8 KiB

Help Service

The Help service (pkg/help) provides an embeddable documentation system that displays MkDocs-based help content in a dedicated window.

Features

  • Embedded help content (MkDocs static site)
  • Context-sensitive help navigation
  • Works with or without Display service
  • Multiple content sources (embedded, filesystem, custom)

Basic Usage

import "github.com/Snider/Core/pkg/help"

// Create with default embedded content
helpService, err := help.New(help.Options{})

// Initialize with core dependencies
helpService.Init(coreInstance, displayService)

Showing Help

// Show main help window
err := helpService.Show()

// Show specific section
err := helpService.ShowAt("getting-started")
err := helpService.ShowAt("api/config")

Options

type Options struct {
    Source string  // Path to help content directory
    Assets fs.FS   // Custom filesystem for assets
}

Default Embedded Content

// Uses embedded MkDocs site
helpService, _ := help.New(help.Options{})

Custom Directory

// Use local directory
helpService, _ := help.New(help.Options{
    Source: "/path/to/docs/site",
})

Custom Filesystem

//go:embed docs/*
var docsFS embed.FS

helpService, _ := help.New(help.Options{
    Assets: docsFS,
})

Integration with Core

The help service can work standalone or integrated with Core:

With Display Service

When Display service is available, help opens through the IPC action system:

// Automatically uses display.open_window action
helpService.Init(core, displayService)
helpService.Show()

Without Display Service

Falls back to direct Wails window creation:

// Creates window directly via Wails
helpService.Init(core, nil)
helpService.Show()

Lifecycle

// Called on application startup
err := helpService.ServiceStartup(ctx)

Building Help Content

Help content is a static MkDocs site. To update:

  1. Edit documentation in docs/ directory
  2. Build with MkDocs:
    mkdocs build
    
  3. The built site goes to pkg/help/public/
  4. Content is embedded at compile time

Frontend Usage (TypeScript)

import { Show, ShowAt } from '@bindings/help/service';

// Open help window
await Show();

// Open specific section
await ShowAt("configuration");
await ShowAt("api/display");

Help Window Options

The help window opens with default settings:

Property Value
Title "Help"
Width 800px
Height 600px

IPC Action

When using Display service, help triggers this action:

{
    "action": "display.open_window",
    "name":   "help",
    "options": {
        "Title":  "Help",
        "Width":  800,
        "Height": 600,
        "URL":    "/#anchor",  // When using ShowAt
    },
}