Skip to content

Commit 3ad1f40

Browse files
committed
testing with doc
1 parent 5973b98 commit 3ad1f40

16 files changed

Lines changed: 2270 additions & 11 deletions

_config.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
title: HDS JavaScript Library
2+
description: Generic toolkit for server and web applications — Health Data Safe
3+
baseurl: /hds-lib-js
4+
remote_theme: pages-themes/cayman@v0.2.0
5+
plugins:
6+
- jekyll-remote-theme
7+
8+
# Markdown rendering
9+
markdown: kramdown
10+
kramdown:
11+
input: GFM
12+
syntax_highlighter: rouge
13+
14+
# Navigation order (used by layouts/templates)
15+
nav:
16+
- title: Home
17+
url: /docs/
18+
- title: Getting Started
19+
url: /docs/getting-started
20+
- title: Settings
21+
url: /docs/settings
22+
- title: HDS Model
23+
url: /docs/hds-model
24+
- title: App Templates
25+
url: /docs/app-templates
26+
- title: Localization
27+
url: /docs/localization
28+
- title: Toolkit
29+
url: /docs/toolkit
30+
- title: Utilities
31+
url: /docs/utilities
32+
33+
# Keep Jekyll from processing build artifacts
34+
exclude:
35+
- hds-lib.js
36+
- hds-lib.js.map
37+
- hds-lib.js.LICENSE.txt
38+
- tests-browser.js
39+
- tests-browser.js.map
40+
- version.json
41+
- docs/MAINTAIN-DOC.md
42+
- Gemfile
43+
- Gemfile.lock

docs/MAINTAIN-DOC.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Documentation Maintenance Guide
2+
3+
This file describes when and how to update the hds-lib-js documentation in `docs/`.
4+
5+
## Structure
6+
7+
```
8+
docs/
9+
├── _config.yml # Jekyll configuration for gh-pages
10+
├── index.md # Library overview, architecture diagram, export list
11+
├── getting-started.md # Installation, setup, browser/Node usage
12+
├── settings.md # Settings module reference
13+
├── hds-model.md # HDSModel, items, streams, authorizations, event types, datasources
14+
├── app-templates.md # Detailed App Templates guide (Manager, Collector, Invite, Client)
15+
├── localization.md # Localization utilities
16+
├── toolkit.md # StreamsAutoCreate, StreamTools
17+
├── utilities.md # Duration, reminders, errors, logger
18+
├── assets/ # Images, SVG diagrams (if extracted from inline)
19+
└── MAINTAIN-DOC.md # This file (excluded from Jekyll build)
20+
```
21+
22+
## When to update
23+
24+
### Always update docs when:
25+
26+
1. **Adding a new public method/property** to any exported class
27+
- Add it to the relevant section with signature, description, and example
28+
- If it's in appTemplates, update `app-templates.md`
29+
30+
2. **Changing method signatures** (parameters, return types)
31+
- Update the method documentation and any affected code examples
32+
33+
3. **Adding a new module or class**
34+
- Create a new page if warranted, or add a section to the most relevant existing page
35+
- Update `index.md` exports table and architecture diagram
36+
- Add to `_config.yml` nav if it's a new page
37+
38+
4. **Changing the appTemplates flow** (new statuses, new event types, new stream suffixes)
39+
- Update the sequence diagram, state diagrams, and SVG stream structure in `app-templates.md`
40+
41+
5. **Changing CollectorRequest structure** (new properties, new section types)
42+
- Update the data structure diagram and property tables in `app-templates.md`
43+
44+
6. **Adding or changing event types**
45+
- Update the event types table in `app-templates.md` and/or `hds-model.md`
46+
47+
7. **Changing the data model integration** (new HDSModel sub-modules, new item properties)
48+
- Update `hds-model.md`
49+
50+
### No doc update needed for:
51+
52+
- Internal refactoring that doesn't change the public API
53+
- Bug fixes that don't change behavior
54+
- Test changes
55+
- Build/CI changes
56+
57+
## How to update
58+
59+
### Markdown conventions
60+
61+
- Use Jekyll front matter (`---\nlayout: default\ntitle: ...\n---`) on every page
62+
- Use GitHub-Flavored Markdown (GFM)
63+
- Use fenced code blocks with language tags (`javascript`, `typescript`, `bash`)
64+
- Use Mermaid for flow/sequence/state diagrams (```mermaid blocks)
65+
66+
### Diagrams
67+
68+
- **ASCII trees** — Preferred for hierarchical/nested structures (stream structures, data models). They render everywhere, stay narrow, and are easy to edit.
69+
- **Mermaid** — Use for flowcharts, sequence diagrams, state machines. Rendered by GitHub and most Jekyll themes with mermaid support.
70+
- **Avoid inline SVG** — SVG does not render in most Markdown viewers (GitHub, Jekyll). Use ASCII or Mermaid instead.
71+
- Keep diagram source editable (no rasterized images for diagrams).
72+
- **Split complex diagrams** — When an architecture or overview diagram has multiple concerns (e.g., library modules + class relationships), split into separate graphs stacked vertically rather than one dense graph. This improves readability on all screen sizes.
73+
74+
### Code examples
75+
76+
- Every public method should have at least one usage example
77+
- Examples should be copy-pasteable and realistic
78+
- Use `const` and `await` consistently
79+
- Show typical output in comments where helpful
80+
81+
### Adding a new page
82+
83+
1. Create `docs/new-page.md` with Jekyll front matter
84+
2. Add entry to `nav:` in `docs/_config.yml`
85+
3. Add link to the table in `docs/index.md`
86+
87+
## Publishing (gh-pages)
88+
89+
The docs are designed for GitHub Pages with Jekyll. To publish:
90+
91+
1. Enable GitHub Pages on the repo (Settings > Pages > Source: branch `main`, folder `/docs`)
92+
2. Jekyll will build automatically using the `_config.yml` configuration
93+
3. The Cayman theme is used via `remote_theme`
94+
95+
For local preview:
96+
97+
```bash
98+
cd docs
99+
gem install bundler jekyll
100+
bundle init
101+
# Add to Gemfile: gem "github-pages", group: :jekyll_plugins
102+
bundle install
103+
bundle exec jekyll serve
104+
```
105+
106+
## Versioning
107+
108+
When the library version changes significantly, consider noting breaking changes at the top of affected pages. The docs track the current `main` branch — there is no versioned documentation (yet).
109+
110+
## Checklist for doc PRs
111+
112+
- [ ] Updated all affected pages
113+
- [ ] Code examples are correct and tested
114+
- [ ] Mermaid diagrams render (check on GitHub preview)
115+
- [ ] SVG diagrams are well-formed
116+
- [ ] `_config.yml` nav is up to date
117+
- [ ] `index.md` exports table is up to date
118+
- [ ] No broken internal links

docs/_config.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
title: HDS JavaScript Library
2+
description: Generic toolkit for server and web applications — Health Data Safe
3+
remote_theme: pages-themes/cayman@v0.2.0
4+
plugins:
5+
- jekyll-remote-theme
6+
7+
# Markdown rendering
8+
markdown: kramdown
9+
kramdown:
10+
input: GFM
11+
syntax_highlighter: rouge
12+
13+
# Navigation order (used by layouts/templates)
14+
nav:
15+
- title: Home
16+
url: /
17+
- title: Getting Started
18+
url: /getting-started
19+
- title: Settings
20+
url: /settings
21+
- title: HDS Model
22+
url: /hds-model
23+
- title: App Templates
24+
url: /app-templates
25+
- title: Localization
26+
url: /localization
27+
- title: Toolkit
28+
url: /toolkit
29+
- title: Utilities
30+
url: /utilities
31+
32+
exclude:
33+
- MAINTAIN-DOC.md
34+
- Gemfile
35+
- Gemfile.lock

0 commit comments

Comments
 (0)