Skip to content

lblod/ember-rdfa-editor-lblod-plugins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ember-rdfa-editor-lblod-plugins

Ember v2 addon which bundles a collection of ember-rdfa-editor plugins related to the LBLOD Project.

Compatibility

  • Ember.js 5.4+ (or 4.12+) 4.12 is no longer tested and not officially supported, but should still work for now.

  • Embroider or ember-auto-import v2

  • Node 18 or above (20+ recommended)

Installation

ember install ember-rdfa-editor-lblod-plugins

General addon information

This addon contains the following editor plugins:

You can configure your editor like this:

<EditorContainer
  @editorOptions={{hash
    showRdfa='true'
    showRdfaHighlight='true'
    showRdfaHover='true'
    showPaper='true'
    showToolbarBottom=null
  }}
  @showRdfaBlocks={{this.controller.showRdfaBlocks}}
>
  <:top>
    {...}
  </:top>
  <:default>
    <Editor
      @plugins={{this.plugins}}
      @schema={{this.schema}}
      @nodeViews={{this.nodeViews}}
      @rdfaEditorInit={{this.rdfaEditorInit}}
    />
  </:default>
  <:aside>
    {...}
  </:aside>
</EditorContainer>

You will have 2 anchor points where to put your plugins: top for a toolbar, and aside for plugin cards.

Styling

Most custom nodespecs defined by plugins define specific CSS classes to allow for them to be styled by a consuming app. These can be augmented by adding custom classes when adding nodespecs to the schema, in the way defined in the ember-rdfa-editor repo.

Embroider

To use @lblod/ember-rdfa-editor-lblod-plugins with Embroider some extra Webpack configuration is needed, which you can import like this:

// ember-cli-build.js
  // ...
  const { Webpack } = require('@embroider/webpack');
  return require('@embroider/compat').compatBuild(app, Webpack, {
    // other Embroider options
    packagerOptions: {
      webpackConfig: require('@lblod/ember-rdfa-editor-lblod-plugins/webpack-config'),
    },
    extraPublicTrees: [],
  });
};

If you already provide some Webpack configuration, you can deep merge that with the config object we provide.

Translation

Translations are provided for UI elements using ember-intl. Currently the only languages supported are English (en-US) and Dutch (nl-BE). Other languages can be added by copying the contents of the file translations/en-us.yaml into the relevant language file in your translations folder and translating all of the strings.

A helper function is provided to assist with finding a reasonable fallback locale, for example providing en-US translations if en is requested. See the test app for example of it's usage.

Contributing

See the Contributing guide for details.

Releasing

See the Release guide.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 12