From b88460c193a7918f8f7379cc37e6e8c4f201a0f0 Mon Sep 17 00:00:00 2001 From: make-github-pseudonymous-again <5165674+make-github-pseudonymous-again@users.noreply.github.com> Date: Sat, 10 Sep 2022 22:45:58 +0200 Subject: [PATCH] :books: docs: Format documentation. --- README.md | 8 ++++---- doc/manual/example.md | 4 +++- doc/manual/installation.md | 16 ++++++++++++---- doc/manual/usage.md | 14 +++----------- doc/scripts/header.js | 6 +++--- package.json | 4 ++-- 6 files changed, 27 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 9afd511..cb56a31 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ User:Svjo CC BY-SA 3.0

-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). @@ -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 diff --git a/doc/manual/example.md b/doc/manual/example.md index aa48f5c..abd0573 100644 --- a/doc/manual/example.md +++ b/doc/manual/example.md @@ -10,7 +10,9 @@ // - LinkedListWithHeadAndLength // - LinkedListWithHead -let { Universe } = fixeddisjointset.ForestAmortizedHalving ; +import { ForestAmortizedHalving } from '@union-find/contiguous' ; + +let { Universe } = ForestAmortizedHalving ; let U = new Universe( 3 ) ; diff --git a/doc/manual/installation.md b/doc/manual/installation.md index 4726bab..4333fa7 100644 --- a/doc/manual/installation.md +++ b/doc/manual/installation.md @@ -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 +``` diff --git a/doc/manual/usage.md b/doc/manual/usage.md index d96e85b..b65389a 100644 --- a/doc/manual/usage.md +++ b/doc/manual/usage.md @@ -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'; ``` diff --git a/doc/scripts/header.js b/doc/scripts/header.js index 657ef13..d78c02e 100644 --- a/doc/scripts/header.js +++ b/doc/scripts/header.js @@ -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'); @@ -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'); }); }); diff --git a/package.json b/package.json index dbd6eb8..c21dd6f 100644 --- a/package.json +++ b/package.json @@ -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"