DocOps Block Processor Documentation
1. Overview
The DocOpsBlockProcessor is a powerful AsciidoctorJ extension that enables dynamic content generation through server-side processing. It creates interactive SVG visualizations and panels in AsciiDoc documents by connecting to a DocOps server.
2. Core Capabilities
2.1. Dynamic Content Generation
-
Server Integration: Connects to DocOps server (default:
http://localhost:8010/extension
) -
Content Processing: Processes block content through external services
-
Multiple Output Formats: Supports SVG and PDF generation
-
Compression: Automatically compresses payload data using GZIP
3. Basic Usage
The processor uses the docops
block name with a required kind
parameter:
[docops,kind="buttons"]
Your content here
4. Configuration Parameters
4.1. Required Parameters
Parameter | Description |
---|---|
|
Type of visualization to generate (e.g., "buttons", "flowchart", "dashboard") |
4.2. Optional Parameters
Parameter | Type | Default | Description |
---|---|---|---|
|
String |
"SVG Viewer" |
Title for the generated content |
|
Boolean |
false |
Show interactive controls overlay |
|
Boolean |
true |
Allow copying functionality |
|
Boolean |
true |
Enable zoom controls |
|
Boolean |
true |
Enable fullscreen mode |
|
String |
"light" |
Theme for controls (light/dark) |
|
String |
"center" |
Alignment (left/center/right) |
|
Boolean |
false |
Use dark theme for content |
|
String |
"1.0" |
Scaling factor for output |
5. Interactive Controls
When controls=true
is enabled, the processor generates an interactive SVG viewer:
5.1. Zoom Controls
-
Zoom In (🔍+): Magnify content up to 5x
-
Zoom Out (🔍-): Reduce content down to 0.2x
-
Reset Zoom (⚪): Return to original size
6. Text Substitution
The processor supports dynamic text replacement using the pattern #[variable]
:
:company-name: ACME Corp
[docops,kind="buttons"]
Welcome to #[company-name]
7. Environment Detection
8. Server Configuration
10. Error Handling
The processor includes comprehensive error handling:
-
Missing Parameters: Clear error messages for required parameters
-
Server Unavailable: Graceful fallback with user notification ("DocOps Server Unavailable! 😵")
-
Network Timeouts: Configurable timeout handling
-
Compression Errors: Safe error recovery with logging
11. Performance Features
12. Example Usage Scenarios
13. Integration Requirements
14. API Integration
14.1. Server Endpoints
-
GET /api/ping
: Health check endpoint -
GET /api/docops/svg
: SVG generation endpoint with parameters: -
kind
: Visualization type -
payload
: Compressed content -
type
: Output format (SVG/PDF) -
useDark
: Dark theme flag -
title
: Content title -
backend
: Document backend -
filename
: Output filename -
scale
: Scaling factor (for PDF output)
15. Troubleshooting
15.1. Common Issues
Issue | Cause | Solution |
---|---|---|
"Parameter Error: Missing 'kind'" |
Required |
Add |
"DocOps Server Unavailable! 😵" |
Server not running or unreachable |
Start DocOps server and verify network connectivity |
Empty output |
Invalid content or server error |
Check server logs and enable |
Controls not showing |
|
Set |
16. Best Practices
16.1. Performance
-
Use appropriate
scale
values to balance quality and file size -
Enable server-side caching for repeated content
-
Consider PDF-specific optimizations for print output
16.2. Accessibility
-
Provide meaningful
title
attributes -
Use sufficient color contrast in custom themes
-
Ensure keyboard navigation works with interactive controls
16.3. Security
-
Validate server URLs in production environments
-
Use HTTPS for server communication when possible
-
Sanitize user input in content blocks
This comprehensive documentation covers all aspects of the DocOpsBlockProcessor capabilities, from basic usage to advanced configuration and troubleshooting.