Browse Source

Add Page to docs

pull/3670/head
Artur Arseniev 5 years ago
parent
commit
8aeec067d2
  1. 4
      docs/.vuepress/config.js
  2. 1
      docs/api.js
  3. 4
      docs/api/component.md
  4. 6
      docs/api/editor.md
  5. 40
      docs/api/page.md

4
docs/.vuepress/config.js

@ -1,6 +1,7 @@
const version = require('./../../package.json').version;
const isDev = process.argv[2] === 'dev';
const devPath = 'http://localhost:8080/dist';
const subDivider = " ‍ ‍ ‍ ";
module.exports = {
title: 'GrapesJS',
@ -63,9 +64,10 @@ module.exports = {
['/api/block_manager', 'Block Manager'],
['/api/commands', 'Commands'],
['/api/components', 'DOM Components'],
['/api/component', ' - Component'],
['/api/component', `${subDivider}Component`],
['/api/panels', 'Panels'],
['/api/pages', 'Pages'],
['/api/page', `${subDivider}Page`],
['/api/style_manager', 'Style Manager'],
['/api/storage_manager', 'Storage Manager'],
['/api/device_manager', 'Device Manager'],

1
docs/api.js

@ -24,6 +24,7 @@ const cmds = [
['canvas/index.js', 'canvas.md'],
['i18n/index.js', 'i18n.md'],
['pages/index.js', 'pages.md'],
['pages/model/Page.js', 'page.md'],
].map(entry =>
`${binRoot}documentation build ${srcRoot}/${entry[0]} -o ${docRoot}/api/${entry[1]} -f md --shallow --markdown-toc false`)
.join(' && ');

4
docs/api/component.md

@ -277,6 +277,10 @@ Returns **this**
Get the style of the component
#### Parameters
* `opts` (optional, default `{}`)
Returns **[Object][2]**
### setStyle

6
docs/api/editor.md

@ -179,6 +179,12 @@ Returns **[string][3]** CSS string
Returns JS of all components
### Parameters
* `opts` **[Object][4]** Options (optional, default `{}`)
* `opts.component` **Component?** Get the JS of a particular component
Returns **[string][3]** JS string
## getComponents

40
docs/api/page.md

@ -0,0 +1,40 @@
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## getAllFrames
Get all frames
### Examples
```javascript
const arrayOfFrames = page.getAllFrames();
```
Returns **[Array][1]\<Frame>**
## getMainFrame
Get the first frame of the page (identified always as the main one)
### Examples
```javascript
const mainFrame = page.getMainFrame();
```
Returns **Frame**
## getMainComponent
Get the root component (usually is the `wrapper` component) from the main frame
### Examples
```javascript
const rootComponent = page.getMainComponent();
console.log(rootComponent.toHTML());
```
Returns **Component**
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
Loading…
Cancel
Save