Members
- 
    
    
Contains the delimiter used for parsing fields with multiple elements
Default:
, - 
    
    
An object containing key value pairs where the key is an identifier for the type of information, and the value is a string identifier for the discord.js MessageEmbed object function to call when creating the embed object.
Properties:
Name Type Default Description urlstring setURL Function called when setting embed url.
titlestring setTitle Function called when setting embed title.
colorstring setColor Function called when setting embed color.
authorstring setAuthor Function called when setting embed author.
descriptionstring setDescription Function called when setting embed description.
thumbnailstring setThumbnail Function called when setting embed thumbnail.
fieldsstring addFields Function called when setting embed fields.
imagestring setImage Function called when setting embed image.
timestampstring setTimestamp Function called when setting embed timestamp.
footerstring setFooter Function called when setting embed footer.
 - 
    
    
Contains an object with all key: value pairs for replacers added using
EmbedMD.setGlobalReplacer.Default:
{} - 
    
    
Contains the regexp splitter used to determine newlines
Default:
/\r\n|\n\r|\n|\r/ - 
    
    
Contains the main splitter used for parsing elements
Default:
# 
Methods
- 
    
EmbedMD._parseMD (filename, replacers, log, refresh)EmbedMD~Embed static
 - 
    
    
    
    
    
    
    
        
Name Type Default Description filenamestring The file path for the markdown file to parse
replacersobject {} optional Object in format of {replacer: value}
logboolean false optional Log the embed object to console for debugging?
refreshboolean false optional Refresh the cache and reload data?
Returns:
Type Description EmbedMD~Embed Data used for future calls to EmbedMD.getEmbed - 
    
    
    
    
    
    
    
        
Name Type Description directorystring The directory to scan for .md files
Returns:
Type Description Array.<String> An array of strings each containing a path to a .md file within the given directory.  - 
    
    
    
A handy dandy helper function to format strings using object properties
Name Type Default Description base_stringstring The string to format
replacers_objektobject {} optional The object with properties to use as replacers.
Returns:
Type Description string The formatted string after using properties from given object as replacers. Example
EmbedMD.format("Hi name!", {name: 'DekiaRPG}); // => "Hi DekitaRPG!" - 
    
    
    
    
    
    
    
        
Name Type Default Description md_embedEmbedMD~Embed An object returned from either
EmbedMD.prepareMDorEmbedMD.parseDirreplacersobject {} optional The replacer object in format of {replacer: value}
logboolean false optional Log the embed object to console for debugging?
refreshboolean false optional Refresh the cache for file and reload data?
Returns:
Type Description MessageEmbed A discord.js message embed object. See discord.js documentation for full object details.  - 
    
    
    
A helper function to map arrays of strings that contain numbers or booleans to their respective types.
Name Type Description arrayarray the array to parse
Returns:
Type Description Array.<any> A clone of array with types converted where possible. Example
EmbedMD.parseArray(['1', '5', 'false', 'some description']) // => [1, 5, false, 'some description'] - 
    
EmbedMD.parseDir (directory)Array.<EmbedMD~Embed> static
 - 
    
    
    
Scans a directory for all .md files within it, then stores each file within an internal cache using its filename as the id.
Name Type Description directorystring The directory to parse for .md files
Returns:
Type Description Array.<EmbedMD~Embed> An array of EmbedMD~Embedobjects for all .md files within given directory. - 
    
EmbedMD.prepareMD (filename, refresh_cache)EmbedMD~Embed static
 - 
    
    
    
    
    
    
    
        
Name Type Default Description filenamestring The filename.md to prepare for embed
refresh_cacheboolean false optional Should the cache for this file be refreshed?
Returns:
Type Description EmbedMD~Embed Data used for future calls to EmbedMD.getEmbed - 
    
    
    
Sets a global replacer string.(used for all md embeds)
Name Type Description stringstring optional The id string to replace globally with value.
valuestring optional The value to be replaced globally.
 - 
    
    
    
UN-Sets a global replacer string. (used for all md embeds)
Name Type Description stringstring optional The id string for the replacer to remove.
 
Type Definitions
- 
    
    
An object containing key value pairs where the key is a string identifier, and the value is an object with the properties detailed below:
Properties:
Name Type Description rawstring Contains the raw .md file data.
filenamestring Contains the filename for this data.
descriptionundefined | string Contains the parsed description string.
thumbnailundefined | string Contains the parsed thumbnail string.
timestampundefined | string Contains the timestamp of embed creation.
titleundefined | string Contains the parsed title string.
colorundefined | string Contains the parsed color string.
urlundefined | string Contains the parsed url string.
authorundefined | Array.<string> Contains the parsed author array.
footerundefined | Array.<string> Contains the parsed footer array.
fieldsundefined | Array.<object> Contains the parsed field objects array.