Installation
Quick Take
Idea
When copywriting, typically you have a to-do list of keywords to place and a word length requirement.
This program:
- counts which keywords from to-do list have been mentioned
- counts the words
- calculates to-do label length compensation, necessary to list something on the right along the same axis
- supports one or more copy chunks to evaluate against
In short, it automates a keyword-oriented copywriting environment.
API — editor()
The main function editor()
is imported like this:
It’s a function which takes two input arguments:
Input argument | Type | Obligatory | Description |
---|---|---|---|
todo Type: String Obligatory: yes | |||
todo | String | yes | To-do keyword list in markdown |
copy Type: String Obligatory: yes | |||
copy | String | yes | One or more markdown chunks of copy, separated by “---” |
The function will return a plain object of a shape:
Key’s name | Type | Description |
---|---|---|
todoLines Type: Array of plain objects | ||
todoLines | Array of plain objects | Array of results, one for each todo line. |
chunkWordCounts Type: Array of numbers | ||
chunkWordCounts | Array of numbers | Array of lengths, one for each copy chunk. Separate the chunks by ”--- “. |
todoTotal Type: Number or zero | ||
todoTotal | Number or zero | Total of todo lines interpreted by the program as to-do list entries (starts with ”- “, dash-space). |
completion Type: Number array | ||
completion | Number array | The result. |
log Type: Plain object | ||
log | Plain object | Various statistics. |
Each todoLines
plain object has the following shape:
Key’s name | Type | Description |
---|---|---|
extracted Type: String | ||
extracted | String | Whole to-do label extracted and trimmed. Can be multiple words. |
length Type: Number | ||
length | Number | String length of extracted label. |
counts Type: Array of numbers | ||
counts | Array of numbers | How many times this keyword has been met in each chunk in copy . |
lengthCompensation Type: Number | ||
lengthCompensation | Number | Counting continuous list rows, how much does this line needs to be extended to align something on the right on the even axis? |
API — version
You can import version
: