Browse Source

Setup deploy scripts

pull/1287/head
Artur Arseniev 8 years ago
parent
commit
564cf1ebf4
  1. 1
      .gitignore
  2. 37
      docs/api/panels.md
  3. 32
      docs/deploy.sh
  4. 4
      package.json

1
.gitignore

@ -18,3 +18,4 @@ node_modules/
bower_components/ bower_components/
grapesjs-*.tgz grapesjs-*.tgz
_index.html _index.html
docs/.vuepress/dist

37
docs/api/panels.md

@ -27,15 +27,6 @@ const panelManager = editor.Panels;
- [getPanelsEl][8] - [getPanelsEl][8]
- [removePanel][9] - [removePanel][9]
- [removeButton][10] - [removeButton][10]
- [render][11]
## init
Initialize module. Automatically called with a new instance of the editor
### Parameters
- `config` **[Object][12]** Configurations
## getPanels ## getPanels
@ -47,7 +38,7 @@ Returns **Collection** Collection of panel
Returns panels element Returns panels element
Returns **[HTMLElement][13]** Returns **[HTMLElement][11]**
## addPanel ## addPanel
@ -75,7 +66,7 @@ Remove a panel from the collection
### Parameters ### Parameters
- `panel` **([Object][12] | Panel | [String][14])** Object with right properties or an instance of Panel or Painel id - `panel` **([Object][12] | Panel | [String][13])** Object with right properties or an instance of Panel or Painel id
### Examples ### Examples
@ -97,7 +88,7 @@ Get panel by ID
### Parameters ### Parameters
- `id` **[string][14]** Id string - `id` **[string][13]** Id string
### Examples ### Examples
@ -113,7 +104,7 @@ Add button to the panel
### Parameters ### Parameters
- `panelId` **[string][14]** Panel's ID - `panelId` **[string][13]** Panel's ID
- `button` **([Object][12] | Button)** Button object or instance of Button - `button` **([Object][12] | Button)** Button object or instance of Button
### Examples ### Examples
@ -152,8 +143,8 @@ Remove button from the panel
### Parameters ### Parameters
- `panelId` **[string][14]** Panel's ID - `panelId` **[string][13]** Panel's ID
- `button` **([Object][12] | Button | [String][14])** Button object or instance of Button or button id - `button` **([Object][12] | Button | [String][13])** Button object or instance of Button or button id
### Examples ### Examples
@ -178,8 +169,8 @@ Get button from the panel
### Parameters ### Parameters
- `panelId` **[string][14]** Panel's ID - `panelId` **[string][13]** Panel's ID
- `id` **[string][14]** Button's ID - `id` **[string][13]** Button's ID
### Examples ### Examples
@ -189,12 +180,6 @@ var button = panelManager.getButton('myPanel','myButton');
Returns **(Button | null)** Returns **(Button | null)**
## render
Render panels and buttons
Returns **[HTMLElement][13]**
[1]: https://github.com/artf/grapesjs/blob/master/src/panels/config/config.js [1]: https://github.com/artf/grapesjs/blob/master/src/panels/config/config.js
[2]: #addpanel [2]: #addpanel
@ -215,10 +200,8 @@ Returns **[HTMLElement][13]**
[10]: #removeButton [10]: #removeButton
[11]: #render [11]: https://developer.mozilla.org/docs/Web/HTML/Element
[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object [12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[13]: https://developer.mozilla.org/docs/Web/HTML/Element [13]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

32
docs/deploy.sh

@ -0,0 +1,32 @@
#!/usr/bin/env sh
# abort on errors
set -e
# build
npm run docs:build-vp
# navigate into the build output directory
cd docs/.vuepress/dist
# I need to deploy all the documentation inside docs folder
mkdir docs-new
# move all the files from the current directory in docs
mv `\ls -1 ./ | grep -v docs-new` ./docs-new
# fetch the current site, remove the old docs dir and make current the new one
git clone -b gh-pages https://github.com/artf/grapesjs.git
rm -fR docs
mv ./docs-new ./docs
# stage all and commit
git add -A
git commit -m 'deploy docs'
# git push -f git@github.com:artf/grapesjs.git master:gh-pages
# git push -f git@github.com:artf/grapesjs.git gh-pages
surge --domain closed-harmony.surge.sh
cd -

4
package.json

@ -92,7 +92,9 @@
"scripts": { "scripts": {
"docs": "vuepress dev docs", "docs": "vuepress dev docs",
"docs:api": "node docs/api.js", "docs:api": "node docs/api.js",
"docs:build": "npm run docs:api && vuepress build docs", "docs:build-vp": "vuepress build docs",
"docs:build": "npm run docs:api && npm run docs:build-vp",
"docs:deploy": "docs/deploy.sh",
"lint": "eslint src", "lint": "eslint src",
"check": "npm run lint && npm run test", "check": "npm run lint && npm run test",
"precommit": "lint-staged", "precommit": "lint-staged",

Loading…
Cancel
Save