- Epitelete
PERF Middleware for Editors in the Proskomma Ecosystem
- contentElementPerf :
object - blockOrGraftPerf :
object - perfSequence :
object - perfDocument :
object - bookCode :
string - bookHistory :
Object - history :
Object.<string, bookHistory> - Proskomma
Proskomma instance
- PipelineHandler
PipelineHandlers instance
PERF Middleware for Editors in the Proskomma Ecosystem
Kind: global class
- Epitelete
- new Epitelete(args)
- .history :
history - .clearPerf() ⇒
void - .sideloadPerf(bookCode, perfDocument) ⇒
Promise.<perfDocument> - .fetchPerf(bookCode) ⇒
Promise.<perfDocument> - .readPerf(bookCode, [options]) ⇒
Promise.<perfDocument> - .writePerf(bookCode, sequenceId, perfSequence) ⇒
Promise.<perfDocument> - .checkPerfSequence(perfSequence) ⇒
Array.<string> - .localBookCodes() ⇒
Array.<string> - .bookHeaders() ⇒
Object - .canUndo(bookCode) ⇒
boolean - .canRedo(bookCode) ⇒
boolean - .undoPerf(bookCode) ⇒
Promise.<?perfDocument> - .redoPerf(bookCode) ⇒
Promise.<?perfDocument> - .readUsfm(bookCode) ⇒
Promise.<string> - .makeDocumentReport(bookCode, reportName, data) ⇒
Promise.<array> - .makeDocumentsReport(reportName, data) ⇒
Promise.<object>
Returns: Epitelete - Epitelete instance
| Param | Type | Default | Description |
|---|---|---|---|
| args | Object |
constructor args | |
| [args.proskomma] | Proskomma |
a proskomma instance | |
| args.docSetId | number |
a docSetId | |
| [args.options] | object |
{} |
setting params |
| [args.options.historySize] | number |
10 |
size of history buffer |
epitelete.history : history
Kind: instance property of Epitelete
Clears docs history
Kind: instance method of Epitelete
Returns: void - void
epitelete.sideloadPerf(bookCode, perfDocument) ⇒ Promise.<perfDocument>
Loads given perf into memory
Kind: instance method of Epitelete
Returns: Promise.<perfDocument> - same sideloaded PERF document
| Param | Type | Description |
|---|---|---|
| bookCode | string |
|
| perfDocument | perfDocument |
PERF document |
epitelete.fetchPerf(bookCode) ⇒ Promise.<perfDocument>
Fetches document from proskomma instance
Kind: instance method of Epitelete
Returns: Promise.<perfDocument> - fetched PERF document
| Param | Type |
|---|---|
| bookCode | string |
epitelete.readPerf(bookCode, [options]) ⇒ Promise.<perfDocument>
Gets document from memory or fetches it if proskomma is set
Kind: instance method of Epitelete
Returns: Promise.<perfDocument> - found or fetched PERF document
| Param | Type | Description |
|---|---|---|
| bookCode | string |
|
| [options] | object |
|
| [options.readPipeline] | string |
pipeline name |
epitelete.writePerf(bookCode, sequenceId, perfSequence) ⇒ Promise.<perfDocument>
Merges a sequence with the document and saves the new modified document.
Kind: instance method of Epitelete
Returns: Promise.<perfDocument> - modified PERF document
| Param | Type | Description |
|---|---|---|
| bookCode | string |
|
| sequenceId | number |
id of modified sequence |
| perfSequence | perfSequence |
modified sequence |
?Checks Perf Sequence
Kind: instance method of Epitelete
Returns: Array.<string> - array of warnings
| Param | Type |
|---|---|
| perfSequence | perfSequence |
Get array of book codes from history
Kind: instance method of Epitelete
Returns: Array.<string> - array of bookCodes
Gets the available books for current docSet.
Kind: instance method of Epitelete
Returns: Object - an object with book codes as keys, and values
contain book header data
Checks if able to undo from specific book history
Kind: instance method of Epitelete
| Param | Type |
|---|---|
| bookCode | string |
Checks if able to redo from specific book history
Kind: instance method of Epitelete
| Param | Type |
|---|---|
| bookCode | string |
Gets previous document from history
Kind: instance method of Epitelete
Returns: Promise.<?perfDocument> - PERF document or null if can not undo
| Param | Type |
|---|---|
| bookCode | string |
Gets next document from history
Kind: instance method of Epitelete
Returns: Promise.<?perfDocument> - PERF document or null if can not redo
| Param | Type |
|---|---|
| bookCode | string |
Gets document from memory and converts it to usfm
Kind: instance method of Epitelete
Returns: Promise.<string> - converted usfm
| Param | Type |
|---|---|
| bookCode | string |
Generates and returns a report via a transform pipeline
Kind: instance method of Epitelete
Returns: Promise.<array> - A report
| Param | Type |
|---|---|
| bookCode | string |
| reportName | string |
| data | object |
Generates and returns a report for each document via a transform pipeline
Kind: instance method of Epitelete
Returns: Promise.<object> - reports for each documents with bookCode as the key
| Param | Type |
|---|---|
| reportName | string |
| data | object |
Kind: global typedef
Properties
| Name | Type |
|---|---|
| type | string |
| [number] | string |
| [subtype] | "verses" | "xref" | "footnote" | "noteCaller" |
| [target] | string |
| [nBlocks] | number |
| [previewText] | string |
Kind: global typedef
Properties
| Name | Type |
|---|---|
| type | "block" | "graft" |
| subtype | string |
| [target] | string |
| [nBlocks] | number |
| [previewText] | string |
| [firstBlockScope] | string |
| [content] | Array.<(string|contentElementPerf)> |
Kind: global typedef
Properties
| Name | Type |
|---|---|
| type | "main" | "introduction" | "introTitle" | "IntroEndTitle" | "title" | "endTitle" | "heading" | "remark" | "sidebar" | "table" | "tree" | "kv" | "footnote" | "noteCaller" | "xref" | "pubNumber" | "altNumber" | "esbCat" | "fig" | "temp" |
| [nBlocks] | number |
| [firstBlockScope] | string |
| [previewText] | string |
| selected | boolean |
| [blocks] | Array.<blockOrGraftPerf> |
Kind: global typedef
Properties
| Name | Type |
|---|---|
| headers | object |
| tags | array |
| sequences | Object.<string, perfSequence> |
| mainSequence | string |
Kind: global typedef
Kind: global typedef
Properties
| Name | Type |
|---|---|
| bookHistory.cursor | number |
| bookHistory.stack | Array.<Object> |
| bookHistory.stack[].perfDocument | perfDocument |
| bookHistory.stack[].pipelineData | Object.<string, any> |
Kind: global typedef
Proskomma instance
Kind: global typedef
See: https://github.com/mvahowe/proskomma-js
PipelineHandlers instance
Kind: global typedef
See: https://github.com/DanielC-N/pipelineHandler