Open Source RWSERVE plugin
Shoulders of giantsby Read Write Tools
|This plugin is used in tandem with the |
This plugin reads a list of references generated via the
snrfilter tool. Each time the plugin is invoked a reference is pulled from the snrfilter document list and inserted into the working document at a designated target point.
A cached copy of the interscribed merge is kept in the interscribe-cache for a specified period of time and used for subsequent HTTP requests.
This plugin may be used with BLUEPHRASE documents or HTML documents.
This plugin is open source and can be used as is, or enhanced to provide additional features.
The plugin may be used together with Etags, cache-control, and content-encoding (compression).
The plugin module is available from NPM. Before proceeding, you should already have
RWSERVE configured and tested.
This module should be installed on your web server in a well-defined place, so that it can be discovered by
RWSERVE. The standard place for public domain plugins is
npm install rwserve-interscribe
Configuration is Everything
Make the software available by declaring it in the
plugins section of your configuration file. For detailed instructions on how to do this, refer to the plugins documentation on the
Read Write Tools HTTP/2 Server website.
insertion-target < div id=interscribe-target>
`*.blue` *methods=GET,HEAD *plugin=rwserve-blue
`*.blue` *methods=GET,HEAD *plugin=rwserve-interscribe
`*.html` *methods=GET,HEAD *plugin=rwserve-interscribe
- An absolute path to the directory to be used for caching the merged results. Typically this will be adjacent to the host's
- The time, in seconds, that the merged document should be kept in the cache before being recreated.
- The absolute path to the file containing the references.
- The minimum
snrScorethat must be met for a doument ref to be used. This is an integer value. Document references in the
snrfilter-filewill be discarded if their
!snrScoreis less than this.
- The HTML text that is searched for, within the current document, and used as the target point. This text should be unique within the document. If it isn't, the first occurrence will be used.
before- Keep the target text within the merged document and place it immediately before the interscribed text.
after- Keep the target text within the merged document and place it immediately after the interscribed text.
discard- Discard the target text.
- The background color to use with the interscribed text. Any HTML color format may be used, like:
gray, #777, rgb(127,127,127).
router shown above will route any
HEAD request for BLUEPHRASE and HTML document to the
`/interscribe` plugin for processing.
A full configuration file with typical settings for a server running on localhost port 7443, is included in this NPM module at
etc/interscribe-config. To use this configuration file, adjust these variables if they don't match your server setup:
|This plugin demonstrates a basic pattern that many plugins follow: |
The rwserve-interscribe plugin is licensed under the MIT License.
Copyright © 2023 Read Write Tools.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|Documentation||Read Write Hub|