Skip to content

Commit

Permalink
update plugin README docs (#468)
Browse files Browse the repository at this point in the history
* update plugin README docs

* update description and keywords for packages
  • Loading branch information
thescientist13 committed Apr 3, 2021
1 parent ffca6bf commit 2ab2927
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 32 deletions.
6 changes: 2 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
"license": "MIT",
"keywords": [
"Greenwood",
"Web Components",
"Lit Element",
"Lit Html",
"Static Site Generator"
"Static Site Generator",
"Web Components"
],
"engines": {
"node": ">=10.x"
Expand Down
20 changes: 10 additions & 10 deletions packages/plugin-google-analytics/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# @greenwood/plugin-google-analytics

## Overview
A composite plugin for Greenwood for adding support for [Google Analytics](https://developers.google.com/analytics/) JavaScript tracker. For more information and complete docs about Greenwood, please visit the [Greenwood website](https://www.greenwoodjs.io/docs).
A Greenwood plugin adding support for [Google Analytics](https://developers.google.com/analytics/) JavaScript tracker.

> _For more information and complete docs about Greenwood, please visit the [Greenwood website](https://www.greenwoodjs.io/)._
> This package assumes you already have `@greenwood/cli` installed.

## Installation
You can use your favorite JavaScript package manager to install this package.
You can use your favorite JavaScript package manager to install this package. This package assumes you already have `@greenwood/cli` installed.

_examples:_
```bash
Expand All @@ -18,9 +19,7 @@ yarn add @greenwood/plugin-google-analytics --dev
```

## Usage
Use this plugin in your _greenwood.config.js_ and simply pass in your Google Analytics ID, e.g. `UA-XXXXX`.

> As this is a composite plugin, you will need to spread the result.
Use this plugin in your _greenwood.config.js_ and pass in your Google Analytics ID, e.g. `UA-XXXXX`.

```javascript
const googleAnalyticsPlugin = require('@greenwood/plugin-google-analytics');
Expand All @@ -29,7 +28,7 @@ module.exports = {
...

plugins: [
...googleAnalyticsPlugin({
googleAnalyticsPlugin({
analyticsId: 'UA-XXXXXX'
})
]
Expand All @@ -38,9 +37,10 @@ module.exports = {

This will then add the Google Analytics [JavaScript tracker snippet](https://developers.google.com/analytics/devguides/collection/analyticsjs/) to your project's _index.html_.

### Options

## Options
- `analyticsId` (required) - Your Google Analytics ID
- `anonymous` (optional) - If tracking of IPs should be done anonymously. Defaults to `true`
- `anonymous` (optional) - Sets if tracking of IPs should be done anonymously. Default is `true`

### Outbound Links
For links that go outside of your domain, the global function [`getOutboundLink`](https://support.google.com/analytics/answer/7478520) is available for you to use.
Expand All @@ -49,7 +49,7 @@ Example:
```html
<a
target="_blank"
rel="noopener"
rel="noopener"
onclick="getOutboundLink('www.mylink.com');"
href="www.mylink.com">My Link
</a>
Expand Down
6 changes: 2 additions & 4 deletions packages/plugin-google-analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{
"name": "@greenwood/plugin-google-analytics",
"version": "0.10.0-alpha.4",
"description": "A composite plugin for Greenwood for adding support for Google Analytics.",
"description": "A Greenwood plugin adding support for Google Analytics JavaScript tracker.",
"repository": "https://github.com/ProjectEvergreen/greenwood/tree/master/packages/plugin-google-analytics",
"author": "Owen Buckley <owen@thegreenhouse.io>",
"license": "MIT",
"keywords": [
"Greenwood",
"Web Components",
"Lit Element",
"Lit Html",
"Static Site Generator",
"Web Components",
"Google Analytics"
],
"main": "src/index.js",
Expand Down
16 changes: 6 additions & 10 deletions packages/plugin-polyfills/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# @greenwood/plugin-polyfills

## Overview
> _**NOTE: This package is currently installed by default by Greenwood so you don't need to install it yourself.**_
A composite plugin for Greenwood for adding support for adding Web Component related polyfills for browser that need support for it. It uses [feature detection]()https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs#using-webcomponents-loaderjs to determine what polyfills are actually needed based on the user's browser, to ensure only the minumum extra code is needed.
A Greenwood plugin adding support for [Web Component related polyfills](https://github.com/webcomponents/polyfills) for browsers that need support for part of the Web Component spec like **Custom Elements** and **Shadow DOM**. It uses [feature detection](https://github.com/webcomponents/polyfills/tree/master/packages/webcomponentsjs#using-webcomponents-loaderjs) to determine what polyfills are actually needed based on the user's browser, to ensure only the minumum extra code is loaded.

As of right now, you will likely need this plugin to load additional polyfills if you want to support these browser(s):

- Internet Explorer <= 11
- Mobile Browsers

> See Greenwood's [browser support](https://www.greenwoodjs.io/about/how-it-works#browser-support) and [evergreen build](https://www.greenwoodjs.io/about/how-it-works#evergreen-build) docs for more information on how Greenwood handles browser support out of the box. Or visit [caniuse.com](https://caniuse.com/) to look up specific support for specific browsers.
See Greenwood's [browser support](https://www.greenwoodjs.io/about/how-it-works#browser-support) and [evergreen build](https://www.greenwoodjs.io/about/how-it-works#evergreen-build) docs for more information on how Greenwood handles browser support out of the box. Or visit [caniuse.com](https://caniuse.com/) to look up specific support for specific browsers.

> This package assumes you already have `@greenwood/cli` installed.
> _For more information and complete docs about Greenwood, please visit the [Greenwood website](https://www.greenwoodjs.io/)._
## Installation
You can use your favorite JavaScript package manager to install this package.
You can use your favorite JavaScript package manager to install this package. This package assumes you already have `@greenwood/cli` installed.

_examples:_
```bash
Expand All @@ -29,20 +27,18 @@ yarn add @greenwood/plugin-polyfills --dev
## Usage
Use this plugin in your _greenwood.config.js_.

> As this is a composite plugin, you will need to spread the result.
```javascript
const polyfillsPlugin = require('@greenwood/plugin-polyfills');

module.exports = {
...

plugins: [
...polyfillsPlugin()
polyfillsPlugin()
]
}
```

This will then add the necessary Polyfills to have your project work in those browsers.
Now when your project builds for production, you will see a _bundles/_ directory in your output directory, as well as a file called _webcomponents-loader.js_, as well as a `<script>` tag for that file in the `<head>` of your _index.html_ files. When a page is loaded, the feature detection capabilities will then load the necessary polyfills to have your project work for a user's given browser.

> Note: we would like to add support for [differntial loading](https://github.com/ProjectEvergreen/greenwood/issues/224) to avoid the cost of this for newer browsers.
6 changes: 2 additions & 4 deletions packages/plugin-polyfills/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
{
"name": "@greenwood/plugin-polyfills",
"version": "0.10.0-alpha.4",
"description": "A composite plugin for Greenwood for adding polyfill support for older browsers.",
"description": "A Greenwood plugin adding support for Web Component related polyfills like Custom Elements and Shadow DOM.",
"repository": "https://github.com/ProjectEvergreen/greenwood/tree/master/packages/plugin-polyfills",
"author": "Owen Buckley <owen@thegreenhouse.io>",
"license": "MIT",
"keywords": [
"Greenwood",
"Web Components",
"Lit Element",
"Lit Html",
"Static Site Generator",
"Web Components",
"Polyfills"
],
"main": "src/index.js",
Expand Down

0 comments on commit 2ab2927

Please sign in to comment.