0.5.0 • Published 1 year ago

@lblod/ember-rdfa-editor-table-of-contents-plugin v0.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

ember-rdfa-editor-table-of-contents-plugin

This plugin implements an auto-refreshing table of contents using an ember-rdfa-editor inline component.

How to configure the plugin

In order to enable the plugin you need to add 'rdfa-toc' to the list of plugins passed to the rdfa-editor. You can configure the plugin with a custom table of contents configuration like this:

plugins = [
  { name: 'rdfa-toc', 
    options: { 
      config: {
        sectionPredicate: 'https://say.data.gift/ns/hasPart',
        value: {
          predicate: 'https://say.data.gift/ns/heading',
        },
      },
      {
        sectionPredicate: 'https://say.data.gift/ns/hasParagraph',
        value: '§',
      }, 
    } 
  },
]

A table of contents component instance with a custom config can be inserted into the editor using:

controller.executeCommand(
      'insert-component',
      'inline-components/table-of-contents',
      {
        config: [
          {
            sectionPredicate: 'https://say.data.gift/ns/hasPart',
            value: {
              predicate: 'https://say.data.gift/ns/heading',
            },
          },
          {
            sectionPredicate: 'https://say.data.gift/ns/hasParagraph',
            value: '§',
          },
        ],
      },
      {},
      false
    );

The dummy application of this plugin contains a working example with custom configuration.

0.5.0

1 year ago

1.0.0-alpha.2

2 years ago

1.0.0-alpha.1

2 years ago

0.4.3

2 years ago

0.3.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.4.2

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago