diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c577e8a..19aafe9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,17 +4,46 @@ on: - pull_request jobs: test: - name: Node.js ${{ matrix.node-version }} + name: Test on Node.js ${{ matrix.node-version }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: node-version: - - 16 + - 20 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm install - - run: npm test \ No newline at end of file + - run: npm test + + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm install + - run: npm run docs + - uses: actions/upload-pages-artifact@v3 + with: + path: "./output" + + deploy: + needs: build + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index f846c68..5073481 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +output/ node_modules package-lock.json yarn.lock diff --git a/index.html b/index.html deleted file mode 100644 index 39b5ee7..0000000 --- a/index.html +++ /dev/null @@ -1,2441 +0,0 @@ - -Math.clamp
-

Stage 0 Draft / April 6, 2024

Math.clamp

- - -

Introduction

-

Math.clamp() constrains a value between an upper and lower bound.

-
- - -

1 Math.clamp ( number, min, max )

-

This function returns the Number value that is the result of constraining number between the bounds defined by min and max.

-
  1. Set number to ? ToNumber(number).
  2. If max is neither undefined nor null, then
    1. Set max to ? ToNumber(max).
    2. Set number to min(number, max).
  3. If min is neither undefined nor null, then
    1. Set min to ? ToNumber(min).
    2. Set number to max(number, min).
  4. Return number.
-
-

A Copyright & Software License

- -

Copyright Notice

-

© 2024 Richie Bendall

- -

Software License

-

All Software contained in this document ("Software") is protected by copyright and is being made available under the "BSD License", included below. This Software may be subject to third party rights (rights from parties other than Ecma International), including patent rights, and no licenses under such third party rights are granted under this license even if the third party concerned is a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS AVAILABLE AT https://ecma-international.org/memento/codeofconduct.htm FOR INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO IMPLEMENT ECMA INTERNATIONAL STANDARDS.

- -

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

- -
    -
  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. -
  3. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  4. -
  5. Neither the name of the authors nor Ecma International may be used to endorse or promote products derived from this software without specific prior written permission.
  6. -
- -

THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

- -
-
\ No newline at end of file diff --git a/package.json b/package.json index 3536587..cc127bc 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "node": ">=12.20" }, "scripts": { - "docs": "ecmarkup spec.html index.html --lint-spec", + "docs": "ecmarkup spec.html output/index.html --lint-spec", "test": "xo && node ./test-implementation.js" }, "keywords": [