docs: Update likec4-view shortcode documentation with title parameter

- Add title parameter documentation to all relevant README files
- Update DOCUMENTOR-GUIDE.md with title parameter example
- Enhance quick-reference.md with complete parameter list
- Update INTEGRATION.md with recommended shortcode usage
- Simplify highlevelarch.md by using shortcode with title parameter
This commit is contained in:
Stephan Lo 2025-11-07 13:58:04 +01:00
parent dc2bb1d60d
commit 97cd265063
5 changed files with 38 additions and 48 deletions

View file

@ -153,4 +153,7 @@ In resources/doc-likec4/views.c4:
Embed in Markdown:
{{< likec4-view view="overview" project="documentation-platform" >}}
With custom title:
{{< likec4-view view="overview" project="documentation-platform" title="Platform Overview" >}}
```

View file

@ -10,53 +10,7 @@ This document describes the high-level architecture of our Enterprise Developmen
## Interactive Architecture Diagram
<div class="likec4-container">
<div class="likec4-header">
Enterprise Development Platform - OTC FaaS Deployment Architecture
</div>
<likec4-view view-id="otc-faas" browser="true"></likec4-view>
<div class="likec4-loading" id="likec4-loading">
Loading architecture diagram...
</div>
</div>
<script>
// Enhanced loading check with fallback
document.addEventListener('DOMContentLoaded', function() {
let attempts = 0;
const maxAttempts = 10;
function checkLikeC4Loading() {
attempts++;
const component = document.querySelector('likec4-view');
const loading = document.getElementById('likec4-loading');
if (component && component.shadowRoot && component.shadowRoot.children.length > 0) {
if (loading) loading.style.display = 'none';
console.log('LikeC4 component loaded successfully');
} else if (attempts >= maxAttempts) {
console.warn('LikeC4 component failed to load');
if (loading) {
loading.innerHTML = 'Interactive diagram failed to load. <br><small>Please ensure JavaScript is enabled and the webcomponent is generated.</small>';
loading.style.color = '#dc3545';
}
} else {
setTimeout(checkLikeC4Loading, 1000);
}
}
// Check if LikeC4 loader is available
if (typeof window.customElements !== 'undefined') {
setTimeout(checkLikeC4Loading, 1500);
} else {
const loading = document.getElementById('likec4-loading');
if (loading) {
loading.innerHTML = 'Interactive diagrams require a modern browser with JavaScript enabled.';
loading.style.color = '#dc3545';
}
}
});
</script>
{{< likec4-view view="otc-faas" project="architecture" title="Enterprise Development Platform - OTC FaaS Deployment Architecture" >}}
{{< alert title="Interactive Diagram" >}}
The diagram above is interactive when viewed in a compatible browser.

View file

@ -134,12 +134,19 @@ description: >
{{< likec4-view view="view-name" project="project-name" >}}
```
### Parameters
- `view` (required) - The view ID from your LikeC4 model
- `project` (optional, default: "architecture") - The LikeC4 project name
- `title` (optional, default: "Architecture View: {view}") - Custom header text above the diagram
### Examples
```markdown
{{< likec4-view view="overview" project="documentation-platform" >}}
{{< likec4-view view="localDevelopment" project="documentation-platform" >}}
{{< likec4-view view="cicdPipeline" project="documentation-platform" >}}
{{< likec4-view view="otc-faas" project="architecture" title="OTC FaaS Deployment" >}}
```
## LikeC4 Commands

View file

@ -66,6 +66,17 @@ In your Markdown files:
{{< likec4-view view="overview" project="documentation-platform" >}}
```
Optional parameters:
- `view` (required) - The view ID from your LikeC4 model
- `project` (optional, default: "architecture") - The LikeC4 project name
- `title` (optional, default: "Architecture View: {view}") - Custom header text
Example with custom title:
```markdown
{{< likec4-view view="overview" project="documentation-platform" title="Complete Documentation Platform" >}}
```
## Configuration
- `likec4.config.json` - Project configuration

View file

@ -46,11 +46,26 @@ This creates `static/js/likec4-webcomponent.js` which contains all your architec
## Using in Hugo Content
Add interactive diagrams to any Markdown page:
### Using the Shortcode (Recommended)
The simplest way to embed diagrams:
```markdown
## Architecture Overview
{{< likec4-view view="otc-faas" project="architecture" title="OTC FaaS Deployment Architecture" >}}
```
**Parameters:**
- `view` (required) - The view ID from your LikeC4 model
- `project` (optional, default: "architecture") - The LikeC4 project name
- `title` (optional, default: "Architecture View: {view}") - Custom header text
### Manual HTML (Alternative)
If you need more control:
```markdown
<div class="likec4-container">
<div class="likec4-header">
System Architecture - High Level View