Simplified data structure around template files
This commit is contained in:
47
CLAUDE.md
47
CLAUDE.md
@ -8,56 +8,55 @@ This is a prototype website, built in Hugo, to enable communities to develop cus
|
||||
- **Main Builder Interface**: `/themes/dispute-protocol-theme/layouts/_default/builder.html`
|
||||
- **JavaScript Files**:
|
||||
- `/static/js/builder.js`: Main application logic
|
||||
- `/static/js/data/modules.js`: Predefined module options
|
||||
- `/static/js/data/templates.js`: Complete protocol templates
|
||||
- `/static/js/data/template-mapper.js`: Maps raw content to module references
|
||||
- `/static/js/templates/*.js`: Individual protocol template definitions
|
||||
- `/static/js/templates/index.js`: Central registry of all templates
|
||||
|
||||
## Content Organization
|
||||
|
||||
- **Components**: Building blocks of a protocol, defined in `/data/components/*.yaml`
|
||||
- **Modules**: Reusable text blocks for specific fields, defined in `modules.js`
|
||||
- **Templates**: Complete predefined protocols combining multiple modules
|
||||
- **Templates**: Complete predefined protocols with content for all fields, defined in `/static/js/templates/*.js`
|
||||
|
||||
## Data Model
|
||||
|
||||
The application maintains a hierarchical data model:
|
||||
- **Stages** → **Components** → **Fields**
|
||||
- Each field can be populated with content from a **Module**
|
||||
- Each field is populated with content directly from templates
|
||||
|
||||
## Core Features
|
||||
|
||||
1. **Black & white UI**: Clean, accessible interface with vertical accordion sections
|
||||
2. **Template selection**: Users can start with a predefined protocol template
|
||||
3. **Module selection**: Users can choose from multiple pre-written modules for each field
|
||||
4. **Customization**: Direct text editing in fields
|
||||
5. **Export options**: Markdown, PDF, and JSON formats
|
||||
6. **Import capability**: Load previously saved protocols
|
||||
3. **Customization**: Direct text editing in fields
|
||||
4. **Export options**: Markdown, PDF, and JSON formats
|
||||
5. **Import capability**: Load previously saved protocols
|
||||
6. **Preview mode**: Toggle to see how the final protocol will appear
|
||||
|
||||
## Module System
|
||||
## Template System
|
||||
|
||||
Modules are the heart of the customization system:
|
||||
- Each module has: `id`, `title`, `componentId`, `fieldId`, and `content`
|
||||
- Modules are categorized by type (principles, participants, filing, etc.)
|
||||
- Custom modules are generated from templates via `template-mapper.js`
|
||||
- Module selector dropdowns display available options for each field
|
||||
Templates provide complete content for dispute resolution protocols:
|
||||
- Each template has: `id`, `title`, `description`, and content data
|
||||
- Templates define content for all stages and components
|
||||
- Templates are loaded dynamically using ES Modules
|
||||
- The template selector provides one-click application of complete protocols
|
||||
|
||||
## Recent Improvements
|
||||
|
||||
1. **Template mapping**: Fixed custom module generation to create descriptive titles
|
||||
2. **Module presentation**: Removed category labels from dropdowns
|
||||
3. **Module coverage**: Added comprehensive modules for all components
|
||||
4. **Name formatting**: Enhanced logic to extract meaningful titles from content
|
||||
1. **Simplified template system**: Consolidated template loading to a single source of truth
|
||||
2. **ES Module architecture**: Implemented modern JavaScript module pattern
|
||||
3. **Enhanced debugging**: Added detailed logging for template application
|
||||
4. **Component titles**: Simplified all component titles to be more direct and consistent
|
||||
5. **Preview mode**: Improved rendering of protocol content with Markdown support
|
||||
|
||||
## Deployment
|
||||
|
||||
- Deployable from a self-hosted GitLab server
|
||||
- Data is maintained in YAML files for components and stages
|
||||
- Module content is defined in JavaScript for easy client-side use
|
||||
- Template content is defined in JavaScript files for easy client-side use
|
||||
|
||||
## Key Files to Modify
|
||||
|
||||
- `/static/js/data/modules.js`: Add, edit or remove module options
|
||||
- `/static/js/data/template-mapper.js`: Adjust how custom modules are generated
|
||||
- `/static/js/data/templates.js`: Define new protocol templates
|
||||
- `/static/js/templates/*.js`: Add, edit or remove protocol templates
|
||||
- `/static/js/templates/index.js`: Register new templates in the central registry
|
||||
- `/static/js/builder.js`: Modify core interface functionality
|
||||
- `/static/css/main.css`: Adjust styling and responsive behavior
|
||||
- `/data/components/*.yaml`: Edit component titles and structure
|
||||
|
Reference in New Issue
Block a user