2015-07-13 12:09:03 +08:00
/ * *
* Created by Tivie on 13 - 07 - 2015.
* /
2017-01-31 13:46:25 +08:00
function getDefaultOpts ( simple ) {
2015-07-13 12:09:03 +08:00
'use strict' ;
var defaultOptions = {
omitExtraWLInCodeBlocks : {
2016-07-21 05:26:15 +08:00
defaultValue : false ,
2015-07-13 12:09:03 +08:00
describe : 'Omit the default extra whiteline added to code blocks' ,
type : 'boolean'
} ,
noHeaderId : {
2016-07-21 05:26:15 +08:00
defaultValue : false ,
2015-07-13 12:09:03 +08:00
describe : 'Turn on/off generated header id' ,
type : 'boolean'
} ,
prefixHeaderId : {
2016-07-21 05:26:15 +08:00
defaultValue : false ,
2017-08-07 01:19:46 +08:00
describe : 'Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic \'section-\' prefix' ,
2015-07-13 12:09:03 +08:00
type : 'string'
} ,
2017-08-07 01:19:46 +08:00
rawPrefixHeaderId : {
defaultValue : false ,
describe : 'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)' ,
type : 'boolean'
} ,
2016-12-31 03:01:44 +08:00
ghCompatibleHeaderId : {
defaultValue : false ,
2016-12-31 03:46:46 +08:00
describe : 'Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)' ,
2017-01-06 10:42:47 +08:00
type : 'boolean'
2016-12-31 03:01:44 +08:00
} ,
2017-08-07 00:45:04 +08:00
rawHeaderId : {
defaultValue : false ,
describe : 'Remove only spaces, \' and " from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids' ,
type : 'boolean'
} ,
2015-07-13 12:09:03 +08:00
headerLevelStart : {
2016-07-21 05:26:15 +08:00
defaultValue : false ,
2015-07-13 12:09:03 +08:00
describe : 'The header blocks level start' ,
type : 'integer'
} ,
parseImgDimensions : {
2016-07-21 05:26:15 +08:00
defaultValue : false ,
2015-07-13 12:09:03 +08:00
describe : 'Turn on/off image dimension parsing' ,
type : 'boolean'
} ,
simplifiedAutoLink : {
2016-07-21 05:26:15 +08:00
defaultValue : false ,
2015-07-13 12:09:03 +08:00
describe : 'Turn on/off GFM autolink style' ,
type : 'boolean'
} ,
2016-12-01 23:25:46 +08:00
excludeTrailingPunctuationFromURLs : {
defaultValue : false ,
describe : 'Excludes trailing punctuation from links generated with autoLinking' ,
type : 'boolean'
} ,
2015-07-13 12:09:03 +08:00
literalMidWordUnderscores : {
2016-07-21 05:26:15 +08:00
defaultValue : false ,
2015-07-13 12:09:03 +08:00
describe : 'Parse midword underscores as literal underscores' ,
type : 'boolean'
} ,
2017-04-05 23:25:20 +08:00
literalMidWordAsterisks : {
defaultValue : false ,
describe : 'Parse midword asterisks as literal asterisks' ,
type : 'boolean'
} ,
2015-07-13 12:09:03 +08:00
strikethrough : {
2016-07-21 05:26:15 +08:00
defaultValue : false ,
2015-07-13 12:09:03 +08:00
describe : 'Turn on/off strikethrough support' ,
type : 'boolean'
} ,
tables : {
2016-07-21 05:26:15 +08:00
defaultValue : false ,
2015-07-13 12:09:03 +08:00
describe : 'Turn on/off tables support' ,
type : 'boolean'
} ,
tablesHeaderId : {
2016-07-21 05:26:15 +08:00
defaultValue : false ,
2015-07-13 12:09:03 +08:00
describe : 'Add an id to table headers' ,
type : 'boolean'
} ,
ghCodeBlocks : {
2016-07-21 05:26:15 +08:00
defaultValue : true ,
2015-07-13 12:09:03 +08:00
describe : 'Turn on/off GFM fenced code blocks support' ,
type : 'boolean'
} ,
tasklists : {
2016-07-21 05:26:15 +08:00
defaultValue : false ,
2015-07-13 12:09:03 +08:00
describe : 'Turn on/off GFM tasklist support' ,
type : 'boolean'
2015-07-15 00:10:52 +08:00
} ,
smoothLivePreview : {
2016-07-21 05:26:15 +08:00
defaultValue : false ,
2015-07-15 00:10:52 +08:00
describe : 'Prevents weird effects in live previews due to incomplete input' ,
type : 'boolean'
2016-06-07 08:23:52 +08:00
} ,
smartIndentationFix : {
2016-07-21 05:26:15 +08:00
defaultValue : false ,
2016-11-11 15:57:56 +08:00
description : 'Tries to smartly fix indentation in es6 strings' ,
2016-06-07 08:23:52 +08:00
type : 'boolean'
2016-11-11 16:15:24 +08:00
} ,
disableForced4SpacesIndentedSublists : {
defaultValue : false ,
description : 'Disables the requirement of indenting nested sublists by 4 spaces' ,
type : 'boolean'
2016-12-01 02:04:17 +08:00
} ,
simpleLineBreaks : {
defaultValue : false ,
description : 'Parses simple line breaks as <br> (GFM Style)' ,
type : 'boolean'
2016-12-17 14:01:15 +08:00
} ,
requireSpaceBeforeHeadingText : {
defaultValue : false ,
description : 'Makes adding a space between `#` and the header text mandatory (GFM Style)' ,
type : 'boolean'
2017-01-06 12:33:12 +08:00
} ,
ghMentions : {
defaultValue : false ,
description : 'Enables github @mentions' ,
type : 'boolean'
2017-01-28 03:03:37 +08:00
} ,
2017-01-28 12:28:50 +08:00
ghMentionsLink : {
defaultValue : 'https://github.com/{u}' ,
description : 'Changes the link generated by @mentions. Only applies if ghMentions option is enabled.' ,
type : 'string'
} ,
2017-01-28 03:03:37 +08:00
encodeEmails : {
defaultValue : true ,
description : 'Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities' ,
type : 'boolean'
2017-03-31 07:25:40 +08:00
} ,
openLinksInNewWindow : {
defaultValue : false ,
description : 'Open all links in new windows' ,
type : 'boolean'
2017-06-02 11:48:53 +08:00
} ,
backslashEscapesHTMLTags : {
defaultValue : false ,
description : 'Support for HTML Tag escaping. ex: \<div>foo\</div>' ,
type : 'boolean'
2017-10-24 20:44:49 +08:00
} ,
emoji : {
defaultValue : false ,
description : 'Enable emoji support. Ex: `this is a :smile: emoji`' ,
type : 'boolean'
2017-10-24 23:46:40 +08:00
} ,
underline : {
defaultValue : false ,
description : 'Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`' ,
type : 'boolean'
2017-12-10 12:49:24 +08:00
} ,
2017-12-10 15:15:09 +08:00
completeHTMLDocument : {
2017-12-10 12:49:24 +08:00
defaultValue : false ,
description : 'Outputs a complete html document, including `<html>`, `<head>` and `<body>` tags' ,
type : 'boolean'
2017-12-10 15:15:09 +08:00
} ,
metadata : {
defaultValue : false ,
description : 'Enable support for document metadata (defined at the top of the document between `«««` and `»»»` or between `---` and `---`).' ,
type : 'boolean'
2015-07-13 12:09:03 +08:00
}
} ;
if ( simple === false ) {
return JSON . parse ( JSON . stringify ( defaultOptions ) ) ;
}
var ret = { } ;
for ( var opt in defaultOptions ) {
if ( defaultOptions . hasOwnProperty ( opt ) ) {
2016-07-21 05:26:15 +08:00
ret [ opt ] = defaultOptions [ opt ] . defaultValue ;
2015-07-13 12:09:03 +08:00
}
}
return ret ;
}
2016-12-23 17:29:58 +08:00
2017-01-31 13:46:25 +08:00
function allOptionsOn ( ) {
2016-12-23 17:29:58 +08:00
'use strict' ;
var options = getDefaultOpts ( true ) ,
ret = { } ;
for ( var opt in options ) {
if ( options . hasOwnProperty ( opt ) ) {
ret [ opt ] = true ;
}
}
return ret ;
}