1
1
[ ![ NPM] [ npm ]] [ npm-url ]
2
- [ ![ Node ] [ node ]] [ node -url]
3
- [ ![ Dependencies ] [ deps ]] [ deps -url]
4
- [ ![ DevDependencies ] [ devdeps ]] [ devdeps -url]
2
+ [ ![ Deps ] [ deps ]] [ deps -url]
3
+ [ ![ Tests ] [ travis ]] [ travis -url]
4
+ [ ![ Coverage ] [ cover ]] [ cover -url]
5
5
[ ![ Standard Code Style] [ style ]] [ style-url ]
6
6
7
7
<div align =" center " >
8
- <img width =" 220 " title =" Electron " src =" https://worldvectorlogo.com/logos/electron-4.svg " />
8
+ <img width =" 260 " title =" Electron " src =" https://worldvectorlogo.com/logos/electron-4.svg " />
9
9
<img width =" 220 " height =" 125 " title =" PostHTML " src =" http://posthtml.github.io/posthtml/logo.svg " >
10
+ <h1 >Electron PostHTML Plugin</h1 >
10
11
</div >
11
12
12
13
## Install
13
14
14
15
``` bash
15
- $ npm i -S electron-posthtml
16
+ npm i -S electron-posthtml
16
17
```
17
18
18
19
## Usage
20
+
19
21
This modules intercepts the ** _ file://_ ** Protocol using [ Electrons Protocol API] [ api ] . All HTML files will automatically processed by PostHTML.
20
22
21
23
[ api ] : http://electron.atom.io/docs/api/protocol/
22
24
23
25
``` js
24
26
' use strict'
25
27
26
- const { app , BrowserWindow } = require (' electron' )
28
+ import { app , BrowserWindow } from ' electron'
29
+ import posthtml from ' electron-posthtml'
27
30
28
- // Load PostHTML
29
- require ( ' electron- posthtml' ) ([/* Plugins */ ])
31
+ // Use PostHTML
32
+ posthtml ([/* Plugins */ ])
30
33
31
34
app .on (' ready' , () => {
32
- let view = new BrowserWindow ({ width: 800 , height: 600 })
35
+ const view = new BrowserWindow ({ width: 800 , height: 600 })
33
36
34
- view .loadUrl (' file://' + __dirname + ' /index.html' )
37
+ view .loadUrl (` file://${ __dirname } /index.html` )
35
38
})
36
39
```
37
40
@@ -41,7 +44,7 @@ app.on('ready', () => {
41
44
42
45
> MIT License (MIT)
43
46
44
- > Copyright (c) 2016 Michael Ciniawsky
47
+ > Copyright (c) 2016 PostHTML Michael Ciniawsky < michael.ciniawsky@gmail.com >
45
48
46
49
> Permission is hereby granted, free of charge, to any person obtaining a copy
47
50
of this software and associated documentation files (the "Software"), to deal
@@ -64,35 +67,14 @@ SOFTWARE.
64
67
[ npm ] : https://img.shields.io/npm/v/electron-posthtml.svg
65
68
[ npm-url ] : https://npmjs.com/package/electron-posthtml
66
69
67
- [ node ] : https://img.shields.io/node/v/gh-badges.svg?maxAge=2592000
68
- [ node-url ] : https://nodejs.org
69
-
70
70
[ deps ] : https://david-dm.org/posthtml/electron-posthtml.svg
71
71
[ deps-url ] : https://david-dm.org/posthtml/electron-posthtml
72
72
73
- [ devdeps ] : https://david-dm.org/posthtml/electron-posthtml/dev-status.svg
74
- [ devdeps-url ] : https://david-dm.org/posthtml/electron-posthtml#info=devDependencies
75
-
76
73
[ style ] : https://img.shields.io/badge/code%20style-standard-yellow.svg
77
74
[ style-url ] : http://standardjs.com/
78
75
79
76
[ travis ] : http://img.shields.io/travis/posthtml/electron-posthtml.svg
80
77
[ travis-url ] : https://travis-ci.org/posthtml/electron-posthtml
81
78
82
- [ travis-rel ] : http://img.shields.io/travis/posthtml/electron-posthtml.svg?branch=release/1.0.0
83
- [ travis-rel-url ] :https://travis-ci.org/posthtml/electron-posthtml?branch=release/1.0.0
84
-
85
- [ travis-dev ] : http://img.shields.io/travis/posthtml/electron-posthtml.svg?branch=develop
86
- [ travis-dev-url ] : https://travis-ci.org/posthtml/electron-posthtml?branch=develop
87
-
88
79
[ cover ] : https://coveralls.io/repos/github/posthtml/electron-posthtml/badge.svg?branch=master
89
80
[ cover-url ] : https://coveralls.io/github/posthtml/electron-posthtml?branch=master
90
-
91
- [ cover-rel ] : https://coveralls.io/repos/github/posthtml/electron-posthtml/badge.svg?branch=release/1.0.0
92
- [ cover-rel-url ] : https://coveralls.io/github/posthtml/electron-posthtml?branch=release/1.0.0
93
-
94
- [ cover-dev ] : https://coveralls.io/repos/github/posthtml/electron-posthtml/badge.svg?branch=develop
95
- [ cover-dev-url ] : https://coveralls.io/github/posthtml/electron-posthtml?branch=develop
96
-
97
- [ license ] : https://img.shields.io/github/license/posthtml/electron-posthtml.svg
98
- [ license-url ] : https://raw.githubusercontent.com/posthtml/electron-posthtml/master/LICENSE
0 commit comments