Skip to content

Commit

Permalink
📚 docs: Format documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Sep 10, 2022
1 parent 26f6c04 commit b88460c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 25 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ User:Svjo
<a href="https://creativecommons.org/licenses/by-sa/3.0">CC BY-SA 3.0</a>
</p>

Fixed-size-array-based disjoint-set data structures for JavaScript.
Contiguously-allocated disjoint-set data structures for JavaScript.
See [docs](https://union-find.github.io/contiguous).
Parent is
[js-data-structures](https://github.com/make-github-pseudonymous-again/js-data-structures).
Expand All @@ -39,9 +39,9 @@ U.find( a ) === U.find( b ) ; // true

## :dancing_women: Related

- [@union-find/non-contiguous](https://github.com/union-find/non-contiguous):
implementation of the same data structures with nodes and pointers instead
of arrays
- [`@union-find/non-contiguous`](https://github.com/union-find/non-contiguous):
Implementation of the same data structures with nodes and pointers instead
of arrays.

## :scroll: References

Expand Down
4 changes: 3 additions & 1 deletion doc/manual/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
// - LinkedListWithHeadAndLength
// - LinkedListWithHead

let { Universe } = fixeddisjointset.ForestAmortizedHalving ;
import { ForestAmortizedHalving } from '@union-find/contiguous' ;

let { Universe } = ForestAmortizedHalving ;

let U = new Universe( 3 ) ;

Expand Down
16 changes: 12 additions & 4 deletions doc/manual/installation.md
Original file line number Diff line number Diff line change
@@ -1,14 +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:@union-find/contiguous
yarn add @union-find/contiguous
```

### npm
```terminal
npm install @union-find/contiguous --save
```

### jspm
```terminal
jspm install npm:@union-find/contiguous
```
14 changes: 3 additions & 11 deletions doc/manual/usage.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
# Usage
The code needs a ES2015+ polyfill to work, for example
[regenerator-runtime/runtime](https://babeljs.io/docs/usage/polyfill).
Import the library where needed
```js
await import( 'regenerator-runtime/runtime.js' ) ;
const implementations = await import('@union-find/contiguous');
// or
import 'regenerator-runtime/runtime.js' ;
```

Then
```js
const fixeddisjointset = await import( '@union-find/contiguous' ) ;
// or
import fixeddisjointset from '@union-find/contiguous' ;
import * as implementations from '@union-find/contiguous';
```
6 changes: 3 additions & 3 deletions doc/scripts/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ const domReady = function (callback) {
}
};

domReady(function () {
domReady(() => {
const projectname = document.createElement('a');
projectname.classList.add('project-name');
projectname.text = 'union-find/contiguous';
projectname.text = '@union-find/contiguous';
projectname.href = './index.html';

const header = document.querySelector('header');
Expand All @@ -24,7 +24,7 @@ domReady(function () {
const input = document.querySelector('.search-input');

// Active search box when focus on searchBox.
input.addEventListener('focus', function () {
input.addEventListener('focus', () => {
searchBox.classList.add('active');
});
});
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"author": "make-github-pseudonymous-again",
"homepage": "https://union-find.github.io/contiguous",
"repository": {
"type": "git",
"url": "https://github.com/union-find/contiguous"
"url": "https://github.com/union-find/contiguous",
"type": "git"
},
"bugs": {
"url": "https://github.com/union-find/contiguous/issues"
Expand Down

0 comments on commit b88460c

Please sign in to comment.