Git Product home page Git Product logo

grapesjs-plugin-header's Introduction

Grapesjs Plugin Header

DEMO

Provide a live demo of your plugin For a better user engagement create a simple live demo by using services like JSFiddle CodeSandbox CodePen and link it here in your README (attaching a screenshot/gif will also be a plus). To help you in this process here below you will find the necessary HTML/CSS/JS, so it just a matter of copy-pasting on some of those services. After that delete this part and update the link above

HTML

<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs"></script>
<script src="https://unpkg.com/grapesjs-plugin-header"></script>

<div id="gjs"></div>

JS

const editor = grapesjs.init({
	container: '#gjs',
  height: '100%',
  fromElement: true,
  storageManager: false,
  plugins: ['grapesjs-plugin-header'],
});

CSS

body, html {
  margin: 0;
  height: 100%;
}

Summary

  • Plugin name: grapesjs-plugin-header
  • Components
    • component-id-1
    • component-id-2
    • ...
  • Blocks
    • block-id-1
    • block-id-2
    • ...

Options

Option Description Default
option1 Description option default value

Download

  • CDN
    • https://unpkg.com/grapesjs-plugin-header
  • NPM
    • npm i grapesjs-plugin-header
  • GIT
    • git clone https://github.com/olivmonnier/grapesjs-plugin-header.git

Usage

Directly in the browser

<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet"/>
<script src="https://unpkg.com/grapesjs"></script>
<script src="path/to/grapesjs-plugin-header.min.js"></script>

<div id="gjs"></div>

<script type="text/javascript">
  var editor = grapesjs.init({
      container: '#gjs',
      // ...
      plugins: ['grapesjs-plugin-header'],
      pluginsOpts: {
        'grapesjs-plugin-header': { /* options */ }
      }
  });
</script>

Modern javascript

import grapesjs from 'grapesjs';
import plugin from 'grapesjs-plugin-header';
import 'grapesjs/dist/css/grapes.min.css';

const editor = grapesjs.init({
  container : '#gjs',
  // ...
  plugins: [plugin],
  pluginsOpts: {
    [plugin]: { /* options */ }
  }
  // or
  plugins: [
    editor => plugin(editor, { /* options */ }),
  ],
});

Development

Clone the repository

$ git clone https://github.com/olivmonnier/grapesjs-plugin-header.git
$ cd grapesjs-plugin-header

Install dependencies

$ npm i

Start the dev server

$ npm start

Build the source

$ npm run build

License

MIT

grapesjs-plugin-header's People

Contributors

dependabot[bot] avatar oliviermonnier avatar olivmonnier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

grapesjs-plugin-header's Issues

Heading "size" is misleading

Headings are a structural HTML element and don't be related to any size of the characters (even if browsers display headings of h1 bigger than h2 headings). My suggestion would be to use a label "Heading" instead of "Size" and option labels of "H1", "H2", etc. so editors don't use e.g. H3 heading on top because they want a smallerheading (in terms of font-size) .

Links don't work in combination with heading

The standard GrapesJS inline link feature doesn't work for headings because the link attributes are not displayed in the traits panel so it's not possible to change the href attribute if the link is applied to a heading.

Error using a plugin

Hi,
when I install your plugin, I got error on this line:

obrazek

I got latest version of GrapesJS and latest version of your plugin.
Other plugins work fine.

Thanks, Filip

Plugin Options

Hi,

is it possible to configure the plugin options with the property "pluginsOpts" in the editor initialization ?
The other plugin have this option, and i would like to change some property like "category" or "tagName" ?

Regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.