npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@lblod/ember-rdfa-editor-standard-template-plugin

v1.0.0-alpha.1

Published

RDFa editor plugin to insert standard templates in the editor

Downloads

13

Readme

@lblod/ember-rdfa-editor-standard-template-plugin

RDFa editor plugin to insert standard templates in the editor. Depending on the position of the cursor or selected text, a dropdown will appear in the toolbar of the editor that lets you insert a template for the proper context at the location of the cursor.

Compatibility

  • Ember.js v3.24 or above
  • Ember CLI v3.24 or above
  • Node.js v14 or above

Installation

ember install @lblod/ember-rdfa-editor
ember install @lblod/ember-rdfa-editor-standard-template-plugin

Configuration

Dispatcher configuration

The plugin will automatically be added in the default and all editor profiles in app/config/editor-profiles.js. Add the plugin name rdfa-editor-standard-template-plugin to other editor profiles if you want to enable the plugin in these profiles, too.

Once the plugin is configured in the appropriate editor profiles in app/config/editor-profiles.js it will be automatically be picked up by the rdfa-editor.

Template model

On installation the plugin will generate a template model. In case the host application already contains a template model, the plugin's model can be merged in the existing model using the template-model mixin.

E.g.

import Model from 'ember-data/model';
import TemplateModelMixin from '@lblod/ember-rdfa-editor-standard-template-plugin/mixins/template-model';

export default Model.extend(TemplateModelMixin, {
  // your template model here
});

Template resource used by the plugin

When creating a template in your database, the following properties are used by the plugin:

  • the title of the template (title)
  • its HTML content (content)
  • the words of the document the template should match on (matches)
  • the contexts in which it should be active (contexts)
  • the contexts in which it should not be active (disabled-in-contexts)

Note: providing multiple contexts will be processed as ( context1 OR context2 OR ... ).

RDFa context

The plugin will search for RDFa contexts in the content of the editor and the editor itself. Based on the contexts, the plugin will show possible templates to be added at the location of the cursor. E.g. if an element in the editor has the typeof="besluit:BehandelingVanAgendapunt" attribute, the plugin will show the templates related to besluit:BehandelingVanAgendapunt in the dropdown menu. This attribute can be set on an element in the content of the editor or predefined in the editor itself.

The dummy app (see "Testing" below), contains this example scenario. Start the dummy app and check out the "CustomHTML" or "CustomXML".

Testing

This plugin comes with a dummy app to test basic functionality. However, this plugin requires external data sources to populate the templates. This means you need to have a running stack of app-gelinkt-notuleren where there are routes for HTTP requests to /templates already set-up. In order for requests to be routed through correctly, you should start Ember in proxy mode, pointing to the Gelinkt Notuleren stack, e.g.:

ember serve --proxy http://localhost/

TODO: This could be improved by mocking the external data source with some prebuilt templates.