Global

Members

(constant) baseConfig

Write config file if not exist
Source:

(constant) cmdEntries

command sample : node app
Source:

(constant) config

Read config
Source:

errors

Valid config values
Source:

Methods

addCustomCSS()

Create custom.css file & update config about it
Source:

addRecordType(name, color)

Add a record type to config
Source:
Parameters:
Name Type Description
name string Type name.
color string Type color : hexa, rgb or color name.

addView(name, key)

Add a view key to config
Source:
Parameters:
Name Type Description
name string View name.
key string Base64 encoded string.

catchLinksFromContent(fileContent) → {array}

Catch links from Mardown file content
Source:
Parameters:
Name Type Description
fileContent string Mardown file content
Returns:
Type:
array
- Objets array : links with type & target id

catchQuoteKeys(fileContent) → {object}

Get all quoting keys from a file
Source:
Parameters:
Name Type Description
fileContent string Markdown content
Returns:
Type:
object
- All quoting keys and for each the linked ids & attributes

citeprocModeIsActive() → {bool}

Check the 'citeproc' mode can be on
Source:
Returns:
Type:
bool

colors()

Templating & create stylesheet with types from config
Source:
Add Mardown attributes to valid links into file content Leave disabled links as simple text
Source:
Parameters:
Name Type Description
content string Mardown file content
file object File after links parsing
Returns:
Type:
string
- Mardown content with converted links

convertQuoteKeys(fileContent, fileQuoteKeys) → {string}

Replace each quoting key from the file content by a short quote from library
Source:
Parameters:
Name Type Description
fileContent string Markdown content
fileQuoteKeys object All quoting keys and for each the linked ids & attributes
Returns:
Type:
string
- File content with the short quotes

cosmoscope(files, entities, historyPath)

Templating & create the Cosmoscope.html file
Source:
Parameters:
Name Type Description
files array All files array, for gen. records
entities object Nodes and links, for gen graph
historyPath string History save path

findFileMeta(fileId) → {array}

Find file metas by its id
Source:
Parameters:
Name Type Description
fileId int File after links & backlinks parsing
Returns:
Type:
array
- List of metas

genBibliography(fileQuoteKeys) → {string}

Get the bibliography for a file for each contained quote & from the library
Source:
Parameters:
Name Type Description
fileQuoteKeys object All quoting keys and for each the linked ids & attributes
Returns:
Type:
string
- Bibliography HTML

genMdFile(title, type, tags)

Generate Mardown record
Source:
Parameters:
Name Type Description
title string Record title.
type string Record type.
tags string Record tags, seperated by comas witout spaces.

getCitationsFromKey(quoteKeys) → {string}

From all quoting keys get linked ids & attributes
Source:
Parameters:
Name Type Description
quoteKeys object All quoting keys and for each the linked ids & attributes
Returns:
Type:
string
- List of keys linked ids & attributes

getConnectedIds(nodeId) → {array}

Get connected links & backlinks from a node
Source:
Parameters:
Name Type Description
nodeId int File id
Returns:
Type:
array
- Links and backlinks ids list

getConnectionLevels(nodeId) → {array}

Find nodes connected around a single one on several levels Get data 'focus mode'
Source:
Parameters:
Name Type Description
nodeId number File id
Returns:
Type:
array
- Array of arrays : contain one array per connection level

getCSL(fileQuotesIds) → {string}

Get 'citeproc' engine, from library and config files (XML, CSL)
Source:
Parameters:
Name Type Description
fileQuotesIds object All quoting keys, without their attributes
Returns:
Type:
string
- Bibliography HTML

getLinkStyle(linkType) → {object}

Get link stroke and color according to the type config
Source:
Parameters:
Name Type Description
linkType string Link type extract from his registration
Returns:
Type:
object
- Shape and color paramters

getRank(backLinkNb, linkNb) → {number}

Get node rank from number of links & backlinks
Source:
Parameters:
Name Type Description
backLinkNb number Number of backlinks
linkNb number Number of links
Returns:
Type:
number
- Rank

modifyExportPath(path)

Change Cosmoscope export folder path
Source:
Parameters:
Name Type Description
path string Path to export folder.

modifyImportPath(path)

Change import folder path
Source:
Parameters:
Name Type Description
path string Path to import folder.
Add its type to a link & turn its target id to int value
Source:
Parameters:
Name Type Description
link string The wikilink content, '***' from '[[***]]'
Returns:
Type:
object
- Object : link type & target

puslishModeIsActive() → {boolean}

If the prompt command contains flag --publish or -p and the 'metas' from config is not undefined
Source:
Returns:
Type:
boolean

register(logs, historyPath)

Templating & create the logs file into history
Source:
Parameters:
Name Type Description
logs object Objets contain errors & warnings arrays
historyPath string Path for history folder
Feed entities.edges object with link object
Source:
Parameters:
Name Type Description
file object File after links parsing

registerNodes(file)

Feed entities.nodes object with node object
Source:
Parameters:
Name Type Description
file object File after links & backlinks crop

registerTags(fileTagList, fileId)

Feed tags object with file tags
Source:
Parameters:
Name Type Description
fileTagList array Tags list
fileId int File id

registerType(fileType, fileId)

Feed types object with file type
Source:
Parameters:
Name Type Description
fileType array File type
fileId int File id

show(logs)

Show errors & warnings into terminal (limited lines)
Source:
Parameters:
Name Type Description
logs object Objets contain errors & warnings arrays