Skip to content

Commit

Permalink
🤖 docs: Upgrade.
Browse files Browse the repository at this point in the history
  • Loading branch information
a-flying-potato authored and make-github-pseudonymous-again committed Jun 27, 2022
1 parent 57a2179 commit 4edcd3d
Show file tree
Hide file tree
Showing 8 changed files with 181 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .esdoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"source": "./src",
"destination": "./gh-pages",
"debug": false,
"index": "./README.md",
"package": "./package.json",
"plugins": [
{
"name": "esdoc-standard-plugin",
"option": {
"accessor": {
"access": ["public", "protected", "private"],
"autoPrivate": true
},
"brand": {
"title": "@aureooms/js-type"
},
"test": {
"type": "ava",
"source": "./test/src"
},
"manual": {
"files":[
"./doc/manual/overview.md",
"./doc/manual/installation.md",
"./doc/manual/usage.md",
"./doc/manual/example.md"
]
}
}
},
{
"name": "esdoc-inject-style-plugin",
"option": {
"enable": true,
"styles": ["./doc/css/style.css"]
}
},
{
"name": "esdoc-inject-script-plugin",
"option": {
"enable": true,
"scripts": ["./doc/scripts/header.js"]
}
},
{
"name": "esdoc-ecmascript-proposal-plugin",
"option": {
"all": true
}
}
]
}
52 changes: 52 additions & 0 deletions doc/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
h1,
h2,
.navigation,
.layout-container > header,
footer
{
border: none;
}

.project-name {
color: #FC913A;
font-weight: bold;
}

.layout-container > header > a.repo-url-github {
font-size: inherit;
display: inline;
background: none;
vertical-align: inherit;
}

.search-box img {
display: none;
}

.search-box::before{
content: "search";
}

.search-input-edge {
height: 0px;
}

.search-result {
width: 300px;
margin-left: 42px;
box-shadow: 1px 1px 13px rgba(0,0,0,0.2);
}

.search-input {
visibility: visible;
}

.search-result li.search-separator {
text-transform: capitalize;
background-color: #ccc;
}

span[data-ice="signature"] > span {
/*font-weight: bold;*/
font-style: italic;
}
3 changes: 3 additions & 0 deletions doc/manual/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Examples

> More examples in [the test files](https://github.com/make-github-pseudonymous-again/js-type/tree/main/test/src).
22 changes: 22 additions & 0 deletions doc/manual/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Installation

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


### yarn
```terminal
yarn add @aureooms/js-type
```

### npm
```terminal
npm install @aureooms/js-type --save
```

### jspm
```terminal
jspm install npm:@aureooms/js-type
```
1 change: 1 addition & 0 deletions doc/manual/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Overview
19 changes: 19 additions & 0 deletions doc/manual/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Usage

> :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');
// or
import 'regenerator-runtime/runtime.js';
```

Then, import the library where needed
```js
const type = await import('@aureooms/js-type');
// or
import * as type from '@aureooms/js-type';
```
30 changes: 30 additions & 0 deletions doc/scripts/header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const domReady = function (callback) {
const state = document.readyState;
if (state === 'interactive' || state === 'complete') {
callback();
} else {
document.addEventListener('DOMContentLoaded', callback);
}
};

domReady(() => {
const projectname = document.createElement('a');
projectname.classList.add('project-name');
projectname.text = 'make-github-pseudonymous-again/js-type';
projectname.href = './index.html';

const header = document.querySelector('header');
header.insertBefore(projectname, header.firstChild);

const testlink = document.querySelector('header > a[data-ice="testLink"]');
testlink.href = 'https://app.codecov.io/gh/make-github-pseudonymous-again/js-type';
testlink.target = '_BLANK';

const searchBox = document.querySelector('.search-box');
const input = document.querySelector('.search-input');

// Active search box when focus on searchBox.
input.addEventListener('focus', () => {
searchBox.classList.add('active');
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"scripts": {
"test": "./node_modules/.bin/aureooms-node-package-test",
"build": "./node_modules/.bin/aureooms-node-package-build",
"doc": "./node_modules/.bin/groc"
"build-docs": "esdoc"
},
"description": "type checking code bricks for JavaScript",
"keywords": [
Expand Down

0 comments on commit 4edcd3d

Please sign in to comment.