Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 5 additions & 38 deletions .github/MAINTAINER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,7 @@ This will generate two keys and provide instructions.
4. Value: Paste the **private key** from the output above
5. Click "Add secret"

## Step 3: Set Up Code Coverage (Optional)

### Get Codecov Token

1. Go to https://codecov.io
2. Sign in with GitHub
3. Add your repository
4. Copy the upload token

### Add Codecov Secret

1. Go to: https://github.com/toon-format/ToonFormat.jl/settings/secrets/actions
2. Click "New repository secret"
3. Name: `CODECOV_TOKEN`
4. Value: Paste your Codecov token
5. Click "Add secret"

## Step 4: Enable GitHub Pages
## Step 3: Enable GitHub Pages

1. Go to: https://github.com/toon-format/ToonFormat.jl/settings/pages
2. Source: Deploy from a branch
Expand All @@ -67,7 +50,7 @@ This will generate two keys and provide instructions.

**Note:** The `gh-pages` branch will be created automatically on the first documentation deployment.

## Step 5: Configure Branch Protection (Recommended)
## Step 4: Configure Branch Protection (Recommended)

1. Go to: https://github.com/toon-format/ToonFormat.jl/settings/branches
2. Click "Add rule"
Expand All @@ -78,7 +61,7 @@ This will generate two keys and provide instructions.
- ✅ Require branches to be up to date before merging
5. Click "Create"

## Step 6: Test the Setup
## Step 5: Test the Setup

### Trigger CI

Expand Down Expand Up @@ -126,18 +109,6 @@ git push origin gh-pages
git checkout main
```

### Coverage Not Uploading

**Check:**
- CODECOV_TOKEN is set in secrets
- Codecov repository is activated
- Tests are generating coverage data

**Test locally:**
```bash
julia --project=. --code-coverage=user -e 'using Pkg; Pkg.test()'
```

### Aqua Tests Failing

**Common issues:**
Expand All @@ -157,9 +128,8 @@ julia --project=. -e 'using Pkg; Pkg.test()'
Once everything is set up:

1. **Add badges to README** (already done)
2. **Set up CompatHelper** (runs automatically daily)
3. **Register package** in Julia General registry
4. **Enable TagBot** (creates releases automatically)
2. **Register package** in Julia General registry
3. **Enable TagBot** (creates releases automatically)

## Maintenance

Expand All @@ -168,18 +138,15 @@ Once everything is set up:
Workflows are in `.github/workflows/`:
- `CI.yml` - Main test suite
- `Documentation.yml` - Docs building
- `CompatHelper.yml` - Dependency updates
- `TagBot.yml` - Release automation

### Monitor Actions

Check regularly:
- https://github.com/toon-format/ToonFormat.jl/actions
- Review failed workflows
- Update dependencies via CompatHelper PRs

## Resources

- [Documenter.jl Guide](https://documenter.juliadocs.org/stable/)
- [GitHub Actions for Julia](https://github.com/julia-actions)
- [Codecov Documentation](https://docs.codecov.com/)
8 changes: 0 additions & 8 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,3 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1

- uses: julia-actions/julia-runtest@v1

- uses: julia-actions/julia-processcoverage@v1

- uses: codecov/codecov-action@v7
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
34 changes: 0 additions & 34 deletions .github/workflows/CompatHelper.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
# Julia
*.jl.cov
*.jl.*.cov
*.jl.mem
deps/deps.jl
Manifest.toml

# Documentation build
docs/build/
docs/site/

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db

# AI files
.claude
.specify
specs/
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Removed

- Stopped exporting the internal helpers `escape_string`, `unescape_string`, `find_first_unquoted`, `is_safe_identifier`, `needs_quoting`, `to_parsed_lines`, `parse_array_header`, `parse_delimited_values` and `parse_key` – call them qualified as `ToonFormat.<name>`

## [0.1.1] - 2025-12-26

### Changed
Expand Down
15 changes: 2 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

## Development Setup

`Project.toml` declares Julia 1.6 or newer; CI tests 1.10, 1.12, and the latest release.

```bash
git clone https://github.com/toon-format/ToonFormat.jl.git
cd ToonFormat.jl
julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.test()'
```

The test suite downloads the spec's conformance fixtures as a lazy artifact pinned in `test/Artifacts.toml`. Set `TEST_GROUP=aqua` to run only the [Aqua.jl](https://github.com/JuliaTesting/Aqua.jl) checks.
The test suite downloads the spec's conformance fixtures as a lazy artifact pinned in `test/Artifacts.toml`.

Build the documentation site into `docs/build/`:

Expand All @@ -19,19 +17,10 @@ julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.in
julia --project=docs docs/make.jl
```

## Coding Standards

- Public functions carry docstrings – `docs/src/api.md` renders them.
- Pull requests pass the Aqua.jl checks configured in `test/test_aqua.jl`.

## Pull Requests

Add tests for every behavior change and use [Conventional Commits](https://www.conventionalcommits.org/) for commit messages. Changes to the format itself belong in [toon-format/spec](https://github.com/toon-format/spec). Maintainers find CI, documentation deployment, and release setup in [`.github/MAINTAINER_GUIDE.md`](.github/MAINTAINER_GUIDE.md).
Spec behavior is tested through the spec fixtures – a missing case goes to toon-format/spec as a fixture. Julia-specific behavior, such as host type normalization, gets a test under `test/`. Use [Conventional Commits](https://www.conventionalcommits.org/) for commit messages. Changes to the format itself belong in [toon-format/spec](https://github.com/toon-format/spec). Maintainers find CI, documentation deployment, and release setup in [`.github/MAINTAINER_GUIDE.md`](.github/MAINTAINER_GUIDE.md).

## Maintainers

- Sébastien Celles – [@s-celles](https://github.com/s-celles)

## License

By contributing, you agree that your contributions are licensed under the MIT License.
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
[compat]
Aqua = "0.8"
JSON = "1"
JSONSchema = "1"
LazyArtifacts = "1"
OrderedCollections = "1"
Printf = "1"
Expand All @@ -20,9 +19,8 @@ julia = "1.10"
[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
JSONSchema = "7d188eb4-7ad8-530c-ae41-71a32a6d4692"
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Aqua", "JSON", "JSONSchema", "LazyArtifacts", "Test"]
test = ["Aqua", "JSON", "LazyArtifacts", "Test"]
49 changes: 1 addition & 48 deletions src/ToonFormat.jl
Original file line number Diff line number Diff line change
@@ -1,49 +1,10 @@
# Copyright (c) 2025 TOON Format Organization
# SPDX-License-Identifier: MIT

"""
ToonFormat - Token-Oriented Object Notation (TOON)

A compact, human-readable serialization format optimized for LLM contexts.
Achieves 30-60% token reduction vs JSON while maintaining readability and structure.

This package provides encoding and decoding functionality with 100% compatibility
with the official TOON specification (v2.0).

# Examples

```julia
using ToonFormat

# Encoding
data = Dict("name" => "Alice", "age" => 30)
toon_str = ToonFormat.encode(data)
println(toon_str)
# name: Alice
# age: 30

# Decoding
decoded = ToonFormat.decode(toon_str)
# Dict("name" => "Alice", "age" => 30)

# With options
options = ToonFormat.EncodeOptions(indent=4, delimiter=ToonFormat.TAB)
toon_str = ToonFormat.encode(data, options=options)
```

# Main Functions
- `encode(value; options)`: Encode a Julia value to TOON format
- `decode(input; options)`: Decode a TOON string to a Julia value

# Types
- `EncodeOptions`: Configuration for encoding (indent, delimiter, keyFolding, flattenDepth)
- `DecodeOptions`: Configuration for decoding (indent, strict, expandPaths)
Encodes Julia values to TOON (Token-Oriented Object Notation) and decodes TOON back.
"""
module ToonFormat

using Printf

# Include all source files
include("constants.jl")
include("types.jl")
include("string_utils.jl")
Expand All @@ -53,18 +14,10 @@ include("scanner.jl")
include("encoder.jl")
include("decoder.jl")

# Export main functions
export encode, decode

# Export types
export EncodeOptions, DecodeOptions

# Export commonly used constants
export COMMA, TAB, PIPE

# Export utility functions for testing
export escape_string,
unescape_string, find_first_unquoted, is_safe_identifier, needs_quoting
export to_parsed_lines, parse_array_header, parse_delimited_values, parse_key

end # module
7 changes: 0 additions & 7 deletions src/constants.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# Copyright (c) 2025 TOON Format Organization
# SPDX-License-Identifier: MIT

"""
Constants used throughout the TOON format implementation.
"""

# Delimiters
const COMMA = ","
const TAB = "\t"
Expand Down
Loading
Loading