Skip to content

Commit aa0bb49

Browse files
committed
Add yamlstar.org website in www/
1 parent 3cd5e88 commit aa0bb49

16 files changed

Lines changed: 1907 additions & 0 deletions

.version.ys

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ vo =: v-old.str/replace(/\./ '\\.')
2121
- regx:: "()${vp}()"
2222
file:
2323
- Meta
24+
- www/docs/index.md
2425
- fortran/fpm.toml
2526
- csharp/YAMLStar.csproj
2627
- delphi/src/yamlstar.pas

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ cli:
8181
libyamlstar:
8282
$(MAKE) -C libyamlstar build
8383

84+
serve:
85+
$(MAKE) -C www serve
86+
87+
publish:
88+
$(MAKE) -C www publish
89+
8490
clean:: $(ALL-CLEAN)
8591
$(MAKE) -C example $@
8692

doc/RELEASING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,23 @@ The release includes:
9595

9696
After shared libraries are released, publish language bindings locally.
9797

98+
## Step 4: Publish Website
99+
100+
After releasing bindings, deploy the updated website to GitHub Pages.
101+
102+
```bash
103+
# Publish website to yamlstar.org
104+
make publish
105+
```
106+
107+
This will:
108+
- Build the MkDocs site from `www/docs/`
109+
- Deploy to GitHub Pages using `mkdocs gh-deploy`
110+
- Update https://yamlstar.org with the new version
111+
112+
The website version is automatically updated during the version bump step (Step 1),
113+
as `www/docs/index.md` is included in the `.version.ys` file list.
114+
98115
### Setup Secrets File
99116

100117
Create `~/.yamlstar-secrets.yaml`:

util/release

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,12 @@ do-release-delphi() (
434434
../util/release-delphi
435435
)
436436

437+
# Publish website to GitHub Pages
438+
do-publish-www() (
439+
echo 'Publishing website to GitHub Pages...'
440+
make -C www publish
441+
)
442+
437443
#------------------------------------------------------------------------------
438444
# Interactive release workflow functions
439445
#------------------------------------------------------------------------------
@@ -482,6 +488,9 @@ Or run each step individually:
482488
- Release all language bindings to their registries
483489
- (Requires prior GitHub release with shared library assets)
484490
491+
9. make publish
492+
- Deploy website to GitHub Pages (yamlstar.org)
493+
485494
Example manual workflow:
486495
make release-sanity-check o=0.1.0 n=0.1.1
487496
make release-version-bump o=0.1.0 n=0.1.1
@@ -491,6 +500,7 @@ Example manual workflow:
491500
make release-push n=0.1.1
492501
make release-build-github n=0.1.1
493502
make release-bindings
503+
make publish
494504
495505
Note: All steps are idempotent and can be re-run safely.
496506
EOF
@@ -600,6 +610,12 @@ do-release() {
600610
fi
601611
echo
602612

613+
# Step 9: Publish website
614+
if confirm "Step 9: Publish website to GitHub Pages?" Y; then
615+
do-publish-www
616+
fi
617+
echo
618+
603619
echo "============================================================"
604620
echo " Release workflow complete!"
605621
echo "============================================================"

www/.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# MkDocs build outputs
2+
site/
3+
4+
# Cache and temp files
5+
.cache/
6+
7+
# Python virtual environment
8+
venv/
9+
.venv/
10+
11+
# Python bytecode
12+
*.pyc
13+
__pycache__/

www/Makefile

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
M := ../.cache/makes
2+
include $M/init.mk
3+
include $M/clean.mk
4+
PYTHON-VENV := venv
5+
include $M/python.mk
6+
include $M/typos.mk
7+
SHELL-DEPS += $(PYTHON-VENV)
8+
include $M/shell.mk
9+
10+
PYTHON-VENV-SETUP := pip install -r requirements.txt
11+
12+
REPO ?= git@github.com:yaml/yamlstar
13+
14+
WATCHER-PID := .watcher.pid
15+
16+
MAKES-CLEAN := site
17+
MAKES-REALCLEAN := $(PYTHON-VENV)
18+
MAKES-DISTCLEAN := .cache/
19+
20+
DEPS := \
21+
$(PYTHON-VENV) \
22+
23+
24+
default::
25+
# Build main site (production)
26+
site: $(DEPS)
27+
mkdocs build -d $@
28+
cp -r spec type $@/
29+
30+
# Serve locally with MkDocs (starts watcher automatically)
31+
serve: $(DEPS) watch
32+
mkdocs serve --livereload
33+
34+
# Build alias for backwards compatibility
35+
build: site
36+
37+
# Lint check
38+
lint: $(TYPOS)
39+
typos
40+
41+
# Deploy to production
42+
publish: site
43+
cd $< && \
44+
git init && \
45+
git add -A && \
46+
git commit -m 'Deploy to production' && \
47+
git push -f $(REPO) HEAD:gh-pages
48+
$(RM) -r $<
49+
50+
# Generate pages from YAMLScript sources
51+
pages:
52+
ys src/libraries.ys > docs/libraries.md
53+
ys src/tools.ys > docs/tools.md
54+
55+
# Alias for pages (called by watcher)
56+
update: pages
57+
@touch docs/libraries.md docs/tools.md
58+
59+
# Watch src/ files and regenerate on change (runs in background)
60+
watch: $(WATCHER-PID)
61+
62+
$(WATCHER-PID):
63+
watchmedo shell-command \
64+
--patterns='*.ys;*.yaml' \
65+
--recursive \
66+
--command='make update' \
67+
src/ & echo $$! > $@
68+
69+
# Stop the file watcher
70+
watch-stop:
71+
ifneq (,$(wildcard $(WATCHER-PID)))
72+
kill $$(< $(WATCHER-PID)) 2>/dev/null || true
73+
$(RM) $(WATCHER-PID)
74+
endif
75+
76+
clean:: watch-stop
77+
78+
docs/%.md: src/%.ys src/%.yaml
79+
ys $< > $@

www/docs/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
yamlstar.org

www/docs/about.md

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
# About YAMLStar
2+
3+
## Vision
4+
5+
YAMLStar aims to be the best YAML loader available, with these key features:
6+
7+
- **YAML 1.2 Spec Compliance**: 100% compliant with the YAML 1.2 specification
8+
- **Pure Clojure Parser**: No dependencies on SnakeYAML or other external parsers
9+
- **Cross-Language Consistency**: Identical behavior in 15+ languages via shared
10+
library
11+
- **Highly Configurable**: Plugin system for extensibility (coming in Phase 3)
12+
- **Lightweight**: Minimal dependencies, fast startup, small binaries
13+
14+
## What Makes YAMLStar Different
15+
16+
YAMLStar is designed from the ground up to provide a consistent YAML loading
17+
experience across all programming languages.
18+
Unlike traditional YAML libraries that are implemented separately for each
19+
language, YAMLStar uses a single core implementation compiled to a native
20+
shared library.
21+
22+
### Key Advantages
23+
24+
**Consistency Across Languages**
25+
: Every language binding uses the same underlying YAML parser, ensuring
26+
identical behavior everywhere.
27+
No more "it works in Python but not in Go" issues.
28+
29+
**100% Spec Compliance**
30+
: Built on the pure Clojure YAML Reference Parser, YAMLStar implements the full
31+
YAML 1.2 specification without shortcuts or omissions.
32+
33+
**Zero External Dependencies**
34+
: The core library depends only on Clojure itself.
35+
No SnakeYAML, libyaml, or other external YAML parsers.
36+
37+
**Lightweight Design**
38+
: YAMLStar implements only what's needed for YAML loading.
39+
The 4-stage pipeline is ~80% lighter than YAMLScript's 7-stage pipeline.
40+
41+
## Architecture
42+
43+
YAMLStar uses a clean 4-stage pipeline to convert YAML text into native data
44+
structures:
45+
46+
<div class="architecture-diagram">
47+
<pre>
48+
YAML String (input)
49+
50+
┌─────────────────────┐
51+
│ Parser │ yamlstar.parser
52+
│ (Pure Clojure) │ - PEG grammar engine
53+
│ YAML 1.2 spec │ - 211 production rules
54+
└─────────────────────┘ - Event emission
55+
↓ Event Stream
56+
[{:event "mapping_start"}
57+
{:event "scalar" :value "key"}
58+
{:event "scalar" :value "value"}
59+
{:event "mapping_end"}]
60+
61+
┌─────────────────────┐
62+
│ Composer │ yamlstar.composer
63+
│ (Stack-based) │ - Event→Node tree
64+
└─────────────────────┘ - Anchor/tag tracking
65+
↓ Node Tree
66+
{:kind :mapping
67+
:value [[{:kind :scalar :value "key"}
68+
{:kind :scalar :value "value"}]]}
69+
70+
┌─────────────────────┐
71+
│ Resolver │ yamlstar.resolver
72+
│ (Tag resolution) │ - Tag inference (!!str, !!int, etc.)
73+
└─────────────────────┘ - Alias resolution
74+
↓ Resolved Nodes
75+
{:kind :mapping :tag "!!map"
76+
:value [[{:kind :scalar :tag "!!str" :value "key"}
77+
{:kind :scalar :tag "!!str" :value "value"}]]}
78+
79+
┌─────────────────────┐
80+
│ Constructor │ yamlstar.constructor
81+
│ (Data conversion) │ - Node→Data
82+
└─────────────────────┘ - Type coercion
83+
84+
Native Data: {"key" "value"}
85+
</pre>
86+
</div>
87+
88+
### Pipeline Stages
89+
90+
1. **Parser**: Converts YAML text into a stream of events using a PEG
91+
(Parsing Expression Grammar) implementation of the YAML 1.2 spec.
92+
93+
2. **Composer**: Converts the flat event stream into a hierarchical node tree,
94+
tracking anchors and tags along the way.
95+
96+
3. **Resolver**: Infers YAML types for untagged nodes using the YAML 1.2 Core
97+
Schema rules (null, bool, int, float, str).
98+
Also resolves anchor references to their aliased nodes.
99+
100+
4. **Constructor**: Converts resolved nodes into native data structures for the
101+
target language (maps, lists, strings, numbers, etc.).
102+
103+
## Comparison to YAMLScript
104+
105+
YAMLStar is derived from YAMLScript but with a different focus:
106+
107+
| Feature | YAMLScript | YAMLStar |
108+
|---------|-----------|----------|
109+
| **Purpose** | YAML + scripting language | Pure YAML loader |
110+
| **Runtime** | Includes SCI interpreter | No runtime evaluation |
111+
| **Pipeline** | 7 stages (parser → runtime) | 4 stages (parser → data) |
112+
| **Dependencies** | Heavy (Babashka, SCI, etc.) | Minimal (Clojure only) |
113+
| **Extensibility** | Built-in scripting | Plugin system (Phase 3) |
114+
| **Use Case** | Dynamic config, scripting | Static config loading |
115+
116+
YAMLScript is excellent for configurations that need dynamic behavior, template
117+
expansion, or computation.
118+
YAMLStar is ideal when you need a lightweight, reliable YAML loader that
119+
behaves identically across all your applications.
120+
121+
## Technical Details
122+
123+
### YAML 1.2 Core Schema
124+
125+
YAMLStar implements the YAML 1.2 Core Schema for type resolution:
126+
127+
- **null**: `null`, `Null`, `NULL`, `~`
128+
- **bool**: `true`, `True`, `TRUE`, `false`, `False`, `FALSE`
129+
- **int**: `[-+]?[0-9]+` (base 10 only)
130+
- **float**: Decimal floats including `.inf`, `-.inf`, `.nan`
131+
- **str**: Everything else (default type)
132+
133+
Explicit tags like `!!str`, `!!int`, `!!float`, `!!bool`, `!!null` override
134+
type inference.
135+
136+
### Event Processing
137+
138+
The parser emits a finite sequence of events:
139+
140+
- `stream_start` / `stream_end`
141+
- `document_start` / `document_end`
142+
- `mapping_start` / `mapping_end`
143+
- `sequence_start` / `sequence_end`
144+
- `scalar` (with value, style, anchor, tag)
145+
- `alias` (reference to anchored node)
146+
147+
The composer uses a stack-based algorithm to build the node tree from these
148+
events.
149+
150+
### Multi-Document Support
151+
152+
YAMLStar supports YAML streams with multiple documents separated by `---`:
153+
154+
- `load(yaml)` - Returns the first document (or only document)
155+
- `load_all(yaml)` - Returns a list of all documents
156+
157+
## Project Statistics
158+
159+
- **Total Lines of Code**: ~5,700 (including grammar)
160+
- **Core Implementation**: ~500 lines (excluding parser)
161+
- **Grammar Rules**: 211 (YAML 1.2 spec)
162+
- **Test Coverage**: 23+ comprehensive tests
163+
- **Dependencies**: 2 (Clojure + data.json for FFI)
164+
- **Language Bindings**: 9 (Clojure, C#, Fortran, Go, Java, Node.js, Perl,
165+
Python, Rust)
166+
167+
## Credits
168+
169+
**Created by**: Ingy döt Net
170+
171+
- Inventor of YAML
172+
- Creator of YAMLScript
173+
- Maintainer of the YAML Reference Parser
174+
175+
**Built on**:
176+
177+
- **YAML Specification** - Created by Ingy döt Net
178+
- **YAMLScript** - Clojure-based YAML + scripting language
179+
- **yaml-reference-parser** - Pure Clojure YAML 1.2 parser
180+
- **Clojure** - Rich Hickey's elegant functional language
181+
182+
**License**: MIT License - See LICENSE file
183+
184+
## Get Involved
185+
186+
YAMLStar is open source and welcomes contributions:
187+
188+
- **GitHub**: [github.com/yaml/yamlstar](https://github.com/yaml/yamlstar)
189+
- **Issues**: Report bugs or request features
190+
- **Pull Requests**: Contribute code or documentation
191+
- **Discussions**: Share ideas and ask questions
192+
193+
Join us in making YAML great again! 🌟

0 commit comments

Comments
 (0)