Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
build: use remarklint for linting of markdown files
Browse files Browse the repository at this point in the history
  • Loading branch information
klemenoslaj committed Mar 3, 2019
1 parent 30f11f3 commit d525d61
Show file tree
Hide file tree
Showing 3 changed files with 750 additions and 14 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<div style="text-align: center">

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f495c18616434c3ca2fafe26f89a818f)](https://app.codacy.com/app/klemenoslaj/ng-action-outlet?utm_source=github.com&utm_medium=referral&utm_content=klemenoslaj/ng-action-outlet&utm_campaign=Badge_Grade_Settings)
[![Travis build](https://img.shields.io/travis/klemenoslaj/ng-action-outlet/master.svg)](https://travis-ci.org/klemenoslaj/ng-action-outlet)
[![Coveralls github](https://img.shields.io/coveralls/klemenoslaj/ng-action-outlet/master.svg)](https://coveralls.io/github/klemenoslaj/ng-action-outlet?branch=master)
[![David](https://img.shields.io/david/klemenoslaj/ng-action-outlet/master.svg)](https://david-dm.org/klemenoslaj/ng-action-outlet)

[![Compodoc tag](./docs/images/coverage-badge.svg)](https://klemenoslaj.github.io/ng-action-outlet/coverage.html)
[![License](https://img.shields.io/npm/l/@ng-action-outlet/core.svg)](https://github.com/klemenoslaj/ng-action-outlet/blob/master/LICENSE)
[![GitHub tag](https://img.shields.io/github/tag/klemenoslaj/ng-action-outlet.svg)](https://github.com/klemenoslaj/ng-action-outlet/releases)
[![Known Vulnerabilities](https://snyk.io/test/github/klemenoslaj/ng-action-outlet/badge.svg?targetFile=package.json)](https://snyk.io/test/github/klemenoslaj/ng-action-outlet?targetFile=package.json)

</div>

# [NgActionOutlet](https://klemenoslaj.github.io/ng-action-outlet/)

The goal of `ActionOutlet` is to provide an easy API to build dynamic menus on runtime and have the possibility to get notified for each and every change, that happens to any particular action in the menu (_e.g. Title change, icon change, disabled state, ..._).
Expand All @@ -16,17 +21,22 @@ The most natural use case is when back-end is in charge over the visibility of a
## Getting started

### Step 1: Install `ng-action-outlet`

You can use either **npm** or **yarn** command-line tool.
Choose the tool that is appropriate for your project.

#### NPM

`npm install @ng-action-outlet/core`

#### YARN

`yarn add @ng-action-outlet/core`

### Step 2: Import `ActionOutletModule`

Import Action Outlet **NgModule** to your Angular module

```typescript
import { ActionOutletModule } from '@ng-action-outlet/core';

Expand All @@ -39,9 +49,11 @@ export class ExampleModule { }
```

### Step 3: Define what component to use with what action

Use providers to set default components for each action to be used for rendering.
Provide action class and use value pointing to your component class,
so that action outlet can associate component to provided action.

```typescript
import { ActionOutletModule, ActionButton, ActionGroup, ActionToggle } from '@ng-action-outlet/core';

Expand All @@ -68,8 +80,10 @@ export class ExampleModule { }
```

### Step 4: Override default's in your component

In order to override your default settings, do the same as initially in a module,
but only for actions that you actually wish to change.

```typescript
import { ActionToggle } from '@ng-action-outlet/core';

Expand All @@ -87,15 +101,17 @@ export class ExampleComponent { }
```

### Step 5: Create action instances

Create actions in a component class so that they can be accessed from the template.

```typescript
import { ActionOutletFactory } from '@ng-action-outlet/core';

@Component(...)
export class ExampleComponent implements OnInit {
...
group: ActionGroup;

constructor(private actionOutlet: ActionOutletFactory) { }

ngOnInit() {
Expand All @@ -109,15 +125,17 @@ export class ExampleComponent implements OnInit {
```

### Step 6: Render the actions

Bind created actions to `actionOutlet` renderer directive.

```html
<ng-container *actionOutlet="group"></ng-container>
```

## Available actions

* [ActionButton](https://klemenoslaj.github.io/ng-action-outlet/classes/ActionButton.html)
* [ActionGroup](https://klemenoslaj.github.io/ng-action-outlet/classes/ActionGroup.html)
* [ActionToggle](https://klemenoslaj.github.io/ng-action-outlet/classes/ActionToggle.html)
- [ActionButton](https://klemenoslaj.github.io/ng-action-outlet/classes/ActionButton.html)
- [ActionGroup](https://klemenoslaj.github.io/ng-action-outlet/classes/ActionGroup.html)
- [ActionToggle](https://klemenoslaj.github.io/ng-action-outlet/classes/ActionToggle.html)

In order to create custom action class, refer to [ActionAbstract](./classes/ActionAbstract.html) class.
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build:core": "ng build core",
"docs:coverage": "compodoc -p ./tsconfig.docs.json --disableLifeCycleHooks --disableInternal --coverageMinimumPerFile 100",
"docs:build.prod": "yarn docs:coverage && compodoc -p ./tsconfig.docs.json --disableLifeCycleHooks --disableInternal --disablePrivate --disableProtected --name NgActionOutlet --output docs",
"docs:build.serve": "compodoc -p ./tsconfig.docs.json --disableLifeCycleHooks --disableInternal -s -w"
"docs:build.serve": "compodoc -p ./tsconfig.docs.json --disableLifeCycleHooks --disableInternal -s -w",
"lint:md": "remark ."
},
"private": true,
"dependencies": {
Expand Down Expand Up @@ -54,6 +55,8 @@
"karma-jasmine-html-reporter": "^0.2.2",
"ng-packagr": "^4.4.0",
"protractor": "~5.4.0",
"remark-cli": "^6.0.1",
"remark-preset-lint-recommended": "^3.0.2",
"semantic-release": "^15.10.5",
"ts-node": "~7.0.0",
"tsickle": ">=0.29.0",
Expand All @@ -74,6 +77,11 @@
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"remarkConfig": {
"plugins": [
"remark-preset-lint-recommended"
]
},
"engines": {
"node": ">= 8.12.0",
"yarn": ">= 1.10.1"
Expand Down
Loading

0 comments on commit d525d61

Please sign in to comment.