This repository was archived by the owner on Mar 14, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +40
-13
lines changed
Expand file tree Collapse file tree 6 files changed +40
-13
lines changed Original file line number Diff line number Diff line change 11# GitBook Plugin: Advanced Emoji
22
3- Transforms emoji like ` :white_check_mark: ` into emoji images.
3+ Transforms emojis like ` :white_check_mark: ` into real : white_check_mark : emoji images using [ emojify.js ] ( https://github.com/hassankhan/emojify.js ) .
44
5+ ## Installation
56
67You can install this plugin via npm:
78
@@ -17,8 +18,18 @@ Be sure to activate the option from the `book.json` file:
1718}
1819```
1920
21+ Then run ` gitbook install ` followed by either ` gitbook serve ` or ` gitbook build `
2022
2123
2224## License
2325
24- Apache License Version 2.0,
26+ * https://github.com/codeclou/gitbook-plugin-advanced-emoji is licensed under MIT License
27+ * https://github.com/hassankhan/emojify.js is licensed under MIT License
28+
29+ ## Publishing to npmjs.com
30+
31+ ```
32+ npm install # install dependencies
33+ npm run pre-publish # copies emoji pngs and css to assets folder
34+ npm run publish # publishes to npmjs.com
35+ ```
Original file line number Diff line number Diff line change 1+ emojify.css
2+ emojis
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11module . exports = {
22 website : {
3- assets : "./node_modules/emojify.js/dist/images/basic/ " ,
3+ assets : "./assets " ,
44 js : [ ] ,
55 css : [
6- "plugin .css"
6+ "emojify .css"
77 ]
88 } ,
99
@@ -12,7 +12,7 @@ module.exports = {
1212 hooks : {
1313 "page:before" : function ( page ) {
1414 var emojify = require ( "emojify.js" ) ;
15- emojify . setConfig ( { img_dir : '/gitbook/plugins/gitbook-plugin-advanced-emoji/' } ) ;
15+ emojify . setConfig ( { img_dir : '/gitbook/plugins/gitbook-plugin-advanced-emoji/emojis/ ' } ) ;
1616 page . content = emojify . replace ( page . content ) ;
1717 return page ;
1818 }
Original file line number Diff line number Diff line change 22 "name" : " gitbook-plugin-advanced-emoji" ,
33 "description" : " Shows the common emojis used on GitHub" ,
44 "main" : " index.js" ,
5- "version" : " 0.0.6 " ,
5+ "version" : " 0.1.0 " ,
66 "engines" : {
77 "gitbook" : " >=2.5.0"
88 },
2626 },
2727 "dependencies" : {
2828 "emojify.js" : " ^1.1.0"
29+ },
30+ "scripts" : {
31+ "pre-publish" : " node ./pre-publish.js"
32+ },
33+ "devDependencies" : {
34+ "fs-extra" : " ^0.26.2"
2935 }
3036}
Original file line number Diff line number Diff line change 1+ var fse = require ( 'fs-extra' ) ;
2+
3+ fse . copy ( './node_modules/emojify.js/dist/images/basic' , './assets/emojis' , function ( err ) {
4+ if ( err ) {
5+ return console . error ( err ) ;
6+ }
7+ console . log ( "success!" ) ;
8+ } ) ;
9+
10+ fse . copy ( './node_modules/emojify.js/dist/css/basic/emojify.css' , './assets/emojify.css' , function ( err ) {
11+ if ( err ) {
12+ return console . error ( err ) ;
13+ }
14+ console . log ( "success!" ) ;
15+ } ) ;
You can’t perform that action at this time.
0 commit comments