Skip to content

ff0000-ad-tech/comment-hooks

Repository files navigation

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] -->

About

Utility for generating regex that match the Red Hook syntax.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published