1.1.0 • Published 3 years ago

@ff0000-ad-tech/comment-hooks v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago
FF0000 Ad Tech

Comment Hooks

Comment-hooks are a pattern that enables text documents to define specific start/end points, so that manager applications can read & write to those locations with confidence.

This library provides an interface for:

  1. Parsing and stringifying hook addresses
  2. Generating hook regex patterns.

With these tools, the manager application has all it needs to read & write to documents which have implemented comment hooks.

Hook Address

[scope].[type].[param]

Formatting

Body Hooks

These hooks indicate a start-point and an end-point. All content between these two comments will be matched.

/*-- [scope].[type].[param].[start/end] --*/
<!-- [scope].[type].[param].[start/end] -->

Insert Hooks

These hooks only indicate a single insertion point, and should be considered write-only.

/*-- [scope].Insert.[param] --*/
<!-- [scope].Insert.[param] -->