scribe-plugin-link-prompt-command

WebJar for scribe-plugin-link-prompt-command

License

License

Apache 2.0
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

scribe-plugin-link-prompt-command
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

scribe-plugin-link-prompt-command
WebJar for scribe-plugin-link-prompt-command
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/guardian/scribe-plugin-link-prompt-command

Download scribe-plugin-link-prompt-command

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/scribe-plugin-link-prompt-command/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>scribe-plugin-link-prompt-command</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/scribe-plugin-link-prompt-command/
implementation 'org.webjars.bower:scribe-plugin-link-prompt-command:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.bower/scribe-plugin-link-prompt-command/
implementation ("org.webjars.bower:scribe-plugin-link-prompt-command:1.0.0")
'org.webjars.bower:scribe-plugin-link-prompt-command:jar:1.0.0'
<dependency org="org.webjars.bower" name="scribe-plugin-link-prompt-command" rev="1.0.0">
  <artifact name="scribe-plugin-link-prompt-command" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='scribe-plugin-link-prompt-command', version='1.0.0')
)
libraryDependencies += "org.webjars.bower" % "scribe-plugin-link-prompt-command" % "1.0.0"
[org.webjars.bower/scribe-plugin-link-prompt-command "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

scribe-plugin-link-prompt-command

A Scribe plugin to simplify the process of adding valid urls in links.

Status

Circle CI

Options

Validation

The validation key can be given a function that takes a string representing a URL the user wishes to add and which returns a object in the following format:

  {
    valid: boolean // whether the URL is considered valid or not
    message: string // The message to show to the user explaining why the URL is invalid
  }

Transformation

The transformation key holds two optional keys: pre and post. Each one contains an array of transform functions that take a String representing the link value and should return a String that is transformed value of the link.

The transformations are processed "left to right" or in ascending index order.

pre transforms are applied before validation. post transforms are applied just before the link value is inserted into the DOM.

Testing

Run unit tests with the following:

npm run test

Running locally

First run bower install to add the dependencies locally. Then load examples/amd.html into a browser and you should have a minimal local running version of the plugin.

Installation

bower install scribe-plugin-link-prompt-command
org.webjars.bower

The Guardian

The source code of the world's leading liberal voice

Versions

Version
1.0.0