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 |
|---|---|---|---|
todoType: String Obligatory: yes | |||
todo | String | yes | To-do keyword list in markdown |
copyType: 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 |
|---|---|---|
todoLinesType: Array of plain objects | ||
todoLines | Array of plain objects | Array of results, one for each todo line. |
chunkWordCountsType: Array of numbers | ||
chunkWordCounts | Array of numbers | Array of lengths, one for each copy chunk. Separate the chunks by ”---“. |
todoTotalType: Number or zero | ||
todoTotal | Number or zero | Total of todo lines interpreted by the program as to-do list entries (starts with ”- “, dash-space). |
completionType: Number array | ||
completion | Number array | The result. |
logType: Plain object | ||
log | Plain object | Various statistics. |
Each todoLines plain object has the following shape:
| Key’s name | Type | Description |
|---|---|---|
extractedType: String | ||
extracted | String | Whole to-do label extracted and trimmed. Can be multiple words. |
lengthType: Number | ||
length | Number | String length of extracted label. |
countsType: Array of numbers | ||
counts | Array of numbers | How many times this keyword has been met in each chunk in copy. |
lengthCompensationType: 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: