Skip to content

Commit

Permalink
Merge pull request #5 from ChapelR/v1.0.0-pre
Browse files Browse the repository at this point in the history
v1.0.0
  • Loading branch information
ChapelR authored Mar 11, 2020
2 parents 5dd1b43 + d321c45 commit b25e435
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 27 deletions.
4 changes: 2 additions & 2 deletions dist/macro.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions docs/developer.md → docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Developer Documentation
# Contributing

This document provides information about the project structure and build process of this framework so developers may make source code edits and contribute to or fork this project.

To get started, clone or download the repository and run `npm install` in the project directory. If you want to work on documentation you may want to globally install Docsify: `npm i -g docsify`.

## Code of Conduct

See the [Contributor Covenant 2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/).

## Project Structure

The `src` folder contains the source code for the framework. The `examples` folder contains macro examples. When built, everything in the example folder will be minified, CSS code will additionally be auto-prefixed. These processed files are output to `examples/minified`. Everything in the `src` folder is concatenated and minified and output to the `dist` folder. A new `harlowe-macro-api.zip` file is also generated with the compiled framework JavaScript.
Expand All @@ -12,7 +16,7 @@ To add new source code files, you'll need to add them to the build process (see

## Coding Standards

Everything here is written in ES5. I may set up Babel on the build process at a later date and move the code to ES6+, but for now contributions should be mostly in ES5. Please lint your code with [JSHint](https://jshint.com/).
Everything here is written in ES5. I may set up Babel on the build process at a later date and move the code to ES6+, but for now contributions should be in ES5. Please lint your code with [JSHint](https://jshint.com/). I use four space indents and prefer the use of single quotes.

## Build Process

Expand All @@ -24,10 +28,14 @@ For the foreseeable future, you will be able to add new files by adding them to

## Testing

I use Tweego to test the project. I use a `test` folder with a `tw` folder containing all be `.twee` files, and the following command to compile it: `tweego -f harlowe-3 -o index.html ../dist/macro.min.js ../examples/minified tw`. There is no easy way to automate testing that I am aware of, so you'll need to thoroughly, manually test your changes.
I use Tweego to test the project. I use a `test` folder with a `tw` folder containing all the `.twee` files, and the following command to compile it: `tweego -f harlowe-3 -o index.html ../dist/macro.min.js ../examples/minified tw`. There is no easy way to automate testing that I am aware of, so you'll need to thoroughly manually test your changes.

## Documentation

Documentation is compiled for the web with [Docsify](https://docsify.js.org/#/), but you don't strictly need Docsify to make edits to the documentation files, as you can simply edit the markdown files. Please attempt to match the style and format present in the files—for example, if you are documenting a new function, use one of the existing function entries as a guide. I would go as far as recommending you copy/paste an existing macro or function entry and replace it's content with your own.

If you add new APIs, methods, functions, etc, you do not *have* to provide and documentation, though I appreciate doing so. You can instead explain the changes to me and I'll document it.
If you add new APIs, methods, functions, etc, you do not *have* to provide and documentation, though I appreciate doing so. You can instead explain the changes to me and I'll document it.

## Contributing Macros

You may contribute macros to this repo directly via a PR or by providing a link to the documentation and script hosted elsewhere and adding said link to the documentation. You may also open an issue with the relevant code or links if you prefer. I will only accept scripts or links that point to scripts that are free and open source, released under a permissive license, and that are reasonably complete and functional. I'm willing to help with tweaking, testing, documentation, and other such work to whatever extent I am able.
18 changes: 9 additions & 9 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This documentation is intended for people who *make* custom macros, so it may be

If you are looking for custom macros you can use, [install the framework](installation-guide.md) and then check out the [macros page](examples/main.md).

See some example scripts [here](https://github.com/ChapelR/harlowe-macro-api/tree/master/examples). Developer documentation for forking and contributing is [here](developer.md).
See some example scripts [here](https://github.com/ChapelR/harlowe-macro-api/tree/master/examples). Developer documentation for forking and contributing is [here](CONTRIBUTING.md).

## Contents

Expand All @@ -36,7 +36,7 @@ See some example scripts [here](https://github.com/ChapelR/harlowe-macro-api/tre
- [Function: `Harlowe.visited()`](#function-harlowevisited)
- [Function: `Harlowe.hasVisited()`](#function-harlowehasvisited)
- [Function: `Harlowe.turns()`](#function-harloweturns)
- [Function: `Harlowe.helpers.isSerialisable()`](#function-harlowehelpersisserialisable)
- [Function: `Harlowe.helpers.isSerializable()`](#function-harlowehelpersisserializable)
- [Function: `Harlowe.helpers.arrayify()`](#function-harlowehelpersarrayify)
- [Function: `Harlowe.helpers.getPassageData()`](#function-harlowehelpersgetpassagedata)
- [API_ACCESS](#api_access)
Expand Down Expand Up @@ -304,13 +304,13 @@ Harlowe.macro('classy', function () {

You can access basic story information, the version information for Harlowe, and the version information for this framework using these properties and methods.

- `Harlowe.version.major`: This property holds the **framework**'s major version.
- `Harlowe.framework.major`: This property holds the **framework**'s major version.

- `Harlowe.version.minor`: This property holds the **framework**'s minor version.
- `Harlowe.framework.minor`: This property holds the **framework**'s minor version.

- `Harlowe.version.patch`: This property holds the **framework**'s patch version.
- `Harlowe.framework.patch`: This property holds the **framework**'s patch version.

- `Harlowe.version.semantic()`: Returns the semantic version of the framework.
- `Harlowe.framework.semantic`: This property holds the Harlowe **framework**'s semantic version string.

- `Harlowe.engine.major`: This property holds the Harlowe **engine**'s major version.

Expand Down Expand Up @@ -628,14 +628,14 @@ if (Harlowe.turns() > 100) {
}
```

### Function: `Harlowe.helpers.isSerialisable()`
### Function: `Harlowe.helpers.isSerializable()`

Checks whether the indicated data can be serialized and saved to Harlowe's history system, and therefore stored in Harlowe story variables. This is *not* the same as being JSON serializable, what Harlowe can save is more limited.

#### Syntax

```javascript
Harlowe.helpers.isSerialisable(data);
Harlowe.helpers.isSerializable(data);
```

#### Arguments
Expand All @@ -649,7 +649,7 @@ Harlowe.helpers.isSerialisable(data);
#### Examples

```
if (Harlowe.helpers.isSerialisable(myData)) {
if (Harlowe.helpers.isSerializable(myData)) {
Harlowe.variables('$myVar', myData);
} else {
alert("I can't save that!");
Expand Down
4 changes: 2 additions & 2 deletions docs/_navbar.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- [Docs](/)
- [Install](installation-guide.md)
- [Macros](/examples/main.md)
- [Downloads](./download ":ignore")
- [Downloads](https://harlowe.twinelab.net/download ":ignore")
- [Changelog](changelog.md)
- [Demo](./demo ':ignore')
- [Demo](https://harlowe.twinelab.net/demo ':ignore')
11 changes: 11 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## Release Versions

### v1.0.0

- **[Update]** Changed `Harlowe.version` to `Harlowe.framework` to alleviate any confusion with `Harlowe.engine`.
- **[Update]** `Harlowe.framework.semantic` is no longer a function, giving it parity with all other `Harlowe.framework` and `Harlowe.engine` properties.
- **[Update]** The alternative spelling `Harlowe.helpers.isSerializable()` now works in addition to `Harlowe.helpers.isSerialisable()`.
- **[Docs]** Renamed `developer.md` to `CONTRIBUTING.md`.
- Added link to Contributor Covenant 2.0 for code of conduct.
- Added details for contributing macro scripts and links to macros.

## Pre-release Versions

### v0.4.1
Expand Down
Loading

0 comments on commit b25e435

Please sign in to comment.