Skip to content

Commit fc9d81c

Browse files
Update READMEs
1 parent 2e989af commit fc9d81c

File tree

2 files changed

+98
-129
lines changed

2 files changed

+98
-129
lines changed

README.md

Lines changed: 48 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,26 @@
44

55
**[angular-shepherd is built and maintained by Ship Shape. Contact us for web app consulting, development, and training for your project](https://shipshape.io/)**.
66

7-
[![npm version](https://badge.fury.io/js/angular-shepherd.svg)](http://badge.fury.io/js/angular-shepherd)
8-
![Download count all time](https://img.shields.io/npm/dt/angular-shepherd.svg)
9-
[![npm](https://img.shields.io/npm/dm/angular-shepherd.svg)]()
10-
![CI Build](https://github.com/shipshapecode/angular-shepherd/workflows/CI%20Build/badge.svg)
7+
[![npm version](https://badge.fury.io/js/angular-shepherd.svg)](http://badge.fury.io/js/angular-shepherd) ![Download count all time](https://img.shields.io/npm/dt/angular-shepherd.svg) [![npm](https://img.shields.io/npm/dm/angular-shepherd.svg)]() ![CI Build](https://github.com/shipshapecode/angular-shepherd/workflows/CI%20Build/badge.svg)
118

12-
This is an Angular wrapper for the [Shepherd](https://github.com/shipshapecode/shepherd), site tour, library.
13-
It provides additional functionality, on top of Shepherd, as well.
9+
This is an Angular wrapper for the [Shepherd](https://github.com/shipshapecode/shepherd), site tour, library. It provides additional functionality, on top of Shepherd, as well.
1410

1511
## Compatibility
1612

17-
* Angular 8: 0.5.0
18-
* Angular 9: 0.6.0
19-
* Angular 10: 0.7.0
20-
* Angular 11: 11.x
21-
* Angular 12: 12.x
22-
* Angular 13: 13.x
23-
* Angular 14: 14.x
24-
* Angular 15: 15.x
25-
* Angular 16: 16.x
26-
* Angular 17: 17.x
27-
* Angular 18: 18.x
28-
* Angular 19: 19.x
29-
30-
This has not been tested in anything but Angular 8+. It may or may not work in previous versions or subsequent versions
31-
of Angular. We would love to support multiple versions, if people with more Angular knowledge would be willing to help us out!
13+
- Angular 8: 0.5.0
14+
- Angular 9: 0.6.0
15+
- Angular 10: 0.7.0
16+
- Angular 11: 11.x
17+
- Angular 12: 12.x
18+
- Angular 13: 13.x
19+
- Angular 14: 14.x
20+
- Angular 15: 15.x
21+
- Angular 16: 16.x
22+
- Angular 17: 17.x
23+
- Angular 18: 18.x
24+
- Angular 19: 19.x
25+
26+
This has not been tested in anything but Angular 8+. It may or may not work in previous versions or subsequent versions of Angular. We would love to support multiple versions, if people with more Angular knowledge would be willing to help us out!
3227

3328
## Installation
3429

@@ -38,42 +33,36 @@ npm install angular-shepherd --save
3833

3934
## Usage
4035

41-
**NOTE: This may not be the proper Angular way to do everything, as I am not
42-
an Angular dev, so please let me know if you have suggestions!**
36+
**NOTE: This may not be the proper Angular way to do everything, as I am not an Angular dev, so please let me know if you have suggestions!**
4337

44-
Shepherd ships a single style file, which you will need to include. You can do so by adding it
45-
to your angular.json.
38+
Shepherd ships a single style file, which you will need to include. You can do so by adding it to your angular.json.
4639

4740
```json
4841
"styles": [
4942
"node_modules/shepherd.js/dist/css/shepherd.css"
5043
],
5144
```
5245

53-
Then, you will need to inject the `ShepherdService` to be able to interact with Shepherd and
54-
call `addSteps` to add your steps, `start` to start the tour, etc.
46+
Then, you will need to inject the `ShepherdService` to be able to interact with Shepherd and call `addSteps` to add your steps, `start` to start the tour, etc.
5547

56-
You could either do this at the application level, in your application component
57-
or on a per component or per route/view basis.
48+
You could either do this at the application level, in your application component or on a per component or per route/view basis.
5849

59-
**NOTE: It is highly recommended to inject ShepherdService into your `app.component.ts`. Injecting it
60-
at the app level ensures you only create one instance of Shepherd.**
50+
**NOTE: It is highly recommended to inject ShepherdService into your `app.component.ts`. Injecting it at the app level ensures you only create one instance of Shepherd.**
6151

6252
In that component you will want to use `AfterViewInit` to `addSteps` to the Shepherd service.
6353

6454
```typescript
6555
import { Component, type AfterViewInit } from '@angular/core';
6656
import { ShepherdService } from 'angular-shepherd';
67-
import { steps as defaultSteps, defaultStepOptions} from '../data';
57+
import { steps as defaultSteps, defaultStepOptions } from '../data';
6858

6959
@Component({
7060
selector: 'shepherd',
7161
templateUrl: './shepherd.component.html',
7262
styleUrls: ['./shepherd.component.css']
7363
})
7464
export class ShepherdComponent implements AfterViewInit {
75-
76-
constructor(private shepherdService: ShepherdService) { }
65+
constructor(private shepherdService: ShepherdService) {}
7766

7867
ngAfterViewInit() {
7968
this.shepherdService.defaultStepOptions = defaultStepOptions;
@@ -87,25 +76,21 @@ export class ShepherdComponent implements AfterViewInit {
8776

8877
## Configuration
8978

90-
The following configuration options can be set on the ShepherdService to control the way that Shepherd is used.
91-
**The only required option is `steps`, which is set via `addSteps`.**
79+
The following configuration options can be set on the ShepherdService to control the way that Shepherd is used. **The only required option is `steps`, which is set via `addSteps`.**
9280

9381
### confirmCancel
9482

95-
`confirmCancel` is a boolean flag, when set to `true` it will pop up a native browser
96-
confirm window on cancel, to ensure you want to cancel.
83+
`confirmCancel` is a boolean flag, when set to `true` it will pop up a native browser confirm window on cancel, to ensure you want to cancel.
9784

9885
### confirmCancelMessage
9986

100-
`confirmCancelMessage` is a string to display in the confirm dialog when `confirmCancel`
101-
is set to true.
87+
`confirmCancelMessage` is a string to display in the confirm dialog when `confirmCancel` is set to true.
10288

10389
### defaultStepOptions
10490

105-
`defaultStepOptions` is used to set the options that will be applied to each step by default.
106-
You can pass in any of the options that you can with Shepherd.
91+
`defaultStepOptions` is used to set the options that will be applied to each step by default. You can pass in any of the options that you can with Shepherd.
10792

108-
**⚠️ You must set `defaultStepOptions` *BEFORE* calling `addSteps` to set the steps.**
93+
**⚠️ You must set `defaultStepOptions` _BEFORE_ calling `addSteps` to set the steps.**
10994

11095
It will be an object of a form something like:
11196

@@ -121,17 +106,16 @@ this.shepherdService.defaultStepOptions = {
121106

122107
> **default value:** `{}`
123108
124-
125109
### requiredElements
126110

127-
`requiredElements` is an array of objects that indicate DOM elements that are **REQUIRED** by your tour and must
128-
exist and be visible for the tour to start. If any elements are not present, it will keep the tour from starting.
111+
`requiredElements` is an array of objects that indicate DOM elements that are **REQUIRED** by your tour and must exist and be visible for the tour to start. If any elements are not present, it will keep the tour from starting.
129112

130113
You can also specify a message, which will tell the user what they need to do to make the tour work.
131114

132-
**⚠️ You must set `requiredElements` *BEFORE* calling `addSteps` to set the steps.**
115+
**⚠️ You must set `requiredElements` _BEFORE_ calling `addSteps` to set the steps.**
133116

134117
_Example_
118+
135119
```js
136120
this.shepherdService.requiredElements = [
137121
{
@@ -143,16 +127,15 @@ this.shepherdService.requiredElements = [
143127
selector: '.username-element',
144128
message: 'User not logged in, please log in to start this tour.',
145129
title: 'Please login'
146-
},
130+
}
147131
];
148132
```
149133

150134
> **default value:** `[]`
151135
152136
### modal
153137

154-
`modal` is a boolean, that should be set to true, if you would like the rest of the screen, other than the current element,
155-
greyed out, and the current element highlighted. If you do not need modal functionality, you can remove this option or set it to false.
138+
`modal` is a boolean, that should be set to true, if you would like the rest of the screen, other than the current element, greyed out, and the current element highlighted. If you do not need modal functionality, you can remove this option or set it to false.
156139

157140
> **default value:** `false`
158141
@@ -164,8 +147,8 @@ You must pass an array of steps to `addSteps`, something like this:
164147
this.shepherdService.addSteps([
165148
{
166149
id: 'intro',
167-
attachTo: {
168-
element: '.first-element',
150+
attachTo: {
151+
element: '.first-element',
169152
on: 'bottom'
170153
},
171154
beforeShowPromise: function() {
@@ -216,25 +199,25 @@ this.shepherdService.addSteps([
216199

217200
## Buttons
218201

219-
In Shepherd, you can have as many buttons as you want inside a step. You can build an object with some premade buttons, making it easier to manipulate and insert in new steps. Buttons by default accept three different types: back, cancel, next. In this simple example, we have three buttons: each one with different types and classes.
202+
In Shepherd, you can have as many buttons as you want inside a step. You can build an object with some premade buttons, making it easier to manipulate and insert in new steps. Buttons by default accept three different types: back, cancel, next. In this simple example, we have three buttons: each one with different types and classes.
220203

221204
```js
222205
const builtInButtons = {
223206
cancel: {
224-
classes: "cancel-button",
225-
text: "Cancel",
226-
type: "cancel"
207+
classes: 'cancel-button',
208+
text: 'Cancel',
209+
type: 'cancel'
227210
},
228211
next: {
229-
classes: "next-button",
230-
text: "Next",
231-
type: "next"
212+
classes: 'next-button',
213+
text: 'Next',
214+
type: 'next'
232215
},
233216
back: {
234-
classes: "back-button",
217+
classes: 'back-button',
235218
secondary: true,
236-
text: "Back",
237-
type: "back"
219+
text: 'Back',
220+
type: 'back'
238221
}
239222
};
240223
```
@@ -244,9 +227,9 @@ Buttons have an action property, which must be a function. Whenever the button i
244227
```js
245228
const builtInButtons = {
246229
complete: {
247-
classes: "complete-button",
248-
text: "Finish Tutorial",
249-
action: function() {
230+
classes: 'complete-button',
231+
text: 'Finish Tutorial',
232+
action: function () {
250233
return console.log('button clicked');
251234
}
252235
}

0 commit comments

Comments
 (0)