Skip to content

Commit

Permalink
📚 docs: Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Apr 24, 2022
1 parent cb698ec commit 6376958
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 14 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ User:Watchduck
</p>

Permutation library for JavaScript.
See [docs](https://computational-combinatorics.github.io/permutation).
See [docs](https://computational-combinatorics.github.io/permutation/index.html).
Parent is [js-algorithms](https://github.com/make-github-pseudonymous-again/js-algorithms).

> :warning: Depending on your environment, the code may require
> `regeneratorRuntime` to be defined, for instance by importing
> [regenerator-runtime/runtime](https://www.npmjs.com/package/regenerator-runtime).
```js
import { next , reversed , identity } from '@combinatorics/permutation' ;
next( reversed( identity( 3 ) ) ) ; // [ 0 , 1 , 2 ]
Expand Down
4 changes: 3 additions & 1 deletion doc/manual/example.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Example
# Examples

> More examples in [the test files](https://github.com/computational-combinatorics/permutation/tree/main/test/src).
```js
import {
Expand Down
15 changes: 11 additions & 4 deletions doc/manual/installation.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# Installation

Can be managed using
[jspm](http://jspm.io)
or [npm](https://github.com/npm/npm).
[yarn](https://yarnpkg.com/en/docs),
[npm](https://docs.npmjs.com),
or [jspm](https://jspm.org/docs).

### jspm

### yarn
```terminal
jspm install npm:@combinatorics/permutation
yarn add @combinatorics/permutation
```

### npm
```terminal
npm install @combinatorics/permutation --save
```

### jspm
```terminal
jspm install npm:@combinatorics/permutation
```
17 changes: 10 additions & 7 deletions doc/manual/usage.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# Usage

The code needs a ES2015+ polyfill to work, for example
[regenerator-runtime/runtime](https://babeljs.io/docs/usage/polyfill).
> :warning: Depending on your environment, the code may require
> `regeneratorRuntime` to be defined, for instance by importing
> [regenerator-runtime/runtime](https://www.npmjs.com/package/regenerator-runtime).
First, require the polyfill at the entry point of your application
```js
await import( 'regenerator-runtime/runtime.js' ) ;
await import('regenerator-runtime/runtime.js');
// or
import 'regenerator-runtime/runtime.js' ;
import 'regenerator-runtime/runtime.js';
```

Then
Then, import the library where needed
```js
const permutation = await import( '@combinatorics/permutation' ) ;
const permutation = await import('@combinatorics/permutation');
// or
import * as permutation from '@combinatorics/permutation' ;
import * as permutation from '@combinatorics/permutation';
```
2 changes: 1 addition & 1 deletion doc/scripts/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const domReady = function (callback) {
domReady(() => {
const projectname = document.createElement('a');
projectname.classList.add('project-name');
projectname.text = 'combinatorics/permutation';
projectname.text = '@combinatorics/permutation';
projectname.href = './index.html';

const header = document.querySelector('header');
Expand Down

0 comments on commit 6376958

Please sign in to comment.