Skip to content

Commit

Permalink
Some minor tweaks and prepped for 0.7.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Perlkonig committed Dec 19, 2021
1 parent 8ea7916 commit 654fc61
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 9 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.7.0] - 2021-12-19

### Breaking Change

- Yet another breaking change. Found an issue where nested glyphs (symbols within symbols) couldn't be reused because of how the IDs got duplicated. So I completely refactored the glyph loading code. This has vastly simplified the `<defs>` section. It now only contains the glyphs defined in the legend. It means that glyphs in the sheets may *not* have hard-coded IDs. Let the renderer auto-assign them. More documentation on this is forthcoming.

### Added

- Documented the API. This involved adding full [TSDoc](https://tsdoc.org/) comments and using [TypeDoc](http://typedoc.org/) to generate the HTML. Also included an API description from Microsoft's [API Extractor](https://api-extractor.com/). The JSON schema is still documented manually. See the `/docs` folder.
- A new playground/demo site is now available at [https://abstractplay.com/renderer/](https://abstractplay.com/renderer/).
- Added `tileSpacing` property that, when combined with `tileWidth` and `tileHeight`, will break the tiles apart and space them from each other. Only works for `squares*` and `vertex*` boards.
- Added glyphs for Alfred's Wyke.
- Added a `glyphmap: [string,string][]` option to the renderer (where `[string,string]` is the old glyph name mapped to a new glyph name). This lets the user swap any glyph for another. Say they prefer the square pieces to the default round ones. The front end could let them map `piece` to `piece-square`.
- Added glyphs for Alfred's Wyke.

## [0.6.0] - 2021-12-15

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ Currently the only supported output format is SVG. The library has been tested a

## Usage

In the browser, simply load `APRender.js` via a `<script>` tag. From within Node, simply import the variables and functions you need. Both methods give you access to the same API. For a concrete example, [see the playground](https://abstractplay.com/renderer/). The API and schema are documented in the `/docs` folder.
In the browser, simply load `APRender.js` via a `<script>` tag. For a concrete example, [see the playground](https://abstractplay.com/renderer/).

From within Node, simply import the variables and functions you need. Both methods give you access to the same API.

The API and schema are documented in the `/docs` folder.

## Contributing

Expand Down
4 changes: 3 additions & 1 deletion docs/api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ <h1>Abstract Play Renderer</h1>
<a href="#usage" id="usage" style="color: inherit; text-decoration: none;">
<h2>Usage</h2>
</a>
<p>In the browser, simply load <code>APRender.js</code> via a <code>&lt;script&gt;</code> tag. From within Node, simply import the variables and functions you need. Both methods give you access to the same API. For a concrete example, <a href="https://abstractplay.com/renderer/">see the playground</a>. The API and schema are documented in the <code>/docs</code> folder.</p>
<p>In the browser, simply load <code>APRender.js</code> via a <code>&lt;script&gt;</code> tag. For a concrete example, <a href="https://abstractplay.com/renderer/">see the playground</a>.</p>
<p>From within Node, simply import the variables and functions you need. Both methods give you access to the same API.</p>
<p>The API and schema are documented in the <code>/docs</code> folder.</p>

<a href="#contributing" id="contributing" style="color: inherit; text-decoration: none;">
<h2>Contributing</h2>
Expand Down
4 changes: 2 additions & 2 deletions docs/schema.adoc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
= Render Schema Documentation
:toc:
:schemaver: 0.2.0
:schemaver: 0.7.0

Games on the Abstract Play service must produce representations of the play area based on this schema. The front-end renderer will then translate that into various forms. The `description` fields in the schema itself are rather curt because JSON doesn't allow niceties like multi-line strings. So this file is intended to give you complete instructions on how to build an instance of this schema.

This document describes version {schemaver} of the schema.
Concrete examples of all the features of the renderer can be found at the https://abstractplay.com/renderer/[public playground/demo area].

== Concepts

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@abstractplay/renderer",
"version": "0.6.0",
"version": "0.7.0",
"description": "Renders Abstract Play game states graphically",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/schema#",
"$id": "https://www.abstractplay.com/schemas/rendergame/1-0-0.json#",
"$id": "https://www.abstractplay.com/schemas/rendergame/0-7-0.json#",
"title": "AP Render Rep",
"description": "Games on the Abstract Play service must produce representations of the play area based on this schema. The front-end renderer will then translate that into various forms. Detailed documentation is difficult within a JSON document (e.g., no multi-line strings allowed), so see the website for standalone documentation.",
"definitions": {
Expand Down
2 changes: 1 addition & 1 deletion test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import Ajv from "ajv";
import { expect } from "chai";
import "mocha";
import schema from "../src/schema.json";
import schema from "../src/schemas/schema.json";

describe("Schema validator", () => {
it("should validate with minimal example", () => {
Expand Down
1 change: 1 addition & 0 deletions test/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@
<section>
<h1>Abstract Play: Renderer Playground</h1>
<p>This is a public place for people to interact and experiment with the Abstract Play rendering engine. Use the drop-down menu to select from a list of samples, and then tweak them to your heart's content. <a href="https://github.com/AbstractPlay/renderer">See the GitHub page for documentation and a list of available glyphs.</a> It should work correctly in Chrome, Firefox, Opera, and Edge. If you encounter issues, please let us know on the GitHub page.</p>
<p>Updated to version 0.7.0.</p>
</section>
<section>
<h1>JSON Input</h1>
Expand Down

0 comments on commit 654fc61

Please sign in to comment.