Skip to content

Commit 2542163

Browse files
committed
Update architectural decisions doc with community import info
Signed-off-by: Scott Rigby <[email protected]>
1 parent 8154c6c commit 2542163

File tree

1 file changed

+27
-39
lines changed

1 file changed

+27
-39
lines changed

ARCHITECTURAL_DECISIONS.md

Lines changed: 27 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -340,61 +340,49 @@ Remove them only after:
340340

341341
### Helm-Specific Requirement
342342

343-
The Helm project maintains community governance documents in a [separate repository](https://github.com/helm/community) that need to be included in the website as an unversioned documentation section.
343+
The Helm project maintains community governance documents in a [separate repository](https://github.com/helm/community) that need to be included in the website as an unversioned documentation section with proper Docusaurus integration.
344344

345345
### Solution
346346

347347
Uses [docusaurus-plugin-remote-content](https://github.com/rdilweb/docusaurus-plugin-remote-content) to import and transform content at build time.
348348

349349
**Architecture:**
350-
- **Multi-instance docs:** Community docs are a separate Docusaurus docs plugin instance with `id: "community"`
351-
- **Content transformation:** Custom functions in `src/utils/communityDocsTransforms.js` handle frontmatter injection and link rewriting
352-
- **Configuration:** Centralized in `docusaurus.config.js` under `customFields.communityDocs` for maintainability
353-
354-
### Key Design Decisions
355-
356-
**Why remote content instead of git submodule:**
357-
- Allows selective import of specific files
358-
- Enables content transformation during import (frontmatter, link fixing)
359-
- Simpler for contributors who don't need to understand submodule workflows
360-
361-
**Why transformation functions are needed:**
362-
- **Frontmatter injection:** Community repo files lack Docusaurus-required metadata (sidebar position, labels)
363-
- **H1 stripping:** When adding `title` frontmatter, the markdown H1 would override it. Stripping H1 allows the frontmatter title to control the page title
364-
- **Link rewriting:** Relative markdown links from source repo must map to website URL structure
365-
366-
### Configuration Structure
367-
368-
```javascript
369-
customFields: {
370-
communityDocs: {
371-
remoteDocs: [/* file list with optional metadata */],
372-
linkExceptions: {/* manual link overrides */}
373-
}
374-
}
375-
```
350+
- **Multi-instance docs:** Community docs are a separate Docusaurus docs plugin instance with `id: "community"`, creating `/community/*` URLs
351+
- **Content transformation:** Custom functions in `src/utils/communityDocsTransforms.js` handle all content processing
352+
- **Configuration:** Centralized in `docusaurus.config.js` under `customFields.communityDocs`
376353

377-
The configuration is defined as a `customFields` constant before the main config object, allowing derived values to be calculated upfront. Helper functions in `src/utils/communityDocsConfig.js` derive paths and create the edit URL function. The plugins can then be defined inside the config object using these pre-calculated values, resulting in a cleaner structure.
354+
### Content Transformation Features
378355

379-
### Commands
356+
**Import notice headers:** Every imported file gets a warning header indicating it shouldn't be edited directly, with a link to the source file in the helm/community repository.
357+
358+
**HIP (Helm Improvement Proposal) formatting:** HIP documents get special treatment:
359+
- Metadata fields (hip, authors, created, status, etc.) displayed as a markdown table
360+
- Sidebar labels include HIP number for easy navigation (e.g., "0023: Utilize Server Side Apply")
361+
- Frontmatter cleaned to remove duplicate metadata
380362

381-
- `yarn download-remote-community` - Fetch and transform latest content
382-
- `yarn clear-remote-community` - Remove imported files (useful before re-import)
363+
**Plain text file handling:** `.txt` files (like meeting notes) are automatically:
364+
- Converted to `.md` files during import
365+
- Title extracted from content headers
366+
- Content wrapped in code blocks to preserve formatting
383367

384-
### Edit URL Handling
368+
**Link transformations:** Only applied for configured exceptions - most links work as-is since the file structure mirrors the source repository.
385369

386-
The plugin configuration includes custom `editUrl` logic that:
387-
1. Points imported files back to the helm/community repository
388-
2. Points locally-created files to helm-www repository
389-
3. Preserves correct paths for both scenarios
370+
### Commands
371+
372+
- `yarn download-remote-community` - Fetch and transform latest content via GitHub API
373+
- `yarn clear-remote-community` - Remove imported files before re-import
390374

391375
### For Contributors
392376

393377
To add new community documents:
394378
1. Add entry to `customFields.communityDocs.remoteDocs` in `docusaurus.config.js`
395-
2. Include any necessary frontmatter in the `meta` field
396-
3. Add link exceptions if the document has special link requirements
397-
4. Run `yarn download-remote-community` to import
379+
2. Include optional `meta` field for frontmatter overrides
380+
3. Add link exceptions only if specific links need custom mapping
381+
4. Run `yarn download-remote-community` to test import locally
382+
383+
To modify transformation logic:
384+
1. Edit `src/utils/communityDocsTransforms.js` for content processing
385+
2. Test changes with `yarn download-remote-community`
398386

399387
## Netlify Build Caching
400388

0 commit comments

Comments
 (0)