Skip to content

Commit

Permalink
Merge pull request #14 from jakeboone02/trailing-quantities
Browse files Browse the repository at this point in the history
Add support for trailing quantity/range and UOM
  • Loading branch information
jakeboone02 authored Dec 2, 2023
2 parents eb67984 + e238892 commit 4b34427
Show file tree
Hide file tree
Showing 35 changed files with 555 additions and 3,235 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Documentation
on:
push:
branches: [main]

jobs:
generate:
name: Generate documentation
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- run: bun install
- run: bun run docs
- uses: actions/upload-pages-artifact@v2
with:
path: 'docs/'

deploy:
name: Deploy documentation site
needs: generate
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@v2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
node_modules
dist
coverage
docs
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

- N/A
### Changed

- `compactStringArray` has been removed. (`array.filter(Boolean)` is functionally equivalent to `compactStringArray(array)`.)

### Added

- If no quantity is detected at the beginning of an ingredient line, the _end_ of the line will be scanned for quantity/range and unit of measure.

## [v1.0.1] - 2023-07-26

Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,11 @@ If present (i.e., not `null`), the `unitOfMeasureID` property corresponds to a k
## Installation

### npm/yarn
### npm

```shell
# npm
npm i parse-ingredient

# yarn
yarn add parse-ingredient
# OR yarn add / pnpm add / bun add
```

### Browser
Expand Down Expand Up @@ -132,6 +129,17 @@ console.log(parseIngredient('For cake:'));
// isGroupHeader: true,
// }
// ]
console.log(parseIngredient('Ripe tomato x2'));
// [
// {
// quantity: 2,
// quantity2: null,
// unitOfMeasure: null,
// unitOfMeasureID: null,
// description: 'Ripe tomato',
// isGroupHeader: false,
// }
// ]
```

## Options
Expand Down
Binary file modified bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion docs/.nojekyll

This file was deleted.

113 changes: 0 additions & 113 deletions docs/assets/highlight.css

This file was deleted.

58 changes: 0 additions & 58 deletions docs/assets/main.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/search.js

This file was deleted.

Loading

0 comments on commit 4b34427

Please sign in to comment.