diff --git a/.gitignore b/.gitignore index 8ec45878..3df5e855 100644 --- a/.gitignore +++ b/.gitignore @@ -185,4 +185,4 @@ Dependency/peg-markdown-highlight/greg/*.o-* Dependency/peg-markdown-highlight/greg/greg # Generated by build script -MacDown/Resources/Prism/* +Markly/Resources/Prism/* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 1ed67965..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,111 +0,0 @@ -# Contributing to MacDown - -## Coding Style - -All style rules are enforced under all circumstances except for external dependencies. - -### Objective-C - -#### The 80-column Rule - -All code should obey the 80-column rule. - -Exception: If a URL in a comment is too long, it can go over the limit. This happens a lot for Apple’s official documentation. Remember, however, that many websites offer alternative, shorter URL forms that are permanent. For example: - -* The title slug in StackOverflow (and other StackExchange sites) URLs can be ommitted. The following two are equivalent: - - `http://stackoverflow.com/questions/13155612/how-does-one-eliminate-objective-c-try-catch-blocks-like-this` - `http://stackoverflow.com/questions/13155612` - -* The commit hash in GitHub commit page’s URL can be shortened. The followings are all equivalent: - - `https://github.com/uranusjr/macdown/commit/1612abb9dbd24113751958777a49cffc6767989c` - `https://github.com/uranusjr/macdown/commit/1612abb9dbd24` - `https://github.com/uranusjr/macdown/commit/1612abb` - -#### Code Blocks - -* Braces go in separate lines. ([Allman style](http://en.wikipedia.org/wiki/Indent_style#Allman_style).) -* If only one statement is contained inside the block, omit braces unless... - * This is part of an if-(else if-)else structure. All brace styles in the same structure should match (i.e. either non or all of them omit braces). - -#### Stetements Inside `if`, `while`, etc. - -* Prefer implicit boolean conversion when it makes sense. - * `if (str.length)` is better than `if (str.length != 0)` if you want to know whether a string is empty. - * The same applies when checking for an object’s `nil`-ness. - * If what you want to compare against is *zero as a number*, not emptiness, such as for `NSRange` position, `NSPoint` coordinates, etc., *do* use the `== 0`/`!= 0` expression. - -* If statements need to span multiple lines, prefer putting logical operators at the *beginning* of the line. - - Yes: - ```c - while (this_is_very_long - || this_is_also_very_long) - { - // ... - } - ``` - - No: - ```c - while (this_is_very_long || - this_is_also_very_long) - { - // ... - } - ``` - -* If code alignment is ambiguious, add extra indentation. - - Yes: - ```c - if (this_is_very_long - || this_is_also_very_long) - foo++; - ``` - - No: - ```c - if (this_is_very_long - || this_is_also_very_long) - foo++; - ``` - - The above is not enforced (but recommended) if braces exist. Useful if you have a hard time fitting the statement into the 80-column constraint. - - Okay: - ```c - if (this_is_very_long - || this_is_very_very_truly_long) - { - foo++; - bar--; - } - ``` - -#### Invisible Characters - -Always use *four spaces* instead of tabs for indentation. Trailing whitespaces should be removed. You can turn on the **Automatically trim trailing whitespace** option in Xcode to let it do the job for you. - -Try to ensure that there’s a trailing newline in the end of a file. This is not strictly enforced since there are no easy ways to do that (except checking manually), but I’d appriciate the effort. - -## Version Control - -MacDown uses Git for source control, and is hosted on GitHub. - -### Commit Messages - -[General rules](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) apply. If you absolutely need to, the first line of the message *can* go as long as 72 (instead of 50) characters, but it must not exceed it. - -Xcode’s commit window does not do a good job indicating whether your commit message is well-formed. I seldom use it personally, but if you do, you can check whether the commit message is good after you push to GitHub—If you see the first line of your commit message getting truncated, it is too long. - -### Pull Requests - -Please rebase your branch to `master` when you submit the pull request. There can be some nagging bugs when Git tries to merge files that are not code, particularly `.xib` and project files. When in doubt, always consider splitting changes into smaller commits so that you won’t need to re-apply your changes when things break. - -Under certain circumstances I may wish you to perform further rebasing and/or squashing *after* you submit your pull request, or even perform them myself instead of merging your commits as-is. Don’t worry—you will always get full credits for your contribution. - -## More to Come - -This style guide is a work in progress. Please feel free to ask if you have any questions about it. I’ll add more rules if there’s ambiguity. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..74521bc8 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,18 @@ +# License + +## Original MacDown Code + +The original MacDown source code is licensed under the MIT License. +See the `LICENSE/macdown.txt` file for the full MIT License text. +Copyright (c) 2014 Tzu-ping Chung. + +## Markly Additions + +All new features, modifications, and additions made to create Markly +are Copyright (c) 2026 Alex Wirtzer. All rights reserved. + +No part of the Markly-specific code may be reproduced, distributed, +or transmitted in any form or by any means without the prior written +permission of the copyright holder. + +For licensing inquiries, contact the copyright holder. diff --git a/MacDown/Resources/Extensions/mermaid.init.js b/MacDown/Resources/Extensions/mermaid.init.js deleted file mode 100644 index 70df7dac..00000000 --- a/MacDown/Resources/Extensions/mermaid.init.js +++ /dev/null @@ -1,36 +0,0 @@ -// init mermaid - -(function () { - - mermaid.initialize({ - startOnLoad:false, - flowchart:{ - htmlLabels: false, - useMaxWidth: true - } - }); - - var init = function() { - var domAll = document.querySelectorAll(".language-mermaid"); - for (var i = 0; i < domAll.length; i++) { - var dom = domAll[i]; - var graphSource = dom.innerText || dom.textContent; - - dom = dom.parentElement; - if (dom.tagName === "PRE") { - dom = dom.parentElement; - } - - var insertSvg = function(svgCode, bindFunctions){ - this.innerHTML = svgCode; - }; - var graph = mermaid.render('graphDiv' + i, graphSource, insertSvg.bind(dom)) - } - }; - - if (typeof window.addEventListener != "undefined") { - window.addEventListener("load", init, false); - } else { - window.attachEvent("onload", init); - } -})(); diff --git a/MacDown/Resources/Prism/components.js b/MacDown/Resources/Prism/components.js new file mode 100644 index 00000000..f87b04f2 --- /dev/null +++ b/MacDown/Resources/Prism/components.js @@ -0,0 +1,624 @@ +var components = { + "core": { + "meta": { + "path": "components/prism-core.js", + "option": "mandatory" + }, + "core": "Core" + }, + "themes": { + "meta": { + "path": "themes/{id}.css", + "link": "index.html?theme={id}", + "exclusive": true + }, + "prism": { + "title": "Default", + "option": "default" + }, + "prism-dark": "Dark", + "prism-funky": "Funky", + "prism-okaidia": { + "title": "Okaidia", + "owner": "ocodia" + }, + "prism-twilight": { + "title": "Twilight", + "owner": "remybach" + }, + "prism-coy": { + "title": "Coy", + "owner": "tshedor" + }, + "prism-solarizedlight": { + "title": "Solarized Light", + "owner": "hectormatos2011 " + } + }, + "languages": { + "meta": { + "path": "components/prism-{id}", + "noCSS": true, + "examplesPath": "examples/prism-{id}", + "addCheckAll": true + }, + "markup": { + "title": "Markup", + "aliasTitles": { "html": "HTML", "xml": "XML", "svg": "SVG", "mathml": "MathML" }, + "option": "default" + }, + "css": { + "title": "CSS", + "option": "default" + }, + "clike": { + "title": "C-like", + "option": "default" + }, + "javascript": { + "title": "JavaScript", + "option": "default", + "require": "clike" + }, + + + + "abap": { + "title": "ABAP", + "owner": "dellagustin" + }, + "actionscript": { + "title": "ActionScript", + "require": "javascript", + "owner": "Golmote" + }, + "apacheconf": { + "title": "Apache Configuration", + "owner": "GuiTeK" + }, + "apl": { + "title": "APL", + "owner": "ngn" + }, + "applescript": { + "title": "AppleScript", + "owner": "Golmote" + }, + "asciidoc": { + "title": "AsciiDoc", + "owner": "Golmote" + }, + "aspnet": { + "title": "ASP.NET (C#)", + "require": "markup", + "owner": "nauzilus" + }, + "autoit": { + "title": "AutoIt", + "owner": "Golmote" + }, + "autohotkey": { + "title": "AutoHotkey", + "owner": "aviaryan" + }, + "bash": { + "title": "Bash", + "owner": "zeitgeist87" + }, + "basic": { + "title": "BASIC", + "owner": "Golmote" + }, + "batch": { + "title": "Batch", + "owner": "Golmote" + }, + "bison": { + "title": "Bison", + "require": "c", + "owner": "Golmote" + }, + "brainfuck": { + "title": "Brainfuck", + "owner": "Golmote" + }, + "c": { + "title": "C", + "require": "clike", + "owner": "zeitgeist87" + }, + "csharp": { + "title": "C#", + "require": "clike", + "owner": "mvalipour" + }, + "cpp": { + "title": "C++", + "require": "c", + "owner": "zeitgeist87" + }, + "coffeescript": { + "title": "CoffeeScript", + "require": "javascript", + "owner": "R-osey" + }, + "crystal": { + "title": "Crystal", + "require": "ruby", + "owner": "MakeNowJust" + }, + "css-extras": { + "title": "CSS Extras", + "require": "css", + "owner": "milesj" + }, + "d": { + "title": "D", + "require": "clike", + "owner": "Golmote" + }, + "dart": { + "title": "Dart", + "require": "clike", + "owner": "Golmote" + }, + "diff": { + "title": "Diff", + "owner": "uranusjr" + }, + "docker": { + "title": "Docker", + "owner": "JustinBeckwith" + }, + "eiffel": { + "title": "Eiffel", + "owner": "Conaclos" + }, + "elixir": { + "title": "Elixir", + "owner": "Golmote" + }, + "erlang": { + "title": "Erlang", + "owner": "Golmote" + }, + "fsharp": { + "title": "F#", + "require": "clike", + "owner": "simonreynolds7" + }, + "fortran": { + "title": "Fortran", + "owner": "Golmote" + }, + "gherkin": { + "title": "Gherkin", + "owner": "hason" + }, + "git": { + "title": "Git", + "owner": "lgiraudel" + }, + "glsl": { + "title": "GLSL", + "require": "clike", + "owner": "Golmote" + }, + "go": { + "title": "Go", + "require": "clike", + "owner": "arnehormann" + }, + "groovy": { + "title": "Groovy", + "require": "clike", + "owner": "robfletcher" + }, + "haml": { + "title": "Haml", + "require": "ruby", + "owner": "Golmote" + }, + "handlebars": { + "title": "Handlebars", + "require": "markup", + "owner": "Golmote" + }, + "haskell": { + "title": "Haskell", + "owner": "bholst" + }, + "haxe": { + "title": "Haxe", + "require": "clike", + "owner": "Golmote" + }, + "http": { + "title": "HTTP", + "owner": "danielgtaylor" + }, + "icon": { + "title": "Icon", + "owner": "Golmote" + }, + "inform7": { + "title": "Inform 7", + "owner": "Golmote" + }, + "ini": { + "title": "Ini", + "owner": "aviaryan" + }, + "j": { + "title": "J", + "owner": "Golmote" + }, + "jade": { + "title": "Jade", + "require": "javascript", + "owner": "Golmote" + }, + "java": { + "title": "Java", + "require": "clike", + "owner": "sherblot" + }, + "json": { + "title": "JSON", + "owner": "CupOfTea696" + }, + "julia": { + "title": "Julia", + "owner": "cdagnino" + }, + "keyman": { + "title": "Keyman", + "owner": "mcdurdin" + }, + "kotlin": { + "title": "Kotlin", + "require": "clike", + "owner": "Golmote" + }, + "latex": { + "title": "LaTeX", + "owner": "japborst" + }, + "less": { + "title": "Less", + "require": "css", + "owner": "Golmote" + }, + "lolcode": { + "title": "LOLCODE", + "owner": "Golmote" + }, + "lua": { + "title": "Lua", + "owner": "Golmote" + }, + "makefile": { + "title": "Makefile", + "owner": "Golmote" + }, + "markdown": { + "title": "Markdown", + "require": "markup", + "owner": "Golmote" + }, + "matlab": { + "title": "MATLAB", + "owner": "Golmote" + }, + "mel": { + "title": "MEL", + "owner": "Golmote" + }, + "mizar": { + "title": "Mizar", + "owner": "Golmote" + }, + "monkey": { + "title": "Monkey", + "owner": "Golmote" + }, + "nasm": { + "title": "NASM", + "owner": "rbmj" + }, + "nginx": { + "title": "nginx", + "owner": "westonganger", + "require": "clike" + }, + "nim": { + "title": "Nim", + "owner": "Golmote" + }, + "nix": { + "title": "Nix", + "owner": "Golmote" + }, + "nsis": { + "title": "NSIS", + "owner": "idleberg" + }, + "objectivec": { + "title": "Objective-C", + "require": "c", + "owner": "uranusjr" + }, + "ocaml": { + "title": "OCaml", + "owner": "Golmote" + }, + "oz": { + "title": "Oz", + "owner": "Golmote" + }, + "parigp": { + "title": "PARI/GP", + "owner": "Golmote" + }, + "parser": { + "title": "Parser", + "require": "markup", + "owner": "Golmote" + }, + "pascal": { + "title": "Pascal", + "owner": "Golmote" + }, + "perl": { + "title": "Perl", + "owner": "Golmote" + }, + "php": { + "title": "PHP", + "require": "clike", + "owner": "milesj" + }, + "php-extras": { + "title": "PHP Extras", + "require": "php", + "owner": "milesj" + }, + "powershell": { + "title": "PowerShell", + "owner": "nauzilus" + }, + "processing": { + "title": "Processing", + "require": "clike", + "owner": "Golmote" + }, + "prolog": { + "title": "Prolog", + "owner": "Golmote" + }, + "puppet": { + "title": "Puppet", + "owner": "Golmote" + }, + "pure": { + "title": "Pure", + "owner": "Golmote" + }, + "python": { + "title": "Python", + "owner": "multipetros" + }, + "q": { + "title": "Q", + "owner": "Golmote" + }, + "qore": { + "title": "Qore", + "require": "clike", + "owner": "temnroegg" + }, + "r": { + "title": "R", + "owner": "Golmote" + }, + "jsx":{ + "title": "React JSX", + "require": ["markup", "javascript"], + "owner": "vkbansal" + }, + "rest": { + "title": "reST (reStructuredText)", + "owner": "Golmote" + }, + "rip": { + "title": "Rip", + "owner": "ravinggenius" + }, + "roboconf": { + "title": "Roboconf", + "owner": "Golmote" + }, + "ruby": { + "title": "Ruby", + "require": "clike", + "owner": "samflores" + }, + "rust": { + "title": "Rust", + "owner": "Golmote" + }, + "sas": { + "title": "SAS", + "owner": "Golmote" + }, + "sass": { + "title": "Sass (Sass)", + "require": "css", + "owner": "Golmote" + }, + "scss": { + "title": "Sass (Scss)", + "require": "css", + "owner": "MoOx" + }, + "scala": { + "title": "Scala", + "require": "java", + "owner": "jozic" + }, + "scheme" : { + "title": "Scheme", + "owner" : "bacchus123" + }, + "smalltalk": { + "title": "Smalltalk", + "owner": "Golmote" + }, + "smarty": { + "title": "Smarty", + "require": "markup", + "owner": "Golmote" + }, + "sql": { + "title": "SQL", + "owner": "multipetros" + }, + "stylus" : { + "title": "Stylus", + "owner": "vkbansal" + }, + "swift": { + "title": "Swift", + "require": "clike", + "owner": "chrischares" + }, + "tcl": { + "title": "Tcl", + "owner": "PeterChaplin" + }, + "textile": { + "title": "Textile", + "require": "markup", + "owner": "Golmote" + }, + "twig": { + "title": "Twig", + "require": "markup", + "owner": "brandonkelly" + }, + "typescript":{ + "title": "TypeScript", + "require": "javascript", + "owner": "vkbansal" + }, + "verilog": { + "title": "Verilog", + "owner": "a-rey" + }, + "vhdl": { + "title": "VHDL", + "owner": "a-rey" + }, + "vim": { + "title": "vim", + "owner": "westonganger" + }, + "wiki": { + "title": "Wiki markup", + "require": "markup", + "owner": "Golmote" + }, + "yaml": { + "title": "YAML", + "owner": "hason" + } + }, + "plugins": { + "meta": { + "path": "plugins/{id}/prism-{id}", + "link": "plugins/{id}/" + }, + "line-highlight": "Line Highlight", + "line-numbers": { + "title": "Line Numbers", + "owner": "kuba-kubula" + }, + "show-invisibles": "Show Invisibles", + "autolinker": "Autolinker", + "wpd": "WebPlatform Docs", + "file-highlight": { + "title": "File Highlight", + "noCSS": true + }, + "show-language": { + "title": "Show Language", + "owner": "nauzilus" + }, + "jsonp-highlight": { + "title": "JSONP Highlight", + "noCSS": true, + "owner": "nauzilus" + }, + "highlight-keywords": { + "title": "Highlight Keywords", + "owner": "vkbansal", + "noCSS": true + }, + "remove-initial-line-feed": { + "title": "Remove initial line feed", + "owner": "Golmote", + "noCSS": true + }, + "previewer-base": { + "title": "Previewer: Base", + "owner": "Golmote" + }, + "previewer-color": { + "title": "Previewer: Color", + "require": "previewer-base", + "owner": "Golmote" + }, + "previewer-gradient": { + "title": "Previewer: Gradient", + "require": "previewer-base", + "owner": "Golmote" + }, + "previewer-easing": { + "title": "Previewer: Easing", + "require": "previewer-base", + "owner": "Golmote" + }, + "previewer-time": { + "title": "Previewer: Time", + "require": "previewer-base", + "owner": "Golmote" + }, + "previewer-angle": { + "title": "Previewer: Angle", + "require": "previewer-base", + "owner": "Golmote" + }, + "autoloader": { + "title": "Autoloader", + "owner": "Golmote", + "noCSS": true + }, + "keep-markup": { + "title": "Keep Markup", + "owner": "Golmote", + "after": "normalize-whitespace", + "noCSS": true + }, + "command-line": { + "title": "Command Line", + "owner": "chriswells0" + }, + "unescaped-markup": "Unescaped Markup", + "normalize-whitespace": { + "title": "Normalize Whitespace", + "owner": "zeitgeist87", + "after": "unescaped-markup", + "noCSS": true + } + } +}; diff --git a/MacDown/Resources/Prism/components/prism-abap.js b/MacDown/Resources/Prism/components/prism-abap.js new file mode 100644 index 00000000..3e0854ee --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-abap.js @@ -0,0 +1,48 @@ +Prism.languages.abap = { + 'comment': /^\*.*/m, + 'string' : /(`|')(\\?.)*?\1/m, + 'string-template': { + pattern: /(\||\})(\\?.)*?(?=\||\{)/, + lookbehind: true, + alias: 'string' + }, + /* End Of Line comments should not interfere with strings when the + quote character occurs within them. We assume a string being highlighted + inside an EOL comment is more acceptable than the opposite. + */ + 'eol-comment': { + pattern: /(^|\s)".*/m, + lookbehind: true, + alias: 'comment' + }, + 'keyword' : { + pattern: /(\s|\.|^)(?:SCIENTIFIC_WITH_LEADING_ZERO|SCALE_PRESERVING_SCIENTIFIC|RMC_COMMUNICATION_FAILURE|END-ENHANCEMENT-SECTION|MULTIPLY-CORRESPONDING|SUBTRACT-CORRESPONDING|VERIFICATION-MESSAGE|DIVIDE-CORRESPONDING|ENHANCEMENT-SECTION|CURRENCY_CONVERSION|RMC_SYSTEM_FAILURE|START-OF-SELECTION|MOVE-CORRESPONDING|RMC_INVALID_STATUS|CUSTOMER-FUNCTION|END-OF-DEFINITION|ENHANCEMENT-POINT|SYSTEM-EXCEPTIONS|ADD-CORRESPONDING|SCALE_PRESERVING|SELECTION-SCREEN|CURSOR-SELECTION|END-OF-SELECTION|LOAD-OF-PROGRAM|SCROLL-BOUNDARY|SELECTION-TABLE|EXCEPTION-TABLE|IMPLEMENTATIONS|PARAMETER-TABLE|RIGHT-JUSTIFIED|UNIT_CONVERSION|AUTHORITY-CHECK|LIST-PROCESSING|SIGN_AS_POSTFIX|COL_BACKGROUND|IMPLEMENTATION|INTERFACE-POOL|TRANSFORMATION|IDENTIFICATION|ENDENHANCEMENT|LINE-SELECTION|INITIALIZATION|LEFT-JUSTIFIED|SELECT-OPTIONS|SELECTION-SETS|COMMUNICATION|CORRESPONDING|DECIMAL_SHIFT|PRINT-CONTROL|VALUE-REQUEST|CHAIN-REQUEST|FUNCTION-POOL|FIELD-SYMBOLS|FUNCTIONALITY|INVERTED-DATE|SELECTION-SET|CLASS-METHODS|OUTPUT-LENGTH|CLASS-CODING|COL_NEGATIVE|ERRORMESSAGE|FIELD-GROUPS|HELP-REQUEST|NO-EXTENSION|NO-TOPOFPAGE|REDEFINITION|DISPLAY-MODE|ENDINTERFACE|EXIT-COMMAND|FIELD-SYMBOL|NO-SCROLLING|SHORTDUMP-ID|ACCESSPOLICY|CLASS-EVENTS|COL_POSITIVE|DECLARATIONS|ENHANCEMENTS|FILTER-TABLE|SWITCHSTATES|SYNTAX-CHECK|TRANSPORTING|ASYNCHRONOUS|SYNTAX-TRACE|TOKENIZATION|USER-COMMAND|WITH-HEADING|ABAP-SOURCE|BREAK-POINT|CHAIN-INPUT|COMPRESSION|FIXED-POINT|NEW-SECTION|NON-UNICODE|OCCURRENCES|RESPONSIBLE|SYSTEM-CALL|TRACE-TABLE|ABBREVIATED|CHAR-TO-HEX|END-OF-FILE|ENDFUNCTION|ENVIRONMENT|ASSOCIATION|COL_HEADING|EDITOR-CALL|END-OF-PAGE|ENGINEERING|IMPLEMENTED|INTENSIFIED|RADIOBUTTON|SYSTEM-EXIT|TOP-OF-PAGE|TRANSACTION|APPLICATION|CONCATENATE|DESTINATION|ENHANCEMENT|IMMEDIATELY|NO-GROUPING|PRECOMPILED|REPLACEMENT|TITLE-LINES|ACTIVATION|BYTE-ORDER|CLASS-POOL|CONNECTION|CONVERSION|DEFINITION|DEPARTMENT|EXPIRATION|INHERITING|MESSAGE-ID|NO-HEADING|PERFORMING|QUEUE-ONLY|RIGHTSPACE|SCIENTIFIC|STATUSINFO|STRUCTURES|SYNCPOINTS|WITH-TITLE|ATTRIBUTES|BOUNDARIES|CLASS-DATA|COL_NORMAL|DD\/MM\/YYYY|DESCENDING|INTERFACES|LINE-COUNT|MM\/DD\/YYYY|NON-UNIQUE|PRESERVING|SELECTIONS|STATEMENTS|SUBROUTINE|TRUNCATION|TYPE-POOLS|ARITHMETIC|BACKGROUND|ENDPROVIDE|EXCEPTIONS|IDENTIFIER|INDEX-LINE|OBLIGATORY|PARAMETERS|PERCENTAGE|PUSHBUTTON|RESOLUTION|COMPONENTS|DEALLOCATE|DISCONNECT|DUPLICATES|FIRST-LINE|HEAD-LINES|NO-DISPLAY|OCCURRENCE|RESPECTING|RETURNCODE|SUBMATCHES|TRACE-FILE|ASCENDING|BYPASSING|ENDMODULE|EXCEPTION|EXCLUDING|EXPORTING|INCREMENT|MATCHCODE|PARAMETER|PARTIALLY|PREFERRED|REFERENCE|REPLACING|RETURNING|SELECTION|SEPARATED|SPECIFIED|STATEMENT|TIMESTAMP|TYPE-POOL|ACCEPTING|APPENDAGE|ASSIGNING|COL_GROUP|COMPARING|CONSTANTS|DANGEROUS|IMPORTING|INSTANCES|LEFTSPACE|LOG-POINT|QUICKINFO|READ-ONLY|SCROLLING|SQLSCRIPT|STEP-LOOP|TOP-LINES|TRANSLATE|APPENDING|AUTHORITY|CHARACTER|COMPONENT|CONDITION|DIRECTORY|DUPLICATE|MESSAGING|RECEIVING|SUBSCREEN|ACCORDING|COL_TOTAL|END-LINES|ENDMETHOD|ENDSELECT|EXPANDING|EXTENSION|INCLUDING|INFOTYPES|INTERFACE|INTERVALS|LINE-SIZE|PF-STATUS|PROCEDURE|PROTECTED|REQUESTED|RESUMABLE|RIGHTPLUS|SAP-SPOOL|SECONDARY|STRUCTURE|SUBSTRING|TABLEVIEW|NUMOFCHAR|ADJACENT|ANALYSIS|ASSIGNED|BACKWARD|CHANNELS|CHECKBOX|CONTINUE|CRITICAL|DATAINFO|DD\/MM\/YY|DURATION|ENCODING|ENDCLASS|FUNCTION|LEFTPLUS|LINEFEED|MM\/DD\/YY|OVERFLOW|RECEIVED|SKIPPING|SORTABLE|STANDARD|SUBTRACT|SUPPRESS|TABSTRIP|TITLEBAR|TRUNCATE|UNASSIGN|WHENEVER|ANALYZER|COALESCE|COMMENTS|CONDENSE|DECIMALS|DEFERRED|ENDWHILE|EXPLICIT|KEYWORDS|MESSAGES|POSITION|PRIORITY|RECEIVER|RENAMING|TIMEZONE|TRAILING|ALLOCATE|CENTERED|CIRCULAR|CONTROLS|CURRENCY|DELETING|DESCRIBE|DISTANCE|ENDCATCH|EXPONENT|EXTENDED|GENERATE|IGNORING|INCLUDES|INTERNAL|MAJOR-ID|MODIFIER|NEW-LINE|OPTIONAL|PROPERTY|ROLLBACK|STARTING|SUPPLIED|ABSTRACT|CHANGING|CONTEXTS|CREATING|CUSTOMER|DATABASE|DAYLIGHT|DEFINING|DISTINCT|DIVISION|ENABLING|ENDCHAIN|ESCAPING|HARMLESS|IMPLICIT|INACTIVE|LANGUAGE|MINOR-ID|MULTIPLY|NEW-PAGE|NO-TITLE|POS_HIGH|SEPARATE|TEXTPOOL|TRANSFER|SELECTOR|DBMAXLEN|ITERATOR|SELECTOR|ARCHIVE|BIT-XOR|BYTE-CO|COLLECT|COMMENT|CURRENT|DEFAULT|DISPLAY|ENDFORM|EXTRACT|LEADING|LISTBOX|LOCATOR|MEMBERS|METHODS|NESTING|POS_LOW|PROCESS|PROVIDE|RAISING|RESERVE|SECONDS|SUMMARY|VISIBLE|BETWEEN|BIT-AND|BYTE-CS|CLEANUP|COMPUTE|CONTROL|CONVERT|DATASET|ENDCASE|FORWARD|HEADERS|HOTSPOT|INCLUDE|INVERSE|KEEPING|NO-ZERO|OBJECTS|OVERLAY|PADDING|PATTERN|PROGRAM|REFRESH|SECTION|SUMMING|TESTING|VERSION|WINDOWS|WITHOUT|BIT-NOT|BYTE-CA|BYTE-NA|CASTING|CONTEXT|COUNTRY|DYNAMIC|ENABLED|ENDLOOP|EXECUTE|FRIENDS|HANDLER|HEADING|INITIAL|\*-INPUT|LOGFILE|MAXIMUM|MINIMUM|NO-GAPS|NO-SIGN|PRAGMAS|PRIMARY|PRIVATE|REDUCED|REPLACE|REQUEST|RESULTS|UNICODE|WARNING|ALIASES|BYTE-CN|BYTE-NS|CALLING|COL_KEY|COLUMNS|CONNECT|ENDEXEC|ENTRIES|EXCLUDE|FILTERS|FURTHER|HELP-ID|LOGICAL|MAPPING|MESSAGE|NAMETAB|OPTIONS|PACKAGE|PERFORM|RECEIVE|STATICS|VARYING|BINDING|CHARLEN|GREATER|XSTRLEN|ACCEPT|APPEND|DETAIL|ELSEIF|ENDING|ENDTRY|FORMAT|FRAMES|GIVING|HASHED|HEADER|IMPORT|INSERT|MARGIN|MODULE|NATIVE|OBJECT|OFFSET|REMOTE|RESUME|SAVING|SIMPLE|SUBMIT|TABBED|TOKENS|UNIQUE|UNPACK|UPDATE|WINDOW|YELLOW|ACTUAL|ASPECT|CENTER|CURSOR|DELETE|DIALOG|DIVIDE|DURING|ERRORS|EVENTS|EXTEND|FILTER|HANDLE|HAVING|IGNORE|LITTLE|MEMORY|NO-GAP|OCCURS|OPTION|PERSON|PLACES|PUBLIC|REDUCE|REPORT|RESULT|SINGLE|SORTED|SWITCH|SYNTAX|TARGET|VALUES|WRITER|ASSERT|BLOCKS|BOUNDS|BUFFER|CHANGE|COLUMN|COMMIT|CONCAT|COPIES|CREATE|DDMMYY|DEFINE|ENDIAN|ESCAPE|EXPAND|KERNEL|LAYOUT|LEGACY|LEVELS|MMDDYY|NUMBER|OUTPUT|RANGES|READER|RETURN|SCREEN|SEARCH|SELECT|SHARED|SOURCE|STABLE|STATIC|SUBKEY|SUFFIX|TABLES|UNWIND|YYMMDD|ASSIGN|BACKUP|BEFORE|BINARY|BIT-OR|BLANKS|CLIENT|CODING|COMMON|DEMAND|DYNPRO|EXCEPT|EXISTS|EXPORT|FIELDS|GLOBAL|GROUPS|LENGTH|LOCALE|MEDIUM|METHOD|MODIFY|NESTED|OTHERS|REJECT|SCROLL|SUPPLY|SYMBOL|ENDFOR|STRLEN|ALIGN|BEGIN|BOUND|ENDAT|ENTRY|EVENT|FINAL|FLUSH|GRANT|INNER|SHORT|USING|WRITE|AFTER|BLACK|BLOCK|CLOCK|COLOR|COUNT|DUMMY|EMPTY|ENDDO|ENDON|GREEN|INDEX|INOUT|LEAVE|LEVEL|LINES|MODIF|ORDER|OUTER|RANGE|RESET|RETRY|RIGHT|SMART|SPLIT|STYLE|TABLE|THROW|UNDER|UNTIL|UPPER|UTF-8|WHERE|ALIAS|BLANK|CLEAR|CLOSE|EXACT|FETCH|FIRST|FOUND|GROUP|LLANG|LOCAL|OTHER|REGEX|SPOOL|TITLE|TYPES|VALID|WHILE|ALPHA|BOXED|CATCH|CHAIN|CHECK|CLASS|COVER|ENDIF|EQUIV|FIELD|FLOOR|FRAME|INPUT|LOWER|MATCH|NODES|PAGES|PRINT|RAISE|ROUND|SHIFT|SPACE|SPOTS|STAMP|STATE|TASKS|TIMES|TRMAC|ULINE|UNION|VALUE|WIDTH|EQUAL|LOG10|TRUNC|BLOB|CASE|CEIL|CLOB|COND|EXIT|FILE|GAPS|HOLD|INCL|INTO|KEEP|KEYS|LAST|LINE|LONG|LPAD|MAIL|MODE|OPEN|PINK|READ|ROWS|TEST|THEN|ZERO|AREA|BACK|BADI|BYTE|CAST|EDIT|EXEC|FAIL|FIND|FKEQ|FONT|FREE|GKEQ|HIDE|INIT|ITNO|LATE|LOOP|MAIN|MARK|MOVE|NEXT|NULL|RISK|ROLE|UNIT|WAIT|ZONE|BASE|CALL|CODE|DATA|DATE|FKGE|GKGE|HIGH|KIND|LEFT|LIST|MASK|MESH|NAME|NODE|PACK|PAGE|POOL|SEND|SIGN|SIZE|SOME|STOP|TASK|TEXT|TIME|USER|VARY|WITH|WORD|BLUE|CONV|COPY|DEEP|ELSE|FORM|FROM|HINT|ICON|JOIN|LIKE|LOAD|ONLY|PART|SCAN|SKIP|SORT|TYPE|UNIX|VIEW|WHEN|WORK|ACOS|ASIN|ATAN|COSH|EACH|FRAC|LESS|RTTI|SINH|SQRT|TANH|AVG|BIT|DIV|ISO|LET|OUT|PAD|SQL|ALL|CI_|CPI|END|LOB|LPI|MAX|MIN|NEW|OLE|RUN|SET|\?TO|YES|ABS|ADD|AND|BIG|FOR|HDB|JOB|LOW|NOT|SAP|TRY|VIA|XML|ANY|GET|IDS|KEY|MOD|OFF|PUT|RAW|RED|REF|SUM|TAB|XSD|CNT|COS|EXP|LOG|SIN|TAN|XOR|AT|CO|CP|DO|GT|ID|IF|NS|OR|BT|CA|CS|GE|NA|NB|EQ|IN|LT|NE|NO|OF|ON|PF|TO|AS|BY|CN|IS|LE|NP|UP|E|I|M|O|Z|C|X)\b/i, + lookbehind: true + }, + /* Numbers can be only integers. Decimal or Hex appear only as strings */ + 'number' : /\b\d+\b/, + /* Operators must always be surrounded by whitespace, they cannot be put + adjacent to operands. + */ + 'operator' : { + pattern: /(\s)(?:\*\*?|<[=>]?|>=?|\?=|[-+\/=])(?=\s)/, + lookbehind: true + }, + 'string-operator' : { + pattern: /(\s)&&?(?=\s)/, + lookbehind: true, + /* The official editor highlights */ + alias: "keyword" + }, + 'token-operator' : [{ + /* Special operators used to access structure components, class methods/attributes, etc. */ + pattern: /(\w)(?:->?|=>|[~|{}])(?=\w)/, + lookbehind: true, + alias: "punctuation" + }, { + /* Special tokens used do delimit string templates */ + pattern: /[|{}]/, + alias: "punctuation" + }], + 'punctuation' : /[,.:()]/ +}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-abap.min.js b/MacDown/Resources/Prism/components/prism-abap.min.js new file mode 100644 index 00000000..e48021f9 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-abap.min.js @@ -0,0 +1 @@ +Prism.languages.abap={comment:/^\*.*/m,string:/(`|')(\\?.)*?\1/m,"string-template":{pattern:/(\||\})(\\?.)*?(?=\||\{)/,lookbehind:!0,alias:"string"},"eol-comment":{pattern:/(^|\s)".*/m,lookbehind:!0,alias:"comment"},keyword:{pattern:/(\s|\.|^)(?:SCIENTIFIC_WITH_LEADING_ZERO|SCALE_PRESERVING_SCIENTIFIC|RMC_COMMUNICATION_FAILURE|END-ENHANCEMENT-SECTION|MULTIPLY-CORRESPONDING|SUBTRACT-CORRESPONDING|VERIFICATION-MESSAGE|DIVIDE-CORRESPONDING|ENHANCEMENT-SECTION|CURRENCY_CONVERSION|RMC_SYSTEM_FAILURE|START-OF-SELECTION|MOVE-CORRESPONDING|RMC_INVALID_STATUS|CUSTOMER-FUNCTION|END-OF-DEFINITION|ENHANCEMENT-POINT|SYSTEM-EXCEPTIONS|ADD-CORRESPONDING|SCALE_PRESERVING|SELECTION-SCREEN|CURSOR-SELECTION|END-OF-SELECTION|LOAD-OF-PROGRAM|SCROLL-BOUNDARY|SELECTION-TABLE|EXCEPTION-TABLE|IMPLEMENTATIONS|PARAMETER-TABLE|RIGHT-JUSTIFIED|UNIT_CONVERSION|AUTHORITY-CHECK|LIST-PROCESSING|SIGN_AS_POSTFIX|COL_BACKGROUND|IMPLEMENTATION|INTERFACE-POOL|TRANSFORMATION|IDENTIFICATION|ENDENHANCEMENT|LINE-SELECTION|INITIALIZATION|LEFT-JUSTIFIED|SELECT-OPTIONS|SELECTION-SETS|COMMUNICATION|CORRESPONDING|DECIMAL_SHIFT|PRINT-CONTROL|VALUE-REQUEST|CHAIN-REQUEST|FUNCTION-POOL|FIELD-SYMBOLS|FUNCTIONALITY|INVERTED-DATE|SELECTION-SET|CLASS-METHODS|OUTPUT-LENGTH|CLASS-CODING|COL_NEGATIVE|ERRORMESSAGE|FIELD-GROUPS|HELP-REQUEST|NO-EXTENSION|NO-TOPOFPAGE|REDEFINITION|DISPLAY-MODE|ENDINTERFACE|EXIT-COMMAND|FIELD-SYMBOL|NO-SCROLLING|SHORTDUMP-ID|ACCESSPOLICY|CLASS-EVENTS|COL_POSITIVE|DECLARATIONS|ENHANCEMENTS|FILTER-TABLE|SWITCHSTATES|SYNTAX-CHECK|TRANSPORTING|ASYNCHRONOUS|SYNTAX-TRACE|TOKENIZATION|USER-COMMAND|WITH-HEADING|ABAP-SOURCE|BREAK-POINT|CHAIN-INPUT|COMPRESSION|FIXED-POINT|NEW-SECTION|NON-UNICODE|OCCURRENCES|RESPONSIBLE|SYSTEM-CALL|TRACE-TABLE|ABBREVIATED|CHAR-TO-HEX|END-OF-FILE|ENDFUNCTION|ENVIRONMENT|ASSOCIATION|COL_HEADING|EDITOR-CALL|END-OF-PAGE|ENGINEERING|IMPLEMENTED|INTENSIFIED|RADIOBUTTON|SYSTEM-EXIT|TOP-OF-PAGE|TRANSACTION|APPLICATION|CONCATENATE|DESTINATION|ENHANCEMENT|IMMEDIATELY|NO-GROUPING|PRECOMPILED|REPLACEMENT|TITLE-LINES|ACTIVATION|BYTE-ORDER|CLASS-POOL|CONNECTION|CONVERSION|DEFINITION|DEPARTMENT|EXPIRATION|INHERITING|MESSAGE-ID|NO-HEADING|PERFORMING|QUEUE-ONLY|RIGHTSPACE|SCIENTIFIC|STATUSINFO|STRUCTURES|SYNCPOINTS|WITH-TITLE|ATTRIBUTES|BOUNDARIES|CLASS-DATA|COL_NORMAL|DD\/MM\/YYYY|DESCENDING|INTERFACES|LINE-COUNT|MM\/DD\/YYYY|NON-UNIQUE|PRESERVING|SELECTIONS|STATEMENTS|SUBROUTINE|TRUNCATION|TYPE-POOLS|ARITHMETIC|BACKGROUND|ENDPROVIDE|EXCEPTIONS|IDENTIFIER|INDEX-LINE|OBLIGATORY|PARAMETERS|PERCENTAGE|PUSHBUTTON|RESOLUTION|COMPONENTS|DEALLOCATE|DISCONNECT|DUPLICATES|FIRST-LINE|HEAD-LINES|NO-DISPLAY|OCCURRENCE|RESPECTING|RETURNCODE|SUBMATCHES|TRACE-FILE|ASCENDING|BYPASSING|ENDMODULE|EXCEPTION|EXCLUDING|EXPORTING|INCREMENT|MATCHCODE|PARAMETER|PARTIALLY|PREFERRED|REFERENCE|REPLACING|RETURNING|SELECTION|SEPARATED|SPECIFIED|STATEMENT|TIMESTAMP|TYPE-POOL|ACCEPTING|APPENDAGE|ASSIGNING|COL_GROUP|COMPARING|CONSTANTS|DANGEROUS|IMPORTING|INSTANCES|LEFTSPACE|LOG-POINT|QUICKINFO|READ-ONLY|SCROLLING|SQLSCRIPT|STEP-LOOP|TOP-LINES|TRANSLATE|APPENDING|AUTHORITY|CHARACTER|COMPONENT|CONDITION|DIRECTORY|DUPLICATE|MESSAGING|RECEIVING|SUBSCREEN|ACCORDING|COL_TOTAL|END-LINES|ENDMETHOD|ENDSELECT|EXPANDING|EXTENSION|INCLUDING|INFOTYPES|INTERFACE|INTERVALS|LINE-SIZE|PF-STATUS|PROCEDURE|PROTECTED|REQUESTED|RESUMABLE|RIGHTPLUS|SAP-SPOOL|SECONDARY|STRUCTURE|SUBSTRING|TABLEVIEW|NUMOFCHAR|ADJACENT|ANALYSIS|ASSIGNED|BACKWARD|CHANNELS|CHECKBOX|CONTINUE|CRITICAL|DATAINFO|DD\/MM\/YY|DURATION|ENCODING|ENDCLASS|FUNCTION|LEFTPLUS|LINEFEED|MM\/DD\/YY|OVERFLOW|RECEIVED|SKIPPING|SORTABLE|STANDARD|SUBTRACT|SUPPRESS|TABSTRIP|TITLEBAR|TRUNCATE|UNASSIGN|WHENEVER|ANALYZER|COALESCE|COMMENTS|CONDENSE|DECIMALS|DEFERRED|ENDWHILE|EXPLICIT|KEYWORDS|MESSAGES|POSITION|PRIORITY|RECEIVER|RENAMING|TIMEZONE|TRAILING|ALLOCATE|CENTERED|CIRCULAR|CONTROLS|CURRENCY|DELETING|DESCRIBE|DISTANCE|ENDCATCH|EXPONENT|EXTENDED|GENERATE|IGNORING|INCLUDES|INTERNAL|MAJOR-ID|MODIFIER|NEW-LINE|OPTIONAL|PROPERTY|ROLLBACK|STARTING|SUPPLIED|ABSTRACT|CHANGING|CONTEXTS|CREATING|CUSTOMER|DATABASE|DAYLIGHT|DEFINING|DISTINCT|DIVISION|ENABLING|ENDCHAIN|ESCAPING|HARMLESS|IMPLICIT|INACTIVE|LANGUAGE|MINOR-ID|MULTIPLY|NEW-PAGE|NO-TITLE|POS_HIGH|SEPARATE|TEXTPOOL|TRANSFER|SELECTOR|DBMAXLEN|ITERATOR|SELECTOR|ARCHIVE|BIT-XOR|BYTE-CO|COLLECT|COMMENT|CURRENT|DEFAULT|DISPLAY|ENDFORM|EXTRACT|LEADING|LISTBOX|LOCATOR|MEMBERS|METHODS|NESTING|POS_LOW|PROCESS|PROVIDE|RAISING|RESERVE|SECONDS|SUMMARY|VISIBLE|BETWEEN|BIT-AND|BYTE-CS|CLEANUP|COMPUTE|CONTROL|CONVERT|DATASET|ENDCASE|FORWARD|HEADERS|HOTSPOT|INCLUDE|INVERSE|KEEPING|NO-ZERO|OBJECTS|OVERLAY|PADDING|PATTERN|PROGRAM|REFRESH|SECTION|SUMMING|TESTING|VERSION|WINDOWS|WITHOUT|BIT-NOT|BYTE-CA|BYTE-NA|CASTING|CONTEXT|COUNTRY|DYNAMIC|ENABLED|ENDLOOP|EXECUTE|FRIENDS|HANDLER|HEADING|INITIAL|\*-INPUT|LOGFILE|MAXIMUM|MINIMUM|NO-GAPS|NO-SIGN|PRAGMAS|PRIMARY|PRIVATE|REDUCED|REPLACE|REQUEST|RESULTS|UNICODE|WARNING|ALIASES|BYTE-CN|BYTE-NS|CALLING|COL_KEY|COLUMNS|CONNECT|ENDEXEC|ENTRIES|EXCLUDE|FILTERS|FURTHER|HELP-ID|LOGICAL|MAPPING|MESSAGE|NAMETAB|OPTIONS|PACKAGE|PERFORM|RECEIVE|STATICS|VARYING|BINDING|CHARLEN|GREATER|XSTRLEN|ACCEPT|APPEND|DETAIL|ELSEIF|ENDING|ENDTRY|FORMAT|FRAMES|GIVING|HASHED|HEADER|IMPORT|INSERT|MARGIN|MODULE|NATIVE|OBJECT|OFFSET|REMOTE|RESUME|SAVING|SIMPLE|SUBMIT|TABBED|TOKENS|UNIQUE|UNPACK|UPDATE|WINDOW|YELLOW|ACTUAL|ASPECT|CENTER|CURSOR|DELETE|DIALOG|DIVIDE|DURING|ERRORS|EVENTS|EXTEND|FILTER|HANDLE|HAVING|IGNORE|LITTLE|MEMORY|NO-GAP|OCCURS|OPTION|PERSON|PLACES|PUBLIC|REDUCE|REPORT|RESULT|SINGLE|SORTED|SWITCH|SYNTAX|TARGET|VALUES|WRITER|ASSERT|BLOCKS|BOUNDS|BUFFER|CHANGE|COLUMN|COMMIT|CONCAT|COPIES|CREATE|DDMMYY|DEFINE|ENDIAN|ESCAPE|EXPAND|KERNEL|LAYOUT|LEGACY|LEVELS|MMDDYY|NUMBER|OUTPUT|RANGES|READER|RETURN|SCREEN|SEARCH|SELECT|SHARED|SOURCE|STABLE|STATIC|SUBKEY|SUFFIX|TABLES|UNWIND|YYMMDD|ASSIGN|BACKUP|BEFORE|BINARY|BIT-OR|BLANKS|CLIENT|CODING|COMMON|DEMAND|DYNPRO|EXCEPT|EXISTS|EXPORT|FIELDS|GLOBAL|GROUPS|LENGTH|LOCALE|MEDIUM|METHOD|MODIFY|NESTED|OTHERS|REJECT|SCROLL|SUPPLY|SYMBOL|ENDFOR|STRLEN|ALIGN|BEGIN|BOUND|ENDAT|ENTRY|EVENT|FINAL|FLUSH|GRANT|INNER|SHORT|USING|WRITE|AFTER|BLACK|BLOCK|CLOCK|COLOR|COUNT|DUMMY|EMPTY|ENDDO|ENDON|GREEN|INDEX|INOUT|LEAVE|LEVEL|LINES|MODIF|ORDER|OUTER|RANGE|RESET|RETRY|RIGHT|SMART|SPLIT|STYLE|TABLE|THROW|UNDER|UNTIL|UPPER|UTF-8|WHERE|ALIAS|BLANK|CLEAR|CLOSE|EXACT|FETCH|FIRST|FOUND|GROUP|LLANG|LOCAL|OTHER|REGEX|SPOOL|TITLE|TYPES|VALID|WHILE|ALPHA|BOXED|CATCH|CHAIN|CHECK|CLASS|COVER|ENDIF|EQUIV|FIELD|FLOOR|FRAME|INPUT|LOWER|MATCH|NODES|PAGES|PRINT|RAISE|ROUND|SHIFT|SPACE|SPOTS|STAMP|STATE|TASKS|TIMES|TRMAC|ULINE|UNION|VALUE|WIDTH|EQUAL|LOG10|TRUNC|BLOB|CASE|CEIL|CLOB|COND|EXIT|FILE|GAPS|HOLD|INCL|INTO|KEEP|KEYS|LAST|LINE|LONG|LPAD|MAIL|MODE|OPEN|PINK|READ|ROWS|TEST|THEN|ZERO|AREA|BACK|BADI|BYTE|CAST|EDIT|EXEC|FAIL|FIND|FKEQ|FONT|FREE|GKEQ|HIDE|INIT|ITNO|LATE|LOOP|MAIN|MARK|MOVE|NEXT|NULL|RISK|ROLE|UNIT|WAIT|ZONE|BASE|CALL|CODE|DATA|DATE|FKGE|GKGE|HIGH|KIND|LEFT|LIST|MASK|MESH|NAME|NODE|PACK|PAGE|POOL|SEND|SIGN|SIZE|SOME|STOP|TASK|TEXT|TIME|USER|VARY|WITH|WORD|BLUE|CONV|COPY|DEEP|ELSE|FORM|FROM|HINT|ICON|JOIN|LIKE|LOAD|ONLY|PART|SCAN|SKIP|SORT|TYPE|UNIX|VIEW|WHEN|WORK|ACOS|ASIN|ATAN|COSH|EACH|FRAC|LESS|RTTI|SINH|SQRT|TANH|AVG|BIT|DIV|ISO|LET|OUT|PAD|SQL|ALL|CI_|CPI|END|LOB|LPI|MAX|MIN|NEW|OLE|RUN|SET|\?TO|YES|ABS|ADD|AND|BIG|FOR|HDB|JOB|LOW|NOT|SAP|TRY|VIA|XML|ANY|GET|IDS|KEY|MOD|OFF|PUT|RAW|RED|REF|SUM|TAB|XSD|CNT|COS|EXP|LOG|SIN|TAN|XOR|AT|CO|CP|DO|GT|ID|IF|NS|OR|BT|CA|CS|GE|NA|NB|EQ|IN|LT|NE|NO|OF|ON|PF|TO|AS|BY|CN|IS|LE|NP|UP|E|I|M|O|Z|C|X)\b/i,lookbehind:!0},number:/\b\d+\b/,operator:{pattern:/(\s)(?:\*\*?|<[=>]?|>=?|\?=|[-+\/=])(?=\s)/,lookbehind:!0},"string-operator":{pattern:/(\s)&&?(?=\s)/,lookbehind:!0,alias:"keyword"},"token-operator":[{pattern:/(\w)(?:->?|=>|[~|{}])(?=\w)/,lookbehind:!0,alias:"punctuation"},{pattern:/[|{}]/,alias:"punctuation"}],punctuation:/[,.:()]/}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-actionscript.js b/MacDown/Resources/Prism/components/prism-actionscript.js new file mode 100644 index 00000000..ff5804d4 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-actionscript.js @@ -0,0 +1,17 @@ +Prism.languages.actionscript = Prism.languages.extend('javascript', { + 'keyword': /\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|native|override|set|static)\b/, + 'operator': /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/ +}); +Prism.languages.actionscript['class-name'].alias = 'function'; + +if (Prism.languages.markup) { + Prism.languages.insertBefore('actionscript', 'string', { + 'xml': { + pattern: /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\\1|\\?(?!\1)[\w\W])*\2)*\s*\/?>/, + lookbehind: true, + inside: { + rest: Prism.languages.markup + } + } + }); +} \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-actionscript.min.js b/MacDown/Resources/Prism/components/prism-actionscript.min.js new file mode 100644 index 00000000..91a85907 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-actionscript.min.js @@ -0,0 +1 @@ +Prism.languages.actionscript=Prism.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|native|override|set|static)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/}),Prism.languages.actionscript["class-name"].alias="function",Prism.languages.markup&&Prism.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\\1|\\?(?!\1)[\w\W])*\2)*\s*\/?>/,lookbehind:!0,inside:{rest:Prism.languages.markup}}}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-apacheconf.js b/MacDown/Resources/Prism/components/prism-apacheconf.js new file mode 100644 index 00000000..31db26bf --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-apacheconf.js @@ -0,0 +1,47 @@ +Prism.languages.apacheconf = { + 'comment': /#.*/, + 'directive-inline': { + pattern: /^(\s*)\b(AcceptFilter|AcceptPathInfo|AccessFileName|Action|AddAlt|AddAltByEncoding|AddAltByType|AddCharset|AddDefaultCharset|AddDescription|AddEncoding|AddHandler|AddIcon|AddIconByEncoding|AddIconByType|AddInputFilter|AddLanguage|AddModuleInfo|AddOutputFilter|AddOutputFilterByType|AddType|Alias|AliasMatch|Allow|AllowCONNECT|AllowEncodedSlashes|AllowMethods|AllowOverride|AllowOverrideList|Anonymous|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail|AsyncRequestWorkerFactor|AuthBasicAuthoritative|AuthBasicFake|AuthBasicProvider|AuthBasicUseDigestAlgorithm|AuthDBDUserPWQuery|AuthDBDUserRealmQuery|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile|AuthDigestAlgorithm|AuthDigestDomain|AuthDigestNonceLifetime|AuthDigestProvider|AuthDigestQop|AuthDigestShmemSize|AuthFormAuthoritative|AuthFormBody|AuthFormDisableNoStore|AuthFormFakeBasicAuth|AuthFormLocation|AuthFormLoginRequiredLocation|AuthFormLoginSuccessLocation|AuthFormLogoutLocation|AuthFormMethod|AuthFormMimetype|AuthFormPassword|AuthFormProvider|AuthFormSitePassphrase|AuthFormSize|AuthFormUsername|AuthGroupFile|AuthLDAPAuthorizePrefix|AuthLDAPBindAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareAsUser|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPInitialBindAsUser|AuthLDAPInitialBindPattern|AuthLDAPMaxSubGroupDepth|AuthLDAPRemoteUserAttribute|AuthLDAPRemoteUserIsDN|AuthLDAPSearchAsUser|AuthLDAPSubGroupAttribute|AuthLDAPSubGroupClass|AuthLDAPUrl|AuthMerging|AuthName|AuthnCacheContext|AuthnCacheEnable|AuthnCacheProvideFor|AuthnCacheSOCache|AuthnCacheTimeout|AuthnzFcgiCheckAuthnProvider|AuthnzFcgiDefineProvider|AuthType|AuthUserFile|AuthzDBDLoginToReferer|AuthzDBDQuery|AuthzDBDRedirectQuery|AuthzDBMType|AuthzSendForbiddenOnFailure|BalancerGrowth|BalancerInherit|BalancerMember|BalancerPersist|BrowserMatch|BrowserMatchNoCase|BufferedLogs|BufferSize|CacheDefaultExpire|CacheDetailHeader|CacheDirLength|CacheDirLevels|CacheDisable|CacheEnable|CacheFile|CacheHeader|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheIgnoreQueryString|CacheIgnoreURLSessionIdentifiers|CacheKeyBaseURL|CacheLastModifiedFactor|CacheLock|CacheLockMaxAge|CacheLockPath|CacheMaxExpire|CacheMaxFileSize|CacheMinExpire|CacheMinFileSize|CacheNegotiatedDocs|CacheQuickHandler|CacheReadSize|CacheReadTime|CacheRoot|CacheSocache|CacheSocacheMaxSize|CacheSocacheMaxTime|CacheSocacheMinTime|CacheSocacheReadSize|CacheSocacheReadTime|CacheStaleOnError|CacheStoreExpired|CacheStoreNoStore|CacheStorePrivate|CGIDScriptTimeout|CGIMapExtension|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckCaseOnly|CheckSpelling|ChrootDir|ContentDigest|CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|Dav|DavDepthInfinity|DavGenericLockDB|DavLockDB|DavMinTimeout|DBDExptime|DBDInitSQL|DBDKeep|DBDMax|DBDMin|DBDParams|DBDPersist|DBDPrepareSQL|DBDriver|DefaultIcon|DefaultLanguage|DefaultRuntimeDir|DefaultType|Define|DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateInflateLimitRequestBody|DeflateInflateRatioBurst|DeflateInflateRatioLimit|DeflateMemLevel|DeflateWindowSize|Deny|DirectoryCheckHandler|DirectoryIndex|DirectoryIndexRedirect|DirectorySlash|DocumentRoot|DTracePrivileges|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|Error|ErrorDocument|ErrorLog|ErrorLogFormat|Example|ExpiresActive|ExpiresByType|ExpiresDefault|ExtendedStatus|ExtFilterDefine|ExtFilterOptions|FallbackResource|FileETag|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace|ForceLanguagePriority|ForceType|ForensicLog|GprofDir|GracefulShutdownTimeout|Group|Header|HeaderName|HeartbeatAddress|HeartbeatListen|HeartbeatMaxServers|HeartbeatStorage|HeartbeatStorage|HostnameLookups|IdentityCheck|IdentityCheckTimeout|ImapBase|ImapDefault|ImapMenu|Include|IncludeOptional|IndexHeadInsert|IndexIgnore|IndexIgnoreReset|IndexOptions|IndexOrderDefault|IndexStyleSheet|InputSed|ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer|KeepAlive|KeepAliveTimeout|KeptBodySize|LanguagePriority|LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionPoolTTL|LDAPConnectionTimeout|LDAPLibraryDebug|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPReferralHopLimit|LDAPReferrals|LDAPRetries|LDAPRetryDelay|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTimeout|LDAPTrustedClientCert|LDAPTrustedGlobalCert|LDAPTrustedMode|LDAPVerifyServerCert|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|Listen|ListenBackLog|LoadFile|LoadModule|LogFormat|LogLevel|LogMessage|LuaAuthzProvider|LuaCodeCache|LuaHookAccessChecker|LuaHookAuthChecker|LuaHookCheckUserID|LuaHookFixups|LuaHookInsertFilter|LuaHookLog|LuaHookMapToStorage|LuaHookTranslateName|LuaHookTypeChecker|LuaInherit|LuaInputFilter|LuaMapHandler|LuaOutputFilter|LuaPackageCPath|LuaPackagePath|LuaQuickHandler|LuaRoot|LuaScope|MaxConnectionsPerChild|MaxKeepAliveRequests|MaxMemFree|MaxRangeOverlaps|MaxRangeReversals|MaxRanges|MaxRequestWorkers|MaxSpareServers|MaxSpareThreads|MaxThreads|MergeTrailers|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads|MMapFile|ModemStandard|ModMimeUsePathInfo|MultiviewsMatch|Mutex|NameVirtualHost|NoProxy|NWSSLTrustedCerts|NWSSLUpgradeable|Options|Order|OutputSed|PassEnv|PidFile|PrivilegesMode|Protocol|ProtocolEcho|ProxyAddHeaders|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyExpressDBMFile|ProxyExpressDBMType|ProxyExpressEnable|ProxyFtpDirCharset|ProxyFtpEscapeWildcards|ProxyFtpListOnWildcard|ProxyHTMLBufSize|ProxyHTMLCharsetOut|ProxyHTMLDocType|ProxyHTMLEnable|ProxyHTMLEvents|ProxyHTMLExtended|ProxyHTMLFixups|ProxyHTMLInterp|ProxyHTMLLinks|ProxyHTMLMeta|ProxyHTMLStripComments|ProxyHTMLURLMap|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassInherit|ProxyPassInterpolateEnv|ProxyPassMatch|ProxyPassReverse|ProxyPassReverseCookieDomain|ProxyPassReverseCookiePath|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxySCGIInternalRedirect|ProxySCGISendfile|ProxySet|ProxySourceAddress|ProxyStatus|ProxyTimeout|ProxyVia|ReadmeName|ReceiveBufferSize|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ReflectorHeader|RemoteIPHeader|RemoteIPInternalProxy|RemoteIPInternalProxyList|RemoteIPProxiesHeader|RemoteIPTrustedProxy|RemoteIPTrustedProxyList|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader|RequestReadTimeout|Require|RewriteBase|RewriteCond|RewriteEngine|RewriteMap|RewriteOptions|RewriteRule|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScoreBoardFile|Script|ScriptAlias|ScriptAliasMatch|ScriptInterpreterSource|ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock|SecureListen|SeeRequestTail|SendBufferSize|ServerAdmin|ServerAlias|ServerLimit|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|Session|SessionCookieName|SessionCookieName2|SessionCookieRemove|SessionCryptoCipher|SessionCryptoDriver|SessionCryptoPassphrase|SessionCryptoPassphraseFile|SessionDBDCookieName|SessionDBDCookieName2|SessionDBDCookieRemove|SessionDBDDeleteLabel|SessionDBDInsertLabel|SessionDBDPerUser|SessionDBDSelectLabel|SessionDBDUpdateLabel|SessionEnv|SessionExclude|SessionHeader|SessionInclude|SessionMaxAge|SetEnv|SetEnvIf|SetEnvIfExpr|SetEnvIfNoCase|SetHandler|SetInputFilter|SetOutputFilter|SSIEndTag|SSIErrorMsg|SSIETag|SSILastModified|SSILegacyExprParser|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSLCACertificateFile|SSLCACertificatePath|SSLCADNRequestFile|SSLCADNRequestPath|SSLCARevocationCheck|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLCompression|SSLCryptoDevice|SSLEngine|SSLFIPS|SSLHonorCipherOrder|SSLInsecureRenegotiation|SSLOCSPDefaultResponder|SSLOCSPEnable|SSLOCSPOverrideResponder|SSLOCSPResponderTimeout|SSLOCSPResponseMaxAge|SSLOCSPResponseTimeSkew|SSLOCSPUseRequestNonce|SSLOpenSSLConfCmd|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationCheck|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCheckPeerCN|SSLProxyCheckPeerExpire|SSLProxyCheckPeerName|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateChainFile|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRenegBufferSize|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLSessionTicketKeyFile|SSLSRPUnknownUserSeed|SSLSRPVerifierFile|SSLStaplingCache|SSLStaplingErrorCacheTimeout|SSLStaplingFakeTryLater|SSLStaplingForceURL|SSLStaplingResponderTimeout|SSLStaplingResponseMaxAge|SSLStaplingResponseTimeSkew|SSLStaplingReturnResponderErrors|SSLStaplingStandardCacheTimeout|SSLStrictSNIVHostCheck|SSLUserName|SSLUseStapling|SSLVerifyClient|SSLVerifyDepth|StartServers|StartThreads|Substitute|Suexec|SuexecUserGroup|ThreadLimit|ThreadsPerChild|ThreadStackSize|TimeOut|TraceEnable|TransferLog|TypesConfig|UnDefine|UndefMacro|UnsetEnv|Use|UseCanonicalName|UseCanonicalPhysicalPort|User|UserDir|VHostCGIMode|VHostCGIPrivs|VHostGroup|VHostPrivs|VHostSecure|VHostUser|VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP|WatchdogInterval|XBitHack|xml2EncAlias|xml2EncDefault|xml2StartParse)\b/mi, + lookbehind: true, + alias: 'property' + }, + 'directive-block': { + pattern: /<\/?\b(AuthnProviderAlias|AuthzProviderAlias|Directory|DirectoryMatch|Else|ElseIf|Files|FilesMatch|If|IfDefine|IfModule|IfVersion|Limit|LimitExcept|Location|LocationMatch|Macro|Proxy|RequireAll|RequireAny|RequireNone|VirtualHost)\b *.*>/i, + inside: { + 'directive-block': { + pattern: /^<\/?\w+/, + inside: { + 'punctuation': /^<\/?/ + }, + alias: 'tag' + }, + 'directive-block-parameter': { + pattern: /.*[^>]/, + inside: { + 'punctuation': /:/, + 'string': { + pattern: /("|').*\1/, + inside: { + 'variable': /(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/ + } + } + }, + alias: 'attr-value' + }, + 'punctuation': />/ + }, + alias: 'tag' + }, + 'directive-flags': { + pattern: /\[(\w,?)+\]/, + alias: 'keyword' + }, + 'string': { + pattern: /("|').*\1/, + inside: { + 'variable': /(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/ + } + }, + 'variable': /(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/, + 'regex': /\^?.*\$|\^.*\$?/ +}; diff --git a/MacDown/Resources/Prism/components/prism-apacheconf.min.js b/MacDown/Resources/Prism/components/prism-apacheconf.min.js new file mode 100644 index 00000000..05577c5b --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-apacheconf.min.js @@ -0,0 +1 @@ +Prism.languages.apacheconf={comment:/#.*/,"directive-inline":{pattern:/^(\s*)\b(AcceptFilter|AcceptPathInfo|AccessFileName|Action|AddAlt|AddAltByEncoding|AddAltByType|AddCharset|AddDefaultCharset|AddDescription|AddEncoding|AddHandler|AddIcon|AddIconByEncoding|AddIconByType|AddInputFilter|AddLanguage|AddModuleInfo|AddOutputFilter|AddOutputFilterByType|AddType|Alias|AliasMatch|Allow|AllowCONNECT|AllowEncodedSlashes|AllowMethods|AllowOverride|AllowOverrideList|Anonymous|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail|AsyncRequestWorkerFactor|AuthBasicAuthoritative|AuthBasicFake|AuthBasicProvider|AuthBasicUseDigestAlgorithm|AuthDBDUserPWQuery|AuthDBDUserRealmQuery|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile|AuthDigestAlgorithm|AuthDigestDomain|AuthDigestNonceLifetime|AuthDigestProvider|AuthDigestQop|AuthDigestShmemSize|AuthFormAuthoritative|AuthFormBody|AuthFormDisableNoStore|AuthFormFakeBasicAuth|AuthFormLocation|AuthFormLoginRequiredLocation|AuthFormLoginSuccessLocation|AuthFormLogoutLocation|AuthFormMethod|AuthFormMimetype|AuthFormPassword|AuthFormProvider|AuthFormSitePassphrase|AuthFormSize|AuthFormUsername|AuthGroupFile|AuthLDAPAuthorizePrefix|AuthLDAPBindAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareAsUser|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPInitialBindAsUser|AuthLDAPInitialBindPattern|AuthLDAPMaxSubGroupDepth|AuthLDAPRemoteUserAttribute|AuthLDAPRemoteUserIsDN|AuthLDAPSearchAsUser|AuthLDAPSubGroupAttribute|AuthLDAPSubGroupClass|AuthLDAPUrl|AuthMerging|AuthName|AuthnCacheContext|AuthnCacheEnable|AuthnCacheProvideFor|AuthnCacheSOCache|AuthnCacheTimeout|AuthnzFcgiCheckAuthnProvider|AuthnzFcgiDefineProvider|AuthType|AuthUserFile|AuthzDBDLoginToReferer|AuthzDBDQuery|AuthzDBDRedirectQuery|AuthzDBMType|AuthzSendForbiddenOnFailure|BalancerGrowth|BalancerInherit|BalancerMember|BalancerPersist|BrowserMatch|BrowserMatchNoCase|BufferedLogs|BufferSize|CacheDefaultExpire|CacheDetailHeader|CacheDirLength|CacheDirLevels|CacheDisable|CacheEnable|CacheFile|CacheHeader|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheIgnoreQueryString|CacheIgnoreURLSessionIdentifiers|CacheKeyBaseURL|CacheLastModifiedFactor|CacheLock|CacheLockMaxAge|CacheLockPath|CacheMaxExpire|CacheMaxFileSize|CacheMinExpire|CacheMinFileSize|CacheNegotiatedDocs|CacheQuickHandler|CacheReadSize|CacheReadTime|CacheRoot|CacheSocache|CacheSocacheMaxSize|CacheSocacheMaxTime|CacheSocacheMinTime|CacheSocacheReadSize|CacheSocacheReadTime|CacheStaleOnError|CacheStoreExpired|CacheStoreNoStore|CacheStorePrivate|CGIDScriptTimeout|CGIMapExtension|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckCaseOnly|CheckSpelling|ChrootDir|ContentDigest|CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|Dav|DavDepthInfinity|DavGenericLockDB|DavLockDB|DavMinTimeout|DBDExptime|DBDInitSQL|DBDKeep|DBDMax|DBDMin|DBDParams|DBDPersist|DBDPrepareSQL|DBDriver|DefaultIcon|DefaultLanguage|DefaultRuntimeDir|DefaultType|Define|DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateInflateLimitRequestBody|DeflateInflateRatioBurst|DeflateInflateRatioLimit|DeflateMemLevel|DeflateWindowSize|Deny|DirectoryCheckHandler|DirectoryIndex|DirectoryIndexRedirect|DirectorySlash|DocumentRoot|DTracePrivileges|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|Error|ErrorDocument|ErrorLog|ErrorLogFormat|Example|ExpiresActive|ExpiresByType|ExpiresDefault|ExtendedStatus|ExtFilterDefine|ExtFilterOptions|FallbackResource|FileETag|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace|ForceLanguagePriority|ForceType|ForensicLog|GprofDir|GracefulShutdownTimeout|Group|Header|HeaderName|HeartbeatAddress|HeartbeatListen|HeartbeatMaxServers|HeartbeatStorage|HeartbeatStorage|HostnameLookups|IdentityCheck|IdentityCheckTimeout|ImapBase|ImapDefault|ImapMenu|Include|IncludeOptional|IndexHeadInsert|IndexIgnore|IndexIgnoreReset|IndexOptions|IndexOrderDefault|IndexStyleSheet|InputSed|ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer|KeepAlive|KeepAliveTimeout|KeptBodySize|LanguagePriority|LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionPoolTTL|LDAPConnectionTimeout|LDAPLibraryDebug|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPReferralHopLimit|LDAPReferrals|LDAPRetries|LDAPRetryDelay|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTimeout|LDAPTrustedClientCert|LDAPTrustedGlobalCert|LDAPTrustedMode|LDAPVerifyServerCert|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|Listen|ListenBackLog|LoadFile|LoadModule|LogFormat|LogLevel|LogMessage|LuaAuthzProvider|LuaCodeCache|LuaHookAccessChecker|LuaHookAuthChecker|LuaHookCheckUserID|LuaHookFixups|LuaHookInsertFilter|LuaHookLog|LuaHookMapToStorage|LuaHookTranslateName|LuaHookTypeChecker|LuaInherit|LuaInputFilter|LuaMapHandler|LuaOutputFilter|LuaPackageCPath|LuaPackagePath|LuaQuickHandler|LuaRoot|LuaScope|MaxConnectionsPerChild|MaxKeepAliveRequests|MaxMemFree|MaxRangeOverlaps|MaxRangeReversals|MaxRanges|MaxRequestWorkers|MaxSpareServers|MaxSpareThreads|MaxThreads|MergeTrailers|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads|MMapFile|ModemStandard|ModMimeUsePathInfo|MultiviewsMatch|Mutex|NameVirtualHost|NoProxy|NWSSLTrustedCerts|NWSSLUpgradeable|Options|Order|OutputSed|PassEnv|PidFile|PrivilegesMode|Protocol|ProtocolEcho|ProxyAddHeaders|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyExpressDBMFile|ProxyExpressDBMType|ProxyExpressEnable|ProxyFtpDirCharset|ProxyFtpEscapeWildcards|ProxyFtpListOnWildcard|ProxyHTMLBufSize|ProxyHTMLCharsetOut|ProxyHTMLDocType|ProxyHTMLEnable|ProxyHTMLEvents|ProxyHTMLExtended|ProxyHTMLFixups|ProxyHTMLInterp|ProxyHTMLLinks|ProxyHTMLMeta|ProxyHTMLStripComments|ProxyHTMLURLMap|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassInherit|ProxyPassInterpolateEnv|ProxyPassMatch|ProxyPassReverse|ProxyPassReverseCookieDomain|ProxyPassReverseCookiePath|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxySCGIInternalRedirect|ProxySCGISendfile|ProxySet|ProxySourceAddress|ProxyStatus|ProxyTimeout|ProxyVia|ReadmeName|ReceiveBufferSize|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ReflectorHeader|RemoteIPHeader|RemoteIPInternalProxy|RemoteIPInternalProxyList|RemoteIPProxiesHeader|RemoteIPTrustedProxy|RemoteIPTrustedProxyList|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader|RequestReadTimeout|Require|RewriteBase|RewriteCond|RewriteEngine|RewriteMap|RewriteOptions|RewriteRule|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScoreBoardFile|Script|ScriptAlias|ScriptAliasMatch|ScriptInterpreterSource|ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock|SecureListen|SeeRequestTail|SendBufferSize|ServerAdmin|ServerAlias|ServerLimit|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|Session|SessionCookieName|SessionCookieName2|SessionCookieRemove|SessionCryptoCipher|SessionCryptoDriver|SessionCryptoPassphrase|SessionCryptoPassphraseFile|SessionDBDCookieName|SessionDBDCookieName2|SessionDBDCookieRemove|SessionDBDDeleteLabel|SessionDBDInsertLabel|SessionDBDPerUser|SessionDBDSelectLabel|SessionDBDUpdateLabel|SessionEnv|SessionExclude|SessionHeader|SessionInclude|SessionMaxAge|SetEnv|SetEnvIf|SetEnvIfExpr|SetEnvIfNoCase|SetHandler|SetInputFilter|SetOutputFilter|SSIEndTag|SSIErrorMsg|SSIETag|SSILastModified|SSILegacyExprParser|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSLCACertificateFile|SSLCACertificatePath|SSLCADNRequestFile|SSLCADNRequestPath|SSLCARevocationCheck|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLCompression|SSLCryptoDevice|SSLEngine|SSLFIPS|SSLHonorCipherOrder|SSLInsecureRenegotiation|SSLOCSPDefaultResponder|SSLOCSPEnable|SSLOCSPOverrideResponder|SSLOCSPResponderTimeout|SSLOCSPResponseMaxAge|SSLOCSPResponseTimeSkew|SSLOCSPUseRequestNonce|SSLOpenSSLConfCmd|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationCheck|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCheckPeerCN|SSLProxyCheckPeerExpire|SSLProxyCheckPeerName|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateChainFile|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRenegBufferSize|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLSessionTicketKeyFile|SSLSRPUnknownUserSeed|SSLSRPVerifierFile|SSLStaplingCache|SSLStaplingErrorCacheTimeout|SSLStaplingFakeTryLater|SSLStaplingForceURL|SSLStaplingResponderTimeout|SSLStaplingResponseMaxAge|SSLStaplingResponseTimeSkew|SSLStaplingReturnResponderErrors|SSLStaplingStandardCacheTimeout|SSLStrictSNIVHostCheck|SSLUserName|SSLUseStapling|SSLVerifyClient|SSLVerifyDepth|StartServers|StartThreads|Substitute|Suexec|SuexecUserGroup|ThreadLimit|ThreadsPerChild|ThreadStackSize|TimeOut|TraceEnable|TransferLog|TypesConfig|UnDefine|UndefMacro|UnsetEnv|Use|UseCanonicalName|UseCanonicalPhysicalPort|User|UserDir|VHostCGIMode|VHostCGIPrivs|VHostGroup|VHostPrivs|VHostSecure|VHostUser|VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP|WatchdogInterval|XBitHack|xml2EncAlias|xml2EncDefault|xml2StartParse)\b/im,lookbehind:!0,alias:"property"},"directive-block":{pattern:/<\/?\b(AuthnProviderAlias|AuthzProviderAlias|Directory|DirectoryMatch|Else|ElseIf|Files|FilesMatch|If|IfDefine|IfModule|IfVersion|Limit|LimitExcept|Location|LocationMatch|Macro|Proxy|RequireAll|RequireAny|RequireNone|VirtualHost)\b *.*>/i,inside:{"directive-block":{pattern:/^<\/?\w+/,inside:{punctuation:/^<\/?/},alias:"tag"},"directive-block-parameter":{pattern:/.*[^>]/,inside:{punctuation:/:/,string:{pattern:/("|').*\1/,inside:{variable:/(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/}}},alias:"attr-value"},punctuation:/>/},alias:"tag"},"directive-flags":{pattern:/\[(\w,?)+\]/,alias:"keyword"},string:{pattern:/("|').*\1/,inside:{variable:/(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/}},variable:/(\$|%)\{?(\w\.?(\+|\-|:)?)+\}?/,regex:/\^?.*\$|\^.*\$?/}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-apl.js b/MacDown/Resources/Prism/components/prism-apl.js new file mode 100644 index 00000000..9218331b --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-apl.js @@ -0,0 +1,29 @@ +Prism.languages.apl = { + 'comment': /(?:⍝|#[! ]).*$/m, + 'string': /'(?:[^'\r\n]|'')*'/, + 'number': /¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:\d*\.?\d+(?:e[\+¯]?\d+)?|¯|∞))?/i, + 'statement': /:[A-Z][a-z][A-Za-z]*\b/, + 'system-function': { + pattern: /⎕[A-Z]+/i, + alias: 'function' + }, + 'constant': /[⍬⌾#⎕⍞]/, + 'function': /[-+×÷⌈⌊∣|⍳?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/, + 'monadic-operator': { + pattern: /[\\\/⌿⍀¨⍨⌶&∥]/, + alias: 'operator' + }, + 'dyadic-operator': { + pattern: /[.⍣⍠⍤∘⌸]/, + alias: 'operator' + }, + 'assignment': { + pattern: /←/, + alias: 'keyword' + }, + 'punctuation': /[\[;\]()◇⋄]/, + 'dfn': { + pattern: /[{}⍺⍵⍶⍹∇⍫:]/, + alias: 'builtin' + } +}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-apl.min.js b/MacDown/Resources/Prism/components/prism-apl.min.js new file mode 100644 index 00000000..bfd9dc36 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-apl.min.js @@ -0,0 +1 @@ +Prism.languages.apl={comment:/(?:⍝|#[! ]).*$/m,string:/'(?:[^'\r\n]|'')*'/,number:/¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:\d*\.?\d+(?:e[\+¯]?\d+)?|¯|∞))?/i,statement:/:[A-Z][a-z][A-Za-z]*\b/,"system-function":{pattern:/⎕[A-Z]+/i,alias:"function"},constant:/[⍬⌾#⎕⍞]/,"function":/[-+×÷⌈⌊∣|⍳?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/,"monadic-operator":{pattern:/[\\\/⌿⍀¨⍨⌶&∥]/,alias:"operator"},"dyadic-operator":{pattern:/[.⍣⍠⍤∘⌸]/,alias:"operator"},assignment:{pattern:/←/,alias:"keyword"},punctuation:/[\[;\]()◇⋄]/,dfn:{pattern:/[{}⍺⍵⍶⍹∇⍫:]/,alias:"builtin"}}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-applescript.js b/MacDown/Resources/Prism/components/prism-applescript.js new file mode 100644 index 00000000..52d0aeee --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-applescript.js @@ -0,0 +1,20 @@ +Prism.languages.applescript = { + 'comment': [ + // Allow one level of nesting + /\(\*(?:\(\*[\w\W]*?\*\)|[\w\W])*?\*\)/, + /--.+/, + /#.+/ + ], + 'string': /"(?:\\?.)*?"/, + 'number': /\b-?\d*\.?\d+([Ee]-?\d+)?\b/, + 'operator': [ + /[&=≠≤≥*+\-\/÷^]|[<>]=?/, + /\b(?:(?:start|begin|end)s? with|(?:(?:does not|doesn't) contain|contains?)|(?:is|isn't|is not) (?:in|contained by)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:(?:does not|doesn't) come|comes) (?:before|after)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equals|equal to|isn't|is not)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|or|div|mod|as|not))\b/ + ], + 'keyword': /\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/, + 'class': { + pattern: /\b(?:alias|application|boolean|class|constant|date|file|integer|list|number|POSIX file|real|record|reference|RGB color|script|text|centimetres|centimeters|feet|inches|kilometres|kilometers|metres|meters|miles|yards|square feet|square kilometres|square kilometers|square metres|square meters|square miles|square yards|cubic centimetres|cubic centimeters|cubic feet|cubic inches|cubic metres|cubic meters|cubic yards|gallons|litres|liters|quarts|grams|kilograms|ounces|pounds|degrees Celsius|degrees Fahrenheit|degrees Kelvin)\b/, + alias: 'builtin' + }, + 'punctuation': /[{}():,¬«»《》]/ +}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-applescript.min.js b/MacDown/Resources/Prism/components/prism-applescript.min.js new file mode 100644 index 00000000..9bcb2cbb --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-applescript.min.js @@ -0,0 +1 @@ +Prism.languages.applescript={comment:[/\(\*(?:\(\*[\w\W]*?\*\)|[\w\W])*?\*\)/,/--.+/,/#.+/],string:/"(?:\\?.)*?"/,number:/\b-?\d*\.?\d+([Ee]-?\d+)?\b/,operator:[/[&=≠≤≥*+\-\/÷^]|[<>]=?/,/\b(?:(?:start|begin|end)s? with|(?:(?:does not|doesn't) contain|contains?)|(?:is|isn't|is not) (?:in|contained by)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:(?:does not|doesn't) come|comes) (?:before|after)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equals|equal to|isn't|is not)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|or|div|mod|as|not))\b/],keyword:/\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/,"class":{pattern:/\b(?:alias|application|boolean|class|constant|date|file|integer|list|number|POSIX file|real|record|reference|RGB color|script|text|centimetres|centimeters|feet|inches|kilometres|kilometers|metres|meters|miles|yards|square feet|square kilometres|square kilometers|square metres|square meters|square miles|square yards|cubic centimetres|cubic centimeters|cubic feet|cubic inches|cubic metres|cubic meters|cubic yards|gallons|litres|liters|quarts|grams|kilograms|ounces|pounds|degrees Celsius|degrees Fahrenheit|degrees Kelvin)\b/,alias:"builtin"},punctuation:/[{}():,¬«»《》]/}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-asciidoc.js b/MacDown/Resources/Prism/components/prism-asciidoc.js new file mode 100644 index 00000000..55a63303 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-asciidoc.js @@ -0,0 +1,271 @@ +(function (Prism) { + + var attributes = { + pattern: /(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\]\\]|\\.)*\]|[^\]\\]|\\.)*\]/m, + lookbehind: true, + inside: { + 'quoted': { + pattern: /([$`])(?:(?!\1)[^\\]|\\.)*\1/, + inside: { + 'punctuation': /^[$`]|[$`]$/ + } + }, + 'interpreted': { + pattern: /'(?:[^'\\]|\\.)*'/, + inside: { + 'punctuation': /^'|'$/ + // See rest below + } + }, + 'string': /"(?:[^"\\]|\\.)*"/, + 'variable': /\w+(?==)/, + 'punctuation': /^\[|\]$|,/, + 'operator': /=/, + // The negative look-ahead prevents blank matches + 'attr-value': /(?!^\s+$).+/ + } + }; + Prism.languages.asciidoc = { + 'comment-block': { + pattern: /^(\/{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1/m, + alias: 'comment' + }, + 'table': { + pattern: /^\|={3,}(?:(?:\r?\n|\r).*)*?(?:\r?\n|\r)\|={3,}$/m, + inside: { + 'specifiers': { + pattern: /(?!\|)(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*])?(?:[<^>](?:\.[<^>])?|\.[<^>])?[a-z]*)(?=\|)/, + alias: 'attr-value' + }, + 'punctuation': { + pattern: /(^|[^\\])[|!]=*/, + lookbehind: true + } + // See rest below + } + }, + + 'passthrough-block': { + pattern: /^(\+{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m, + inside: { + 'punctuation': /^\++|\++$/ + // See rest below + } + }, + // Literal blocks and listing blocks + 'literal-block': { + pattern: /^(-{4,}|\.{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m, + inside: { + 'punctuation': /^(?:-+|\.+)|(?:-+|\.+)$/ + // See rest below + } + }, + // Sidebar blocks, quote blocks, example blocks and open blocks + 'other-block': { + pattern: /^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m, + inside: { + 'punctuation': /^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/ + // See rest below + } + }, + + // list-punctuation and list-label must appear before indented-block + 'list-punctuation': { + pattern: /(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im, + lookbehind: true, + alias: 'punctuation' + }, + 'list-label': { + pattern: /(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im, + lookbehind: true, + alias: 'symbol' + }, + 'indented-block': { + pattern: /((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/, + lookbehind: true + }, + + 'comment': /^\/\/.*/m, + 'title': { + pattern: /^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} +.+|^\.(?![\s.]).*/m, + alias: 'important', + inside: { + 'punctuation': /^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/ + // See rest below + } + }, + 'attribute-entry': { + pattern: /^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m, + alias: 'tag' + }, + 'attributes': attributes, + 'hr': { + pattern: /^'{3,}$/m, + alias: 'punctuation' + }, + 'page-break': { + pattern: /^<{3,}$/m, + alias: 'punctuation' + }, + 'admonition': { + pattern: /^(?:TIP|NOTE|IMPORTANT|WARNING|CAUTION):/m, + alias: 'keyword' + }, + 'callout': [ + { + pattern: /(^[ \t]*)/m, + lookbehind: true, + alias: 'symbol' + }, + { + pattern: /<\d+>/, + alias: 'symbol' + } + ], + 'macro': { + pattern: /\b[a-z\d][a-z\d-]*::?(?:(?:\S+)??\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/, + inside: { + 'function': /^[a-z\d-]+(?=:)/, + 'punctuation': /^::?/, + 'attributes': { + pattern: /(?:\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/, + inside: attributes.inside + } + } + }, + 'inline': { + /* + The initial look-behind prevents the highlighting of escaped quoted text. + + Quoted text can be multi-line but cannot span an empty line. + All quoted text can have attributes before [foobar, 'foobar', baz="bar"]. + + First, we handle the constrained quotes. + Those must be bounded by non-word chars and cannot have spaces between the delimiter and the first char. + They are, in order: _emphasis_, ``double quotes'', `single quotes', `monospace`, 'emphasis', *strong*, +monospace+ and #unquoted# + + Then we handle the unconstrained quotes. + Those do not have the restrictions of the constrained quotes. + They are, in order: __emphasis__, **strong**, ++monospace++, +++passthrough+++, ##unquoted##, $$passthrough$$, ~subscript~, ^superscript^, {attribute-reference}, [[anchor]], [[[bibliography anchor]]], <>, (((indexes))) and ((indexes)) + */ + pattern: /(^|[^\\])(?:(?:\B\[(?:[^\]\\"]|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?: ['`]|.)+?(?:(?:\r?\n|\r)(?: ['`]|.)+?)*['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"]|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m, + lookbehind: true, + inside: { + 'attributes': attributes, + 'url': { + pattern: /^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/, + inside: { + 'punctuation': /^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/ + } + }, + 'attribute-ref': { + pattern: /^\{.+\}$/, + inside: { + 'variable': { + pattern: /(^\{)[a-z\d,+_-]+/, + lookbehind: true + }, + 'operator': /^[=?!#%@$]|!(?=[:}])/, + 'punctuation': /^\{|\}$|::?/ + } + }, + 'italic': { + pattern: /^(['_])[\s\S]+\1$/, + inside: { + 'punctuation': /^(?:''?|__?)|(?:''?|__?)$/ + } + }, + 'bold': { + pattern: /^\*[\s\S]+\*$/, + inside: { + punctuation: /^\*\*?|\*\*?$/ + } + }, + 'punctuation': /^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/ + } + }, + 'replacement': { + pattern: /\((?:C|TM|R)\)/, + alias: 'builtin' + }, + 'entity': /&#?[\da-z]{1,8};/i, + 'line-continuation': { + pattern: /(^| )\+$/m, + lookbehind: true, + alias: 'punctuation' + } + }; + + + // Allow some nesting. There is no recursion though, so cloning should not be needed. + + attributes.inside['interpreted'].inside.rest = { + 'macro': Prism.languages.asciidoc['macro'], + 'inline': Prism.languages.asciidoc['inline'], + 'replacement': Prism.languages.asciidoc['replacement'], + 'entity': Prism.languages.asciidoc['entity'] + }; + + Prism.languages.asciidoc['passthrough-block'].inside.rest = { + 'macro': Prism.languages.asciidoc['macro'] + }; + + Prism.languages.asciidoc['literal-block'].inside.rest = { + 'callout': Prism.languages.asciidoc['callout'] + }; + + Prism.languages.asciidoc['table'].inside.rest = { + 'comment-block': Prism.languages.asciidoc['comment-block'], + 'passthrough-block': Prism.languages.asciidoc['passthrough-block'], + 'literal-block': Prism.languages.asciidoc['literal-block'], + 'other-block': Prism.languages.asciidoc['other-block'], + 'list-punctuation': Prism.languages.asciidoc['list-punctuation'], + 'indented-block': Prism.languages.asciidoc['indented-block'], + 'comment': Prism.languages.asciidoc['comment'], + 'title': Prism.languages.asciidoc['title'], + 'attribute-entry': Prism.languages.asciidoc['attribute-entry'], + 'attributes': Prism.languages.asciidoc['attributes'], + 'hr': Prism.languages.asciidoc['hr'], + 'page-break': Prism.languages.asciidoc['page-break'], + 'admonition': Prism.languages.asciidoc['admonition'], + 'list-label': Prism.languages.asciidoc['list-label'], + 'callout': Prism.languages.asciidoc['callout'], + 'macro': Prism.languages.asciidoc['macro'], + 'inline': Prism.languages.asciidoc['inline'], + 'replacement': Prism.languages.asciidoc['replacement'], + 'entity': Prism.languages.asciidoc['entity'], + 'line-continuation': Prism.languages.asciidoc['line-continuation'] + }; + + Prism.languages.asciidoc['other-block'].inside.rest = { + 'table': Prism.languages.asciidoc['table'], + 'list-punctuation': Prism.languages.asciidoc['list-punctuation'], + 'indented-block': Prism.languages.asciidoc['indented-block'], + 'comment': Prism.languages.asciidoc['comment'], + 'attribute-entry': Prism.languages.asciidoc['attribute-entry'], + 'attributes': Prism.languages.asciidoc['attributes'], + 'hr': Prism.languages.asciidoc['hr'], + 'page-break': Prism.languages.asciidoc['page-break'], + 'admonition': Prism.languages.asciidoc['admonition'], + 'list-label': Prism.languages.asciidoc['list-label'], + 'macro': Prism.languages.asciidoc['macro'], + 'inline': Prism.languages.asciidoc['inline'], + 'replacement': Prism.languages.asciidoc['replacement'], + 'entity': Prism.languages.asciidoc['entity'], + 'line-continuation': Prism.languages.asciidoc['line-continuation'] + }; + + Prism.languages.asciidoc['title'].inside.rest = { + 'macro': Prism.languages.asciidoc['macro'], + 'inline': Prism.languages.asciidoc['inline'], + 'replacement': Prism.languages.asciidoc['replacement'], + 'entity': Prism.languages.asciidoc['entity'] + }; + + // Plugin to make entity title show the real entity, idea by Roman Komarov + Prism.hooks.add('wrap', function(env) { + if (env.type === 'entity') { + env.attributes['title'] = env.content.replace(/&/, '&'); + } + }); +}(Prism)); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-asciidoc.min.js b/MacDown/Resources/Prism/components/prism-asciidoc.min.js new file mode 100644 index 00000000..6d6ae173 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-asciidoc.min.js @@ -0,0 +1 @@ +!function(a){var i={pattern:/(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\]\\]|\\.)*\]|[^\]\\]|\\.)*\]/m,lookbehind:!0,inside:{quoted:{pattern:/([$`])(?:(?!\1)[^\\]|\\.)*\1/,inside:{punctuation:/^[$`]|[$`]$/}},interpreted:{pattern:/'(?:[^'\\]|\\.)*'/,inside:{punctuation:/^'|'$/}},string:/"(?:[^"\\]|\\.)*"/,variable:/\w+(?==)/,punctuation:/^\[|\]$|,/,operator:/=/,"attr-value":/(?!^\s+$).+/}};a.languages.asciidoc={"comment-block":{pattern:/^(\/{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1/m,alias:"comment"},table:{pattern:/^\|={3,}(?:(?:\r?\n|\r).*)*?(?:\r?\n|\r)\|={3,}$/m,inside:{specifiers:{pattern:/(?!\|)(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*])?(?:[<^>](?:\.[<^>])?|\.[<^>])?[a-z]*)(?=\|)/,alias:"attr-value"},punctuation:{pattern:/(^|[^\\])[|!]=*/,lookbehind:!0}}},"passthrough-block":{pattern:/^(\+{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m,inside:{punctuation:/^\++|\++$/}},"literal-block":{pattern:/^(-{4,}|\.{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m,inside:{punctuation:/^(?:-+|\.+)|(?:-+|\.+)$/}},"other-block":{pattern:/^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m,inside:{punctuation:/^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/}},"list-punctuation":{pattern:/(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im,lookbehind:!0,alias:"punctuation"},"list-label":{pattern:/(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im,lookbehind:!0,alias:"symbol"},"indented-block":{pattern:/((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/,lookbehind:!0},comment:/^\/\/.*/m,title:{pattern:/^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} +.+|^\.(?![\s.]).*/m,alias:"important",inside:{punctuation:/^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/}},"attribute-entry":{pattern:/^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m,alias:"tag"},attributes:i,hr:{pattern:/^'{3,}$/m,alias:"punctuation"},"page-break":{pattern:/^<{3,}$/m,alias:"punctuation"},admonition:{pattern:/^(?:TIP|NOTE|IMPORTANT|WARNING|CAUTION):/m,alias:"keyword"},callout:[{pattern:/(^[ \t]*)/m,lookbehind:!0,alias:"symbol"},{pattern:/<\d+>/,alias:"symbol"}],macro:{pattern:/\b[a-z\d][a-z\d-]*::?(?:(?:\S+)??\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:{"function":/^[a-z\d-]+(?=:)/,punctuation:/^::?/,attributes:{pattern:/(?:\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:i.inside}}},inline:{pattern:/(^|[^\\])(?:(?:\B\[(?:[^\]\\"]|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?: ['`]|.)+?(?:(?:\r?\n|\r)(?: ['`]|.)+?)*['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"]|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m,lookbehind:!0,inside:{attributes:i,url:{pattern:/^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/,inside:{punctuation:/^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/}},"attribute-ref":{pattern:/^\{.+\}$/,inside:{variable:{pattern:/(^\{)[a-z\d,+_-]+/,lookbehind:!0},operator:/^[=?!#%@$]|!(?=[:}])/,punctuation:/^\{|\}$|::?/}},italic:{pattern:/^(['_])[\s\S]+\1$/,inside:{punctuation:/^(?:''?|__?)|(?:''?|__?)$/}},bold:{pattern:/^\*[\s\S]+\*$/,inside:{punctuation:/^\*\*?|\*\*?$/}},punctuation:/^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/}},replacement:{pattern:/\((?:C|TM|R)\)/,alias:"builtin"},entity:/&#?[\da-z]{1,8};/i,"line-continuation":{pattern:/(^| )\+$/m,lookbehind:!0,alias:"punctuation"}},i.inside.interpreted.inside.rest={macro:a.languages.asciidoc.macro,inline:a.languages.asciidoc.inline,replacement:a.languages.asciidoc.replacement,entity:a.languages.asciidoc.entity},a.languages.asciidoc["passthrough-block"].inside.rest={macro:a.languages.asciidoc.macro},a.languages.asciidoc["literal-block"].inside.rest={callout:a.languages.asciidoc.callout},a.languages.asciidoc.table.inside.rest={"comment-block":a.languages.asciidoc["comment-block"],"passthrough-block":a.languages.asciidoc["passthrough-block"],"literal-block":a.languages.asciidoc["literal-block"],"other-block":a.languages.asciidoc["other-block"],"list-punctuation":a.languages.asciidoc["list-punctuation"],"indented-block":a.languages.asciidoc["indented-block"],comment:a.languages.asciidoc.comment,title:a.languages.asciidoc.title,"attribute-entry":a.languages.asciidoc["attribute-entry"],attributes:a.languages.asciidoc.attributes,hr:a.languages.asciidoc.hr,"page-break":a.languages.asciidoc["page-break"],admonition:a.languages.asciidoc.admonition,"list-label":a.languages.asciidoc["list-label"],callout:a.languages.asciidoc.callout,macro:a.languages.asciidoc.macro,inline:a.languages.asciidoc.inline,replacement:a.languages.asciidoc.replacement,entity:a.languages.asciidoc.entity,"line-continuation":a.languages.asciidoc["line-continuation"]},a.languages.asciidoc["other-block"].inside.rest={table:a.languages.asciidoc.table,"list-punctuation":a.languages.asciidoc["list-punctuation"],"indented-block":a.languages.asciidoc["indented-block"],comment:a.languages.asciidoc.comment,"attribute-entry":a.languages.asciidoc["attribute-entry"],attributes:a.languages.asciidoc.attributes,hr:a.languages.asciidoc.hr,"page-break":a.languages.asciidoc["page-break"],admonition:a.languages.asciidoc.admonition,"list-label":a.languages.asciidoc["list-label"],macro:a.languages.asciidoc.macro,inline:a.languages.asciidoc.inline,replacement:a.languages.asciidoc.replacement,entity:a.languages.asciidoc.entity,"line-continuation":a.languages.asciidoc["line-continuation"]},a.languages.asciidoc.title.inside.rest={macro:a.languages.asciidoc.macro,inline:a.languages.asciidoc.inline,replacement:a.languages.asciidoc.replacement,entity:a.languages.asciidoc.entity},a.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))})}(Prism); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-aspnet.js b/MacDown/Resources/Prism/components/prism-aspnet.js new file mode 100644 index 00000000..9511e453 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-aspnet.js @@ -0,0 +1,36 @@ +Prism.languages.aspnet = Prism.languages.extend('markup', { + 'page-directive tag': { + pattern: /<%\s*@.*%>/i, + inside: { + 'page-directive tag': /<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i, + rest: Prism.languages.markup.tag.inside + } + }, + 'directive tag': { + pattern: /<%.*%>/i, + inside: { + 'directive tag': /<%\s*?[$=%#:]{0,2}|%>/i, + rest: Prism.languages.csharp + } + } +}); +// Regexp copied from prism-markup, with a negative look-ahead added +Prism.languages.aspnet.tag.pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i; + +// match directives of attribute value foo="<% Bar %>" +Prism.languages.insertBefore('inside', 'punctuation', { + 'directive tag': Prism.languages.aspnet['directive tag'] +}, Prism.languages.aspnet.tag.inside["attr-value"]); + +Prism.languages.insertBefore('aspnet', 'comment', { + 'asp comment': /<%--[\w\W]*?--%>/ +}); + +// script runat="server" contains csharp, not javascript +Prism.languages.insertBefore('aspnet', Prism.languages.javascript ? 'script' : 'tag', { + 'asp script': { + pattern: /()[\w\W]*?(?=<\/script>)/i, + lookbehind: true, + inside: Prism.languages.csharp || {} + } +}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-aspnet.min.js b/MacDown/Resources/Prism/components/prism-aspnet.min.js new file mode 100644 index 00000000..0afede54 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-aspnet.min.js @@ -0,0 +1 @@ +Prism.languages.aspnet=Prism.languages.extend("markup",{"page-directive tag":{pattern:/<%\s*@.*%>/i,inside:{"page-directive tag":/<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,rest:Prism.languages.markup.tag.inside}},"directive tag":{pattern:/<%.*%>/i,inside:{"directive tag":/<%\s*?[$=%#:]{0,2}|%>/i,rest:Prism.languages.csharp}}}),Prism.languages.aspnet.tag.pattern=/<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,Prism.languages.insertBefore("inside","punctuation",{"directive tag":Prism.languages.aspnet["directive tag"]},Prism.languages.aspnet.tag.inside["attr-value"]),Prism.languages.insertBefore("aspnet","comment",{"asp comment":/<%--[\w\W]*?--%>/}),Prism.languages.insertBefore("aspnet",Prism.languages.javascript?"script":"tag",{"asp script":{pattern:/()[\w\W]*?(?=<\/script>)/i,lookbehind:!0,inside:Prism.languages.csharp||{}}}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-autohotkey.js b/MacDown/Resources/Prism/components/prism-autohotkey.js new file mode 100644 index 00000000..c66e0570 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-autohotkey.js @@ -0,0 +1,27 @@ +// NOTES - follows first-first highlight method, block is locked after highlight, different from SyntaxHl +Prism.languages.autohotkey= { + 'comment': { + pattern: /(^[^";\n]*("[^"\n]*?"[^"\n]*?)*)(;.*$|^\s*\/\*[\s\S]*\n\*\/)/m, + lookbehind: true + }, + 'string': /"(([^"\n\r]|"")*)"/m, + 'function': /[^\(\); \t,\n\+\*\-=\?>:\\\/<&%\[\]]+?(?=\()/m, //function - don't use .*\) in the end bcoz string locks it + 'tag': /^[ \t]*[^\s:]+?(?=:(?:[^:]|$))/m, //labels + 'variable': /%\w+%/, + 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/, + 'operator': /\?|\/\/?=?|:=|\|[=|]?|&[=&]?|\+[=+]?|-[=-]?|\*[=*]?|<(?:<=?|>|=)?|>>?=?|[.^!=~]=?|\b(?:AND|NOT|OR)\b/, + 'punctuation': /[\{}[\]\(\):,]/, + 'boolean': /\b(true|false)\b/, + + 'selector': /\b(AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i, + + 'constant': /\b(a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_formatfloat|a_formatinteger|a_gui|a_guievent|a_guicontrol|a_guicontrolevent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_isunicode|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|programfiles|a_programfiles|a_programs|a_programscommon|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel)\b/i, + + 'builtin': /\b(abs|acos|asc|asin|atan|ceil|chr|class|cos|dllcall|exp|fileexist|Fileopen|floor|il_add|il_create|il_destroy|instr|substr|isfunc|islabel|IsObject|ln|log|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|onmessage|numget|numput|registercallback|regexmatch|regexreplace|round|sin|tan|sqrt|strlen|sb_seticon|sb_setparts|sb_settext|strsplit|tv_add|tv_delete|tv_getchild|tv_getcount|tv_getnext|tv_get|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__New|__Call|__Get|__Set)\b/i, + + 'symbol': /\b(alt|altdown|altup|appskey|backspace|browser_back|browser_favorites|browser_forward|browser_home|browser_refresh|browser_search|browser_stop|bs|capslock|ctrl|ctrlbreak|ctrldown|ctrlup|del|delete|down|end|enter|esc|escape|f1|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f2|f20|f21|f22|f23|f24|f3|f4|f5|f6|f7|f8|f9|home|ins|insert|joy1|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy2|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy3|joy30|joy31|joy32|joy4|joy5|joy6|joy7|joy8|joy9|joyaxes|joybuttons|joyinfo|joyname|joypov|joyr|joyu|joyv|joyx|joyy|joyz|lalt|launch_app1|launch_app2|launch_mail|launch_media|lbutton|lcontrol|lctrl|left|lshift|lwin|lwindown|lwinup|mbutton|media_next|media_play_pause|media_prev|media_stop|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadadd|numpadclear|numpaddel|numpaddiv|numpaddot|numpaddown|numpadend|numpadenter|numpadhome|numpadins|numpadleft|numpadmult|numpadpgdn|numpadpgup|numpadright|numpadsub|numpadup|pgdn|pgup|printscreen|ralt|rbutton|rcontrol|rctrl|right|rshift|rwin|rwindown|rwinup|scrolllock|shift|shiftdown|shiftup|space|tab|up|volume_down|volume_mute|volume_up|wheeldown|wheelleft|wheelright|wheelup|xbutton1|xbutton2)\b/i, + + 'important': /#\b(AllowSameLineComments|ClipboardTimeout|CommentFlag|ErrorStdOut|EscapeChar|HotkeyInterval|HotkeyModifierTimeout|Hotstring|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Include|IncludeAgain|InstallKeybdHook|InstallMouseHook|KeyHistory|LTrim|MaxHotkeysPerInterval|MaxMem|MaxThreads|MaxThreadsBuffer|MaxThreadsPerHotkey|NoEnv|NoTrayIcon|Persistent|SingleInstance|UseHook|WinActivateForce)\b/i, + + 'keyword': /\b(Abort|AboveNormal|Add|ahk_class|ahk_group|ahk_id|ahk_pid|All|Alnum|Alpha|AltSubmit|AltTab|AltTabAndMenu|AltTabMenu|AltTabMenuDismiss|AlwaysOnTop|AutoSize|Background|BackgroundTrans|BelowNormal|between|BitAnd|BitNot|BitOr|BitShiftLeft|BitShiftRight|BitXOr|Bold|Border|Button|ByRef|Checkbox|Checked|CheckedGray|Choose|ChooseString|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Expand|ExStyle|FileSystem|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Region|Relative|Rename|Report|Resize|Restore|Retry|RGB|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab2|TabStop|Text|Theme|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|TryAgain|Type|UnCheck|underline|Unicode|Unlock|UpDown|Upper|Uppercase|UseErrorLevel|Vis|VisFirst|Visible|VScroll|Wait|WaitClose|WantCtrlA|WantF2|WantReturn|While|Wrap|Xdigit|xm|xp|xs|Yes|ym|yp|ys)\b/i +}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-autohotkey.min.js b/MacDown/Resources/Prism/components/prism-autohotkey.min.js new file mode 100644 index 00000000..d4d9685b --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-autohotkey.min.js @@ -0,0 +1 @@ +Prism.languages.autohotkey={comment:{pattern:/(^[^";\n]*("[^"\n]*?"[^"\n]*?)*)(;.*$|^\s*\/\*[\s\S]*\n\*\/)/m,lookbehind:!0},string:/"(([^"\n\r]|"")*)"/m,"function":/[^\(\); \t,\n\+\*\-=\?>:\\\/<&%\[\]]+?(?=\()/m,tag:/^[ \t]*[^\s:]+?(?=:(?:[^:]|$))/m,variable:/%\w+%/,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,operator:/\?|\/\/?=?|:=|\|[=|]?|&[=&]?|\+[=+]?|-[=-]?|\*[=*]?|<(?:<=?|>|=)?|>>?=?|[.^!=~]=?|\b(?:AND|NOT|OR)\b/,punctuation:/[\{}[\]\(\):,]/,"boolean":/\b(true|false)\b/,selector:/\b(AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i,constant:/\b(a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_formatfloat|a_formatinteger|a_gui|a_guievent|a_guicontrol|a_guicontrolevent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_isunicode|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|programfiles|a_programfiles|a_programs|a_programscommon|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel)\b/i,builtin:/\b(abs|acos|asc|asin|atan|ceil|chr|class|cos|dllcall|exp|fileexist|Fileopen|floor|il_add|il_create|il_destroy|instr|substr|isfunc|islabel|IsObject|ln|log|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|onmessage|numget|numput|registercallback|regexmatch|regexreplace|round|sin|tan|sqrt|strlen|sb_seticon|sb_setparts|sb_settext|strsplit|tv_add|tv_delete|tv_getchild|tv_getcount|tv_getnext|tv_get|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__New|__Call|__Get|__Set)\b/i,symbol:/\b(alt|altdown|altup|appskey|backspace|browser_back|browser_favorites|browser_forward|browser_home|browser_refresh|browser_search|browser_stop|bs|capslock|ctrl|ctrlbreak|ctrldown|ctrlup|del|delete|down|end|enter|esc|escape|f1|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f2|f20|f21|f22|f23|f24|f3|f4|f5|f6|f7|f8|f9|home|ins|insert|joy1|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy2|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy3|joy30|joy31|joy32|joy4|joy5|joy6|joy7|joy8|joy9|joyaxes|joybuttons|joyinfo|joyname|joypov|joyr|joyu|joyv|joyx|joyy|joyz|lalt|launch_app1|launch_app2|launch_mail|launch_media|lbutton|lcontrol|lctrl|left|lshift|lwin|lwindown|lwinup|mbutton|media_next|media_play_pause|media_prev|media_stop|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadadd|numpadclear|numpaddel|numpaddiv|numpaddot|numpaddown|numpadend|numpadenter|numpadhome|numpadins|numpadleft|numpadmult|numpadpgdn|numpadpgup|numpadright|numpadsub|numpadup|pgdn|pgup|printscreen|ralt|rbutton|rcontrol|rctrl|right|rshift|rwin|rwindown|rwinup|scrolllock|shift|shiftdown|shiftup|space|tab|up|volume_down|volume_mute|volume_up|wheeldown|wheelleft|wheelright|wheelup|xbutton1|xbutton2)\b/i,important:/#\b(AllowSameLineComments|ClipboardTimeout|CommentFlag|ErrorStdOut|EscapeChar|HotkeyInterval|HotkeyModifierTimeout|Hotstring|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Include|IncludeAgain|InstallKeybdHook|InstallMouseHook|KeyHistory|LTrim|MaxHotkeysPerInterval|MaxMem|MaxThreads|MaxThreadsBuffer|MaxThreadsPerHotkey|NoEnv|NoTrayIcon|Persistent|SingleInstance|UseHook|WinActivateForce)\b/i,keyword:/\b(Abort|AboveNormal|Add|ahk_class|ahk_group|ahk_id|ahk_pid|All|Alnum|Alpha|AltSubmit|AltTab|AltTabAndMenu|AltTabMenu|AltTabMenuDismiss|AlwaysOnTop|AutoSize|Background|BackgroundTrans|BelowNormal|between|BitAnd|BitNot|BitOr|BitShiftLeft|BitShiftRight|BitXOr|Bold|Border|Button|ByRef|Checkbox|Checked|CheckedGray|Choose|ChooseString|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Expand|ExStyle|FileSystem|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Region|Relative|Rename|Report|Resize|Restore|Retry|RGB|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab2|TabStop|Text|Theme|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|TryAgain|Type|UnCheck|underline|Unicode|Unlock|UpDown|Upper|Uppercase|UseErrorLevel|Vis|VisFirst|Visible|VScroll|Wait|WaitClose|WantCtrlA|WantF2|WantReturn|While|Wrap|Xdigit|xm|xp|xs|Yes|ym|yp|ys)\b/i}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-autoit.js b/MacDown/Resources/Prism/components/prism-autoit.js new file mode 100644 index 00000000..0322d956 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-autoit.js @@ -0,0 +1,33 @@ +Prism.languages.autoit = { + "comment": [ + /;.*/, + { + // The multi-line comments delimiters can actually be commented out with ";" + pattern: /(^\s*)#(?:comments-start|cs)[\s\S]*?^\s*#(?:comments-end|ce)/m, + lookbehind: true + } + ], + "url": { + pattern: /(^\s*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m, + lookbehind: true + }, + "string": { + pattern: /(["'])(?:\1\1|(?!\1)[^\r\n])*\1/, + inside: { + "variable": /([%$@])\w+\1/ + } + }, + "directive": { + pattern: /(^\s*)#\w+/m, + lookbehind: true, + alias: 'keyword' + }, + "function": /\b\w+(?=\()/, + // Variables and macros + "variable": /[$@]\w+/, + "keyword": /\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i, + "number": /\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i, + "boolean": /\b(?:True|False)\b/i, + "operator": /<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Or|Not)\b/i, + "punctuation": /[\[\]().,:]/ +}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-autoit.min.js b/MacDown/Resources/Prism/components/prism-autoit.min.js new file mode 100644 index 00000000..49b79864 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-autoit.min.js @@ -0,0 +1 @@ +Prism.languages.autoit={comment:[/;.*/,{pattern:/(^\s*)#(?:comments-start|cs)[\s\S]*?^\s*#(?:comments-end|ce)/m,lookbehind:!0}],url:{pattern:/(^\s*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m,lookbehind:!0},string:{pattern:/(["'])(?:\1\1|(?!\1)[^\r\n])*\1/,inside:{variable:/([%$@])\w+\1/}},directive:{pattern:/(^\s*)#\w+/m,lookbehind:!0,alias:"keyword"},"function":/\b\w+(?=\()/,variable:/[$@]\w+/,keyword:/\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i,number:/\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,"boolean":/\b(?:True|False)\b/i,operator:/<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Or|Not)\b/i,punctuation:/[\[\]().,:]/}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-bash.js b/MacDown/Resources/Prism/components/prism-bash.js new file mode 100644 index 00000000..6fa4ebb4 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-bash.js @@ -0,0 +1,78 @@ +(function(Prism) { + var insideString = { + variable: [ + // Arithmetic Environment + { + pattern: /\$?\(\([\w\W]+?\)\)/, + inside: { + // If there is a $ sign at the beginning highlight $(( and )) as variable + variable: [{ + pattern: /(^\$\(\([\w\W]+)\)\)/, + lookbehind: true + }, + /^\$\(\(/, + ], + number: /\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee]-?\d+)?)\b/, + // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic + operator: /--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/, + // If there is no $ sign at the beginning highlight (( and )) as punctuation + punctuation: /\(\(?|\)\)?|,|;/ + } + }, + // Command Substitution + { + pattern: /\$\([^)]+\)|`[^`]+`/, + inside: { + variable: /^\$\(|^`|\)$|`$/ + } + }, + /\$(?:[a-z0-9_#\?\*!@]+|\{[^}]+\})/i + ], + }; + + Prism.languages.bash = { + 'shebang': { + pattern: /^#!\s*\/bin\/bash|^#!\s*\/bin\/sh/, + alias: 'important' + }, + 'comment': { + pattern: /(^|[^"{\\])#.*/, + lookbehind: true + }, + 'string': [ + //Support for Here-Documents https://en.wikipedia.org/wiki/Here_document + { + pattern: /((?:^|[^<])<<\s*)(?:"|')?(\w+?)(?:"|')?\s*\r?\n(?:[\s\S])*?\r?\n\2/g, + lookbehind: true, + inside: insideString + }, + { + pattern: /(["'])(?:\\\\|\\?[^\\])*?\1/g, + inside: insideString + } + ], + 'variable': insideString.variable, + // Originally based on http://ss64.com/bash/ + 'function': { + pattern: /(^|\s|;|\||&)(?:alias|apropos|apt-get|aptitude|aspell|awk|basename|bash|bc|bg|builtin|bzip2|cal|cat|cd|cfdisk|chgrp|chmod|chown|chroot|chkconfig|cksum|clear|cmp|comm|command|cp|cron|crontab|csplit|cut|date|dc|dd|ddrescue|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|enable|env|ethtool|eval|exec|expand|expect|export|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|getopts|git|grep|groupadd|groupdel|groupmod|groups|gzip|hash|head|help|hg|history|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|jobs|join|kill|killall|less|link|ln|locate|logname|logout|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|make|man|mkdir|mkfifo|mkisofs|mknod|more|most|mount|mtools|mtr|mv|mmv|nano|netstat|nice|nl|nohup|notify-send|nslookup|open|op|passwd|paste|pathchk|ping|pkill|popd|pr|printcap|printenv|printf|ps|pushd|pv|pwd|quota|quotacheck|quotactl|ram|rar|rcp|read|readarray|readonly|reboot|rename|renice|remsync|rev|rm|rmdir|rsync|screen|scp|sdiff|sed|seq|service|sftp|shift|shopt|shutdown|sleep|slocate|sort|source|split|ssh|stat|strace|su|sudo|sum|suspend|sync|tail|tar|tee|test|time|timeout|times|touch|top|traceroute|trap|tr|tsort|tty|type|ulimit|umask|umount|unalias|uname|unexpand|uniq|units|unrar|unshar|uptime|useradd|userdel|usermod|users|uuencode|uudecode|v|vdir|vi|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yes|zip)(?=$|\s|;|\||&)/, + lookbehind: true + }, + 'keyword': { + pattern: /(^|\s|;|\||&)(?:let|:|\.|if|then|else|elif|fi|for|break|continue|while|in|case|function|select|do|done|until|echo|exit|return|set|declare)(?=$|\s|;|\||&)/, + lookbehind: true + }, + 'boolean': { + pattern: /(^|\s|;|\||&)(?:true|false)(?=$|\s|;|\||&)/, + lookbehind: true + }, + 'operator': /&&?|\|\|?|==?|!=?|<<>|<=?|>=?|=~/, + 'punctuation': /\$?\(\(?|\)\)?|\.\.|[{}[\];]/ + }; + + var inside = insideString.variable[1].inside; + inside['function'] = Prism.languages.bash['function']; + inside.keyword = Prism.languages.bash.keyword; + inside.boolean = Prism.languages.bash.boolean; + inside.operator = Prism.languages.bash.operator; + inside.punctuation = Prism.languages.bash.punctuation; +})(Prism); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-bash.min.js b/MacDown/Resources/Prism/components/prism-bash.min.js new file mode 100644 index 00000000..9a1b5c65 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-bash.min.js @@ -0,0 +1 @@ +!function(e){var t={variable:[{pattern:/\$?\(\([\w\W]+?\)\)/,inside:{variable:[{pattern:/(^\$\(\([\w\W]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee]-?\d+)?)\b/,operator:/--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\([^)]+\)|`[^`]+`/,inside:{variable:/^\$\(|^`|\)$|`$/}},/\$(?:[a-z0-9_#\?\*!@]+|\{[^}]+\})/i]};e.languages.bash={shebang:{pattern:/^#!\s*\/bin\/bash|^#!\s*\/bin\/sh/,alias:"important"},comment:{pattern:/(^|[^"{\\])#.*/,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<\s*)(?:"|')?(\w+?)(?:"|')?\s*\r?\n(?:[\s\S])*?\r?\n\2/g,lookbehind:!0,inside:t},{pattern:/(["'])(?:\\\\|\\?[^\\])*?\1/g,inside:t}],variable:t.variable,"function":{pattern:/(^|\s|;|\||&)(?:alias|apropos|apt-get|aptitude|aspell|awk|basename|bash|bc|bg|builtin|bzip2|cal|cat|cd|cfdisk|chgrp|chmod|chown|chroot|chkconfig|cksum|clear|cmp|comm|command|cp|cron|crontab|csplit|cut|date|dc|dd|ddrescue|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|enable|env|ethtool|eval|exec|expand|expect|export|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|getopts|git|grep|groupadd|groupdel|groupmod|groups|gzip|hash|head|help|hg|history|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|jobs|join|kill|killall|less|link|ln|locate|logname|logout|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|make|man|mkdir|mkfifo|mkisofs|mknod|more|most|mount|mtools|mtr|mv|mmv|nano|netstat|nice|nl|nohup|notify-send|nslookup|open|op|passwd|paste|pathchk|ping|pkill|popd|pr|printcap|printenv|printf|ps|pushd|pv|pwd|quota|quotacheck|quotactl|ram|rar|rcp|read|readarray|readonly|reboot|rename|renice|remsync|rev|rm|rmdir|rsync|screen|scp|sdiff|sed|seq|service|sftp|shift|shopt|shutdown|sleep|slocate|sort|source|split|ssh|stat|strace|su|sudo|sum|suspend|sync|tail|tar|tee|test|time|timeout|times|touch|top|traceroute|trap|tr|tsort|tty|type|ulimit|umask|umount|unalias|uname|unexpand|uniq|units|unrar|unshar|uptime|useradd|userdel|usermod|users|uuencode|uudecode|v|vdir|vi|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yes|zip)(?=$|\s|;|\||&)/,lookbehind:!0},keyword:{pattern:/(^|\s|;|\||&)(?:let|:|\.|if|then|else|elif|fi|for|break|continue|while|in|case|function|select|do|done|until|echo|exit|return|set|declare)(?=$|\s|;|\||&)/,lookbehind:!0},"boolean":{pattern:/(^|\s|;|\||&)(?:true|false)(?=$|\s|;|\||&)/,lookbehind:!0},operator:/&&?|\|\|?|==?|!=?|<<>|<=?|>=?|=~/,punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];]/};var a=t.variable[1].inside;a["function"]=e.languages.bash["function"],a.keyword=e.languages.bash.keyword,a.boolean=e.languages.bash.boolean,a.operator=e.languages.bash.operator,a.punctuation=e.languages.bash.punctuation}(Prism); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-basic.js b/MacDown/Resources/Prism/components/prism-basic.js new file mode 100644 index 00000000..8c5338fc --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-basic.js @@ -0,0 +1,14 @@ +Prism.languages.basic = { + 'string': /"(?:""|[!#$%&'()*,\/:;<=>?^_ +\-.A-Z\d])*"/i, + 'comment': { + pattern: /(?:!|REM\b).+/i, + inside: { + 'keyword': /^REM/i + } + }, + 'number': /(?:\b|\B[.-])(?:\d+\.?\d*)(?:E[+-]?\d+)?/i, + 'keyword': /\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SHARED|SINGLE|SELECT CASE|SHELL|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i, + 'function': /\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i, + 'operator': /<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i, + 'punctuation': /[,;:()]/ +}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-basic.min.js b/MacDown/Resources/Prism/components/prism-basic.min.js new file mode 100644 index 00000000..f2c8baa2 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-basic.min.js @@ -0,0 +1 @@ +Prism.languages.basic={string:/"(?:""|[!#$%&'()*,\/:;<=>?^_ +\-.A-Z\d])*"/i,comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},number:/(?:\b|\B[.-])(?:\d+\.?\d*)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SHARED|SINGLE|SELECT CASE|SHELL|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,"function":/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-batch.js b/MacDown/Resources/Prism/components/prism-batch.js new file mode 100644 index 00000000..c7ca9ca6 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-batch.js @@ -0,0 +1,99 @@ +(function (Prism) { + var variable = /%%?[~:\w]+%?|!\S+!/; + var parameter = { + pattern: /\/[a-z?]+(?=[ :]|$):?|-[a-z]\b|--[a-z-]+\b/im, + alias: 'attr-name', + inside: { + 'punctuation': /:/ + } + }; + var string = /"[^"]*"/; + var number = /(?:\b|-)\d+\b/; + + Prism.languages.batch = { + 'comment': [ + /^::.*/m, + { + pattern: /((?:^|[&(])[ \t]*)rem\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im, + lookbehind: true + } + ], + 'label': { + pattern: /^:.*/m, + alias: 'property' + }, + 'command': [ + { + // FOR command + pattern: /((?:^|[&(])[ \t]*)for(?: ?\/[a-z?](?:[ :](?:"[^"]*"|\S+))?)* \S+ in \([^)]+\) do/im, + lookbehind: true, + inside: { + 'keyword': /^for\b|\b(?:in|do)\b/i, + 'string': string, + 'parameter': parameter, + 'variable': variable, + 'number': number, + 'punctuation': /[()',]/ + } + }, + { + // IF command + pattern: /((?:^|[&(])[ \t]*)if(?: ?\/[a-z?](?:[ :](?:"[^"]*"|\S+))?)* (?:not )?(?:cmdextversion \d+|defined \w+|errorlevel \d+|exist \S+|(?:"[^"]*"|\S+)?(?:==| (?:equ|neq|lss|leq|gtr|geq) )(?:"[^"]*"|\S+))/im, + lookbehind: true, + inside: { + 'keyword': /^if\b|\b(?:not|cmdextversion|defined|errorlevel|exist)\b/i, + 'string': string, + 'parameter': parameter, + 'variable': variable, + 'number': number, + 'operator': /\^|==|\b(?:equ|neq|lss|leq|gtr|geq)\b/i + } + }, + { + // ELSE command + pattern: /((?:^|[&()])[ \t]*)else\b/im, + lookbehind: true, + inside: { + 'keyword': /^else\b/i + } + }, + { + // SET command + pattern: /((?:^|[&(])[ \t]*)set(?: ?\/[a-z](?:[ :](?:"[^"]*"|\S+))?)* (?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im, + lookbehind: true, + inside: { + 'keyword': /^set\b/i, + 'string': string, + 'parameter': parameter, + 'variable': [ + variable, + /\w+(?=(?:[*\/%+\-&^|]|<<|>>)?=)/ + ], + 'number': number, + 'operator': /[*\/%+\-&^|]=?|<<=?|>>=?|[!~_=]/, + 'punctuation': /[()',]/ + } + }, + { + // Other commands + pattern: /((?:^|[&(])[ \t]*@?)\w+\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im, + lookbehind: true, + inside: { + 'keyword': /^\w+\b/i, + 'string': string, + 'parameter': parameter, + 'label': { + pattern: /(^\s*):\S+/m, + lookbehind: true, + alias: 'property' + }, + 'variable': variable, + 'number': number, + 'operator': /\^/ + } + } + ], + 'operator': /[&@]/, + 'punctuation': /[()']/ + }; +}(Prism)); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-batch.min.js b/MacDown/Resources/Prism/components/prism-batch.min.js new file mode 100644 index 00000000..6ce50857 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-batch.min.js @@ -0,0 +1 @@ +!function(e){var r=/%%?[~:\w]+%?|!\S+!/,t={pattern:/\/[a-z?]+(?=[ :]|$):?|-[a-z]\b|--[a-z-]+\b/im,alias:"attr-name",inside:{punctuation:/:/}},n=/"[^"]*"/,i=/(?:\b|-)\d+\b/;e.languages.batch={comment:[/^::.*/m,{pattern:/((?:^|[&(])[ \t]*)rem\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0}],label:{pattern:/^:.*/m,alias:"property"},command:[{pattern:/((?:^|[&(])[ \t]*)for(?: ?\/[a-z?](?:[ :](?:"[^"]*"|\S+))?)* \S+ in \([^)]+\) do/im,lookbehind:!0,inside:{keyword:/^for\b|\b(?:in|do)\b/i,string:n,parameter:t,variable:r,number:i,punctuation:/[()',]/}},{pattern:/((?:^|[&(])[ \t]*)if(?: ?\/[a-z?](?:[ :](?:"[^"]*"|\S+))?)* (?:not )?(?:cmdextversion \d+|defined \w+|errorlevel \d+|exist \S+|(?:"[^"]*"|\S+)?(?:==| (?:equ|neq|lss|leq|gtr|geq) )(?:"[^"]*"|\S+))/im,lookbehind:!0,inside:{keyword:/^if\b|\b(?:not|cmdextversion|defined|errorlevel|exist)\b/i,string:n,parameter:t,variable:r,number:i,operator:/\^|==|\b(?:equ|neq|lss|leq|gtr|geq)\b/i}},{pattern:/((?:^|[&()])[ \t]*)else\b/im,lookbehind:!0,inside:{keyword:/^else\b/i}},{pattern:/((?:^|[&(])[ \t]*)set(?: ?\/[a-z](?:[ :](?:"[^"]*"|\S+))?)* (?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0,inside:{keyword:/^set\b/i,string:n,parameter:t,variable:[r,/\w+(?=(?:[*\/%+\-&^|]|<<|>>)?=)/],number:i,operator:/[*\/%+\-&^|]=?|<<=?|>>=?|[!~_=]/,punctuation:/[()',]/}},{pattern:/((?:^|[&(])[ \t]*@?)\w+\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0,inside:{keyword:/^\w+\b/i,string:n,parameter:t,label:{pattern:/(^\s*):\S+/m,lookbehind:!0,alias:"property"},variable:r,number:i,operator:/\^/}}],operator:/[&@]/,punctuation:/[()']/}}(Prism); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-bison.js b/MacDown/Resources/Prism/components/prism-bison.js new file mode 100644 index 00000000..9a65a537 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-bison.js @@ -0,0 +1,39 @@ +Prism.languages.bison = Prism.languages.extend('c', {}); + +Prism.languages.insertBefore('bison', 'comment', { + 'bison': { + // This should match all the beginning of the file + // including the prologue(s), the bison declarations and + // the grammar rules. + pattern: /^[\s\S]*?%%[\s\S]*?%%/, + inside: { + 'c': { + // Allow for one level of nested braces + pattern: /%\{[\s\S]*?%\}|\{(?:\{[^}]*\}|[^{}])*\}/, + inside: { + 'delimiter': { + pattern: /^%?\{|%?\}$/, + alias: 'punctuation' + }, + 'bison-variable': { + pattern: /[$@](?:<[^\s>]+>)?[\w$]+/, + alias: 'variable', + inside: { + 'punctuation': /<|>/ + } + }, + rest: Prism.languages.c + } + }, + 'comment': Prism.languages.c.comment, + 'string': Prism.languages.c.string, + 'property': /\S+(?=:)/, + 'keyword': /%\w+/, + 'number': { + pattern: /(^|[^@])\b(?:0x[\da-f]+|\d+)/i, + lookbehind: true + }, + 'punctuation': /%[%?]|[|:;\[\]<>]/ + } + } +}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-bison.min.js b/MacDown/Resources/Prism/components/prism-bison.min.js new file mode 100644 index 00000000..c26f3317 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-bison.min.js @@ -0,0 +1 @@ +Prism.languages.bison=Prism.languages.extend("c",{}),Prism.languages.insertBefore("bison","comment",{bison:{pattern:/^[\s\S]*?%%[\s\S]*?%%/,inside:{c:{pattern:/%\{[\s\S]*?%\}|\{(?:\{[^}]*\}|[^{}])*\}/,inside:{delimiter:{pattern:/^%?\{|%?\}$/,alias:"punctuation"},"bison-variable":{pattern:/[$@](?:<[^\s>]+>)?[\w$]+/,alias:"variable",inside:{punctuation:/<|>/}},rest:Prism.languages.c}},comment:Prism.languages.c.comment,string:Prism.languages.c.string,property:/\S+(?=:)/,keyword:/%\w+/,number:{pattern:/(^|[^@])\b(?:0x[\da-f]+|\d+)/i,lookbehind:!0},punctuation:/%[%?]|[|:;\[\]<>]/}}}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-brainfuck.js b/MacDown/Resources/Prism/components/prism-brainfuck.js new file mode 100644 index 00000000..604d1229 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-brainfuck.js @@ -0,0 +1,20 @@ +Prism.languages.brainfuck = { + 'pointer': { + pattern: /<|>/, + alias: 'keyword' + }, + 'increment': { + pattern: /\+/, + alias: 'inserted' + }, + 'decrement': { + pattern: /-/, + alias: 'deleted' + }, + 'branching': { + pattern: /\[|\]/, + alias: 'important' + }, + 'operator': /[.,]/, + 'comment': /\S+/ +}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-brainfuck.min.js b/MacDown/Resources/Prism/components/prism-brainfuck.min.js new file mode 100644 index 00000000..ed9707ea --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-brainfuck.min.js @@ -0,0 +1 @@ +Prism.languages.brainfuck={pointer:{pattern:/<|>/,alias:"keyword"},increment:{pattern:/\+/,alias:"inserted"},decrement:{pattern:/-/,alias:"deleted"},branching:{pattern:/\[|\]/,alias:"important"},operator:/[.,]/,comment:/\S+/}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-c.js b/MacDown/Resources/Prism/components/prism-c.js new file mode 100644 index 00000000..a9525d40 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-c.js @@ -0,0 +1,33 @@ +Prism.languages.c = Prism.languages.extend('clike', { + 'keyword': /\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/, + 'operator': /\-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*\/]/, + 'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i +}); + +Prism.languages.insertBefore('c', 'string', { + 'macro': { + // allow for multiline macro definitions + // spaces after the # character compile fine with gcc + pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im, + lookbehind: true, + alias: 'property', + inside: { + // highlight the path of the include statement as a string + 'string': { + pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/, + lookbehind: true + }, + // highlight macro directives as keywords + 'directive': { + pattern: /(#\s*)\b(define|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/, + lookbehind: true, + alias: 'keyword' + } + } + }, + // highlight predefined macros as constants + 'constant': /\b(__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|stdin|stdout|stderr)\b/ +}); + +delete Prism.languages.c['class-name']; +delete Prism.languages.c['boolean']; diff --git a/MacDown/Resources/Prism/components/prism-c.min.js b/MacDown/Resources/Prism/components/prism-c.min.js new file mode 100644 index 00000000..30740be2 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-c.min.js @@ -0,0 +1 @@ +Prism.languages.c=Prism.languages.extend("clike",{keyword:/\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/\-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*\/]/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,lookbehind:!0},directive:{pattern:/(#\s*)\b(define|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,lookbehind:!0,alias:"keyword"}}},constant:/\b(__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|stdin|stdout|stderr)\b/}),delete Prism.languages.c["class-name"],delete Prism.languages.c["boolean"]; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-clike.js b/MacDown/Resources/Prism/components/prism-clike.js new file mode 100644 index 00000000..c691011d --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-clike.js @@ -0,0 +1,29 @@ +Prism.languages.clike = { + 'comment': [ + { + pattern: /(^|[^\\])\/\*[\w\W]*?\*\//, + lookbehind: true + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true + } + ], + 'string': { + pattern: /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true + }, + 'class-name': { + pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i, + lookbehind: true, + inside: { + punctuation: /(\.|\\)/ + } + }, + 'keyword': /\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/, + 'boolean': /\b(true|false)\b/, + 'function': /[a-z0-9_]+(?=\()/i, + 'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i, + 'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/, + 'punctuation': /[{}[\];(),.:]/ +}; diff --git a/MacDown/Resources/Prism/components/prism-clike.min.js b/MacDown/Resources/Prism/components/prism-clike.min.js new file mode 100644 index 00000000..951774c5 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-clike.min.js @@ -0,0 +1 @@ +Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:{pattern:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-coffeescript.js b/MacDown/Resources/Prism/components/prism-coffeescript.js new file mode 100644 index 00000000..6e9bdeb6 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-coffeescript.js @@ -0,0 +1,83 @@ +(function(Prism) { + +// Ignore comments starting with { to privilege string interpolation highlighting +var comment = /#(?!\{).+/, + interpolation = { + pattern: /#\{[^}]+\}/, + alias: 'variable' + }; + +Prism.languages.coffeescript = Prism.languages.extend('javascript', { + 'comment': comment, + 'string': [ + + // Strings are multiline + /'(?:\\?[^\\])*?'/, + + { + // Strings are multiline + pattern: /"(?:\\?[^\\])*?"/, + inside: { + 'interpolation': interpolation + } + } + ], + 'keyword': /\b(and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/, + 'class-member': { + pattern: /@(?!\d)\w+/, + alias: 'variable' + } +}); + +Prism.languages.insertBefore('coffeescript', 'comment', { + 'multiline-comment': { + pattern: /###[\s\S]+?###/, + alias: 'comment' + }, + + // Block regexp can contain comments and interpolation + 'block-regex': { + pattern: /\/{3}[\s\S]*?\/{3}/, + alias: 'regex', + inside: { + 'comment': comment, + 'interpolation': interpolation + } + } +}); + +Prism.languages.insertBefore('coffeescript', 'string', { + 'inline-javascript': { + pattern: /`(?:\\?[\s\S])*?`/, + inside: { + 'delimiter': { + pattern: /^`|`$/, + alias: 'punctuation' + }, + rest: Prism.languages.javascript + } + }, + + // Block strings + 'multiline-string': [ + { + pattern: /'''[\s\S]*?'''/, + alias: 'string' + }, + { + pattern: /"""[\s\S]*?"""/, + alias: 'string', + inside: { + interpolation: interpolation + } + } + ] + +}); + +Prism.languages.insertBefore('coffeescript', 'keyword', { + // Object property + 'property': /(?!\d)\w+(?=\s*:(?!:))/ +}); + +}(Prism)); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-coffeescript.min.js b/MacDown/Resources/Prism/components/prism-coffeescript.min.js new file mode 100644 index 00000000..a0ec71e0 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-coffeescript.min.js @@ -0,0 +1 @@ +!function(e){var n=/#(?!\{).+/,t={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:n,string:[/'(?:\\?[^\\])*?'/,{pattern:/"(?:\\?[^\\])*?"/,inside:{interpolation:t}}],keyword:/\b(and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:n,interpolation:t}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\?[\s\S])*?`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},rest:e.languages.javascript}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,alias:"string"},{pattern:/"""[\s\S]*?"""/,alias:"string",inside:{interpolation:t}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/})}(Prism); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-core.js b/MacDown/Resources/Prism/components/prism-core.js new file mode 100644 index 00000000..87e3b5b3 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-core.js @@ -0,0 +1,494 @@ +var _self = (typeof window !== 'undefined') + ? window // if in browser + : ( + (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) + ? self // if in worker + : {} // if in node js + ); + +/** + * Prism: Lightweight, robust, elegant syntax highlighting + * MIT license http://www.opensource.org/licenses/mit-license.php/ + * @author Lea Verou http://lea.verou.me + */ + +var Prism = (function(){ + +// Private helper vars +var lang = /\blang(?:uage)?-(\w+)\b/i; +var uniqueId = 0; + +var _ = _self.Prism = { + util: { + encode: function (tokens) { + if (tokens instanceof Token) { + return new Token(tokens.type, _.util.encode(tokens.content), tokens.alias); + } else if (_.util.type(tokens) === 'Array') { + return tokens.map(_.util.encode); + } else { + return tokens.replace(/&/g, '&').replace(/ text.length) { + // Something went terribly wrong, ABORT, ABORT! + break tokenloop; + } + + if (str instanceof Token) { + continue; + } + + pattern.lastIndex = 0; + + var match = pattern.exec(str), + delNum = 1; + + // Greedy patterns can override/remove up to two previously matched tokens + if (!match && greedy && i != strarr.length - 1) { + // Reconstruct the original text using the next two tokens + var nextToken = strarr[i + 1].matchedStr || strarr[i + 1], + combStr = str + nextToken; + + if (i < strarr.length - 2) { + combStr += strarr[i + 2].matchedStr || strarr[i + 2]; + } + + // Try the pattern again on the reconstructed text + pattern.lastIndex = 0; + match = pattern.exec(combStr); + if (!match) { + continue; + } + + var from = match.index + (lookbehind ? match[1].length : 0); + // To be a valid candidate, the new match has to start inside of str + if (from >= str.length) { + continue; + } + var to = match.index + match[0].length, + len = str.length + nextToken.length; + + // Number of tokens to delete and replace with the new match + delNum = 3; + + if (to <= len) { + if (strarr[i + 1].greedy) { + continue; + } + delNum = 2; + combStr = combStr.slice(0, len); + } + str = combStr; + } + + if (!match) { + continue; + } + + if(lookbehind) { + lookbehindLength = match[1].length; + } + + var from = match.index + lookbehindLength, + match = match[0].slice(lookbehindLength), + to = from + match.length, + before = str.slice(0, from), + after = str.slice(to); + + var args = [i, delNum]; + + if (before) { + args.push(before); + } + + var wrapped = new Token(token, inside? _.tokenize(match, inside) : match, alias, match, greedy); + + args.push(wrapped); + + if (after) { + args.push(after); + } + + Array.prototype.splice.apply(strarr, args); + } + } + } + + return strarr; + }, + + hooks: { + all: {}, + + add: function (name, callback) { + var hooks = _.hooks.all; + + hooks[name] = hooks[name] || []; + + hooks[name].push(callback); + }, + + run: function (name, env) { + var callbacks = _.hooks.all[name]; + + if (!callbacks || !callbacks.length) { + return; + } + + for (var i=0, callback; callback = callbacks[i++];) { + callback(env); + } + } + } +}; + +var Token = _.Token = function(type, content, alias, matchedStr, greedy) { + this.type = type; + this.content = content; + this.alias = alias; + // Copy of the full string this token was created from + this.matchedStr = matchedStr || null; + this.greedy = !!greedy; +}; + +Token.stringify = function(o, language, parent) { + if (typeof o == 'string') { + return o; + } + + if (_.util.type(o) === 'Array') { + return o.map(function(element) { + return Token.stringify(element, language, o); + }).join(''); + } + + var env = { + type: o.type, + content: Token.stringify(o.content, language, parent), + tag: 'span', + classes: ['token', o.type], + attributes: {}, + language: language, + parent: parent + }; + + if (env.type == 'comment') { + env.attributes['spellcheck'] = 'true'; + } + + if (o.alias) { + var aliases = _.util.type(o.alias) === 'Array' ? o.alias : [o.alias]; + Array.prototype.push.apply(env.classes, aliases); + } + + _.hooks.run('wrap', env); + + var attributes = ''; + + for (var name in env.attributes) { + attributes += (attributes ? ' ' : '') + name + '="' + (env.attributes[name] || '') + '"'; + } + + return '<' + env.tag + ' class="' + env.classes.join(' ') + '" ' + attributes + '>' + env.content + ''; + +}; + +if (!_self.document) { + if (!_self.addEventListener) { + // in Node.js + return _self.Prism; + } + // In worker + _self.addEventListener('message', function(evt) { + var message = JSON.parse(evt.data), + lang = message.language, + code = message.code, + immediateClose = message.immediateClose; + + _self.postMessage(_.highlight(code, _.languages[lang], lang)); + if (immediateClose) { + _self.close(); + } + }, false); + + return _self.Prism; +} + +//Get current script and highlight +var script = document.currentScript || [].slice.call(document.getElementsByTagName("script")).pop(); + +if (script) { + _.filename = script.src; + + if (document.addEventListener && !script.hasAttribute('data-manual')) { + document.addEventListener('DOMContentLoaded', _.highlightAll); + } +} + +return _self.Prism; + +})(); + +if (typeof module !== 'undefined' && module.exports) { + module.exports = Prism; +} + +// hack for components to work correctly in node.js +if (typeof global !== 'undefined') { + global.Prism = Prism; +} diff --git a/MacDown/Resources/Prism/components/prism-core.min.js b/MacDown/Resources/Prism/components/prism-core.min.js new file mode 100644 index 00000000..8f384db5 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-core.min.js @@ -0,0 +1 @@ +var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,n=_self.Prism={util:{encode:function(e){return e instanceof a?new a(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/e.length)break e;if(!(m instanceof a)){u.lastIndex=0;var y=u.exec(m),v=1;if(!y&&h&&p!=r.length-1){var b=r[p+1].matchedStr||r[p+1],k=m+b;if(p=m.length)continue;var _=y.index+y[0].length,P=m.length+b.length;if(v=3,P>=_){if(r[p+1].greedy)continue;v=2,k=k.slice(0,P)}m=k}if(y){g&&(f=y[1].length);var w=y.index+f,y=y[0].slice(f),_=w+y.length,S=m.slice(0,w),O=m.slice(_),j=[p,v];S&&j.push(S);var A=new a(i,c?n.tokenize(y,c):y,d,y,h);j.push(A),O&&j.push(O),Array.prototype.splice.apply(r,j)}}}}}return r},hooks:{all:{},add:function(e,t){var a=n.hooks.all;a[e]=a[e]||[],a[e].push(t)},run:function(e,t){var a=n.hooks.all[e];if(a&&a.length)for(var r,l=0;r=a[l++];)r(t)}}},a=n.Token=function(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.matchedStr=a||null,this.greedy=!!r};if(a.stringify=function(e,t,r){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return a.stringify(n,t,e)}).join("");var l={type:e.type,content:a.stringify(e.content,t,r),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:r};if("comment"==l.type&&(l.attributes.spellcheck="true"),e.alias){var i="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run("wrap",l);var o="";for(var s in l.attributes)o+=(o?" ":"")+s+'="'+(l.attributes[s]||"")+'"';return"<"+l.tag+' class="'+l.classes.join(" ")+'" '+o+">"+l.content+""},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var t=JSON.parse(e.data),a=t.language,r=t.code,l=t.immediateClose;_self.postMessage(n.highlight(r,n.languages[a],a)),l&&_self.close()},!1),_self.Prism):_self.Prism;var r=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return r&&(n.filename=r.src,document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",n.highlightAll)),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-cpp.js b/MacDown/Resources/Prism/components/prism-cpp.js new file mode 100644 index 00000000..8ce28f62 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-cpp.js @@ -0,0 +1,12 @@ +Prism.languages.cpp = Prism.languages.extend('c', { + 'keyword': /\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, + 'boolean': /\b(true|false)\b/, + 'operator': /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/ +}); + +Prism.languages.insertBefore('cpp', 'keyword', { + 'class-name': { + pattern: /(class\s+)[a-z0-9_]+/i, + lookbehind: true + } +}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-cpp.min.js b/MacDown/Resources/Prism/components/prism-cpp.min.js new file mode 100644 index 00000000..44b49fb8 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-cpp.min.js @@ -0,0 +1 @@ +Prism.languages.cpp=Prism.languages.extend("c",{keyword:/\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,"boolean":/\b(true|false)\b/,operator:/[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/}),Prism.languages.insertBefore("cpp","keyword",{"class-name":{pattern:/(class\s+)[a-z0-9_]+/i,lookbehind:!0}}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-crystal.js b/MacDown/Resources/Prism/components/prism-crystal.js new file mode 100644 index 00000000..66f24fb3 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-crystal.js @@ -0,0 +1,53 @@ +(function(Prism) { + Prism.languages.crystal = Prism.languages.extend('ruby', { + keyword: [ + /\b(?:abstract|alias|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|ifdef|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|rescue|return|require|self|sizeof|struct|super|then|type|typeof|union|unless|until|when|while|with|yield|__DIR__|__FILE__|__LINE__)\b/, + { + pattern: /(\.\s*)(?:is_a|responds_to)\?/, + lookbehind: true + } + ], + + number: /\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[0-9a-fA-F_]*[0-9a-fA-F]|(?:[0-9](?:[0-9_]*[0-9])?)(?:\.[0-9_]*[0-9])?(?:[eE][+-]?[0-9_]*[0-9])?)(?:_(?:[uif](?:8|16|32|64))?)?\b/, + }); + + var rest = Prism.util.clone(Prism.languages.crystal); + + Prism.languages.insertBefore('crystal', 'string', { + attribute: { + pattern: /@\[.+?\]/, + alias: 'attr-name', + inside: { + delimiter: { + pattern: /^@\[|\]$/, + alias: 'tag' + }, + rest: rest + } + }, + + expansion: [ + { + pattern: /\{\{.+?\}\}/, + inside: { + delimiter: { + pattern: /^\{\{|\}\}$/, + alias: 'tag' + }, + rest: rest + } + }, + { + pattern: /\{%.+?%\}/, + inside: { + delimiter: { + pattern: /^\{%|%\}$/, + alias: 'tag' + }, + rest: rest + } + } + ] + }); + +}(Prism)); diff --git a/MacDown/Resources/Prism/components/prism-crystal.min.js b/MacDown/Resources/Prism/components/prism-crystal.min.js new file mode 100644 index 00000000..6c4e1a79 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-crystal.min.js @@ -0,0 +1 @@ +!function(e){e.languages.crystal=e.languages.extend("ruby",{keyword:[/\b(?:abstract|alias|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|ifdef|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|rescue|return|require|self|sizeof|struct|super|then|type|typeof|union|unless|until|when|while|with|yield|__DIR__|__FILE__|__LINE__)\b/,{pattern:/(\.\s*)(?:is_a|responds_to)\?/,lookbehind:!0}],number:/\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[0-9a-fA-F_]*[0-9a-fA-F]|(?:[0-9](?:[0-9_]*[0-9])?)(?:\.[0-9_]*[0-9])?(?:[eE][+-]?[0-9_]*[0-9])?)(?:_(?:[uif](?:8|16|32|64))?)?\b/});var t=e.util.clone(e.languages.crystal);e.languages.insertBefore("crystal","string",{attribute:{pattern:/@\[.+?\]/,alias:"attr-name",inside:{delimiter:{pattern:/^@\[|\]$/,alias:"tag"},rest:t}},expansion:[{pattern:/\{\{.+?\}\}/,inside:{delimiter:{pattern:/^\{\{|\}\}$/,alias:"tag"},rest:t}},{pattern:/\{%.+?%\}/,inside:{delimiter:{pattern:/^\{%|%\}$/,alias:"tag"},rest:t}}]})}(Prism); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-csharp.js b/MacDown/Resources/Prism/components/prism-csharp.js new file mode 100644 index 00000000..3b79d2e1 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-csharp.js @@ -0,0 +1,24 @@ +Prism.languages.csharp = Prism.languages.extend('clike', { + 'keyword': /\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/, + 'string': [ + /@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/, + /("|')(\\?.)*?\1/ + ], + 'number': /\b-?(0x[\da-f]+|\d*\.?\d+f?)\b/i +}); + +Prism.languages.insertBefore('csharp', 'keyword', { + 'preprocessor': { + pattern: /(^\s*)#.*/m, + lookbehind: true, + alias: 'property', + inside: { + // highlight preprocessor directives as keywords + 'directive': { + pattern: /(\s*#)\b(define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/, + lookbehind: true, + alias: 'keyword' + } + } + } +}); diff --git a/MacDown/Resources/Prism/components/prism-csharp.min.js b/MacDown/Resources/Prism/components/prism-csharp.min.js new file mode 100644 index 00000000..ab27060f --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-csharp.min.js @@ -0,0 +1 @@ +Prism.languages.csharp=Prism.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,string:[/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,/("|')(\\?.)*?\1/],number:/\b-?(0x[\da-f]+|\d*\.?\d+f?)\b/i}),Prism.languages.insertBefore("csharp","keyword",{preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(\s*#)\b(define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-css-extras.js b/MacDown/Resources/Prism/components/prism-css-extras.js new file mode 100644 index 00000000..766a5b0b --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-css-extras.js @@ -0,0 +1,15 @@ +Prism.languages.css.selector = { + pattern: /[^\{\}\s][^\{\}]*(?=\s*\{)/, + inside: { + 'pseudo-element': /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/, + 'pseudo-class': /:[-\w]+(?:\(.*\))?/, + 'class': /\.[-:\.\w]+/, + 'id': /#[-:\.\w]+/ + } +}; + +Prism.languages.insertBefore('css', 'function', { + 'hexcode': /#[\da-f]{3,6}/i, + 'entity': /\\[\da-f]{1,8}/i, + 'number': /[\d%\.]+/ +}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-css-extras.min.js b/MacDown/Resources/Prism/components/prism-css-extras.min.js new file mode 100644 index 00000000..0a753ea1 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-css-extras.min.js @@ -0,0 +1 @@ +Prism.languages.css.selector={pattern:/[^\{\}\s][^\{\}]*(?=\s*\{)/,inside:{"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+(?:\(.*\))?/,"class":/\.[-:\.\w]+/,id:/#[-:\.\w]+/}},Prism.languages.insertBefore("css","function",{hexcode:/#[\da-f]{3,6}/i,entity:/\\[\da-f]{1,8}/i,number:/[\d%\.]+/}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-css.js b/MacDown/Resources/Prism/components/prism-css.js new file mode 100644 index 00000000..3b219a90 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-css.js @@ -0,0 +1,48 @@ +Prism.languages.css = { + 'comment': /\/\*[\w\W]*?\*\//, + 'atrule': { + pattern: /@[\w-]+?.*?(;|(?=\s*\{))/i, + inside: { + 'rule': /@[\w-]+/ + // See rest below + } + }, + 'url': /url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i, + 'selector': /[^\{\}\s][^\{\};]*?(?=\s*\{)/, + 'string': /("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/, + 'property': /(\b|\B)[\w-]+(?=\s*:)/i, + 'important': /\B!important\b/i, + 'function': /[-a-z0-9]+(?=\()/i, + 'punctuation': /[(){};:]/ +}; + +Prism.languages.css['atrule'].inside.rest = Prism.util.clone(Prism.languages.css); + +if (Prism.languages.markup) { + Prism.languages.insertBefore('markup', 'tag', { + 'style': { + pattern: /()[\w\W]*?(?=<\/style>)/i, + lookbehind: true, + inside: Prism.languages.css, + alias: 'language-css' + } + }); + + Prism.languages.insertBefore('inside', 'attr-value', { + 'style-attr': { + pattern: /\s*style=("|').*?\1/i, + inside: { + 'attr-name': { + pattern: /^\s*style/i, + inside: Prism.languages.markup.tag.inside + }, + 'punctuation': /^\s*=\s*['"]|['"]\s*$/, + 'attr-value': { + pattern: /.+/i, + inside: Prism.languages.css + } + }, + alias: 'language-css' + } + }, Prism.languages.markup.tag); +} \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-css.min.js b/MacDown/Resources/Prism/components/prism-css.min.js new file mode 100644 index 00000000..5d8be071 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-css.min.js @@ -0,0 +1 @@ +Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/()[\w\W]*?(?=<\/style>)/i,lookbehind:!0,inside:Prism.languages.css,alias:"language-css"}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag)); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-d.js b/MacDown/Resources/Prism/components/prism-d.js new file mode 100644 index 00000000..347eb082 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-d.js @@ -0,0 +1,64 @@ +Prism.languages.d = Prism.languages.extend('clike', { + 'string': [ + // r"", x"" + /\b[rx]"(\\.|[^\\"])*"[cwd]?/, + // q"[]", q"()", q"<>", q"{}" + /\bq"(?:\[[\s\S]*?\]|\([\s\S]*?\)|<[\s\S]*?>|\{[\s\S]*?\})"/, + // q"IDENT + // ... + // IDENT" + /\bq"([_a-zA-Z][_a-zA-Z\d]*)(?:\r?\n|\r)[\s\S]*?(?:\r?\n|\r)\1"/, + // q"//", q"||", etc. + /\bq"(.)[\s\S]*?\1"/, + // Characters + /'(?:\\'|\\?[^']+)'/, + + /(["`])(\\.|(?!\1)[^\\])*\1[cwd]?/ + ], + + 'number': [ + // The lookbehind and the negative look-ahead try to prevent bad highlighting of the .. operator + // Hexadecimal numbers must be handled separately to avoid problems with exponent "e" + /\b0x\.?[a-f\d_]+(?:(?!\.\.)\.[a-f\d_]*)?(?:p[+-]?[a-f\d_]+)?[ulfi]*/i, + { + pattern: /((?:\.\.)?)(?:\b0b\.?|\b|\.)\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:e[+-]?\d[\d_]*)?[ulfi]*/i, + lookbehind: true + } + ], + + // In order: $, keywords and special tokens, globally defined symbols + 'keyword': /\$|\b(?:abstract|alias|align|asm|assert|auto|body|bool|break|byte|case|cast|catch|cdouble|cent|cfloat|char|class|const|continue|creal|dchar|debug|default|delegate|delete|deprecated|do|double|else|enum|export|extern|false|final|finally|float|for|foreach|foreach_reverse|function|goto|idouble|if|ifloat|immutable|import|inout|int|interface|invariant|ireal|lazy|long|macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|public|pure|real|ref|return|scope|shared|short|static|struct|super|switch|synchronized|template|this|throw|true|try|typedef|typeid|typeof|ubyte|ucent|uint|ulong|union|unittest|ushort|version|void|volatile|wchar|while|with|__(?:(?:FILE|MODULE|LINE|FUNCTION|PRETTY_FUNCTION|DATE|EOF|TIME|TIMESTAMP|VENDOR|VERSION)__|gshared|traits|vector|parameters)|string|wstring|dstring|size_t|ptrdiff_t)\b/, + 'operator': /\|[|=]?|&[&=]?|\+[+=]?|-[-=]?|\.?\.\.|=[>=]?|!(?:i[ns]\b|<>?=?|>=?|=)?|\bi[ns]\b|(?:<[<>]?|>>?>?|\^\^|[*\/%^~])=?/ +}); + + +Prism.languages.d.comment = [ + // Shebang + /^\s*#!.+/, + // /+ +/ + { + // Allow one level of nesting + pattern: /(^|[^\\])\/\+(?:\/\+[\w\W]*?\+\/|[\w\W])*?\+\//, + lookbehind: true + } +].concat(Prism.languages.d.comment); + +Prism.languages.insertBefore('d', 'comment', { + 'token-string': { + // Allow one level of nesting + pattern: /\bq\{(?:|\{[^}]*\}|[^}])*\}/, + alias: 'string' + } +}); + +Prism.languages.insertBefore('d', 'keyword', { + 'property': /\B@\w*/ +}); + +Prism.languages.insertBefore('d', 'function', { + 'register': { + // Iasm registers + pattern: /\b(?:[ABCD][LHX]|E[ABCD]X|E?(?:BP|SP|DI|SI)|[ECSDGF]S|CR[0234]|DR[012367]|TR[3-7]|X?MM[0-7]|R[ABCD]X|[BS]PL|R[BS]P|[DS]IL|R[DS]I|R(?:[89]|1[0-5])[BWD]?|XMM(?:[89]|1[0-5])|YMM(?:1[0-5]|\d))\b|\bST(?:\([0-7]\)|\b)/, + alias: 'variable' + } +}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-d.min.js b/MacDown/Resources/Prism/components/prism-d.min.js new file mode 100644 index 00000000..ecce9418 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-d.min.js @@ -0,0 +1 @@ +Prism.languages.d=Prism.languages.extend("clike",{string:[/\b[rx]"(\\.|[^\\"])*"[cwd]?/,/\bq"(?:\[[\s\S]*?\]|\([\s\S]*?\)|<[\s\S]*?>|\{[\s\S]*?\})"/,/\bq"([_a-zA-Z][_a-zA-Z\d]*)(?:\r?\n|\r)[\s\S]*?(?:\r?\n|\r)\1"/,/\bq"(.)[\s\S]*?\1"/,/'(?:\\'|\\?[^']+)'/,/(["`])(\\.|(?!\1)[^\\])*\1[cwd]?/],number:[/\b0x\.?[a-f\d_]+(?:(?!\.\.)\.[a-f\d_]*)?(?:p[+-]?[a-f\d_]+)?[ulfi]*/i,{pattern:/((?:\.\.)?)(?:\b0b\.?|\b|\.)\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:e[+-]?\d[\d_]*)?[ulfi]*/i,lookbehind:!0}],keyword:/\$|\b(?:abstract|alias|align|asm|assert|auto|body|bool|break|byte|case|cast|catch|cdouble|cent|cfloat|char|class|const|continue|creal|dchar|debug|default|delegate|delete|deprecated|do|double|else|enum|export|extern|false|final|finally|float|for|foreach|foreach_reverse|function|goto|idouble|if|ifloat|immutable|import|inout|int|interface|invariant|ireal|lazy|long|macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|public|pure|real|ref|return|scope|shared|short|static|struct|super|switch|synchronized|template|this|throw|true|try|typedef|typeid|typeof|ubyte|ucent|uint|ulong|union|unittest|ushort|version|void|volatile|wchar|while|with|__(?:(?:FILE|MODULE|LINE|FUNCTION|PRETTY_FUNCTION|DATE|EOF|TIME|TIMESTAMP|VENDOR|VERSION)__|gshared|traits|vector|parameters)|string|wstring|dstring|size_t|ptrdiff_t)\b/,operator:/\|[|=]?|&[&=]?|\+[+=]?|-[-=]?|\.?\.\.|=[>=]?|!(?:i[ns]\b|<>?=?|>=?|=)?|\bi[ns]\b|(?:<[<>]?|>>?>?|\^\^|[*\/%^~])=?/}),Prism.languages.d.comment=[/^\s*#!.+/,{pattern:/(^|[^\\])\/\+(?:\/\+[\w\W]*?\+\/|[\w\W])*?\+\//,lookbehind:!0}].concat(Prism.languages.d.comment),Prism.languages.insertBefore("d","comment",{"token-string":{pattern:/\bq\{(?:|\{[^}]*\}|[^}])*\}/,alias:"string"}}),Prism.languages.insertBefore("d","keyword",{property:/\B@\w*/}),Prism.languages.insertBefore("d","function",{register:{pattern:/\b(?:[ABCD][LHX]|E[ABCD]X|E?(?:BP|SP|DI|SI)|[ECSDGF]S|CR[0234]|DR[012367]|TR[3-7]|X?MM[0-7]|R[ABCD]X|[BS]PL|R[BS]P|[DS]IL|R[DS]I|R(?:[89]|1[0-5])[BWD]?|XMM(?:[89]|1[0-5])|YMM(?:1[0-5]|\d))\b|\bST(?:\([0-7]\)|\b)/,alias:"variable"}}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-dart.js b/MacDown/Resources/Prism/components/prism-dart.js new file mode 100644 index 00000000..5a6e68a8 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-dart.js @@ -0,0 +1,18 @@ +Prism.languages.dart = Prism.languages.extend('clike', { + 'string': [ + /r?("""|''')[\s\S]*?\1/, + /r?("|')(\\?.)*?\1/ + ], + 'keyword': [ + /\b(?:async|sync|yield)\*/, + /\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|default|deferred|do|dynamic|else|enum|export|external|extends|factory|final|finally|for|get|if|implements|import|in|library|new|null|operator|part|rethrow|return|set|static|super|switch|this|throw|try|typedef|var|void|while|with|yield)\b/ + ], + 'operator': /\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/ +}); + +Prism.languages.insertBefore('dart','function',{ + 'metadata': { + pattern: /@\w+/, + alias: 'symbol' + } +}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-dart.min.js b/MacDown/Resources/Prism/components/prism-dart.min.js new file mode 100644 index 00000000..78dda7fa --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-dart.min.js @@ -0,0 +1 @@ +Prism.languages.dart=Prism.languages.extend("clike",{string:[/r?("""|''')[\s\S]*?\1/,/r?("|')(\\?.)*?\1/],keyword:[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|default|deferred|do|dynamic|else|enum|export|external|extends|factory|final|finally|for|get|if|implements|import|in|library|new|null|operator|part|rethrow|return|set|static|super|switch|this|throw|try|typedef|var|void|while|with|yield)\b/],operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),Prism.languages.insertBefore("dart","function",{metadata:{pattern:/@\w+/,alias:"symbol"}}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-diff.js b/MacDown/Resources/Prism/components/prism-diff.js new file mode 100644 index 00000000..3c5351c0 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-diff.js @@ -0,0 +1,20 @@ +Prism.languages.diff = { + 'coord': [ + // Match all kinds of coord lines (prefixed by "+++", "---" or "***"). + /^(?:\*{3}|-{3}|\+{3}).*$/m, + // Match "@@ ... @@" coord lines in unified diff. + /^@@.*@@$/m, + // Match coord lines in normal diff (starts with a number). + /^\d+.*$/m + ], + + // Match inserted and deleted lines. Support both +/- and >/< styles. + 'deleted': /^[-<].+$/m, + 'inserted': /^[+>].+$/m, + + // Match "different" lines (prefixed with "!") in context diff. + 'diff': { + 'pattern': /^!(?!!).+$/m, + 'alias': 'important' + } +}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-diff.min.js b/MacDown/Resources/Prism/components/prism-diff.min.js new file mode 100644 index 00000000..091562ec --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-diff.min.js @@ -0,0 +1 @@ +Prism.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d+.*$/m],deleted:/^[-<].+$/m,inserted:/^[+>].+$/m,diff:{pattern:/^!(?!!).+$/m,alias:"important"}}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-docker.js b/MacDown/Resources/Prism/components/prism-docker.js new file mode 100644 index 00000000..80a96ddb --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-docker.js @@ -0,0 +1,9 @@ +Prism.languages.docker = { + 'keyword': { + pattern: /(^\s*)(?:ONBUILD|FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|COPY|VOLUME|USER|WORKDIR|CMD|LABEL|ENTRYPOINT)(?=\s)/mi, + lookbehind: true + }, + 'string': /("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*?\1/, + 'comment': /#.*/, + 'punctuation': /---|\.\.\.|[:[\]{}\-,|>?]/ +}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-docker.min.js b/MacDown/Resources/Prism/components/prism-docker.min.js new file mode 100644 index 00000000..8c9c7236 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-docker.min.js @@ -0,0 +1 @@ +Prism.languages.docker={keyword:{pattern:/(^\s*)(?:ONBUILD|FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|COPY|VOLUME|USER|WORKDIR|CMD|LABEL|ENTRYPOINT)(?=\s)/im,lookbehind:!0},string:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*?\1/,comment:/#.*/,punctuation:/---|\.\.\.|[:[\]{}\-,|>?]/}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-eiffel.js b/MacDown/Resources/Prism/components/prism-eiffel.js new file mode 100644 index 00000000..cfdb6a52 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-eiffel.js @@ -0,0 +1,24 @@ +Prism.languages.eiffel = { + 'string': [ + // Aligned-verbatim-strings + /"([^[]*)\[[\s\S]+?\]\1"/, + // Non-aligned-verbatim-strings + /"([^{]*)\{[\s\S]+?\}\1"/, + // Single-line string + /"(?:%\s+%|%"|.)*?"/ + ], + // (comments including quoted strings not supported) + 'comment': /--.*/, + // normal char | special char | char code + 'char': /'(?:%'|.)+?'/, + 'keyword': /\b(?:across|agent|alias|all|and|attached|as|assign|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i, + 'boolean': /\b(?:True|False)\b/i, + 'number': [ + // hexa | octal | bin + /\b0[xcb][\da-f](?:_*[\da-f])*\b/i, + // Decimal + /(?:\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?[eE][+-]?)?\d(?:_*\d)*|\d(?:_*\d)*\.?/ + ], + 'punctuation': /:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/, + 'operator': /\\\\|\|\.\.\||\.\.|\/[~\/=]?|[><]=?|[-+*^=~]/ +}; diff --git a/MacDown/Resources/Prism/components/prism-eiffel.min.js b/MacDown/Resources/Prism/components/prism-eiffel.min.js new file mode 100644 index 00000000..af6d3989 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-eiffel.min.js @@ -0,0 +1 @@ +Prism.languages.eiffel={string:[/"([^[]*)\[[\s\S]+?\]\1"/,/"([^{]*)\{[\s\S]+?\}\1"/,/"(?:%\s+%|%"|.)*?"/],comment:/--.*/,"char":/'(?:%'|.)+?'/,keyword:/\b(?:across|agent|alias|all|and|attached|as|assign|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i,"boolean":/\b(?:True|False)\b/i,number:[/\b0[xcb][\da-f](?:_*[\da-f])*\b/i,/(?:\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?[eE][+-]?)?\d(?:_*\d)*|\d(?:_*\d)*\.?/],punctuation:/:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/,operator:/\\\\|\|\.\.\||\.\.|\/[~\/=]?|[><]=?|[-+*^=~]/}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-elixir.js b/MacDown/Resources/Prism/components/prism-elixir.js new file mode 100644 index 00000000..42ae187e --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-elixir.js @@ -0,0 +1,90 @@ +Prism.languages.elixir = { + // Negative look-ahead is needed for string interpolation + // Negative look-behind is needed to avoid highlighting markdown headers in + // multi-line doc strings + 'comment': { + pattern: /(^|[^#])#(?![{#]).*/m, + lookbehind: true + }, + // ~r"""foo""", ~r'''foo''', ~r/foo/, ~r|foo|, ~r"foo", ~r'foo', ~r(foo), ~r[foo], ~r{foo}, ~r + 'regex': /~[rR](?:("""|'''|[\/|"'])(?:\\.|(?!\1)[^\\])+\1|\((?:\\\)|[^)])+\)|\[(?:\\\]|[^\]])+\]|\{(?:\\\}|[^}])+\}|<(?:\\>|[^>])+>)[uismxfr]*/, + 'string': [ + { + // ~s"""foo""", ~s'''foo''', ~s/foo/, ~s|foo|, ~s"foo", ~s'foo', ~s(foo), ~s[foo], ~s{foo}, ~s + pattern: /~[cCsSwW](?:("""|'''|[\/|"'])(?:\\.|(?!\1)[^\\])+\1|\((?:\\\)|[^)])+\)|\[(?:\\\]|[^\]])+\]|\{(?:\\\}|#\{[^}]+\}|[^}])+\}|<(?:\\>|[^>])+>)[csa]?/, + inside: { + // See interpolation below + } + }, + { + pattern: /("""|''')[\s\S]*?\1/, + inside: { + // See interpolation below + } + }, + { + // Multi-line strings are allowed + pattern: /("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/, + inside: { + // See interpolation below + } + } + ], + 'atom': { + // Look-behind prevents bad highlighting of the :: operator + pattern: /(^|[^:]):\w+/, + lookbehind: true, + alias: 'symbol' + }, + // Look-ahead prevents bad highlighting of the :: operator + 'attr-name': /\w+:(?!:)/, + 'capture': { + // Look-behind prevents bad highlighting of the && operator + pattern: /(^|[^&])&(?:[^&\s\d()][^\s()]*|(?=\())/, + lookbehind: true, + alias: 'function' + }, + 'argument': { + // Look-behind prevents bad highlighting of the && operator + pattern: /(^|[^&])&\d+/, + lookbehind: true, + alias: 'variable' + }, + 'attribute': { + pattern: /@[\S]+/, + alias: 'variable' + }, + 'number': /\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i, + 'keyword': /\b(?:after|alias|and|case|catch|cond|def(?:callback|exception|impl|module|p|protocol|struct)?|do|else|end|fn|for|if|import|not|or|require|rescue|try|unless|use|when)\b/, + 'boolean': /\b(?:true|false|nil)\b/, + 'operator': [ + /\bin\b|&&?|\|[|>]?|\\\\|::|\.\.\.?|\+\+?|-[->]?|<[-=>]|>=|!==?|\B!|=(?:==?|[>~])?|[*\/^]/, + { + // We don't want to match << + pattern: /([^<])<(?!<)/, + lookbehind: true + }, + { + // We don't want to match >> + pattern: /([^>])>(?!>)/, + lookbehind: true + } + ], + 'punctuation': /<<|>>|[.,%\[\]{}()]/ +}; + +Prism.languages.elixir.string.forEach(function(o) { + o.inside = { + 'interpolation': { + pattern: /#\{[^}]+\}/, + inside: { + 'delimiter': { + pattern: /^#\{|\}$/, + alias: 'punctuation' + }, + rest: Prism.util.clone(Prism.languages.elixir) + } + } + }; +}); + diff --git a/MacDown/Resources/Prism/components/prism-elixir.min.js b/MacDown/Resources/Prism/components/prism-elixir.min.js new file mode 100644 index 00000000..d9c1f172 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-elixir.min.js @@ -0,0 +1 @@ +Prism.languages.elixir={comment:{pattern:/(^|[^#])#(?![{#]).*/m,lookbehind:!0},regex:/~[rR](?:("""|'''|[\/|"'])(?:\\.|(?!\1)[^\\])+\1|\((?:\\\)|[^)])+\)|\[(?:\\\]|[^\]])+\]|\{(?:\\\}|[^}])+\}|<(?:\\>|[^>])+>)[uismxfr]*/,string:[{pattern:/~[cCsSwW](?:("""|'''|[\/|"'])(?:\\.|(?!\1)[^\\])+\1|\((?:\\\)|[^)])+\)|\[(?:\\\]|[^\]])+\]|\{(?:\\\}|#\{[^}]+\}|[^}])+\}|<(?:\\>|[^>])+>)[csa]?/,inside:{}},{pattern:/("""|''')[\s\S]*?\1/,inside:{}},{pattern:/("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/,inside:{}}],atom:{pattern:/(^|[^:]):\w+/,lookbehind:!0,alias:"symbol"},"attr-name":/\w+:(?!:)/,capture:{pattern:/(^|[^&])&(?:[^&\s\d()][^\s()]*|(?=\())/,lookbehind:!0,alias:"function"},argument:{pattern:/(^|[^&])&\d+/,lookbehind:!0,alias:"variable"},attribute:{pattern:/@[\S]+/,alias:"variable"},number:/\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i,keyword:/\b(?:after|alias|and|case|catch|cond|def(?:callback|exception|impl|module|p|protocol|struct)?|do|else|end|fn|for|if|import|not|or|require|rescue|try|unless|use|when)\b/,"boolean":/\b(?:true|false|nil)\b/,operator:[/\bin\b|&&?|\|[|>]?|\\\\|::|\.\.\.?|\+\+?|-[->]?|<[-=>]|>=|!==?|\B!|=(?:==?|[>~])?|[*\/^]/,{pattern:/([^<])<(?!<)/,lookbehind:!0},{pattern:/([^>])>(?!>)/,lookbehind:!0}],punctuation:/<<|>>|[.,%\[\]{}()]/},Prism.languages.elixir.string.forEach(function(e){e.inside={interpolation:{pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"},rest:Prism.util.clone(Prism.languages.elixir)}}}}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-erlang.js b/MacDown/Resources/Prism/components/prism-erlang.js new file mode 100644 index 00000000..5baa9d77 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-erlang.js @@ -0,0 +1,41 @@ +Prism.languages.erlang = { + 'comment': /%.+/, + 'string': /"(?:\\?.)*?"/, + 'quoted-function': { + pattern: /'(?:\\.|[^'\\])+'(?=\()/, + alias: 'function' + }, + 'quoted-atom': { + pattern: /'(?:\\.|[^'\\])+'/, + alias: 'atom' + }, + 'boolean': /\b(?:true|false)\b/, + 'keyword': /\b(?:fun|when|case|of|end|if|receive|after|try|catch)\b/, + 'number': [ + /\$\\?./, + /\d+#[a-z0-9]+/i, + /(?:\b|-)\d*\.?\d+([Ee][+-]?\d+)?\b/ + ], + 'function': /\b[a-z][\w@]*(?=\()/, + 'variable': { + // Look-behind is used to prevent wrong highlighting of atoms containing "@" + pattern: /(^|[^@])(?:\b|\?)[A-Z_][\w@]*/, + lookbehind: true + }, + 'operator': [ + /[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:bnot|div|rem|band|bor|bxor|bsl|bsr|not|and|or|xor|orelse|andalso)\b/, + { + // We don't want to match << + pattern: /(^|[^<])<(?!<)/, + lookbehind: true + }, + { + // We don't want to match >> + pattern: /(^|[^>])>(?!>)/, + lookbehind: true + } + ], + 'atom': /\b[a-z][\w@]*/, + 'punctuation': /[()[\]{}:;,.#|]|<<|>>/ + +}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-erlang.min.js b/MacDown/Resources/Prism/components/prism-erlang.min.js new file mode 100644 index 00000000..613f0f95 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-erlang.min.js @@ -0,0 +1 @@ +Prism.languages.erlang={comment:/%.+/,string:/"(?:\\?.)*?"/,"quoted-function":{pattern:/'(?:\\.|[^'\\])+'(?=\()/,alias:"function"},"quoted-atom":{pattern:/'(?:\\.|[^'\\])+'/,alias:"atom"},"boolean":/\b(?:true|false)\b/,keyword:/\b(?:fun|when|case|of|end|if|receive|after|try|catch)\b/,number:[/\$\\?./,/\d+#[a-z0-9]+/i,/(?:\b|-)\d*\.?\d+([Ee][+-]?\d+)?\b/],"function":/\b[a-z][\w@]*(?=\()/,variable:{pattern:/(^|[^@])(?:\b|\?)[A-Z_][\w@]*/,lookbehind:!0},operator:[/[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:bnot|div|rem|band|bor|bxor|bsl|bsr|not|and|or|xor|orelse|andalso)\b/,{pattern:/(^|[^<])<(?!<)/,lookbehind:!0},{pattern:/(^|[^>])>(?!>)/,lookbehind:!0}],atom:/\b[a-z][\w@]*/,punctuation:/[()[\]{}:;,.#|]|<<|>>/}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-fortran.js b/MacDown/Resources/Prism/components/prism-fortran.js new file mode 100644 index 00000000..7b417ce2 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-fortran.js @@ -0,0 +1,37 @@ +Prism.languages.fortran = { + 'quoted-number': { + pattern: /[BOZ](['"])[A-F0-9]+\1/i, + alias: 'number' + }, + 'string': { + pattern: /(?:\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:\s*!.+(?:\r\n?|\n))?|(?!\1).)*(?:\1|&)/, + inside: { + 'comment': { + pattern: /(&(?:\r\n?|\n)\s*)!.*/, + lookbehind: true + } + } + }, + 'comment': /!.*/, + 'boolean': /\.(?:TRUE|FALSE)\.(?:_\w+)?/i, + 'number': /(?:\b|[+-])(?:\d+(?:\.\d*)?|\.\d+)(?:[ED][+-]?\d+)?(?:_\w+)?/i, + 'keyword': [ + // Types + /\b(?:INTEGER|REAL|DOUBLE ?PRECISION|COMPLEX|CHARACTER|LOGICAL)\b/i, + // END statements + /\b(?:END ?)?(?:BLOCK ?DATA|DO|FILE|FORALL|FUNCTION|IF|INTERFACE|MODULE(?! PROCEDURE)|PROGRAM|SELECT|SUBROUTINE|TYPE|WHERE)\b/i, + // Statements + /\b(?:ALLOCATABLE|ALLOCATE|BACKSPACE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|DEALLOCATE|DIMENSION|DO|END|EQUIVALENCE|EXIT|EXTERNAL|FORMAT|GO ?TO|IMPLICIT(?: NONE)?|INQUIRE|INTENT|INTRINSIC|MODULE PROCEDURE|NAMELIST|NULLIFY|OPEN|OPTIONAL|PARAMETER|POINTER|PRINT|PRIVATE|PUBLIC|READ|RETURN|REWIND|SAVE|SELECT|STOP|TARGET|WHILE|WRITE)\b/i, + // Others + /\b(?:ASSIGNMENT|DEFAULT|ELEMENTAL|ELSE|ELSEWHERE|ELSEIF|ENTRY|IN|INCLUDE|INOUT|KIND|NULL|ONLY|OPERATOR|OUT|PURE|RECURSIVE|RESULT|SEQUENCE|STAT|THEN|USE)\b/i + ], + 'operator': [ + /\*\*|\/\/|=>|[=\/]=|[<>]=?|::|[+\-*=%]|\.(?:EQ|NE|LT|LE|GT|GE|NOT|AND|OR|EQV|NEQV)\.|\.[A-Z]+\./i, + { + // Use lookbehind to prevent confusion with (/ /) + pattern: /(^|(?!\().)\/(?!\))/, + lookbehind: true + } + ], + 'punctuation': /\(\/|\/\)|[(),;:&]/ +}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-fortran.min.js b/MacDown/Resources/Prism/components/prism-fortran.min.js new file mode 100644 index 00000000..6801223c --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-fortran.min.js @@ -0,0 +1 @@ +Prism.languages.fortran={"quoted-number":{pattern:/[BOZ](['"])[A-F0-9]+\1/i,alias:"number"},string:{pattern:/(?:\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:\s*!.+(?:\r\n?|\n))?|(?!\1).)*(?:\1|&)/,inside:{comment:{pattern:/(&(?:\r\n?|\n)\s*)!.*/,lookbehind:!0}}},comment:/!.*/,"boolean":/\.(?:TRUE|FALSE)\.(?:_\w+)?/i,number:/(?:\b|[+-])(?:\d+(?:\.\d*)?|\.\d+)(?:[ED][+-]?\d+)?(?:_\w+)?/i,keyword:[/\b(?:INTEGER|REAL|DOUBLE ?PRECISION|COMPLEX|CHARACTER|LOGICAL)\b/i,/\b(?:END ?)?(?:BLOCK ?DATA|DO|FILE|FORALL|FUNCTION|IF|INTERFACE|MODULE(?! PROCEDURE)|PROGRAM|SELECT|SUBROUTINE|TYPE|WHERE)\b/i,/\b(?:ALLOCATABLE|ALLOCATE|BACKSPACE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|DEALLOCATE|DIMENSION|DO|END|EQUIVALENCE|EXIT|EXTERNAL|FORMAT|GO ?TO|IMPLICIT(?: NONE)?|INQUIRE|INTENT|INTRINSIC|MODULE PROCEDURE|NAMELIST|NULLIFY|OPEN|OPTIONAL|PARAMETER|POINTER|PRINT|PRIVATE|PUBLIC|READ|RETURN|REWIND|SAVE|SELECT|STOP|TARGET|WHILE|WRITE)\b/i,/\b(?:ASSIGNMENT|DEFAULT|ELEMENTAL|ELSE|ELSEWHERE|ELSEIF|ENTRY|IN|INCLUDE|INOUT|KIND|NULL|ONLY|OPERATOR|OUT|PURE|RECURSIVE|RESULT|SEQUENCE|STAT|THEN|USE)\b/i],operator:[/\*\*|\/\/|=>|[=\/]=|[<>]=?|::|[+\-*=%]|\.(?:EQ|NE|LT|LE|GT|GE|NOT|AND|OR|EQV|NEQV)\.|\.[A-Z]+\./i,{pattern:/(^|(?!\().)\/(?!\))/,lookbehind:!0}],punctuation:/\(\/|\/\)|[(),;:&]/}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-fsharp.js b/MacDown/Resources/Prism/components/prism-fsharp.js new file mode 100644 index 00000000..77ef92f8 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-fsharp.js @@ -0,0 +1,33 @@ +Prism.languages.fsharp = Prism.languages.extend('clike', { + 'comment': [ + { + pattern: /(^|[^\\])\(\*[\w\W]*?\*\)/, + lookbehind: true + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true + } + ], + 'keyword': /\b(?:let|return|use|yield)(?:!\B|\b)|\b(abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|select|static|struct|then|to|true|try|type|upcast|val|void|when|while|with|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/, + 'string': /(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|("|')(?:\\\1|\\?(?!\1)[\s\S])*\1)B?/, + 'number': [ + /\b-?0x[\da-fA-F]+(un|lf|LF)?\b/, + /\b-?0b[01]+(y|uy)?\b/, + /\b-?(\d*\.?\d+|\d+\.)([fFmM]|[eE][+-]?\d+)?\b/, + /\b-?\d+(y|uy|s|us|l|u|ul|L|UL|I)?\b/ + ] +}); +Prism.languages.insertBefore('fsharp', 'keyword', { + 'preprocessor': { + pattern: /^[^\r\n\S]*#.*/m, + alias: 'property', + inside: { + 'directive': { + pattern: /(\s*#)\b(else|endif|if|light|line|nowarn)\b/, + lookbehind: true, + alias: 'keyword' + } + } + } +}); diff --git a/MacDown/Resources/Prism/components/prism-fsharp.min.js b/MacDown/Resources/Prism/components/prism-fsharp.min.js new file mode 100644 index 00000000..215dbeb1 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-fsharp.min.js @@ -0,0 +1 @@ +Prism.languages.fsharp=Prism.languages.extend("clike",{comment:[{pattern:/(^|[^\\])\(\*[\w\W]*?\*\)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],keyword:/\b(?:let|return|use|yield)(?:!\B|\b)|\b(abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|select|static|struct|then|to|true|try|type|upcast|val|void|when|while|with|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/,string:/(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|("|')(?:\\\1|\\?(?!\1)[\s\S])*\1)B?/,number:[/\b-?0x[\da-fA-F]+(un|lf|LF)?\b/,/\b-?0b[01]+(y|uy)?\b/,/\b-?(\d*\.?\d+|\d+\.)([fFmM]|[eE][+-]?\d+)?\b/,/\b-?\d+(y|uy|s|us|l|u|ul|L|UL|I)?\b/]}),Prism.languages.insertBefore("fsharp","keyword",{preprocessor:{pattern:/^[^\r\n\S]*#.*/m,alias:"property",inside:{directive:{pattern:/(\s*#)\b(else|endif|if|light|line|nowarn)\b/,lookbehind:!0,alias:"keyword"}}}}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-gherkin.js b/MacDown/Resources/Prism/components/prism-gherkin.js new file mode 100644 index 00000000..66e25b3a --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-gherkin.js @@ -0,0 +1,78 @@ +Prism.languages.gherkin = { + 'pystring': { + pattern: /("""|''')[\s\S]+?\1/, + alias: 'string' + }, + 'comment': { + pattern: /((^|\r?\n|\r)[ \t]*)#.*/, + lookbehind: true + }, + 'tag': { + pattern: /((^|\r?\n|\r)[ \t]*)@\S*/, + lookbehind: true + }, + 'feature': { + pattern: /((^|\r?\n|\r)[ \t]*)(Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţionalitate|Funcționalitate|Functionaliteit|Fungsi|Funkcia|Funkcija|Funkcionalitāte|Funkcionalnost|Funkcja|Funksie|Funktionalität|Funktionalitéit|Funzionalità|Hwaet|Hwæt|Jellemző|Karakteristik|laH|Lastnost|Mak|Mogucnost|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|perbogh|poQbogh malja'|Potrzeba biznesowa|Požadavek|Požiadavka|Pretty much|Qap|Qu'meH 'ut|Savybė|Tính năng|Trajto|Vermoë|Vlastnosť|Właściwość|Značilnost|Δυνατότητα|Λειτουργία|Могућност|Мөмкинлек|Особина|Свойство|Үзенчәлеклелек|Функционал|Функционалност|Функция|Функціонал|תכונה|خاصية|خصوصیت|صلاحیت|کاروبار کی ضرورت|وِیژگی|रूप लेख|ਖਾਸੀਅਤ|ਨਕਸ਼ ਨੁਹਾਰ|ਮੁਹਾਂਦਰਾ|గుణము|ಹೆಚ್ಚಳ|ความต้องการทางธุรกิจ|ความสามารถ|โครงหลัก|기능|フィーチャ|功能|機能):([^:]+(?:\r?\n|\r|$))*/, + lookbehind: true, + inside: { + 'important': { + pattern: /(:)[^\r\n]+/, + lookbehind: true + }, + keyword: /[^:\r\n]+:/ + } + }, + 'scenario': { + pattern: /((^|\r?\n|\r)[ \t]*)(Abstract Scenario|Abstrakt Scenario|Achtergrond|Aer|Ær|Agtergrond|All y'all|Antecedentes|Antecedents|Atburðarás|Atburðarásir|Awww, look mate|B4|Background|Baggrund|Bakgrund|Bakgrunn|Bakgrunnur|Beispiele|Beispiller|Bối cảnh|Cefndir|Cenario|Cenário|Cenario de Fundo|Cenário de Fundo|Cenarios|Cenários|Contesto|Context|Contexte|Contexto|Conto|Contoh|Contone|Dæmi|Dasar|Dead men tell no tales|Delineacao do Cenario|Delineação do Cenário|Dis is what went down|Dữ liệu|Dyagram senaryo|Dyagram Senaryo|Egzanp|Ejemplos|Eksempler|Ekzemploj|Enghreifftiau|Esbozo do escenario|Escenari|Escenario|Esempi|Esquema de l'escenari|Esquema del escenario|Esquema do Cenario|Esquema do Cenário|Examples|EXAMPLZ|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|ghantoH|Grundlage|Hannergrond|Háttér|Heave to|Istorik|Juhtumid|Keadaan|Khung kịch bản|Khung tình huống|Kịch bản|Koncept|Konsep skenario|Kontèks|Kontekst|Kontekstas|Konteksts|Kontext|Konturo de la scenaro|Latar Belakang|lut|lut chovnatlh|lutmey|Lýsing Atburðarásar|Lýsing Dæma|Menggariskan Senario|MISHUN|MISHUN SRSLY|mo'|Náčrt Scenára|Náčrt Scénáře|Náčrt Scenáru|Oris scenarija|Örnekler|Osnova|Osnova Scenára|Osnova scénáře|Osnutek|Ozadje|Paraugs|Pavyzdžiai|Példák|Piemēri|Plan du scénario|Plan du Scénario|Plan senaryo|Plan Senaryo|Plang vum Szenario|Pozadí|Pozadie|Pozadina|Príklady|Příklady|Primer|Primeri|Primjeri|Przykłady|Raamstsenaarium|Reckon it's like|Rerefons|Scenár|Scénář|Scenarie|Scenarij|Scenarijai|Scenarijaus šablonas|Scenariji|Scenārijs|Scenārijs pēc parauga|Scenarijus|Scenario|Scénario|Scenario Amlinellol|Scenario Outline|Scenario Template|Scenariomal|Scenariomall|Scenarios|Scenariu|Scenariusz|Scenaro|Schema dello scenario|Se ðe|Se the|Se þe|Senario|Senaryo|Senaryo deskripsyon|Senaryo Deskripsyon|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie|Situasie Uiteensetting|Skenario|Skenario konsep|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa|Swa hwaer swa|Swa hwær swa|Szablon scenariusza|Szenario|Szenariogrundriss|Tapaukset|Tapaus|Tapausaihio|Taust|Tausta|Template Keadaan|Template Senario|Template Situai|The thing of it is|Tình huống|Variantai|Voorbeelde|Voorbeelden|Wharrimean is|Yo\-ho\-ho|You'll wanna|Założenia|Παραδείγματα|Περιγραφή Σεναρίου|Σενάρια|Σενάριο|Υπόβαθρο|Кереш|Контекст|Концепт|Мисаллар|Мисоллар|Основа|Передумова|Позадина|Предистория|Предыстория|Приклади|Пример|Примери|Примеры|Рамка на сценарий|Скица|Структура сценарија|Структура сценария|Структура сценарію|Сценарий|Сценарий структураси|Сценарийның төзелеше|Сценарији|Сценарио|Сценарій|Тарих|Үрнәкләр|דוגמאות|רקע|תבנית תרחיש|תרחיש|الخلفية|الگوی سناریو|امثلة|پس منظر|زمینه|سناریو|سيناريو|سيناريو مخطط|مثالیں|منظر نامے کا خاکہ|منظرنامہ|نمونه ها|उदाहरण|परिदृश्य|परिदृश्य रूपरेखा|पृष्ठभूमि|ਉਦਾਹਰਨਾਂ|ਪਟਕਥਾ|ਪਟਕਥਾ ਢਾਂਚਾ|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਿਛੋਕੜ|ఉదాహరణలు|కథనం|నేపథ్యం|సన్నివేశం|ಉದಾಹರಣೆಗಳು|ಕಥಾಸಾರಾಂಶ|ವಿವರಣೆ|ಹಿನ್ನೆಲೆ|โครงสร้างของเหตุการณ์|ชุดของตัวอย่าง|ชุดของเหตุการณ์|แนวคิด|สรุปเหตุการณ์|เหตุการณ์|배경|시나리오|시나리오 개요|예|サンプル|シナリオ|シナリオアウトライン|シナリオテンプレ|シナリオテンプレート|テンプレ|例|例子|剧本|剧本大纲|劇本|劇本大綱|场景|场景大纲|場景|場景大綱|背景):[^:\r\n]*/, + lookbehind: true, + inside: { + 'important': { + pattern: /(:)[^\r\n]*/, + lookbehind: true + }, + keyword: /[^:\r\n]+:/ + } + }, + 'table-body': { + pattern: /((?:\r?\n|\r)[ \t]*\|.+\|[^\r\n]*)+/, + lookbehind: true, + inside: { + 'outline': { + pattern: /<[^>]+?>/, + alias: 'variable' + }, + 'td': { + pattern: /\s*[^\s|][^|]*/, + alias: 'string' + }, + 'punctuation': /\|/ + } + }, + 'table-head': { + pattern: /((?:\r?\n|\r)[ \t]*\|.+\|[^\r\n]*)/, + inside: { + 'th': { + pattern: /\s*[^\s|][^|]*/, + alias: 'variable' + }, + 'punctuation': /\|/ + } + }, + 'atrule': { + pattern: /((?:\r?\n|\r)[ \t]+)('ach|'a|'ej|7|a|A také|A taktiež|A tiež|A zároveň|Aber|Ac|Adott|Akkor|Ak|Aleshores|Ale|Ali|Allora|Alors|Als|Ama|Amennyiben|Amikor|Ampak|an|AN|Ananging|And y'all|And|Angenommen|Anrhegedig a|An|Apabila|Atès|Atesa|Atunci|Avast!|Aye|A|awer|Bagi|Banjur|Bet|Biết|Blimey!|Buh|But at the end of the day I reckon|But y'all|But|BUT|Cal|Când|Cando|Cand|Ce|Cuando|Če|Ða ðe|Ða|Dadas|Dada|Dados|Dado|DaH ghu' bejlu'|dann|Dann|Dano|Dan|Dar|Dat fiind|Data|Date fiind|Date|Dati fiind|Dati|Daţi fiind|Dați fiind|Dato|DEN|Den youse gotta|Dengan|De|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|Entonces|En|Epi|E|És|Etant donnée|Etant donné|Et|Étant données|Étant donnée|Étant donné|Etant données|Etant donnés|Étant donnés|Fakat|Gangway!|Gdy|Gegeben seien|Gegeben sei|Gegeven|Gegewe|ghu' noblu'|Gitt|Given y'all|Given|Givet|Givun|Ha|Cho|I CAN HAZ|In|Ir|It's just unbelievable|I|Ja|Jeśli|Jeżeli|Kadar|Kada|Kad|Kai|Kaj|Když|Keď|Kemudian|Ketika|Khi|Kiedy|Ko|Kuid|Kui|Kun|Lan|latlh|Le sa a|Let go and haul|Le|Lè sa a|Lè|Logo|Lorsqu'<|Lorsque|mä|Maar|Mais|Mając|Majd|Maka|Manawa|Mas|Ma|Menawa|Men|Mutta|Nalikaning|Nalika|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Og|Och|Oletetaan|Onda|Ond|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|qaSDI'|Quando|Quand|Quan|Så|Sed|Se|Siis|Sipoze ke|Sipoze Ke|Sipoze|Si|Şi|Și|Soit|Stel|Tada|Tad|Takrat|Tak|Tapi|Ter|Tetapi|Tha the|Tha|Then y'all|Then|Thì|Thurh|Toda|Too right|ugeholl|Und|Un|Và|vaj|Vendar|Ve|wann|Wanneer|WEN|Wenn|When y'all|When|Wtedy|Wun|Y'know|Yeah nah|Yna|Youse know like when|Youse know when youse got|Y|Za predpokladu|Za předpokladu|Zadani|Zadano|Zadan|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa þe|Þa|Þá|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً|اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा|किन्तु|चूंकि|जब|तथा|तदा|तब|परन्तु|पर|यदि|ਅਤੇ|ਜਦੋਂ|ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|ਤਦ|ਪਰ|అప్పుడు|ఈ పరిస్థితిలో|కాని|చెప్పబడినది|మరియు|ಆದರೆ|ನಂತರ|ನೀಡಿದ|ಮತ್ತು|ಸ್ಥಿತಿಯನ್ನು|กำหนดให้|ดังนั้น|แต่|เมื่อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t]+)/, + lookbehind: true + }, + 'string': { + pattern: /("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')/, + inside: { + 'outline': { + pattern: /<[^>]+?>/, + alias: 'variable' + } + } + }, + 'outline': { + pattern: /<[^>]+?>/, + alias: 'variable' + } +}; diff --git a/MacDown/Resources/Prism/components/prism-gherkin.min.js b/MacDown/Resources/Prism/components/prism-gherkin.min.js new file mode 100644 index 00000000..cece556d --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-gherkin.min.js @@ -0,0 +1 @@ +Prism.languages.gherkin={pystring:{pattern:/("""|''')[\s\S]+?\1/,alias:"string"},comment:{pattern:/((^|\r?\n|\r)[ \t]*)#.*/,lookbehind:!0},tag:{pattern:/((^|\r?\n|\r)[ \t]*)@\S*/,lookbehind:!0},feature:{pattern:/((^|\r?\n|\r)[ \t]*)(Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţionalitate|Funcționalitate|Functionaliteit|Fungsi|Funkcia|Funkcija|Funkcionalitāte|Funkcionalnost|Funkcja|Funksie|Funktionalität|Funktionalitéit|Funzionalità|Hwaet|Hwæt|Jellemző|Karakteristik|laH|Lastnost|Mak|Mogucnost|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|perbogh|poQbogh malja'|Potrzeba biznesowa|Požadavek|Požiadavka|Pretty much|Qap|Qu'meH 'ut|Savybė|Tính năng|Trajto|Vermoë|Vlastnosť|Właściwość|Značilnost|Δυνατότητα|Λειτουργία|Могућност|Мөмкинлек|Особина|Свойство|Үзенчәлеклелек|Функционал|Функционалност|Функция|Функціонал|תכונה|خاصية|خصوصیت|صلاحیت|کاروبار کی ضرورت|وِیژگی|रूप लेख|ਖਾਸੀਅਤ|ਨਕਸ਼ ਨੁਹਾਰ|ਮੁਹਾਂਦਰਾ|గుణము|ಹೆಚ್ಚಳ|ความต้องการทางธุรกิจ|ความสามารถ|โครงหลัก|기능|フィーチャ|功能|機能):([^:]+(?:\r?\n|\r|$))*/,lookbehind:!0,inside:{important:{pattern:/(:)[^\r\n]+/,lookbehind:!0},keyword:/[^:\r\n]+:/}},scenario:{pattern:/((^|\r?\n|\r)[ \t]*)(Abstract Scenario|Abstrakt Scenario|Achtergrond|Aer|Ær|Agtergrond|All y'all|Antecedentes|Antecedents|Atburðarás|Atburðarásir|Awww, look mate|B4|Background|Baggrund|Bakgrund|Bakgrunn|Bakgrunnur|Beispiele|Beispiller|Bối cảnh|Cefndir|Cenario|Cenário|Cenario de Fundo|Cenário de Fundo|Cenarios|Cenários|Contesto|Context|Contexte|Contexto|Conto|Contoh|Contone|Dæmi|Dasar|Dead men tell no tales|Delineacao do Cenario|Delineação do Cenário|Dis is what went down|Dữ liệu|Dyagram senaryo|Dyagram Senaryo|Egzanp|Ejemplos|Eksempler|Ekzemploj|Enghreifftiau|Esbozo do escenario|Escenari|Escenario|Esempi|Esquema de l'escenari|Esquema del escenario|Esquema do Cenario|Esquema do Cenário|Examples|EXAMPLZ|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|ghantoH|Grundlage|Hannergrond|Háttér|Heave to|Istorik|Juhtumid|Keadaan|Khung kịch bản|Khung tình huống|Kịch bản|Koncept|Konsep skenario|Kontèks|Kontekst|Kontekstas|Konteksts|Kontext|Konturo de la scenaro|Latar Belakang|lut|lut chovnatlh|lutmey|Lýsing Atburðarásar|Lýsing Dæma|Menggariskan Senario|MISHUN|MISHUN SRSLY|mo'|Náčrt Scenára|Náčrt Scénáře|Náčrt Scenáru|Oris scenarija|Örnekler|Osnova|Osnova Scenára|Osnova scénáře|Osnutek|Ozadje|Paraugs|Pavyzdžiai|Példák|Piemēri|Plan du scénario|Plan du Scénario|Plan senaryo|Plan Senaryo|Plang vum Szenario|Pozadí|Pozadie|Pozadina|Príklady|Příklady|Primer|Primeri|Primjeri|Przykłady|Raamstsenaarium|Reckon it's like|Rerefons|Scenár|Scénář|Scenarie|Scenarij|Scenarijai|Scenarijaus šablonas|Scenariji|Scenārijs|Scenārijs pēc parauga|Scenarijus|Scenario|Scénario|Scenario Amlinellol|Scenario Outline|Scenario Template|Scenariomal|Scenariomall|Scenarios|Scenariu|Scenariusz|Scenaro|Schema dello scenario|Se ðe|Se the|Se þe|Senario|Senaryo|Senaryo deskripsyon|Senaryo Deskripsyon|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie|Situasie Uiteensetting|Skenario|Skenario konsep|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa|Swa hwaer swa|Swa hwær swa|Szablon scenariusza|Szenario|Szenariogrundriss|Tapaukset|Tapaus|Tapausaihio|Taust|Tausta|Template Keadaan|Template Senario|Template Situai|The thing of it is|Tình huống|Variantai|Voorbeelde|Voorbeelden|Wharrimean is|Yo\-ho\-ho|You'll wanna|Założenia|Παραδείγματα|Περιγραφή Σεναρίου|Σενάρια|Σενάριο|Υπόβαθρο|Кереш|Контекст|Концепт|Мисаллар|Мисоллар|Основа|Передумова|Позадина|Предистория|Предыстория|Приклади|Пример|Примери|Примеры|Рамка на сценарий|Скица|Структура сценарија|Структура сценария|Структура сценарію|Сценарий|Сценарий структураси|Сценарийның төзелеше|Сценарији|Сценарио|Сценарій|Тарих|Үрнәкләр|דוגמאות|רקע|תבנית תרחיש|תרחיש|الخلفية|الگوی سناریو|امثلة|پس منظر|زمینه|سناریو|سيناريو|سيناريو مخطط|مثالیں|منظر نامے کا خاکہ|منظرنامہ|نمونه ها|उदाहरण|परिदृश्य|परिदृश्य रूपरेखा|पृष्ठभूमि|ਉਦਾਹਰਨਾਂ|ਪਟਕਥਾ|ਪਟਕਥਾ ਢਾਂਚਾ|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਿਛੋਕੜ|ఉదాహరణలు|కథనం|నేపథ్యం|సన్నివేశం|ಉದಾಹರಣೆಗಳು|ಕಥಾಸಾರಾಂಶ|ವಿವರಣೆ|ಹಿನ್ನೆಲೆ|โครงสร้างของเหตุการณ์|ชุดของตัวอย่าง|ชุดของเหตุการณ์|แนวคิด|สรุปเหตุการณ์|เหตุการณ์|배경|시나리오|시나리오 개요|예|サンプル|シナリオ|シナリオアウトライン|シナリオテンプレ|シナリオテンプレート|テンプレ|例|例子|剧本|剧本大纲|劇本|劇本大綱|场景|场景大纲|場景|場景大綱|背景):[^:\r\n]*/,lookbehind:!0,inside:{important:{pattern:/(:)[^\r\n]*/,lookbehind:!0},keyword:/[^:\r\n]+:/}},"table-body":{pattern:/((?:\r?\n|\r)[ \t]*\|.+\|[^\r\n]*)+/,lookbehind:!0,inside:{outline:{pattern:/<[^>]+?>/,alias:"variable"},td:{pattern:/\s*[^\s|][^|]*/,alias:"string"},punctuation:/\|/}},"table-head":{pattern:/((?:\r?\n|\r)[ \t]*\|.+\|[^\r\n]*)/,inside:{th:{pattern:/\s*[^\s|][^|]*/,alias:"variable"},punctuation:/\|/}},atrule:{pattern:/((?:\r?\n|\r)[ \t]+)('ach|'a|'ej|7|a|A také|A taktiež|A tiež|A zároveň|Aber|Ac|Adott|Akkor|Ak|Aleshores|Ale|Ali|Allora|Alors|Als|Ama|Amennyiben|Amikor|Ampak|an|AN|Ananging|And y'all|And|Angenommen|Anrhegedig a|An|Apabila|Atès|Atesa|Atunci|Avast!|Aye|A|awer|Bagi|Banjur|Bet|Biết|Blimey!|Buh|But at the end of the day I reckon|But y'all|But|BUT|Cal|Când|Cando|Cand|Ce|Cuando|Če|Ða ðe|Ða|Dadas|Dada|Dados|Dado|DaH ghu' bejlu'|dann|Dann|Dano|Dan|Dar|Dat fiind|Data|Date fiind|Date|Dati fiind|Dati|Daţi fiind|Dați fiind|Dato|DEN|Den youse gotta|Dengan|De|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|Entonces|En|Epi|E|És|Etant donnée|Etant donné|Et|Étant données|Étant donnée|Étant donné|Etant données|Etant donnés|Étant donnés|Fakat|Gangway!|Gdy|Gegeben seien|Gegeben sei|Gegeven|Gegewe|ghu' noblu'|Gitt|Given y'all|Given|Givet|Givun|Ha|Cho|I CAN HAZ|In|Ir|It's just unbelievable|I|Ja|Jeśli|Jeżeli|Kadar|Kada|Kad|Kai|Kaj|Když|Keď|Kemudian|Ketika|Khi|Kiedy|Ko|Kuid|Kui|Kun|Lan|latlh|Le sa a|Let go and haul|Le|Lè sa a|Lè|Logo|Lorsqu'<|Lorsque|mä|Maar|Mais|Mając|Majd|Maka|Manawa|Mas|Ma|Menawa|Men|Mutta|Nalikaning|Nalika|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Og|Och|Oletetaan|Onda|Ond|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|qaSDI'|Quando|Quand|Quan|Så|Sed|Se|Siis|Sipoze ke|Sipoze Ke|Sipoze|Si|Şi|Și|Soit|Stel|Tada|Tad|Takrat|Tak|Tapi|Ter|Tetapi|Tha the|Tha|Then y'all|Then|Thì|Thurh|Toda|Too right|ugeholl|Und|Un|Và|vaj|Vendar|Ve|wann|Wanneer|WEN|Wenn|When y'all|When|Wtedy|Wun|Y'know|Yeah nah|Yna|Youse know like when|Youse know when youse got|Y|Za predpokladu|Za předpokladu|Zadani|Zadano|Zadan|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa þe|Þa|Þá|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً|اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा|किन्तु|चूंकि|जब|तथा|तदा|तब|परन्तु|पर|यदि|ਅਤੇ|ਜਦੋਂ|ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|ਤਦ|ਪਰ|అప్పుడు|ఈ పరిస్థితిలో|కాని|చెప్పబడినది|మరియు|ಆದರೆ|ನಂತರ|ನೀಡಿದ|ಮತ್ತು|ಸ್ಥಿತಿಯನ್ನು|กำหนดให้|ดังนั้น|แต่|เมื่อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t]+)/,lookbehind:!0},string:{pattern:/("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')/,inside:{outline:{pattern:/<[^>]+?>/,alias:"variable"}}},outline:{pattern:/<[^>]+?>/,alias:"variable"}}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-git.js b/MacDown/Resources/Prism/components/prism-git.js new file mode 100644 index 00000000..e5cc4cef --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-git.js @@ -0,0 +1,68 @@ +Prism.languages.git = { + /* + * A simple one line comment like in a git status command + * For instance: + * $ git status + * # On branch infinite-scroll + * # Your branch and 'origin/sharedBranches/frontendTeam/infinite-scroll' have diverged, + * # and have 1 and 2 different commits each, respectively. + * nothing to commit (working directory clean) + */ + 'comment': /^#.*/m, + + /* + * Regexp to match the changed lines in a git diff output. Check the example below. + */ + 'deleted': /^[-–].*/m, + 'inserted': /^\+.*/m, + + /* + * a string (double and simple quote) + */ + 'string': /("|')(\\?.)*?\1/m, + + /* + * a git command. It starts with a random prompt finishing by a $, then "git" then some other parameters + * For instance: + * $ git add file.txt + */ + 'command': { + pattern: /^.*\$ git .*$/m, + inside: { + /* + * A git command can contain a parameter starting by a single or a double dash followed by a string + * For instance: + * $ git diff --cached + * $ git log -p + */ + 'parameter': /\s(--|-)\w+/m + } + }, + + /* + * Coordinates displayed in a git diff command + * For instance: + * $ git diff + * diff --git file.txt file.txt + * index 6214953..1d54a52 100644 + * --- file.txt + * +++ file.txt + * @@ -1 +1,2 @@ + * -Here's my tetx file + * +Here's my text file + * +And this is the second line + */ + 'coord': /^@@.*@@$/m, + + /* + * Match a "commit [SHA1]" line in a git log output. + * For instance: + * $ git log + * commit a11a14ef7e26f2ca62d4b35eac455ce636d0dc09 + * Author: lgiraudel + * Date: Mon Feb 17 11:18:34 2014 +0100 + * + * Add of a new line + */ + 'commit_sha1': /^commit \w{40}$/m +}; diff --git a/MacDown/Resources/Prism/components/prism-git.min.js b/MacDown/Resources/Prism/components/prism-git.min.js new file mode 100644 index 00000000..e4b5da47 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-git.min.js @@ -0,0 +1 @@ +Prism.languages.git={comment:/^#.*/m,deleted:/^[-–].*/m,inserted:/^\+.*/m,string:/("|')(\\?.)*?\1/m,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s(--|-)\w+/m}},coord:/^@@.*@@$/m,commit_sha1:/^commit \w{40}$/m}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-glsl.js b/MacDown/Resources/Prism/components/prism-glsl.js new file mode 100644 index 00000000..e9cbfacb --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-glsl.js @@ -0,0 +1,16 @@ +Prism.languages.glsl = Prism.languages.extend('clike', { + 'comment': [ + /\/\*[\w\W]*?\*\//, + /\/\/(?:\\(?:\r\n|[\s\S])|.)*/ + ], + 'number': /\b(?:0x[\da-f]+|(?:\.\d+|\d+\.?\d*)(?:e[+-]?\d+)?)[ulf]*\b/i, + 'keyword': /\b(?:attribute|const|uniform|varying|buffer|shared|coherent|volatile|restrict|readonly|writeonly|atomic_uint|layout|centroid|flat|smooth|noperspective|patch|sample|break|continue|do|for|while|switch|case|default|if|else|subroutine|in|out|inout|float|double|int|void|bool|true|false|invariant|precise|discard|return|d?mat[234](?:x[234])?|[ibdu]?vec[234]|uint|lowp|mediump|highp|precision|[iu]?sampler[123]D|[iu]?samplerCube|sampler[12]DShadow|samplerCubeShadow|[iu]?sampler[12]DArray|sampler[12]DArrayShadow|[iu]?sampler2DRect|sampler2DRectShadow|[iu]?samplerBuffer|[iu]?sampler2DMS(?:Array)?|[iu]?samplerCubeArray|samplerCubeArrayShadow|[iu]?image[123]D|[iu]?image2DRect|[iu]?imageCube|[iu]?imageBuffer|[iu]?image[12]DArray|[iu]?imageCubeArray|[iu]?image2DMS(?:Array)?|struct|common|partition|active|asm|class|union|enum|typedef|template|this|resource|goto|inline|noinline|public|static|extern|external|interface|long|short|half|fixed|unsigned|superp|input|output|hvec[234]|fvec[234]|sampler3DRect|filter|sizeof|cast|namespace|using)\b/ +}); + +Prism.languages.insertBefore('glsl', 'comment', { + 'preprocessor': { + pattern: /(^[ \t]*)#(?:(?:define|undef|if|ifdef|ifndef|else|elif|endif|error|pragma|extension|version|line)\b)?/m, + lookbehind: true, + alias: 'builtin' + } +}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-glsl.min.js b/MacDown/Resources/Prism/components/prism-glsl.min.js new file mode 100644 index 00000000..ad901c4c --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-glsl.min.js @@ -0,0 +1 @@ +Prism.languages.glsl=Prism.languages.extend("clike",{comment:[/\/\*[\w\W]*?\*\//,/\/\/(?:\\(?:\r\n|[\s\S])|.)*/],number:/\b(?:0x[\da-f]+|(?:\.\d+|\d+\.?\d*)(?:e[+-]?\d+)?)[ulf]*\b/i,keyword:/\b(?:attribute|const|uniform|varying|buffer|shared|coherent|volatile|restrict|readonly|writeonly|atomic_uint|layout|centroid|flat|smooth|noperspective|patch|sample|break|continue|do|for|while|switch|case|default|if|else|subroutine|in|out|inout|float|double|int|void|bool|true|false|invariant|precise|discard|return|d?mat[234](?:x[234])?|[ibdu]?vec[234]|uint|lowp|mediump|highp|precision|[iu]?sampler[123]D|[iu]?samplerCube|sampler[12]DShadow|samplerCubeShadow|[iu]?sampler[12]DArray|sampler[12]DArrayShadow|[iu]?sampler2DRect|sampler2DRectShadow|[iu]?samplerBuffer|[iu]?sampler2DMS(?:Array)?|[iu]?samplerCubeArray|samplerCubeArrayShadow|[iu]?image[123]D|[iu]?image2DRect|[iu]?imageCube|[iu]?imageBuffer|[iu]?image[12]DArray|[iu]?imageCubeArray|[iu]?image2DMS(?:Array)?|struct|common|partition|active|asm|class|union|enum|typedef|template|this|resource|goto|inline|noinline|public|static|extern|external|interface|long|short|half|fixed|unsigned|superp|input|output|hvec[234]|fvec[234]|sampler3DRect|filter|sizeof|cast|namespace|using)\b/}),Prism.languages.insertBefore("glsl","comment",{preprocessor:{pattern:/(^[ \t]*)#(?:(?:define|undef|if|ifdef|ifndef|else|elif|endif|error|pragma|extension|version|line)\b)?/m,lookbehind:!0,alias:"builtin"}}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-go.js b/MacDown/Resources/Prism/components/prism-go.js new file mode 100644 index 00000000..3f7d7c56 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-go.js @@ -0,0 +1,9 @@ +Prism.languages.go = Prism.languages.extend('clike', { + 'keyword': /\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/, + 'builtin': /\b(bool|byte|complex(64|128)|error|float(32|64)|rune|string|u?int(8|16|32|64|)|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(ln)?|real|recover)\b/, + 'boolean': /\b(_|iota|nil|true|false)\b/, + 'operator': /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./, + 'number': /\b(-?(0x[a-f\d]+|(\d+\.?\d*|\.\d+)(e[-+]?\d+)?)i?)\b/i, + 'string': /("|'|`)(\\?.|\r|\n)*?\1/ +}); +delete Prism.languages.go['class-name']; diff --git a/MacDown/Resources/Prism/components/prism-go.min.js b/MacDown/Resources/Prism/components/prism-go.min.js new file mode 100644 index 00000000..d616836b --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-go.min.js @@ -0,0 +1 @@ +Prism.languages.go=Prism.languages.extend("clike",{keyword:/\b(break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,builtin:/\b(bool|byte|complex(64|128)|error|float(32|64)|rune|string|u?int(8|16|32|64|)|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(ln)?|real|recover)\b/,"boolean":/\b(_|iota|nil|true|false)\b/,operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,number:/\b(-?(0x[a-f\d]+|(\d+\.?\d*|\.\d+)(e[-+]?\d+)?)i?)\b/i,string:/("|'|`)(\\?.|\r|\n)*?\1/}),delete Prism.languages.go["class-name"]; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-groovy.js b/MacDown/Resources/Prism/components/prism-groovy.js new file mode 100644 index 00000000..a6656cd9 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-groovy.js @@ -0,0 +1,56 @@ +Prism.languages.groovy = Prism.languages.extend('clike', { + 'keyword': /\b(as|def|in|abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/, + 'string': /("""|''')[\W\w]*?\1|("|'|\/)(?:\\?.)*?\2|(\$\/)(\$\/\$|[\W\w])*?\/\$/, + 'number': /\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?[\d]+)?)[glidf]?\b/i, + 'operator': { + pattern: /(^|[^.])(~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.{1,2}(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/, + lookbehind: true + }, + 'punctuation': /\.+|[{}[\];(),:$]/ +}); + +Prism.languages.insertBefore('groovy', 'string', { + 'shebang': { + pattern: /#!.+/, + alias: 'comment' + } +}); + +Prism.languages.insertBefore('groovy', 'punctuation', { + 'spock-block': /\b(setup|given|when|then|and|cleanup|expect|where):/ +}); + +Prism.languages.insertBefore('groovy', 'function', { + 'annotation': { + alias: 'punctuation', + pattern: /(^|[^.])@\w+/, + lookbehind: true + } +}); + +// Handle string interpolation +Prism.hooks.add('wrap', function(env) { + if (env.language === 'groovy' && env.type === 'string') { + var delimiter = env.content[0]; + + if (delimiter != "'") { + var pattern = /([^\\])(\$(\{.*?\}|[\w\.]+))/; + if (delimiter === '$') { + pattern = /([^\$])(\$(\{.*?\}|[\w\.]+))/; + } + + // To prevent double HTML-ecoding we have to decode env.content first + env.content = env.content.replace(/&/g, '&').replace(/</g, '<'); + + env.content = Prism.highlight(env.content, { + 'expression': { + pattern: pattern, + lookbehind: true, + inside: Prism.languages.groovy + } + }); + + env.classes.push(delimiter === '/' ? 'regex' : 'gstring'); + } + } +}); diff --git a/MacDown/Resources/Prism/components/prism-groovy.min.js b/MacDown/Resources/Prism/components/prism-groovy.min.js new file mode 100644 index 00000000..54f8a1f9 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-groovy.min.js @@ -0,0 +1 @@ +Prism.languages.groovy=Prism.languages.extend("clike",{keyword:/\b(as|def|in|abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,string:/("""|''')[\W\w]*?\1|("|'|\/)(?:\\?.)*?\2|(\$\/)(\$\/\$|[\W\w])*?\/\$/,number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?[\d]+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.{1,2}(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),Prism.languages.insertBefore("groovy","string",{shebang:{pattern:/#!.+/,alias:"comment"}}),Prism.languages.insertBefore("groovy","punctuation",{"spock-block":/\b(setup|given|when|then|and|cleanup|expect|where):/}),Prism.languages.insertBefore("groovy","function",{annotation:{alias:"punctuation",pattern:/(^|[^.])@\w+/,lookbehind:!0}}),Prism.hooks.add("wrap",function(e){if("groovy"===e.language&&"string"===e.type){var t=e.content[0];if("'"!=t){var n=/([^\\])(\$(\{.*?\}|[\w\.]+))/;"$"===t&&(n=/([^\$])(\$(\{.*?\}|[\w\.]+))/),e.content=e.content.replace(/&/g,"&").replace(/</g,"<"),e.content=Prism.highlight(e.content,{expression:{pattern:n,lookbehind:!0,inside:Prism.languages.groovy}}),e.classes.push("/"===t?"regex":"gstring")}}}); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-haml.js b/MacDown/Resources/Prism/components/prism-haml.js new file mode 100644 index 00000000..e14539f9 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-haml.js @@ -0,0 +1,154 @@ +/* TODO + Handle multiline code after tag + %foo= some | + multiline | + code | +*/ + +(function(Prism) { + + Prism.languages.haml = { + // Multiline stuff should appear before the rest + + 'multiline-comment': { + pattern: /((?:^|\r?\n|\r)([\t ]*))(?:\/|-#).*((?:\r?\n|\r)\2[\t ]+.+)*/, + lookbehind: true, + alias: 'comment' + }, + + 'multiline-code': [ + { + pattern: /((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*((?:\r?\n|\r)\2[\t ]+.*,[\t ]*)*((?:\r?\n|\r)\2[\t ]+.+)/, + lookbehind: true, + inside: { + rest: Prism.languages.ruby + } + }, + { + pattern: /((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*\|[\t ]*((?:\r?\n|\r)\2[\t ]+.*\|[\t ]*)*/, + lookbehind: true, + inside: { + rest: Prism.languages.ruby + } + } + ], + + // See at the end of the file for known filters + 'filter': { + pattern: /((?:^|\r?\n|\r)([\t ]*)):[\w-]+((?:\r?\n|\r)(?:\2[\t ]+.+|\s*?(?=\r?\n|\r)))+/, + lookbehind: true, + inside: { + 'filter-name': { + pattern: /^:[\w-]+/, + alias: 'variable' + } + } + }, + + 'markup': { + pattern: /((?:^|\r?\n|\r)[\t ]*)<.+/, + lookbehind: true, + inside: { + rest: Prism.languages.markup + } + }, + 'doctype': { + pattern: /((?:^|\r?\n|\r)[\t ]*)!!!(?: .+)?/, + lookbehind: true + }, + 'tag': { + // Allows for one nested group of braces + pattern: /((?:^|\r?\n|\r)[\t ]*)[%.#][\w\-#.]*[\w\-](?:\([^)]+\)|\{(?:\{[^}]+\}|[^}])+\}|\[[^\]]+\])*[\/<>]*/, + lookbehind: true, + inside: { + 'attributes': [ + { + // Lookbehind tries to prevent interpolations for breaking it all + // Allows for one nested group of braces + pattern: /(^|[^#])\{(?:\{[^}]+\}|[^}])+\}/, + lookbehind: true, + inside: { + rest: Prism.languages.ruby + } + }, + { + pattern: /\([^)]+\)/, + inside: { + 'attr-value': { + pattern: /(=\s*)(?:"(?:\\?.)*?"|[^)\s]+)/, + lookbehind: true + }, + 'attr-name': /[\w:-]+(?=\s*!?=|\s*[,)])/, + 'punctuation': /[=(),]/ + } + }, + { + pattern: /\[[^\]]+\]/, + inside: { + rest: Prism.languages.ruby + } + } + ], + 'punctuation': /[<>]/ + } + }, + 'code': { + pattern: /((?:^|\r?\n|\r)[\t ]*(?:[~-]|[&!]?=)).+/, + lookbehind: true, + inside: { + rest: Prism.languages.ruby + } + }, + // Interpolations in plain text + 'interpolation': { + pattern: /#\{[^}]+\}/, + inside: { + 'delimiter': { + pattern: /^#\{|\}$/, + alias: 'punctuation' + }, + rest: Prism.languages.ruby + } + }, + 'punctuation': { + pattern: /((?:^|\r?\n|\r)[\t ]*)[~=\-&!]+/, + lookbehind: true + } + }; + + var filter_pattern = '((?:^|\\r?\\n|\\r)([\\t ]*)):{{filter_name}}((?:\\r?\\n|\\r)(?:\\2[\\t ]+.+|\\s*?(?=\\r?\\n|\\r)))+'; + + // Non exhaustive list of available filters and associated languages + var filters = [ + 'css', + {filter:'coffee',language:'coffeescript'}, + 'erb', + 'javascript', + 'less', + 'markdown', + 'ruby', + 'scss', + 'textile' + ]; + var all_filters = {}; + for (var i = 0, l = filters.length; i < l; i++) { + var filter = filters[i]; + filter = typeof filter === 'string' ? {filter: filter, language: filter} : filter; + if (Prism.languages[filter.language]) { + all_filters['filter-' + filter.filter] = { + pattern: RegExp(filter_pattern.replace('{{filter_name}}', filter.filter)), + lookbehind: true, + inside: { + 'filter-name': { + pattern: /^:[\w-]+/, + alias: 'variable' + }, + rest: Prism.languages[filter.language] + } + } + } + } + + Prism.languages.insertBefore('haml', 'filter', all_filters); + +}(Prism)); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-haml.min.js b/MacDown/Resources/Prism/components/prism-haml.min.js new file mode 100644 index 00000000..0a717544 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-haml.min.js @@ -0,0 +1 @@ +!function(e){e.languages.haml={"multiline-comment":{pattern:/((?:^|\r?\n|\r)([\t ]*))(?:\/|-#).*((?:\r?\n|\r)\2[\t ]+.+)*/,lookbehind:!0,alias:"comment"},"multiline-code":[{pattern:/((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*((?:\r?\n|\r)\2[\t ]+.*,[\t ]*)*((?:\r?\n|\r)\2[\t ]+.+)/,lookbehind:!0,inside:{rest:e.languages.ruby}},{pattern:/((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*\|[\t ]*((?:\r?\n|\r)\2[\t ]+.*\|[\t ]*)*/,lookbehind:!0,inside:{rest:e.languages.ruby}}],filter:{pattern:/((?:^|\r?\n|\r)([\t ]*)):[\w-]+((?:\r?\n|\r)(?:\2[\t ]+.+|\s*?(?=\r?\n|\r)))+/,lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"variable"}}},markup:{pattern:/((?:^|\r?\n|\r)[\t ]*)<.+/,lookbehind:!0,inside:{rest:e.languages.markup}},doctype:{pattern:/((?:^|\r?\n|\r)[\t ]*)!!!(?: .+)?/,lookbehind:!0},tag:{pattern:/((?:^|\r?\n|\r)[\t ]*)[%.#][\w\-#.]*[\w\-](?:\([^)]+\)|\{(?:\{[^}]+\}|[^}])+\}|\[[^\]]+\])*[\/<>]*/,lookbehind:!0,inside:{attributes:[{pattern:/(^|[^#])\{(?:\{[^}]+\}|[^}])+\}/,lookbehind:!0,inside:{rest:e.languages.ruby}},{pattern:/\([^)]+\)/,inside:{"attr-value":{pattern:/(=\s*)(?:"(?:\\?.)*?"|[^)\s]+)/,lookbehind:!0},"attr-name":/[\w:-]+(?=\s*!?=|\s*[,)])/,punctuation:/[=(),]/}},{pattern:/\[[^\]]+\]/,inside:{rest:e.languages.ruby}}],punctuation:/[<>]/}},code:{pattern:/((?:^|\r?\n|\r)[\t ]*(?:[~-]|[&!]?=)).+/,lookbehind:!0,inside:{rest:e.languages.ruby}},interpolation:{pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"},rest:e.languages.ruby}},punctuation:{pattern:/((?:^|\r?\n|\r)[\t ]*)[~=\-&!]+/,lookbehind:!0}};for(var t="((?:^|\\r?\\n|\\r)([\\t ]*)):{{filter_name}}((?:\\r?\\n|\\r)(?:\\2[\\t ]+.+|\\s*?(?=\\r?\\n|\\r)))+",r=["css",{filter:"coffee",language:"coffeescript"},"erb","javascript","less","markdown","ruby","scss","textile"],n={},a=0,i=r.length;i>a;a++){var l=r[a];l="string"==typeof l?{filter:l,language:l}:l,e.languages[l.language]&&(n["filter-"+l.filter]={pattern:RegExp(t.replace("{{filter_name}}",l.filter)),lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"variable"},rest:e.languages[l.language]}})}e.languages.insertBefore("haml","filter",n)}(Prism); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-handlebars.js b/MacDown/Resources/Prism/components/prism-handlebars.js new file mode 100644 index 00000000..d6eb8e95 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-handlebars.js @@ -0,0 +1,83 @@ +(function(Prism) { + + var handlebars_pattern = /\{\{\{[\w\W]+?\}\}\}|\{\{[\w\W]+?\}\}/g; + + Prism.languages.handlebars = Prism.languages.extend('markup', { + 'handlebars': { + pattern: handlebars_pattern, + inside: { + 'delimiter': { + pattern: /^\{\{\{?|\}\}\}?$/i, + alias: 'punctuation' + }, + 'string': /(["'])(\\?.)*?\1/, + 'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?)\b/, + 'boolean': /\b(true|false)\b/, + 'block': { + pattern: /^(\s*~?\s*)[#\/]\S+?(?=\s*~?\s*$|\s)/i, + lookbehind: true, + alias: 'keyword' + }, + 'brackets': { + pattern: /\[[^\]]+\]/, + inside: { + punctuation: /\[|\]/, + variable: /[\w\W]+/ + } + }, + 'punctuation': /[!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]/, + 'variable': /[^!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~\s]+/ + } + } + }); + + // Comments are inserted at top so that they can + // surround markup + Prism.languages.insertBefore('handlebars', 'tag', { + 'handlebars-comment': { + pattern: /\{\{![\w\W]*?\}\}/, + alias: ['handlebars','comment'] + } + }); + + // Tokenize all inline Handlebars expressions that are wrapped in {{ }} or {{{ }}} + // This allows for easy Handlebars + markup highlighting + Prism.hooks.add('before-highlight', function(env) { + if (env.language !== 'handlebars') { + return; + } + + env.tokenStack = []; + + env.backupCode = env.code; + env.code = env.code.replace(handlebars_pattern, function(match) { + env.tokenStack.push(match); + + return '___HANDLEBARS' + env.tokenStack.length + '___'; + }); + }); + + // Restore env.code for other plugins (e.g. line-numbers) + Prism.hooks.add('before-insert', function(env) { + if (env.language === 'handlebars') { + env.code = env.backupCode; + delete env.backupCode; + } + }); + + // Re-insert the tokens after highlighting + // and highlight them with defined grammar + Prism.hooks.add('after-highlight', function(env) { + if (env.language !== 'handlebars') { + return; + } + + for (var i = 0, t; t = env.tokenStack[i]; i++) { + // The replace prevents $$, $&, $`, $', $n, $nn from being interpreted as special patterns + env.highlightedCode = env.highlightedCode.replace('___HANDLEBARS' + (i + 1) + '___', Prism.highlight(t, env.grammar, 'handlebars').replace(/\$/g, '$$$$')); + } + + env.element.innerHTML = env.highlightedCode; + }); + +}(Prism)); diff --git a/MacDown/Resources/Prism/components/prism-handlebars.min.js b/MacDown/Resources/Prism/components/prism-handlebars.min.js new file mode 100644 index 00000000..bb27b616 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-handlebars.min.js @@ -0,0 +1 @@ +!function(e){var a=/\{\{\{[\w\W]+?\}\}\}|\{\{[\w\W]+?\}\}/g;e.languages.handlebars=e.languages.extend("markup",{handlebars:{pattern:a,inside:{delimiter:{pattern:/^\{\{\{?|\}\}\}?$/i,alias:"punctuation"},string:/(["'])(\\?.)*?\1/,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?)\b/,"boolean":/\b(true|false)\b/,block:{pattern:/^(\s*~?\s*)[#\/]\S+?(?=\s*~?\s*$|\s)/i,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\w\W]+/}},punctuation:/[!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~\s]+/}}}),e.languages.insertBefore("handlebars","tag",{"handlebars-comment":{pattern:/\{\{![\w\W]*?\}\}/,alias:["handlebars","comment"]}}),e.hooks.add("before-highlight",function(e){"handlebars"===e.language&&(e.tokenStack=[],e.backupCode=e.code,e.code=e.code.replace(a,function(a){return e.tokenStack.push(a),"___HANDLEBARS"+e.tokenStack.length+"___"}))}),e.hooks.add("before-insert",function(e){"handlebars"===e.language&&(e.code=e.backupCode,delete e.backupCode)}),e.hooks.add("after-highlight",function(a){if("handlebars"===a.language){for(var n,t=0;n=a.tokenStack[t];t++)a.highlightedCode=a.highlightedCode.replace("___HANDLEBARS"+(t+1)+"___",e.highlight(n,a.grammar,"handlebars").replace(/\$/g,"$$$$"));a.element.innerHTML=a.highlightedCode}})}(Prism); \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-haskell.js b/MacDown/Resources/Prism/components/prism-haskell.js new file mode 100644 index 00000000..a2f43be2 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-haskell.js @@ -0,0 +1,32 @@ +Prism.languages.haskell= { + 'comment': { + pattern: /(^|[^-!#$%*+=?&@|~.:<>^\\\/])(--[^-!#$%*+=?&@|~.:<>^\\\/].*|{-[\w\W]*?-})/m, + lookbehind: true + }, + 'char': /'([^\\']|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/, + 'string': /"([^\\"]|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+)|\\\s+\\)*"/, + 'keyword' : /\b(case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/, + 'import_statement' : { + // The imported or hidden names are not included in this import + // statement. This is because we want to highlight those exactly like + // we do for the names in the program. + pattern: /(\r?\n|\r|^)\s*import\s+(qualified\s+)?([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9']*)*(\s+as\s+([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9']*)*)?(\s+hiding\b)?/m, + inside: { + 'keyword': /\b(import|qualified|as|hiding)\b/ + } + }, + // These are builtin variables only. Constructors are highlighted later as a constant. + 'builtin': /\b(abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/, + // decimal integers and floating point numbers | octal integers | hexadecimal integers + 'number' : /\b(\d+(\.\d+)?(e[+-]?\d+)?|0o[0-7]+|0x[0-9a-f]+)\b/i, + // Most of this is needed because of the meaning of a single '.'. + // If it stands alone freely, it is the function composition. + // It may also be a separator between a module name and an identifier => no + // operator. If it comes together with other special characters it is an + // operator too. + 'operator' : /\s\.\s|[-!#$%*+=?&@|~.:<>^\\\/]*\.[-!#$%*+=?&@|~.:<>^\\\/]+|[-!#$%*+=?&@|~.:<>^\\\/]+\.[-!#$%*+=?&@|~.:<>^\\\/]*|[-!#$%*+=?&@|~:<>^\\\/]+|`([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*`/, + // In Haskell, nearly everything is a variable, do not highlight these. + 'hvariable': /\b([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*\b/, + 'constant': /\b([A-Z][_a-zA-Z0-9']*\.)*[A-Z][_a-zA-Z0-9']*\b/, + 'punctuation' : /[{}[\];(),.:]/ +}; diff --git a/MacDown/Resources/Prism/components/prism-haskell.min.js b/MacDown/Resources/Prism/components/prism-haskell.min.js new file mode 100644 index 00000000..115927a8 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-haskell.min.js @@ -0,0 +1 @@ +Prism.languages.haskell={comment:{pattern:/(^|[^-!#$%*+=?&@|~.:<>^\\\/])(--[^-!#$%*+=?&@|~.:<>^\\\/].*|{-[\w\W]*?-})/m,lookbehind:!0},"char":/'([^\\']|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+))'/,string:/"([^\\"]|\\([abfnrtv\\"'&]|\^[A-Z@[\]\^_]|NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|\d+|o[0-7]+|x[0-9a-fA-F]+)|\\\s+\\)*"/,keyword:/\b(case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,import_statement:{pattern:/(\r?\n|\r|^)\s*import\s+(qualified\s+)?([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9']*)*(\s+as\s+([A-Z][_a-zA-Z0-9']*)(\.[A-Z][_a-zA-Z0-9']*)*)?(\s+hiding\b)?/m,inside:{keyword:/\b(import|qualified|as|hiding)\b/}},builtin:/\b(abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/,number:/\b(\d+(\.\d+)?(e[+-]?\d+)?|0o[0-7]+|0x[0-9a-f]+)\b/i,operator:/\s\.\s|[-!#$%*+=?&@|~.:<>^\\\/]*\.[-!#$%*+=?&@|~.:<>^\\\/]+|[-!#$%*+=?&@|~.:<>^\\\/]+\.[-!#$%*+=?&@|~.:<>^\\\/]*|[-!#$%*+=?&@|~:<>^\\\/]+|`([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*`/,hvariable:/\b([A-Z][_a-zA-Z0-9']*\.)*[_a-z][_a-zA-Z0-9']*\b/,constant:/\b([A-Z][_a-zA-Z0-9']*\.)*[A-Z][_a-zA-Z0-9']*\b/,punctuation:/[{}[\];(),.:]/}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-haxe.js b/MacDown/Resources/Prism/components/prism-haxe.js new file mode 100644 index 00000000..70d9add9 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-haxe.js @@ -0,0 +1,43 @@ +Prism.languages.haxe = Prism.languages.extend('clike', { + // Strings can be multi-line + 'string': { + pattern: /(["'])(?:(?!\1)[^\\]|\\[\s\S])*\1/, + inside: { + 'interpolation': { + pattern: /(^|[^\\])\$(?:\w+|\{[^}]+\})/, + lookbehind: true, + inside: { + 'interpolation': { + pattern: /^\$\w*/, + alias: 'variable' + } + // See rest below + } + } + } + }, + // The final look-ahead prevents highlighting of keywords if expressions such as "haxe.macro.Expr" + 'keyword': /\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|from|for|function|if|implements|import|in|inline|interface|macro|new|null|override|public|private|return|static|super|switch|throw|to|try|typedef|using|var|while)(?!\.)\b/, + 'operator': /\.{3}|\+\+?|-[->]?|[=!]=?|&&?|\|\|?|<[<=]?|>[>=]?|[*\/%~^]/ +}); +Prism.languages.insertBefore('haxe', 'class-name', { + 'regex': { + pattern: /~\/(?:[^\/\\\r\n]|\\.)+\/[igmsu]*/ + } +}); +Prism.languages.insertBefore('haxe', 'keyword', { + 'preprocessor': { + pattern: /#\w+/, + alias: 'builtin' + }, + 'metadata': { + pattern: /@:?\w+/, + alias: 'symbol' + }, + 'reification': { + pattern: /\$(?:\w+|(?=\{))/, + alias: 'variable' + } +}); +Prism.languages.haxe['string'].inside['interpolation'].inside.rest = Prism.util.clone(Prism.languages.haxe); +delete Prism.languages.haxe['class-name']; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-haxe.min.js b/MacDown/Resources/Prism/components/prism-haxe.min.js new file mode 100644 index 00000000..42f05b0c --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-haxe.min.js @@ -0,0 +1 @@ +Prism.languages.haxe=Prism.languages.extend("clike",{string:{pattern:/(["'])(?:(?!\1)[^\\]|\\[\s\S])*\1/,inside:{interpolation:{pattern:/(^|[^\\])\$(?:\w+|\{[^}]+\})/,lookbehind:!0,inside:{interpolation:{pattern:/^\$\w*/,alias:"variable"}}}}},keyword:/\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|from|for|function|if|implements|import|in|inline|interface|macro|new|null|override|public|private|return|static|super|switch|throw|to|try|typedef|using|var|while)(?!\.)\b/,operator:/\.{3}|\+\+?|-[->]?|[=!]=?|&&?|\|\|?|<[<=]?|>[>=]?|[*\/%~^]/}),Prism.languages.insertBefore("haxe","class-name",{regex:{pattern:/~\/(?:[^\/\\\r\n]|\\.)+\/[igmsu]*/}}),Prism.languages.insertBefore("haxe","keyword",{preprocessor:{pattern:/#\w+/,alias:"builtin"},metadata:{pattern:/@:?\w+/,alias:"symbol"},reification:{pattern:/\$(?:\w+|(?=\{))/,alias:"variable"}}),Prism.languages.haxe.string.inside.interpolation.inside.rest=Prism.util.clone(Prism.languages.haxe),delete Prism.languages.haxe["class-name"]; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-http.js b/MacDown/Resources/Prism/components/prism-http.js new file mode 100644 index 00000000..edddb406 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-http.js @@ -0,0 +1,50 @@ +Prism.languages.http = { + 'request-line': { + pattern: /^(POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b\shttps?:\/\/\S+\sHTTP\/[0-9.]+/m, + inside: { + // HTTP Verb + property: /^(POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b/, + // Path or query argument + 'attr-name': /:\w+/ + } + }, + 'response-status': { + pattern: /^HTTP\/1.[01] [0-9]+.*/m, + inside: { + // Status, e.g. 200 OK + property: { + pattern: /(^HTTP\/1.[01] )[0-9]+.*/i, + lookbehind: true + } + } + }, + // HTTP header name + 'header-name': { + pattern: /^[\w-]+:(?=.)/m, + alias: 'keyword' + } +}; + +// Create a mapping of Content-Type headers to language definitions +var httpLanguages = { + 'application/json': Prism.languages.javascript, + 'application/xml': Prism.languages.markup, + 'text/xml': Prism.languages.markup, + 'text/html': Prism.languages.markup +}; + +// Insert each content type parser that has its associated language +// currently loaded. +for (var contentType in httpLanguages) { + if (httpLanguages[contentType]) { + var options = {}; + options[contentType] = { + pattern: new RegExp('(content-type:\\s*' + contentType + '[\\w\\W]*?)(?:\\r?\\n|\\r){2}[\\w\\W]*', 'i'), + lookbehind: true, + inside: { + rest: httpLanguages[contentType] + } + }; + Prism.languages.insertBefore('http', 'header-name', options); + } +} diff --git a/MacDown/Resources/Prism/components/prism-http.min.js b/MacDown/Resources/Prism/components/prism-http.min.js new file mode 100644 index 00000000..bd3b7287 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-http.min.js @@ -0,0 +1 @@ +Prism.languages.http={"request-line":{pattern:/^(POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b\shttps?:\/\/\S+\sHTTP\/[0-9.]+/m,inside:{property:/^(POST|GET|PUT|DELETE|OPTIONS|PATCH|TRACE|CONNECT)\b/,"attr-name":/:\w+/}},"response-status":{pattern:/^HTTP\/1.[01] [0-9]+.*/m,inside:{property:{pattern:/(^HTTP\/1.[01] )[0-9]+.*/i,lookbehind:!0}}},"header-name":{pattern:/^[\w-]+:(?=.)/m,alias:"keyword"}};var httpLanguages={"application/json":Prism.languages.javascript,"application/xml":Prism.languages.markup,"text/xml":Prism.languages.markup,"text/html":Prism.languages.markup};for(var contentType in httpLanguages)if(httpLanguages[contentType]){var options={};options[contentType]={pattern:new RegExp("(content-type:\\s*"+contentType+"[\\w\\W]*?)(?:\\r?\\n|\\r){2}[\\w\\W]*","i"),lookbehind:!0,inside:{rest:httpLanguages[contentType]}},Prism.languages.insertBefore("http","header-name",options)} \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-icon.js b/MacDown/Resources/Prism/components/prism-icon.js new file mode 100644 index 00000000..96e5ac45 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-icon.js @@ -0,0 +1,17 @@ +Prism.languages.icon = { + 'comment': /#.*/, + 'string': /(["'])(?:(?!\1)[^\\\r\n]|\\.|_(?:\r?\n|\r))*\1/, + 'number': /\b(?:\d+r[a-z\d]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b|\.\d+\b/i, + 'builtin-keyword': { + pattern: /&(?:allocated|ascii|clock|collections|cset|current|date|dateline|digits|dump|e|error(?:number|text|value)?|errout|fail|features|file|host|input|lcase|letters|level|line|main|null|output|phi|pi|pos|progname|random|regions|source|storage|subject|time|trace|ucase|version)\b/, + alias: 'variable' + }, + 'directive': { + pattern: /\$\w+/, + alias: 'builtin' + }, + 'keyword': /\b(?:break|by|case|create|default|do|else|end|every|fail|global|if|initial|invocable|link|local|next|not|of|procedure|record|repeat|return|static|suspend|then|to|until|while)\b/, + 'function': /(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/, + 'operator': /[+-]:(?!=)|(?:[\/?@^%&]|\+\+?|--?|==?=?|~==?=?|\*\*?|\|\|\|?|<(?:->?|>?=?)(?::=)?|:(?:=:?)?|[!.\\|~]/, + 'punctuation': /[\[\](){},;]/ +}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-icon.min.js b/MacDown/Resources/Prism/components/prism-icon.min.js new file mode 100644 index 00000000..4c55b556 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-icon.min.js @@ -0,0 +1 @@ +Prism.languages.icon={comment:/#.*/,string:/(["'])(?:(?!\1)[^\\\r\n]|\\.|_(?:\r?\n|\r))*\1/,number:/\b(?:\d+r[a-z\d]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b|\.\d+\b/i,"builtin-keyword":{pattern:/&(?:allocated|ascii|clock|collections|cset|current|date|dateline|digits|dump|e|error(?:number|text|value)?|errout|fail|features|file|host|input|lcase|letters|level|line|main|null|output|phi|pi|pos|progname|random|regions|source|storage|subject|time|trace|ucase|version)\b/,alias:"variable"},directive:{pattern:/\$\w+/,alias:"builtin"},keyword:/\b(?:break|by|case|create|default|do|else|end|every|fail|global|if|initial|invocable|link|local|next|not|of|procedure|record|repeat|return|static|suspend|then|to|until|while)\b/,"function":/(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/,operator:/[+-]:(?!=)|(?:[\/?@^%&]|\+\+?|--?|==?=?|~==?=?|\*\*?|\|\|\|?|<(?:->?|>?=?)(?::=)?|:(?:=:?)?|[!.\\|~]/,punctuation:/[\[\](){},;]/}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-inform7.js b/MacDown/Resources/Prism/components/prism-inform7.js new file mode 100644 index 00000000..91aca0e2 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-inform7.js @@ -0,0 +1,58 @@ +Prism.languages.inform7 = { + 'string': { + pattern: /"[^"]*"/, + inside: { + 'substitution': { + pattern: /\[[^\]]+\]/, + inside: { + 'delimiter': { + pattern:/\[|\]/, + alias: 'punctuation' + } + // See rest below + } + } + } + }, + 'comment': /\[[^\]]+\]/, + 'title': { + pattern: /^[ \t]*(?:volume|book|part(?! of)|chapter|section|table)\b.+/im, + alias: 'important' + }, + 'number': { + pattern: /(^|[^-])(?:(?:\b|-)\d+(?:\.\d+)?(?:\^\d+)?\w*|\b(?:one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve))\b(?!-)/i, + lookbehind: true + }, + 'verb': { + pattern: /(^|[^-])\b(?:applying to|are|attacking|answering|asking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:s|ing)?|consulting|contain(?:s|ing)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:ve|s|ving)|hold(?:s|ing)?|impl(?:y|ies)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:s|ing)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:s|ing)?|setting|showing|singing|sleeping|smelling|squeezing|switching|support(?:s|ing)?|swearing|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:s|ing)?|var(?:y|ies|ying)|waiting|waking|waving|wear(?:s|ing)?)\b(?!-)/i, + lookbehind: true, + alias: 'operator' + }, + 'keyword': { + pattern: /(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|unless|the story)|every turn|if|include|instead(?: of)?|let|move|no|now|otherwise|repeat|report|resume the story|rule for|running through|say(?:ing)?|stop the action|test|try(?:ing)?|understand|unless|use|when|while|yes)\b(?!-)/i, + lookbehind: true + }, + 'property': { + pattern: /(^|[^-])\b(?:adjacent(?! to)|carried|closed|concealed|contained|dark|described|edible|empty|enclosed|enterable|even|female|fixed in place|full|handled|held|improper-named|incorporated|inedible|invisible|lighted|lit|lock(?:able|ed)|male|marked for listing|mentioned|negative|neuter|non-(?:empty|full|recurring)|odd|opaque|open(?:able)?|plural-named|portable|positive|privately-named|proper-named|provided|publically-named|pushable between rooms|recurring|related|rubbing|scenery|seen|singular-named|supported|swinging|switch(?:able|ed(?: on| off)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i, + lookbehind: true, + alias: 'symbol' + }, + 'position': { + pattern: /(^|[^-])\b(?:above|adjacent to|back side of|below|between|down|east|everywhere|front side|here|in|inside(?: from)?|north(?:east|west)?|nowhere|on(?: top of)?|other side|outside(?: from)?|parts? of|regionally in|south(?:east|west)?|through|up|west|within)\b(?!-)/i, + lookbehind: true, + alias: 'keyword' + }, + 'type': { + pattern: /(^|[^-])\b(?:actions?|activit(?:y|ies)|actors?|animals?|backdrops?|containers?|devices?|directions?|doors?|holders?|kinds?|lists?|m[ae]n|nobody|nothing|nouns?|numbers?|objects?|people|persons?|player(?:'s holdall)?|regions?|relations?|rooms?|rule(?:book)?s?|scenes?|someone|something|supporters?|tables?|texts?|things?|time|vehicles?|wom[ae]n)\b(?!-)/i, + lookbehind: true, + alias: 'variable' + }, + 'punctuation': /[.,:;(){}]/ +}; + +Prism.languages.inform7['string'].inside['substitution'].inside.rest = Prism.util.clone(Prism.languages.inform7); +// We don't want the remaining text in the substitution to be highlighted as the string. +Prism.languages.inform7['string'].inside['substitution'].inside.rest.text = { + pattern: /\S(?:\s*\S)*/, + alias: 'comment' +}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-inform7.min.js b/MacDown/Resources/Prism/components/prism-inform7.min.js new file mode 100644 index 00000000..aa3df9b2 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-inform7.min.js @@ -0,0 +1 @@ +Prism.languages.inform7={string:{pattern:/"[^"]*"/,inside:{substitution:{pattern:/\[[^\]]+\]/,inside:{delimiter:{pattern:/\[|\]/,alias:"punctuation"}}}}},comment:/\[[^\]]+\]/,title:{pattern:/^[ \t]*(?:volume|book|part(?! of)|chapter|section|table)\b.+/im,alias:"important"},number:{pattern:/(^|[^-])(?:(?:\b|-)\d+(?:\.\d+)?(?:\^\d+)?\w*|\b(?:one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve))\b(?!-)/i,lookbehind:!0},verb:{pattern:/(^|[^-])\b(?:applying to|are|attacking|answering|asking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:s|ing)?|consulting|contain(?:s|ing)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:ve|s|ving)|hold(?:s|ing)?|impl(?:y|ies)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:s|ing)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:s|ing)?|setting|showing|singing|sleeping|smelling|squeezing|switching|support(?:s|ing)?|swearing|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:s|ing)?|var(?:y|ies|ying)|waiting|waking|waving|wear(?:s|ing)?)\b(?!-)/i,lookbehind:!0,alias:"operator"},keyword:{pattern:/(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|unless|the story)|every turn|if|include|instead(?: of)?|let|move|no|now|otherwise|repeat|report|resume the story|rule for|running through|say(?:ing)?|stop the action|test|try(?:ing)?|understand|unless|use|when|while|yes)\b(?!-)/i,lookbehind:!0},property:{pattern:/(^|[^-])\b(?:adjacent(?! to)|carried|closed|concealed|contained|dark|described|edible|empty|enclosed|enterable|even|female|fixed in place|full|handled|held|improper-named|incorporated|inedible|invisible|lighted|lit|lock(?:able|ed)|male|marked for listing|mentioned|negative|neuter|non-(?:empty|full|recurring)|odd|opaque|open(?:able)?|plural-named|portable|positive|privately-named|proper-named|provided|publically-named|pushable between rooms|recurring|related|rubbing|scenery|seen|singular-named|supported|swinging|switch(?:able|ed(?: on| off)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i,lookbehind:!0,alias:"symbol"},position:{pattern:/(^|[^-])\b(?:above|adjacent to|back side of|below|between|down|east|everywhere|front side|here|in|inside(?: from)?|north(?:east|west)?|nowhere|on(?: top of)?|other side|outside(?: from)?|parts? of|regionally in|south(?:east|west)?|through|up|west|within)\b(?!-)/i,lookbehind:!0,alias:"keyword"},type:{pattern:/(^|[^-])\b(?:actions?|activit(?:y|ies)|actors?|animals?|backdrops?|containers?|devices?|directions?|doors?|holders?|kinds?|lists?|m[ae]n|nobody|nothing|nouns?|numbers?|objects?|people|persons?|player(?:'s holdall)?|regions?|relations?|rooms?|rule(?:book)?s?|scenes?|someone|something|supporters?|tables?|texts?|things?|time|vehicles?|wom[ae]n)\b(?!-)/i,lookbehind:!0,alias:"variable"},punctuation:/[.,:;(){}]/},Prism.languages.inform7.string.inside.substitution.inside.rest=Prism.util.clone(Prism.languages.inform7),Prism.languages.inform7.string.inside.substitution.inside.rest.text={pattern:/\S(?:\s*\S)*/,alias:"comment"}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-ini.js b/MacDown/Resources/Prism/components/prism-ini.js new file mode 100644 index 00000000..e6a38522 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-ini.js @@ -0,0 +1,11 @@ +Prism.languages.ini= { + 'comment': /^[ \t]*;.*$/m, + 'important': /\[.*?\]/, + 'constant': /^[ \t]*[^\s=]+?(?=[ \t]*=)/m, + 'attr-value': { + pattern: /=.*/, + inside: { + 'punctuation': /^[=]/ + } + } +}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-ini.min.js b/MacDown/Resources/Prism/components/prism-ini.min.js new file mode 100644 index 00000000..b78bc951 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-ini.min.js @@ -0,0 +1 @@ +Prism.languages.ini={comment:/^[ \t]*;.*$/m,important:/\[.*?\]/,constant:/^[ \t]*[^\s=]+?(?=[ \t]*=)/m,"attr-value":{pattern:/=.*/,inside:{punctuation:/^[=]/}}}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-j.js b/MacDown/Resources/Prism/components/prism-j.js new file mode 100644 index 00000000..1d49f3b1 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-j.js @@ -0,0 +1,22 @@ +Prism.languages.j = { + 'comment': /\bNB\..*/, + 'string': /'(?:''|[^'\r\n])*'/, + 'keyword': /\b(?:(?:adverb|conjunction|CR|def|define|dyad|LF|monad|noun|verb)\b|(?:assert|break|case|catch[dt]?|continue|do|else|elseif|end|fcase|for|for_\w+|goto_\w+|if|label_\w+|return|select|throw|try|while|whilst)\.)/, + 'verb': { + // Negative look-ahead prevents bad highlighting + // of ^: ;. =. =: !. !: + pattern: /(?!\^:|;\.|[=!][.:])(?:\{(?:\.|::?)?|p(?:\.\.?|:)|[=!\]]|[<>+*\-%$|,#][.:]?|[\^?]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/, + alias: 'keyword' + }, + 'number': /\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:[ejpx]|ad|ar)_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_(?!\.))/, + 'adverb': { + pattern: /[~}]|[\/\\]\.?|[bfM]\.|t[.:]/, + alias: 'builtin' + }, + 'operator': /[=a][.:]|_\./, + 'conjunction': { + pattern: /&(?:\.:?|:)?|[.:@][.:]?|[!D][.:]|[;dHT]\.|`:?|[\^LS]:|"/, + alias: 'variable' + }, + 'punctuation': /[()]/ +}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-j.min.js b/MacDown/Resources/Prism/components/prism-j.min.js new file mode 100644 index 00000000..e13af187 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-j.min.js @@ -0,0 +1 @@ +Prism.languages.j={comment:/\bNB\..*/,string:/'(?:''|[^'\r\n])*'/,keyword:/\b(?:(?:adverb|conjunction|CR|def|define|dyad|LF|monad|noun|verb)\b|(?:assert|break|case|catch[dt]?|continue|do|else|elseif|end|fcase|for|for_\w+|goto_\w+|if|label_\w+|return|select|throw|try|while|whilst)\.)/,verb:{pattern:/(?!\^:|;\.|[=!][.:])(?:\{(?:\.|::?)?|p(?:\.\.?|:)|[=!\]]|[<>+*\-%$|,#][.:]?|[\^?]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/,alias:"keyword"},number:/\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:[ejpx]|ad|ar)_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_(?!\.))/,adverb:{pattern:/[~}]|[\/\\]\.?|[bfM]\.|t[.:]/,alias:"builtin"},operator:/[=a][.:]|_\./,conjunction:{pattern:/&(?:\.:?|:)?|[.:@][.:]?|[!D][.:]|[;dHT]\.|`:?|[\^LS]:|"/,alias:"variable"},punctuation:/[()]/}; \ No newline at end of file diff --git a/MacDown/Resources/Prism/components/prism-jade.js b/MacDown/Resources/Prism/components/prism-jade.js new file mode 100644 index 00000000..2b101056 --- /dev/null +++ b/MacDown/Resources/Prism/components/prism-jade.js @@ -0,0 +1,198 @@ +(function(Prism) { + // TODO: + // - Add CSS highlighting inside + + + + + +
+
+ +

Highlight Keywords

+

This plugin adds special CSS classes for each keyword matched in the code. For example, the keyword if will have the class keyword-if as well. You can have fine grained control over the appearance of each keyword by providing your own CSS rules.

+
+ +
+

Examples

+ +

JavaScript

+

+
+	

HTML (Markup)

+

+
+
+ + + + + + + + + + diff --git a/MacDown/Resources/Prism/plugins/highlight-keywords/prism-highlight-keywords.js b/MacDown/Resources/Prism/plugins/highlight-keywords/prism-highlight-keywords.js new file mode 100644 index 00000000..32b28122 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/highlight-keywords/prism-highlight-keywords.js @@ -0,0 +1,17 @@ +(function(){ + +if ( + typeof self !== 'undefined' && !self.Prism || + typeof global !== 'undefined' && !global.Prism +) { + return; +} + +Prism.hooks.add('wrap', function(env) { + if (env.type !== "keyword") { + return; + } + env.classes.push('keyword-' + env.content); +}); + +})(); diff --git a/MacDown/Resources/Prism/plugins/highlight-keywords/prism-highlight-keywords.min.js b/MacDown/Resources/Prism/plugins/highlight-keywords/prism-highlight-keywords.min.js new file mode 100644 index 00000000..c4326fea --- /dev/null +++ b/MacDown/Resources/Prism/plugins/highlight-keywords/prism-highlight-keywords.min.js @@ -0,0 +1 @@ +!function(){"undefined"!=typeof self&&!self.Prism||"undefined"!=typeof global&&!global.Prism||Prism.hooks.add("wrap",function(e){"keyword"===e.type&&e.classes.push("keyword-"+e.content)})}(); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/ie8/index.html b/MacDown/Resources/Prism/plugins/ie8/index.html new file mode 100644 index 00000000..2fef8e9d --- /dev/null +++ b/MacDown/Resources/Prism/plugins/ie8/index.html @@ -0,0 +1,67 @@ + + + + + + +IE8 ▲ Prism plugins + + + + + + + + + + + + +
+
+ +

IE8 (Work in progress)

+

Adds basic IE8 support to Prism through a series of polyfills.

+
+ +
+

How to use

+ +
+ +
+

Examples

+ +

JavaScript

+
/**
+ * This is a multiline comment
+ */
+var foo = 5; // this is a single line comment
+var str = "A string",
+    r = /and a regex/;
+ +

CSS

+
@font-face {
+	src: url(http://lea.verou.me/logo.otf);
+	font-family: 'LeaVerou';
+}
+ +

HTML

+
<!-- A comment -->
+<img src="http://prismjs.com/img/spectrum.png" alt="" />
+<p>Some text</p>
+
+ +
+ + + + + + + + \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/ie8/prism-ie8.css b/MacDown/Resources/Prism/plugins/ie8/prism-ie8.css new file mode 100644 index 00000000..b5f76309 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/ie8/prism-ie8.css @@ -0,0 +1,3 @@ +.token a { + color: inherit; +} \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/ie8/prism-ie8.js b/MacDown/Resources/Prism/plugins/ie8/prism-ie8.js new file mode 100644 index 00000000..0cd83eca --- /dev/null +++ b/MacDown/Resources/Prism/plugins/ie8/prism-ie8.js @@ -0,0 +1,42 @@ +(function(){ + +if (!window.Prism) { + return; +} + +var dummy = document.createElement('header'); + +if (!String.prototype.trim) { + String.prototype.trim = function () { + return this.replace(/^\s+/g, '').replace(/\s+$/g, ''); + }; +} + +// textContent polyfill +if (!('textContent' in dummy) && ('innerText' in dummy) && Object.defineProperty) { + Object.defineProperty(Element.prototype, 'textContent', { + get: function() { + return this.innerText; + }, + set: function(text) { + this.innerText = text; + } + }); +} + +// IE8 doesn't have DOMContentLoaded +if (!document.addEventListener && 'textContent' in dummy) { + setTimeout(Prism.highlightAll, 10); +} + +// Test if innerHTML line break bug is present +dummy.innerHTML = '\r\n'; + +if (dummy.textContent.indexOf('\n') === -1) { + // IE8 innerHTML bug: Discards line breaks + Prism.hooks.add('after-highlight', function(env) { + env.element.innerHTML = env.highlightedCode.replace(/\r?\n/g, '
'); + }); +} + +})(); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/ie8/prism-ie8.min.js b/MacDown/Resources/Prism/plugins/ie8/prism-ie8.min.js new file mode 100644 index 00000000..2bd5c628 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/ie8/prism-ie8.min.js @@ -0,0 +1 @@ +!function(){if(window.Prism){var e=document.createElement("header");String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+/g,"").replace(/\s+$/g,"")}),!("textContent"in e)&&"innerText"in e&&Object.defineProperty&&Object.defineProperty(Element.prototype,"textContent",{get:function(){return this.innerText},set:function(e){this.innerText=e}}),!document.addEventListener&&"textContent"in e&&setTimeout(Prism.highlightAll,10),e.innerHTML="\r\n",-1===e.textContent.indexOf("\n")&&Prism.hooks.add("after-highlight",function(e){e.element.innerHTML=e.highlightedCode.replace(/\r?\n/g,"
")})}}(); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/index.html b/MacDown/Resources/Prism/plugins/index.html new file mode 100644 index 00000000..e0e6cf23 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/index.html @@ -0,0 +1,42 @@ + + + + + + +Plugins ▲ Prism + + + + + + + + + + + +
+
+
+ +
+

Available plugins

+
    +
    + +
    +

    Contribute

    +

    Writing Prism plugins is easy! Read how at the “Extending Prism” section. +

    + +
    + + + + + + + + + \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/jsonp-highlight/index.html b/MacDown/Resources/Prism/plugins/jsonp-highlight/index.html new file mode 100644 index 00000000..d70d375e --- /dev/null +++ b/MacDown/Resources/Prism/plugins/jsonp-highlight/index.html @@ -0,0 +1,174 @@ + + + + + + +JSONP Highlight ▲ Prism plugins + + + + + + + + + + +
    +
    + +

    JSONP Highlight

    +

    Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).

    +
    + +
    +

    How to use

    + +

    Use the data-jsonp attribute on <pre> elements, like so:

    + +
    <pre
    +  class="language-javascript"
    +  data-jsonp="https://api.github.com/repos/leaverou/prism/contents/prism.js">
    +</pre>
    + +

    + Don't specifiy the callback query parameter in the URL; this will be added + automatically. If the API expects a different callback parameter name however, use the + data-callback parameter to specify the name: +

    + +
    <pre class="…" data-jsonp="…" data-callback="cb"></pre>
    + +

    + The next trick is of course actually extracting something from the JSONP response worth + highlighting, which means processing the response to extract the interesting data. +

    + +

    The following JSONP APIs are automatically detected and parsed:

    + + + +

    If you need to do your own parsing, you can hook your your own data adapters in two ways:

    +
      +
    1. + Supply the data-adapter parameter on the <pre> element. + This must be the name of a globally defined function. + The plugin will use only this adapter to parse the response. +
    2. +
    3. + Register your adapter function by calling + Prism.plugins.jsonphighlight.registerAdapter(function(rsp) { … }). + It will be added to the list of inbuilt adapters and used if no other registered + adapater (e.g. GitHub/Bitbucket) can parse the response. +
    4. +
    + +

    + In either case, the function must accept at least a single parameter (the JSONP response) and + returns a string of the content to highlight. If your adapter cannot parse the response, you + must return null. The DOM node that will contain the highlighted code will also + be passed in as the second argument, incase you need to use it to query any extra information + (maybe you wish to inspect the class or data-jsonp attributes to + assist in parsing the response). +

    + +

    + The following example demonstrates both methods of using a custom adapter, to simply return + the stringyfied JSONP response (i.e highlight the entire JSONP data): +

    + +
    <!-- perhaps this is in a .js file elsewhere -->
    +<script>
    +	function dump_json(rsp) {
    +		return "using dump_json: " + JSON.stringify(rsp,null,2);
    +	}
    +</script>
    +
    +<!-- … include prism.js … -->
    +<script>
    +	Prism.plugins.jsonphighlight.registerAdapter(function(rsp) {
    +		return "using registerAdapter: " + JSON.stringify(rsp,null,2);
    +	})
    +</script>
    +
    + +

    And later in your HTML:

    + +
    <!-- using the data-adapter attribute -->
    +<pre class="language-javascript" data-jsonp="…" data-adapter="dump_json"></pre>
    +
    +<!-- using whatever data adapters are available -->
    +<pre class="language-javascript" data-jsonp="…"></pre>
    +
    + +

    + Finally, unlike like the File Highlight + plugin, you do need to supply the appropriate class with the language + to highlight. This could have been auto-detected, but since you're not actually linking to + a file it's not always possible (see below in the example using GitHub status). + Furthermore, if you're linking to files with a .xaml extension for example, + this plugin then needs to somehow map that to highlight as markup, which just + means more bloat. You know what you're trying to highlight, just say so :) +

    + +

    Caveat for Gists

    + +

    + There's a bit of a catch with gists, as they can actually contain multiple files. + There are two options to handle this: +

    + +
      +
    1. + If your gist only contains one file, you don't need to to anything; the one and only + file will automatically be chosen and highlighted +
    2. +
    3. + If your file contains multiple files, the first one will be chosen by default. + However, you can supply the filename in the data-filename attribute, and + this file will be highlighted instead: +
      <pre class="…" data-jsonp="…" data-filename="mydemo.js"></pre>
      +
    4. +
    +
    + +
    +

    Examples

    + +

    The plugin’s JS code (from GitHub):

    +
    
    +
    +	

    GitHub Gist (gist contains a single file, automatically selected):

    +
    
    +
    +	

    GitHub Gist (gist contains a multiple files, file to load specified):

    +
    
    +
    + 	

    Bitbucket API:

    +
    
    + 	
    + 	

    Custom adapter (JSON.stringify showing GitHub status):

    +
    
    +
    +	

    Registered adapter (as above, but without explicitly declaring the data-adapter attribute):

    +
    
    +
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/jsonp-highlight/prism-jsonp-highlight.js b/MacDown/Resources/Prism/plugins/jsonp-highlight/prism-jsonp-highlight.js new file mode 100644 index 00000000..4ce5ca50 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/jsonp-highlight/prism-jsonp-highlight.js @@ -0,0 +1,151 @@ +(function() { + if ( !self.Prism || !self.document || !document.querySelectorAll || ![].filter) return; + + var adapters = []; + function registerAdapter(adapter) { + if (typeof adapter === "function" && !getAdapter(adapter)) { + adapters.push(adapter); + } + } + function getAdapter(adapter) { + if (typeof adapter === "function") { + return adapters.filter(function(fn) { return fn.valueOf() === adapter.valueOf()})[0]; + } + else if (typeof adapter === "string" && adapter.length > 0) { + return adapters.filter(function(fn) { return fn.name === adapter})[0]; + } + return null; + } + function removeAdapter(adapter) { + if (typeof adapter === "string") + adapter = getAdapter(adapter); + if (typeof adapter === "function") { + var index = adapters.indexOf(adapter); + if (index >=0) { + adapters.splice(index,1); + } + } + } + + Prism.plugins.jsonphighlight = { + registerAdapter: registerAdapter, + removeAdapter: removeAdapter, + highlight: highlight + }; + registerAdapter(function github(rsp, el) { + if ( rsp && rsp.meta && rsp.data ) { + if ( rsp.meta.status && rsp.meta.status >= 400 ) { + return "Error: " + ( rsp.data.message || rsp.meta.status ); + } + else if ( typeof(rsp.data.content) === "string" ) { + return typeof(atob) === "function" + ? atob(rsp.data.content.replace(/\s/g, "")) + : "Your browser cannot decode base64"; + } + } + return null; + }); + registerAdapter(function gist(rsp, el) { + if ( rsp && rsp.meta && rsp.data && rsp.data.files ) { + if ( rsp.meta.status && rsp.meta.status >= 400 ) { + return "Error: " + ( rsp.data.message || rsp.meta.status ); + } + else { + var filename = el.getAttribute("data-filename"); + if (filename == null) { + // Maybe in the future we can somehow render all files + // But the standard + + + + + + +
    +
    + +

    Keep markup

    +

    Prevents custom markup from being dropped out during highlighting.

    +
    + +
    + +

    How to use

    +

    You have nothing to do. With this plugin loaded, all markup inside code will be kept.

    + +

    Examples

    + +

    The following source code

    +
    <pre><code class="language-css">
    +@media <mark>screen</mark> {
    +	div {
    +		<mark>text</mark>-decoration: <mark><mark>under</mark>line</mark>;
    +		back<mark>ground: url</mark>('foo.png');
    +	}
    +}</code></pre>
    + +

    would render like this:

    +
    
    +@media screen {
    +	div {
    +		text-decoration: underline;
    +		background: url('foo.png');
    +	}
    +}
    + +

    + It also works for inline code: + var bar = function () { /* foo */ }; +

    + +
    + +
    + + + + + + + + + \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/keep-markup/prism-keep-markup.js b/MacDown/Resources/Prism/plugins/keep-markup/prism-keep-markup.js new file mode 100644 index 00000000..58e20fd0 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/keep-markup/prism-keep-markup.js @@ -0,0 +1,97 @@ +(function () { + + if (typeof self === 'undefined' || !self.Prism || !self.document || !document.createRange) { + return; + } + + Prism.plugins.KeepMarkup = true; + + Prism.hooks.add('before-highlight', function (env) { + if (!env.element.children.length) { + return; + } + + var pos = 0; + var data = []; + var f = function (elt, baseNode) { + var o = {}; + if (!baseNode) { + // Clone the original tag to keep all attributes + o.clone = elt.cloneNode(false); + o.posOpen = pos; + data.push(o); + } + for (var i = 0, l = elt.childNodes.length; i < l; i++) { + var child = elt.childNodes[i]; + if (child.nodeType === 1) { // element + f(child); + } else if(child.nodeType === 3) { // text + pos += child.data.length; + } + } + if (!baseNode) { + o.posClose = pos; + } + }; + f(env.element, true); + + if (data && data.length) { + // data is an array of all existing tags + env.keepMarkup = data; + } + }); + + Prism.hooks.add('after-highlight', function (env) { + if(env.keepMarkup && env.keepMarkup.length) { + + var walk = function (elt, nodeState) { + for (var i = 0, l = elt.childNodes.length; i < l; i++) { + + var child = elt.childNodes[i]; + + if (child.nodeType === 1) { // element + if (!walk(child, nodeState)) { + return false; + } + + } else if (child.nodeType === 3) { // text + if(!nodeState.nodeStart && nodeState.pos + child.data.length > nodeState.node.posOpen) { + // We found the start position + nodeState.nodeStart = child; + nodeState.nodeStartPos = nodeState.node.posOpen - nodeState.pos; + } + if(nodeState.nodeStart && nodeState.pos + child.data.length >= nodeState.node.posClose) { + // We found the end position + nodeState.nodeEnd = child; + nodeState.nodeEndPos = nodeState.node.posClose - nodeState.pos; + } + + nodeState.pos += child.data.length; + } + + if (nodeState.nodeStart && nodeState.nodeEnd) { + // Select the range and wrap it with the clone + var range = document.createRange(); + range.setStart(nodeState.nodeStart, nodeState.nodeStartPos); + range.setEnd(nodeState.nodeEnd, nodeState.nodeEndPos); + nodeState.node.clone.appendChild(range.extractContents()); + range.insertNode(nodeState.node.clone); + range.detach(); + + // Process is over + return false; + } + } + return true; + }; + + // For each tag, we walk the DOM to reinsert it + env.keepMarkup.forEach(function (node) { + walk(env.element, { + node: node, + pos: 0 + }); + }); + } + }); +}()); diff --git a/MacDown/Resources/Prism/plugins/keep-markup/prism-keep-markup.min.js b/MacDown/Resources/Prism/plugins/keep-markup/prism-keep-markup.min.js new file mode 100644 index 00000000..ecaf13ce --- /dev/null +++ b/MacDown/Resources/Prism/plugins/keep-markup/prism-keep-markup.min.js @@ -0,0 +1 @@ +!function(){"undefined"!=typeof self&&self.Prism&&self.document&&document.createRange&&(Prism.plugins.KeepMarkup=!0,Prism.hooks.add("before-highlight",function(e){if(e.element.children.length){var n=0,o=[],t=function(e,d){var r={};d||(r.clone=e.cloneNode(!1),r.posOpen=n,o.push(r));for(var a=0,s=e.childNodes.length;s>a;a++){var p=e.childNodes[a];1===p.nodeType?t(p):3===p.nodeType&&(n+=p.data.length)}d||(r.posClose=n)};t(e.element,!0),o&&o.length&&(e.keepMarkup=o)}}),Prism.hooks.add("after-highlight",function(e){if(e.keepMarkup&&e.keepMarkup.length){var n=function(e,o){for(var t=0,d=e.childNodes.length;d>t;t++){var r=e.childNodes[t];if(1===r.nodeType){if(!n(r,o))return!1}else 3===r.nodeType&&(!o.nodeStart&&o.pos+r.data.length>o.node.posOpen&&(o.nodeStart=r,o.nodeStartPos=o.node.posOpen-o.pos),o.nodeStart&&o.pos+r.data.length>=o.node.posClose&&(o.nodeEnd=r,o.nodeEndPos=o.node.posClose-o.pos),o.pos+=r.data.length);if(o.nodeStart&&o.nodeEnd){var a=document.createRange();return a.setStart(o.nodeStart,o.nodeStartPos),a.setEnd(o.nodeEnd,o.nodeEndPos),o.node.clone.appendChild(a.extractContents()),a.insertNode(o.node.clone),a.detach(),!1}}return!0};e.keepMarkup.forEach(function(o){n(e.element,{node:o,pos:0})})}}))}(); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/line-highlight/index.html b/MacDown/Resources/Prism/plugins/line-highlight/index.html new file mode 100644 index 00000000..91eec0df --- /dev/null +++ b/MacDown/Resources/Prism/plugins/line-highlight/index.html @@ -0,0 +1,88 @@ + + + + + + +Line highlight ▲ Prism plugins + + + + + + + + + + + +
    +
    + +

    Line highlight

    +

    Highlights specific lines and/or line ranges.

    +
    + +
    +

    How to use

    + +

    Obviously, this only works on code blocks (<pre><code>) and not for inline code. + +

    You specify the lines to be highlighted through the data-line attribute on the <pre> element, in the following simple format:

    +
      +
    • A single number refers to the line with that number
    • +
    • Ranges are denoted by two numbers, separated with a hyphen (-)
    • +
    • Multiple line numbers or ranges are separated by commas.
    • +
    • Whitespace is allowed anywhere and will be stripped off.
    • +
    + +

    Examples:

    +
    +
    5
    +
    The 5th line
    + +
    1-5
    +
    Lines 1 through 5
    + +
    1,4
    +
    Line 1 and line 4
    + +
    1-2, 5, 9-20
    +
    Lines 1 through 2, line 5, lines 9 through 20
    +
    + +

    In case you want the line numbering to be offset by a certain number (for example, you want the 1st line to be number 41 instead of 1, which is an offset of 40), you can additionally use the data-line-offset attribute. + +

    You can also link to specific lines on any code snippet, by using the following as a url hash: #{element-id}.{lines} where + {element-id} is the id of the <pre> element and {lines} is one or more lines or line ranges that follow the format + outlined above. For example, if there is an element with id="play" on the page, you can link to lines 5-6 by linking to #play.5-6

    +
    + +
    +

    Examples

    + +

    Line 2

    +
    
    +	
    +	

    Lines 15-25

    +
    
    +	
    +	

    Line 1 and lines 3-4 and line 42

    +
    
    +	
    +	

    Line 43, starting from line 41

    +
    
    +	
    +	

    Linking example

    +
    + +
    + + + + + + + + + \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/line-highlight/prism-line-highlight.css b/MacDown/Resources/Prism/plugins/line-highlight/prism-line-highlight.css new file mode 100644 index 00000000..9c8a3cce --- /dev/null +++ b/MacDown/Resources/Prism/plugins/line-highlight/prism-line-highlight.css @@ -0,0 +1,47 @@ +pre[data-line] { + position: relative; + padding: 1em 0 1em 3em; +} + +.line-highlight { + position: absolute; + left: 0; + right: 0; + padding: inherit 0; + margin-top: 1em; /* Same as .prism’s padding-top */ + + background: hsla(24, 20%, 50%,.08); + background: -moz-linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0)); + background: -webkit-linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0)); + background: -o-linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0)); + background: linear-gradient(to right, hsla(24, 20%, 50%,.1) 70%, hsla(24, 20%, 50%,0)); + + pointer-events: none; + + line-height: inherit; + white-space: pre; +} + + .line-highlight:before, + .line-highlight[data-end]:after { + content: attr(data-start); + position: absolute; + top: .4em; + left: .6em; + min-width: 1em; + padding: 0 .5em; + background-color: hsla(24, 20%, 50%,.4); + color: hsl(24, 20%, 95%); + font: bold 65%/1.5 sans-serif; + text-align: center; + vertical-align: .3em; + border-radius: 999px; + text-shadow: none; + box-shadow: 0 1px white; + } + + .line-highlight[data-end]:after { + content: attr(data-end); + top: auto; + bottom: .4em; + } diff --git a/MacDown/Resources/Prism/plugins/line-highlight/prism-line-highlight.js b/MacDown/Resources/Prism/plugins/line-highlight/prism-line-highlight.js new file mode 100644 index 00000000..3436c3ac --- /dev/null +++ b/MacDown/Resources/Prism/plugins/line-highlight/prism-line-highlight.js @@ -0,0 +1,132 @@ +(function(){ + +if (typeof self === 'undefined' || !self.Prism || !self.document || !document.querySelector) { + return; +} + +function $$(expr, con) { + return Array.prototype.slice.call((con || document).querySelectorAll(expr)); +} + +function hasClass(element, className) { + className = " " + className + " "; + return (" " + element.className + " ").replace(/[\n\t]/g, " ").indexOf(className) > -1 +} + +// Some browsers round the line-height, others don't. +// We need to test for it to position the elements properly. +var isLineHeightRounded = (function() { + var res; + return function() { + if(typeof res === 'undefined') { + var d = document.createElement('div'); + d.style.fontSize = '13px'; + d.style.lineHeight = '1.5'; + d.style.padding = 0; + d.style.border = 0; + d.innerHTML = ' 
     '; + document.body.appendChild(d); + // Browsers that round the line-height should have offsetHeight === 38 + // The others should have 39. + res = d.offsetHeight === 38; + document.body.removeChild(d); + } + return res; + } +}()); + +function highlightLines(pre, lines, classes) { + var ranges = lines.replace(/\s+/g, '').split(','), + offset = +pre.getAttribute('data-line-offset') || 0; + + var parseMethod = isLineHeightRounded() ? parseInt : parseFloat; + var lineHeight = parseMethod(getComputedStyle(pre).lineHeight); + + for (var i=0, range; range = ranges[i++];) { + range = range.split('-'); + + var start = +range[0], + end = +range[1] || start; + + var line = document.createElement('div'); + + line.textContent = Array(end - start + 2).join(' \n'); + line.className = (classes || '') + ' line-highlight'; + + //if the line-numbers plugin is enabled, then there is no reason for this plugin to display the line numbers + if(!hasClass(pre, 'line-numbers')) { + line.setAttribute('data-start', start); + + if(end > start) { + line.setAttribute('data-end', end); + } + } + + line.style.top = (start - offset - 1) * lineHeight + 'px'; + + //allow this to play nicely with the line-numbers plugin + if(hasClass(pre, 'line-numbers')) { + //need to attack to pre as when line-numbers is enabled, the code tag is relatively which screws up the positioning + pre.appendChild(line); + } else { + (pre.querySelector('code') || pre).appendChild(line); + } + } +} + +function applyHash() { + var hash = location.hash.slice(1); + + // Remove pre-existing temporary lines + $$('.temporary.line-highlight').forEach(function (line) { + line.parentNode.removeChild(line); + }); + + var range = (hash.match(/\.([\d,-]+)$/) || [,''])[1]; + + if (!range || document.getElementById(hash)) { + return; + } + + var id = hash.slice(0, hash.lastIndexOf('.')), + pre = document.getElementById(id); + + if (!pre) { + return; + } + + if (!pre.hasAttribute('data-line')) { + pre.setAttribute('data-line', ''); + } + + highlightLines(pre, range, 'temporary '); + + document.querySelector('.temporary.line-highlight').scrollIntoView(); +} + +var fakeTimer = 0; // Hack to limit the number of times applyHash() runs + +Prism.hooks.add('complete', function(env) { + var pre = env.element.parentNode; + var lines = pre && pre.getAttribute('data-line'); + + if (!pre || !lines || !/pre/i.test(pre.nodeName)) { + return; + } + + clearTimeout(fakeTimer); + + $$('.line-highlight', pre).forEach(function (line) { + line.parentNode.removeChild(line); + }); + + highlightLines(pre, lines); + + fakeTimer = setTimeout(applyHash, 1); +}); + +if(window.addEventListener) { + window.addEventListener('hashchange', applyHash); +} + +})(); diff --git a/MacDown/Resources/Prism/plugins/line-highlight/prism-line-highlight.min.js b/MacDown/Resources/Prism/plugins/line-highlight/prism-line-highlight.min.js new file mode 100644 index 00000000..aecd63e2 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/line-highlight/prism-line-highlight.min.js @@ -0,0 +1 @@ +!function(){function e(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function t(e,t){return t=" "+t+" ",(" "+e.className+" ").replace(/[\n\t]/g," ").indexOf(t)>-1}function n(e,n,i){for(var o,a=n.replace(/\s+/g,"").split(","),l=+e.getAttribute("data-line-offset")||0,d=r()?parseInt:parseFloat,c=d(getComputedStyle(e).lineHeight),s=0;o=a[s++];){o=o.split("-");var u=+o[0],m=+o[1]||u,h=document.createElement("div");h.textContent=Array(m-u+2).join(" \n"),h.className=(i||"")+" line-highlight",t(e,"line-numbers")||(h.setAttribute("data-start",u),m>u&&h.setAttribute("data-end",m)),h.style.top=(u-l-1)*c+"px",t(e,"line-numbers")?e.appendChild(h):(e.querySelector("code")||e).appendChild(h)}}function i(){var t=location.hash.slice(1);e(".temporary.line-highlight").forEach(function(e){e.parentNode.removeChild(e)});var i=(t.match(/\.([\d,-]+)$/)||[,""])[1];if(i&&!document.getElementById(t)){var r=t.slice(0,t.lastIndexOf(".")),o=document.getElementById(r);o&&(o.hasAttribute("data-line")||o.setAttribute("data-line",""),n(o,i,"temporary "),document.querySelector(".temporary.line-highlight").scrollIntoView())}}if("undefined"!=typeof self&&self.Prism&&self.document&&document.querySelector){var r=function(){var e;return function(){if("undefined"==typeof e){var t=document.createElement("div");t.style.fontSize="13px",t.style.lineHeight="1.5",t.style.padding=0,t.style.border=0,t.innerHTML=" 
     ",document.body.appendChild(t),e=38===t.offsetHeight,document.body.removeChild(t)}return e}}(),o=0;Prism.hooks.add("complete",function(t){var r=t.element.parentNode,a=r&&r.getAttribute("data-line");r&&a&&/pre/i.test(r.nodeName)&&(clearTimeout(o),e(".line-highlight",r).forEach(function(e){e.parentNode.removeChild(e)}),n(r,a),o=setTimeout(i,1))}),window.addEventListener&&window.addEventListener("hashchange",i)}}(); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/line-numbers/index.html b/MacDown/Resources/Prism/plugins/line-numbers/index.html new file mode 100644 index 00000000..2d016949 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/line-numbers/index.html @@ -0,0 +1,64 @@ + + + + + + +Line Numbers ▲ Prism plugins + + + + + + + + + + + +
    +
    + +

    Line Numbers

    +

    Line number at the beginning of code lines.

    +
    + +
    +

    How to use

    + +

    Obviously, this is supposed to work only for code blocks (<pre><code>) and not for inline code.

    +

    Add class line-numbers to your desired <pre> and line-numbers plugin will take care.

    +

    Optional: You can specify the data-start (Number) attribute on the <pre> element. It will shift the line counter.

    +
    + +
    +

    Examples

    + +

    JavaScript

    +
    
    +
    +  

    CSS

    +
    
    +
    +  

    HTML

    +

    Please note the data-start="-5" in the code below.

    +
    
    +
    +  

    Unknown languages

    +
    This raw text
    +is not highlighted
    +but it still has
    +lines numbers
    +
    + +
    + + + + + + + + + + \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/line-numbers/prism-line-numbers.css b/MacDown/Resources/Prism/plugins/line-numbers/prism-line-numbers.css new file mode 100644 index 00000000..284cc0ac --- /dev/null +++ b/MacDown/Resources/Prism/plugins/line-numbers/prism-line-numbers.css @@ -0,0 +1,40 @@ +pre.line-numbers { + position: relative; + padding-left: 3.8em; + counter-reset: linenumber; +} + +pre.line-numbers > code { + position: relative; +} + +.line-numbers .line-numbers-rows { + position: absolute; + pointer-events: none; + top: 0; + font-size: 100%; + left: -3.8em; + width: 3em; /* works for line-numbers below 1000 lines */ + letter-spacing: -1px; + border-right: 1px solid #999; + + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + +} + + .line-numbers-rows > span { + pointer-events: none; + display: block; + counter-increment: linenumber; + } + + .line-numbers-rows > span:before { + content: counter(linenumber); + color: #999; + display: block; + padding-right: 0.8em; + text-align: right; + } \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/line-numbers/prism-line-numbers.js b/MacDown/Resources/Prism/plugins/line-numbers/prism-line-numbers.js new file mode 100644 index 00000000..8323a43b --- /dev/null +++ b/MacDown/Resources/Prism/plugins/line-numbers/prism-line-numbers.js @@ -0,0 +1,56 @@ +(function() { + +if (typeof self === 'undefined' || !self.Prism || !self.document) { + return; +} + +Prism.hooks.add('complete', function (env) { + if (!env.code) { + return; + } + + // works only for wrapped inside
     (not inline)
    +	var pre = env.element.parentNode;
    +	var clsReg = /\s*\bline-numbers\b\s*/;
    +	if (
    +		!pre || !/pre/i.test(pre.nodeName) ||
    +			// Abort only if nor the 
     nor the  have the class
    +		(!clsReg.test(pre.className) && !clsReg.test(env.element.className))
    +	) {
    +		return;
    +	}
    +
    +	if (env.element.querySelector(".line-numbers-rows")) {
    +		// Abort if line numbers already exists
    +		return;
    +	}
    +
    +	if (clsReg.test(env.element.className)) {
    +		// Remove the class "line-numbers" from the 
    +		env.element.className = env.element.className.replace(clsReg, '');
    +	}
    +	if (!clsReg.test(pre.className)) {
    +		// Add the class "line-numbers" to the 
    +		pre.className += ' line-numbers';
    +	}
    +
    +	var match = env.code.match(/\n(?!$)/g);
    +	var linesNum = match ? match.length + 1 : 1;
    +	var lineNumbersWrapper;
    +
    +	var lines = new Array(linesNum + 1);
    +	lines = lines.join('');
    +
    +	lineNumbersWrapper = document.createElement('span');
    +	lineNumbersWrapper.className = 'line-numbers-rows';
    +	lineNumbersWrapper.innerHTML = lines;
    +
    +	if (pre.hasAttribute('data-start')) {
    +		pre.style.counterReset = 'linenumber ' + (parseInt(pre.getAttribute('data-start'), 10) - 1);
    +	}
    +
    +	env.element.appendChild(lineNumbersWrapper);
    +
    +});
    +
    +}());
    \ No newline at end of file
    diff --git a/MacDown/Resources/Prism/plugins/line-numbers/prism-line-numbers.min.js b/MacDown/Resources/Prism/plugins/line-numbers/prism-line-numbers.min.js
    new file mode 100644
    index 00000000..7fea3256
    --- /dev/null
    +++ b/MacDown/Resources/Prism/plugins/line-numbers/prism-line-numbers.min.js
    @@ -0,0 +1 @@
    +!function(){"undefined"!=typeof self&&self.Prism&&self.document&&Prism.hooks.add("complete",function(e){if(e.code){var t=e.element.parentNode,s=/\s*\bline-numbers\b\s*/;if(t&&/pre/i.test(t.nodeName)&&(s.test(t.className)||s.test(e.element.className))&&!e.element.querySelector(".line-numbers-rows")){s.test(e.element.className)&&(e.element.className=e.element.className.replace(s,"")),s.test(t.className)||(t.className+=" line-numbers");var n,a=e.code.match(/\n(?!$)/g),l=a?a.length+1:1,m=new Array(l+1);m=m.join(""),n=document.createElement("span"),n.className="line-numbers-rows",n.innerHTML=m,t.hasAttribute("data-start")&&(t.style.counterReset="linenumber "+(parseInt(t.getAttribute("data-start"),10)-1)),e.element.appendChild(n)}}})}();
    \ No newline at end of file
    diff --git a/MacDown/Resources/Prism/plugins/normalize-whitespace/demo.html b/MacDown/Resources/Prism/plugins/normalize-whitespace/demo.html
    new file mode 100644
    index 00000000..a6bcf22b
    --- /dev/null
    +++ b/MacDown/Resources/Prism/plugins/normalize-whitespace/demo.html
    @@ -0,0 +1,33 @@
    +
    +
    + +
    +
    +	
    +
    +
    +		var example = {
    +			foo: true,
    +
    +			bar: false
    +		};
    +
    +
    +	
    +
    +
    + +
    + + + + + \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/normalize-whitespace/index.html b/MacDown/Resources/Prism/plugins/normalize-whitespace/index.html new file mode 100644 index 00000000..7942b55e --- /dev/null +++ b/MacDown/Resources/Prism/plugins/normalize-whitespace/index.html @@ -0,0 +1,142 @@ + + + + + + + Normalize Whitespace ▲ Prism plugins + + + + + + + + + + + + +
    +
    + +

    Normalize Whitespace

    +

    Supports multiple operations to normalize whitespace in code blocks.

    +
    + +
    +

    How to use

    + +

    Obviously, this is supposed to work only for code blocks (<pre><code>) and not for inline code.

    +

    By default the plugin trims all leading and trailing whitespace of every code block. + It also removes extra indents and trailing whitespace on every line.

    + +

    The default settings can be overridden with the setDefaults() method + like so:

    + +
    
    +Prism.plugins.NormalizeWhitespace.setDefaults({
    +	'remove-trailing': true,
    +	'remove-indent': true,
    +	'left-trim': true,
    +	'right-trim': true,
    +	/*'break-lines': 80,
    +	'indent': 2,
    +	'remove-initial-line-feed': false,
    +	'tabs-to-spaces': 4,
    +	'spaces-to-tabs': 4*/
    +});
    +
    + +

    The following settings are available:

    + +
    +
    remove-trailing
    +
    Removes trailing whitespace on all lines.
    +
    remove-indent
    +
    If the whole code block is indented too much it removes the extra indent.
    +
    left-trim
    +
    Removes all whitespace from the top of the code block.
    +
    right-trim
    +
    Removes all whitespace from the bottom of the code block.
    +
    break-lines
    +
    Simple way of breaking long lines at a certain length (default is 80 characters).
    +
    indent
    +
    Adds a certain number of tabs to every line.
    +
    remove-initial-line-feed
    +
    Less aggressive version of left-trim. + It only removes a single line feed from the top of the code block.
    +
    tabs-to-spaces
    +
    Converts all tabs to a certain number of spaces (default is 4 spaces).
    +
    spaces-to-tabs
    +
    Converts a certain number of spaces to a tab (default is 4 spaces).
    +
    +
    + +
    +

    Examples

    + +

    The following example demonstrates the use of this plugin:

    + +
    
    +
    +	

    The result looks like this:

    + +
    +
    +	
    +
    +
    +		var example = {
    +			foo: true,
    +
    +			bar: false
    +		};
    +
    +
    +	
    +
    +
    + +

    It is also compatible with the keep-markup plugin:

    + +
    +
    +	
    +
    +
    +	@media screen {
    +		div {
    +			text-decoration: underline;
    +			background: url('foo.png');
    +		}
    +	}
    +
    +
    +
    + + +
    + +
    + + + + + + + + + + diff --git a/MacDown/Resources/Prism/plugins/normalize-whitespace/prism-normalize-whitespace.js b/MacDown/Resources/Prism/plugins/normalize-whitespace/prism-normalize-whitespace.js new file mode 100644 index 00000000..db02fce5 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/normalize-whitespace/prism-normalize-whitespace.js @@ -0,0 +1,170 @@ +(function() { + +if (typeof self === 'undefined' || !self.Prism || !self.document) { + return; +} + +var assign = Object.assign || function (obj1, obj2) { + for (var name in obj2) { + if (obj2.hasOwnProperty(name)) + obj1[name] = obj2[name]; + } + return obj1; +} + +function NormalizeWhitespace(defaults) { + this.defaults = assign({}, defaults); +} + +function toCamelCase(value) { + return value.replace(/-(\w)/g, function(match, firstChar) { + return firstChar.toUpperCase(); + }); +} + +function tabLen(str) { + var res = 0; + for (var i = 0; i < str.length; ++i) { + if (str.charCodeAt(i) == '\t'.charCodeAt(0)) + res += 3; + } + return str.length + res; +} + +NormalizeWhitespace.prototype = { + setDefaults: function (defaults) { + this.defaults = assign(this.defaults, defaults); + }, + normalize: function (input, settings) { + settings = assign(this.defaults, settings); + + for (var name in settings) { + var methodName = toCamelCase(name); + if (name !== "normalize" && methodName !== 'setDefaults' && + settings[name] && this[methodName]) { + input = this[methodName].call(this, input, settings[name]); + } + } + + return input; + }, + + /* + * Normalization methods + */ + leftTrim: function (input) { + return input.replace(/^\s+/, ''); + }, + rightTrim: function (input) { + return input.replace(/\s+$/, ''); + }, + tabsToSpaces: function (input, spaces) { + spaces = spaces|0 || 4; + return input.replace(/\t/g, new Array(++spaces).join(' ')); + }, + spacesToTabs: function (input, spaces) { + spaces = spaces|0 || 4; + return input.replace(new RegExp(' {' + spaces + '}', 'g'), '\t'); + }, + removeTrailing: function (input) { + return input.replace(/\s*?$/gm, ''); + }, + // Support for deprecated plugin remove-initial-line-feed + removeInitialLineFeed: function (input) { + return input.replace(/^(?:\r?\n|\r)/, ''); + }, + removeIndent: function (input) { + var indents = input.match(/^[^\S\n\r]*(?=\S)/gm); + + if (!indents || !indents[0].length) + return input; + + indents.sort(function(a, b){return a.length - b.length; }); + + if (!indents[0].length) + return input; + + return input.replace(new RegExp('^' + indents[0], 'gm'), ''); + }, + indent: function (input, tabs) { + return input.replace(/^[^\S\n\r]*(?=\S)/gm, new Array(++tabs).join('\t') + '$&'); + }, + breakLines: function (input, characters) { + characters = (characters === true) ? 80 : characters|0 || 80; + + var lines = input.split('\n'); + for (var i = 0; i < lines.length; ++i) { + if (tabLen(lines[i]) <= characters) + continue; + + var line = lines[i].split(/(\s+)/g), + len = 0; + + for (var j = 0; j < line.length; ++j) { + var tl = tabLen(line[j]); + len += tl; + if (len > characters) { + line[j] = '\n' + line[j]; + len = tl; + } + } + lines[i] = line.join(''); + } + return lines.join('\n'); + } +}; + +Prism.plugins.NormalizeWhitespace = new NormalizeWhitespace({ + 'remove-trailing': true, + 'remove-indent': true, + 'left-trim': true, + 'right-trim': true, + /*'break-lines': 80, + 'indent': 2, + 'remove-initial-line-feed': false, + 'tabs-to-spaces': 4, + 'spaces-to-tabs': 4*/ +}); + +Prism.hooks.add('before-highlight', function (env) { + var pre = env.element.parentNode; + if (!env.code || !pre || pre.nodeName.toLowerCase() !== 'pre' || + (env.settings && env.settings['whitespace-normalization'] === false)) + return; + + var children = pre.childNodes, + before = '', + after = '', + codeFound = false, + Normalizer = Prism.plugins.NormalizeWhitespace; + + // Move surrounding whitespace from the
     tag into the  tag
    +	for (var i = 0; i < children.length; ++i) {
    +		var node = children[i];
    +
    +		if (node == env.element) {
    +			codeFound = true;
    +		} else if (node.nodeName === "#text") {
    +			if (codeFound) {
    +				after += node.nodeValue;
    +			} else {
    +				before += node.nodeValue;
    +			}
    +
    +			pre.removeChild(node);
    +			--i;
    +		}
    +	}
    +
    +	if (!env.element.children.length || !Prism.plugins.KeepMarkup) {
    +		env.code = before + env.code + after;
    +		env.code = Normalizer.normalize(env.code, env.settings);
    +	} else {
    +		// Preserve markup for keep-markup plugin
    +		var html = before + env.element.innerHTML + after;
    +		env.element.innerHTML = Normalizer.normalize(html, env.settings);
    +		env.code = env.element.textContent;
    +	}
    +});
    +
    +}());
    \ No newline at end of file
    diff --git a/MacDown/Resources/Prism/plugins/normalize-whitespace/prism-normalize-whitespace.min.js b/MacDown/Resources/Prism/plugins/normalize-whitespace/prism-normalize-whitespace.min.js
    new file mode 100644
    index 00000000..53a4b4af
    --- /dev/null
    +++ b/MacDown/Resources/Prism/plugins/normalize-whitespace/prism-normalize-whitespace.min.js
    @@ -0,0 +1 @@
    +!function(){function e(e){this.defaults=r({},e)}function n(e){return e.replace(/-(\w)/g,function(e,n){return n.toUpperCase()})}function t(e){for(var n=0,t=0;tn&&(o[l]="\n"+o[l],a=s)}r[i]=o.join("")}return r.join("\n")}},Prism.plugins.NormalizeWhitespace=new e({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-highlight",function(e){var n=e.element.parentNode;if(e.code&&n&&"pre"===n.nodeName.toLowerCase()&&(!e.settings||e.settings["whitespace-normalization"]!==!1)){for(var t=n.childNodes,r="",i="",o=!1,a=Prism.plugins.NormalizeWhitespace,l=0;l
    +
    +
    +
    +	
    +	
    +	Previewer: Angle ▲ Prism plugins
    +	
    +	
    +	
    +	
    +	
    +	
    +
    +	
    +	
    +
    +
    +
    +
    +
    + +

    Previewer: Angle

    +

    Previewer for CSS angles.

    +
    + +
    +

    How to use

    + +

    You don't need to do anything. With this plugin loaded, a previewer will appear on hovering the angle values in code blocks.

    +

    This plugin is compatible with CSS, Less, Sass, Scss and Stylus.

    +
    + +
    +

    Examples

    + +

    CSS

    +
    div {
    +	transform: rotate(10deg);
    +}
    + +

    Less

    +
    @angle: 3rad;
    +#header a {
    +	transform: rotate(.4turn)
    +}
    + +

    Sass

    +
    $angle: 380grad
    +@mixin foobar
    +	transform: rotate(-120deg)
    +.foo
    +	transform: rotate(18rad)
    +
    + +

    Scss

    +
    $angle: 1.8turn;
    +.foo {
    +	transform: rotate(-3rad)
    +}
    + +

    Stylus

    +
    angle = 357deg
    +.foo
    +	transform: rotate(100grad)
    +
    + +
    + +
    + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-angle/prism-previewer-angle.css b/MacDown/Resources/Prism/plugins/previewer-angle/prism-previewer-angle.css new file mode 100644 index 00000000..31490c3a --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-angle/prism-previewer-angle.css @@ -0,0 +1,32 @@ +.prism-previewer-angle:before { + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + border-radius: 50%; + background: #fff; +} +.prism-previewer-angle:after { + margin-top: 4px; +} +.prism-previewer-angle svg { + width: 32px; + height: 32px; + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + transform: rotate(-90deg); +} +.prism-previewer-angle[data-negative] svg { + -webkit-transform: scaleX(-1) rotate(-90deg); + -moz-transform: scaleX(-1) rotate(-90deg); + -ms-transform: scaleX(-1) rotate(-90deg); + -o-transform: scaleX(-1) rotate(-90deg); + transform: scaleX(-1) rotate(-90deg); +} +.prism-previewer-angle circle { + fill: transparent; + stroke: hsl(200, 10%, 20%); + stroke-opacity: 0.9; + stroke-width: 32; + stroke-dasharray: 0, 500; +} \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-angle/prism-previewer-angle.js b/MacDown/Resources/Prism/plugins/previewer-angle/prism-previewer-angle.js new file mode 100644 index 00000000..36bc28dd --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-angle/prism-previewer-angle.js @@ -0,0 +1,118 @@ +(function() { + + if ( + typeof self !== 'undefined' && !self.Prism || + typeof global !== 'undefined' && !global.Prism + ) { + return; + } + + var languages = { + 'css': true, + 'less': true, + 'markup': { + lang: 'markup', + before: 'punctuation', + inside: 'inside', + root: Prism.languages.markup && Prism.languages.markup['tag'].inside['attr-value'] + }, + 'sass': [ + { + lang: 'sass', + inside: 'inside', + root: Prism.languages.sass && Prism.languages.sass['property-line'] + }, + { + lang: 'sass', + before: 'operator', + inside: 'inside', + root: Prism.languages.sass && Prism.languages.sass['variable-line'] + } + ], + 'scss': true, + 'stylus': [ + { + lang: 'stylus', + before: 'func', + inside: 'rest', + root: Prism.languages.stylus && Prism.languages.stylus['property-declaration'].inside + }, + { + lang: 'stylus', + before: 'func', + inside: 'rest', + root: Prism.languages.stylus && Prism.languages.stylus['variable-declaration'].inside + } + ] + }; + + Prism.hooks.add('before-highlight', function (env) { + if (env.language && languages[env.language] && !languages[env.language].initialized) { + var lang = languages[env.language]; + if (Prism.util.type(lang) !== 'Array') { + lang = [lang]; + } + lang.forEach(function(lang) { + var before, inside, root, skip; + if (lang === true) { + before = 'important'; + inside = env.language; + lang = env.language; + } else { + before = lang.before || 'important'; + inside = lang.inside || lang.lang; + root = lang.root || Prism.languages; + skip = lang.skip; + lang = env.language; + } + + if (!skip && Prism.languages[lang]) { + Prism.languages.insertBefore(inside, before, { + 'angle': /(?:\b|\B-|(?=\B\.))\d*\.?\d+(?:deg|g?rad|turn)\b/i + }, root); + env.grammar = Prism.languages[lang]; + + languages[env.language] = {initialized: true}; + } + }); + } + }); + + if (Prism.plugins.Previewer) { + new Prism.plugins.Previewer('angle', function(value) { + var num = parseFloat(value); + var unit = value.match(/[a-z]+$/i); + var max, percentage; + if (!num || !unit) { + return false; + } + unit = unit[0]; + + switch(unit) { + case 'deg': + max = 360; + break; + case 'grad': + max = 400; + break; + case 'rad': + max = 2 * Math.PI; + break; + case 'turn': + max = 1; + } + + percentage = 100 * num/max; + percentage %= 100; + + this[(num < 0? 'set' : 'remove') + 'Attribute']('data-negative', ''); + this.querySelector('circle').style.strokeDasharray = Math.abs(percentage) + ',500'; + return true; + }, '*', function () { + this._elt.innerHTML = '' + + '' + + ''; + }); + } + +}()); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-angle/prism-previewer-angle.min.js b/MacDown/Resources/Prism/plugins/previewer-angle/prism-previewer-angle.min.js new file mode 100644 index 00000000..e5ca1887 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-angle/prism-previewer-angle.min.js @@ -0,0 +1 @@ +!function(){if(("undefined"==typeof self||self.Prism)&&("undefined"==typeof global||global.Prism)){var a={css:!0,less:!0,markup:{lang:"markup",before:"punctuation",inside:"inside",root:Prism.languages.markup&&Prism.languages.markup.tag.inside["attr-value"]},sass:[{lang:"sass",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]},{lang:"sass",before:"operator",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]}],scss:!0,stylus:[{lang:"stylus",before:"func",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"func",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]};Prism.hooks.add("before-highlight",function(s){if(s.language&&a[s.language]&&!a[s.language].initialized){var e=a[s.language];"Array"!==Prism.util.type(e)&&(e=[e]),e.forEach(function(e){var i,r,n,g;e===!0?(i="important",r=s.language,e=s.language):(i=e.before||"important",r=e.inside||e.lang,n=e.root||Prism.languages,g=e.skip,e=s.language),!g&&Prism.languages[e]&&(Prism.languages.insertBefore(r,i,{angle:/(?:\b|\B-|(?=\B\.))\d*\.?\d+(?:deg|g?rad|turn)\b/i},n),s.grammar=Prism.languages[e],a[s.language]={initialized:!0})})}}),Prism.plugins.Previewer&&new Prism.plugins.Previewer("angle",function(a){var s,e,i=parseFloat(a),r=a.match(/[a-z]+$/i);if(!i||!r)return!1;switch(r=r[0]){case"deg":s=360;break;case"grad":s=400;break;case"rad":s=2*Math.PI;break;case"turn":s=1}return e=100*i/s,e%=100,this[(0>i?"set":"remove")+"Attribute"]("data-negative",""),this.querySelector("circle").style.strokeDasharray=Math.abs(e)+",500",!0},"*",function(){this._elt.innerHTML=''})}}(); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-base/index.html b/MacDown/Resources/Prism/plugins/previewer-base/index.html new file mode 100644 index 00000000..7a7c96b9 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-base/index.html @@ -0,0 +1,124 @@ + + + + + + + Previewer: Base ▲ Prism plugins + + + + + + + + + + + + + + +
    +
    + +

    Previewer: Base

    +

    Provides an API to add previewers.

    +
    + +
    +

    How to use

    + +

    This plugins provides a constructor that can be accessed through Prism.plugins.Previewer.

    +

    Once a previewer has been instanciated, an HTML element is appended to the document body. + This element will appear when specific tokens are hovered.

    + +

    new Prism.plugins.Previewer(type, updater, supportedLanguages)

    + +
      +
    • +

      type: the token type this previewer is associated to. + The previewer will be shown when hovering tokens of this type.

      +
    • +
    • +

      updater: the function that will be called each time an associated token is hovered. + This function takes the text content of the token as its only parameter. + The previewer HTML element can be accessed through the keyword this. + This function must return true for the previewer to be shown.

      +
    • +
    • +

      supportedLanguages: an optional array of supported languages. + The previewer will be available only for those. + Defaults to '*', which means every languages.

      +
    • +
    + +
    + +
    +

    Examples

    + +

    This is a simplified version of the color previewer plugin.

    + +

    Implementing a previewer for hexadecimal CSS colors

    +

    First, you need to add specific tokens to the grammar. For hexadecimal CSS colors, it might look like this:

    +
    Prism.languages.insertBefore('css', 'important', {
    +	'color': /\B#(?:[0-9a-f]{3}){1,2}\b/i
    +});
    + +

    Then, the previewer can be instanciated. The updater function will set the background color of the previewer HTML element, based of the hovered token.

    + +
    new Prism.plugins.Previewer('color', function(value) {
    +	// Reset the background color
    +	this.style.backgroundColor = '';
    +	// Set the background color to the value of the current hovered token
    +	this.style.backgroundColor = value;
    +	// Returns true if the color is valid, false otherwise
    +	return !!this.style.backgroundColor;
    +}, 'css');
    + +

    Now, with a bit of CSS to style the previewer, the result would be something like this:

    + +
    div {
    +	color: #dd4a68;
    +	background: #669900;
    +	border: 1px solid #ee9900;
    +}
    + +
    + +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-base/prism-previewer-base.css b/MacDown/Resources/Prism/plugins/previewer-base/prism-previewer-base.css new file mode 100644 index 00000000..35e0a63e --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-base/prism-previewer-base.css @@ -0,0 +1,76 @@ +.prism-previewer, +.prism-previewer:before, +.prism-previewer:after { + position: absolute; + pointer-events: none; +} +.prism-previewer, +.prism-previewer:after { + left: 50%; +} +.prism-previewer { + margin-top: -48px; + width: 32px; + height: 32px; + margin-left: -16px; + + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=$opacity)"; + filter: alpha(opacity=0); + -khtml-opacity: 0; + -moz-opacity: 0; + opacity: 0; + -webkit-transition: opacity .25s; + -moz-transition: opacity .25s; + -o-transition: opacity .25s; + transition: opacity .25s; +} +.prism-previewer.flipped { + margin-top: 0; + margin-bottom: -48px; +} +.prism-previewer:before, +.prism-previewer:after { + content: ''; + position: absolute; + pointer-events: none; +} +.prism-previewer:before { + top: -5px; + right: -5px; + left: -5px; + bottom: -5px; + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + border: 5px solid #fff; + -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.5) inset, 0 0 10px rgba(0, 0, 0, 0.75); + -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.5) inset, 0 0 10px rgba(0, 0, 0, 0.75); + -ms-box-shadow: 0 0 3px rgba(0, 0, 0, 0.5) inset, 0 0 10px rgba(0, 0, 0, 0.75); + -o-box-shadow: 0 0 3px rgba(0, 0, 0, 0.5) inset, 0 0 10px rgba(0, 0, 0, 0.75); + box-shadow: 0 0 3px rgba(0, 0, 0, 0.5) inset, 0 0 10px rgba(0, 0, 0, 0.75); +} + +.prism-previewer:after { + top: 100%; + width: 0; + height: 0; + margin: 5px 0 0 -7px; + border: 7px solid transparent; + border-color: rgba(255, 0, 0, 0); + border-top-color: #fff; +} +.prism-previewer.flipped:after { + top: auto; + bottom: 100%; + margin-top: 0; + margin-bottom: 5px; + border-top-color: rgba(255, 0, 0, 0); + border-bottom-color: #fff; +} +.prism-previewer.active { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=$opacity)"; + filter: alpha(opacity=1); + -khtml-opacity: 1; + -moz-opacity: 1; + opacity: 1; +} \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-base/prism-previewer-base.js b/MacDown/Resources/Prism/plugins/previewer-base/prism-previewer-base.js new file mode 100644 index 00000000..67960657 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-base/prism-previewer-base.js @@ -0,0 +1,201 @@ +(function() { + + if (typeof self === 'undefined' || !self.Prism || !self.document || !Function.prototype.bind) { + return; + } + + /** + * Returns the absolute X, Y offsets for an element + * @param {HTMLElement} element + * @returns {{top: number, right: number, bottom: number, left: number}} + */ + var getOffset = function (element) { + var left = 0, top = 0, el = element; + + if (el.parentNode) { + do { + left += el.offsetLeft; + top += el.offsetTop; + } while ((el = el.offsetParent) && el.nodeType < 9); + + el = element; + + do { + left -= el.scrollLeft; + top -= el.scrollTop; + } while ((el = el.parentNode) && !/body/i.test(el.nodeName)); + } + + return { + top: top, + right: innerWidth - left - element.offsetWidth, + bottom: innerHeight - top - element.offsetHeight, + left: left + }; + }; + + var tokenRegexp = /(?:^|\s)token(?=$|\s)/; + var activeRegexp = /(?:^|\s)active(?=$|\s)/g; + var flippedRegexp = /(?:^|\s)flipped(?=$|\s)/g; + + /** + * Previewer constructor + * @param {string} type Unique previewer type + * @param {function} updater Function that will be called on mouseover. + * @param {string[]|string=} supportedLanguages Aliases of the languages this previewer must be enabled for. Defaults to "*", all languages. + * @constructor + */ + var Previewer = function (type, updater, supportedLanguages, initializer) { + this._elt = null; + this._type = type; + this._clsRegexp = RegExp('(?:^|\\s)' + type + '(?=$|\\s)'); + this._token = null; + this.updater = updater; + this._mouseout = this.mouseout.bind(this); + this.initializer = initializer; + + var self = this; + + if (!supportedLanguages) { + supportedLanguages = ['*']; + } + if (Prism.util.type(supportedLanguages) !== 'Array') { + supportedLanguages = [supportedLanguages]; + } + supportedLanguages.forEach(function (lang) { + if (typeof lang !== 'string') { + lang = lang.lang; + } + if (!Previewer.byLanguages[lang]) { + Previewer.byLanguages[lang] = []; + } + if (Previewer.byLanguages[lang].indexOf(self) < 0) { + Previewer.byLanguages[lang].push(self); + } + }); + Previewer.byType[type] = this; + }; + + /** + * Creates the HTML element for the previewer. + */ + Previewer.prototype.init = function () { + if (this._elt) { + return; + } + this._elt = document.createElement('div'); + this._elt.className = 'prism-previewer prism-previewer-' + this._type; + document.body.appendChild(this._elt); + if(this.initializer) { + this.initializer(); + } + }; + + /** + * Checks the class name of each hovered element + * @param token + */ + Previewer.prototype.check = function (token) { + do { + if (tokenRegexp.test(token.className) && this._clsRegexp.test(token.className)) { + break; + } + } while(token = token.parentNode); + + if (token && token !== this._token) { + this._token = token; + this.show(); + } + }; + + /** + * Called on mouseout + */ + Previewer.prototype.mouseout = function() { + this._token.removeEventListener('mouseout', this._mouseout, false); + this._token = null; + this.hide(); + }; + + /** + * Shows the previewer positioned properly for the current token. + */ + Previewer.prototype.show = function () { + if (!this._elt) { + this.init(); + } + if (!this._token) { + return; + } + + if (this.updater.call(this._elt, this._token.textContent)) { + this._token.addEventListener('mouseout', this._mouseout, false); + + var offset = getOffset(this._token); + this._elt.className += ' active'; + + if (offset.top - this._elt.offsetHeight > 0) { + this._elt.className = this._elt.className.replace(flippedRegexp, ''); + this._elt.style.top = offset.top + 'px'; + this._elt.style.bottom = ''; + } else { + this._elt.className += ' flipped'; + this._elt.style.bottom = offset.bottom + 'px'; + this._elt.style.top = ''; + } + + this._elt.style.left = offset.left + Math.min(200, this._token.offsetWidth / 2) + 'px'; + } else { + this.hide(); + } + }; + + /** + * Hides the previewer. + */ + Previewer.prototype.hide = function () { + this._elt.className = this._elt.className.replace(activeRegexp, ''); + }; + + /** + * Map of all registered previewers by language + * @type {{}} + */ + Previewer.byLanguages = {}; + + /** + * Map of all registered previewers by type + * @type {{}} + */ + Previewer.byType = {}; + + /** + * Initializes the mouseover event on the code block. + * @param {HTMLElement} elt The code block (env.element) + * @param {string} lang The language (env.language) + */ + Previewer.initEvents = function (elt, lang) { + var previewers = []; + if (Previewer.byLanguages[lang]) { + previewers = previewers.concat(Previewer.byLanguages[lang]); + } + if (Previewer.byLanguages['*']) { + previewers = previewers.concat(Previewer.byLanguages['*']); + } + elt.addEventListener('mouseover', function (e) { + var target = e.target; + previewers.forEach(function (previewer) { + previewer.check(target); + }); + }, false); + }; + Prism.plugins.Previewer = Previewer; + + // Initialize the previewers only when needed + Prism.hooks.add('after-highlight', function (env) { + if(Previewer.byLanguages['*'] || Previewer.byLanguages[env.language]) { + Previewer.initEvents(env.element, env.language); + } + }); + +}()); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-base/prism-previewer-base.min.js b/MacDown/Resources/Prism/plugins/previewer-base/prism-previewer-base.min.js new file mode 100644 index 00000000..fdd9f8bd --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-base/prism-previewer-base.min.js @@ -0,0 +1 @@ +!function(){if("undefined"!=typeof self&&self.Prism&&self.document&&Function.prototype.bind){var t=function(t){var e=0,s=0,i=t;if(i.parentNode){do e+=i.offsetLeft,s+=i.offsetTop;while((i=i.offsetParent)&&i.nodeType<9);i=t;do e-=i.scrollLeft,s-=i.scrollTop;while((i=i.parentNode)&&!/body/i.test(i.nodeName))}return{top:s,right:innerWidth-e-t.offsetWidth,bottom:innerHeight-s-t.offsetHeight,left:e}},e=/(?:^|\s)token(?=$|\s)/,s=/(?:^|\s)active(?=$|\s)/g,i=/(?:^|\s)flipped(?=$|\s)/g,o=function(t,e,s,i){this._elt=null,this._type=t,this._clsRegexp=RegExp("(?:^|\\s)"+t+"(?=$|\\s)"),this._token=null,this.updater=e,this._mouseout=this.mouseout.bind(this),this.initializer=i;var n=this;s||(s=["*"]),"Array"!==Prism.util.type(s)&&(s=[s]),s.forEach(function(t){"string"!=typeof t&&(t=t.lang),o.byLanguages[t]||(o.byLanguages[t]=[]),o.byLanguages[t].indexOf(n)<0&&o.byLanguages[t].push(n)}),o.byType[t]=this};o.prototype.init=function(){this._elt||(this._elt=document.createElement("div"),this._elt.className="prism-previewer prism-previewer-"+this._type,document.body.appendChild(this._elt),this.initializer&&this.initializer())},o.prototype.check=function(t){do if(e.test(t.className)&&this._clsRegexp.test(t.className))break;while(t=t.parentNode);t&&t!==this._token&&(this._token=t,this.show())},o.prototype.mouseout=function(){this._token.removeEventListener("mouseout",this._mouseout,!1),this._token=null,this.hide()},o.prototype.show=function(){if(this._elt||this.init(),this._token)if(this.updater.call(this._elt,this._token.textContent)){this._token.addEventListener("mouseout",this._mouseout,!1);var e=t(this._token);this._elt.className+=" active",e.top-this._elt.offsetHeight>0?(this._elt.className=this._elt.className.replace(i,""),this._elt.style.top=e.top+"px",this._elt.style.bottom=""):(this._elt.className+=" flipped",this._elt.style.bottom=e.bottom+"px",this._elt.style.top=""),this._elt.style.left=e.left+Math.min(200,this._token.offsetWidth/2)+"px"}else this.hide()},o.prototype.hide=function(){this._elt.className=this._elt.className.replace(s,"")},o.byLanguages={},o.byType={},o.initEvents=function(t,e){var s=[];o.byLanguages[e]&&(s=s.concat(o.byLanguages[e])),o.byLanguages["*"]&&(s=s.concat(o.byLanguages["*"])),t.addEventListener("mouseover",function(t){var e=t.target;s.forEach(function(t){t.check(e)})},!1)},Prism.plugins.Previewer=o,Prism.hooks.add("after-highlight",function(t){(o.byLanguages["*"]||o.byLanguages[t.language])&&o.initEvents(t.element,t.language)})}}(); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-color/index.html b/MacDown/Resources/Prism/plugins/previewer-color/index.html new file mode 100644 index 00000000..34be828c --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-color/index.html @@ -0,0 +1,92 @@ + + + + + + + Previewer: Color ▲ Prism plugins + + + + + + + + + + + + +
    +
    + +

    Previewer: Color

    +

    Previewer for CSS colors.

    +
    + +
    +

    How to use

    + +

    You don't need to do anything. With this plugin loaded, a previewer will appear on hovering the color values in code blocks.

    +

    This plugin is compatible with CSS, Markup attributes, Less, Sass, Scss and Stylus.

    +
    + +
    +

    Examples

    + +

    CSS

    +
    div {
    +	color: rgba(255, 0, 0, 0.2);
    +	background: purple;
    +	border: 1px solid hsl(100,70%,40%);
    +}
    + +

    Markup attributes

    +
    <table bgcolor="#6E5494">
    +<tr style="background: lightblue;">
    + +

    Less

    +
    @nice-blue: #5B83AD;
    +#header a {
    +	color: hsla(102, 53%, 42%, 0.4);
    +}
    + +

    Sass

    +
    $color: blue
    +@mixin foobar
    +    color: rgba(147, 32, 34, 0.8)
    +.foo
    +    color: pink
    +
    + +

    Scss

    +
    $color: blue;
    +$attr: background;
    +.foo {
    +    #{$attr}-color: rgba(255,255,0,0.75);
    +}
    + +

    Stylus

    +
    color = olive
    +.foo
    +	color: #000
    +
    + +
    + +
    + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-color/prism-previewer-color.css b/MacDown/Resources/Prism/plugins/previewer-color/prism-previewer-color.css new file mode 100644 index 00000000..c6adf0e1 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-color/prism-previewer-color.css @@ -0,0 +1,9 @@ +.prism-previewer-color { + background-image: linear-gradient(45deg, #bbb 25%, transparent 25%, transparent 75%, #bbb 75%, #bbb), linear-gradient(45deg, #bbb 25%, #eee 25%, #eee 75%, #bbb 75%, #bbb); + background-size: 10px 10px; + background-position: 0 0, 5px 5px; +} +.prism-previewer-color:before { + background-color: inherit; + background-clip: padding-box; +} diff --git a/MacDown/Resources/Prism/plugins/previewer-color/prism-previewer-color.js b/MacDown/Resources/Prism/plugins/previewer-color/prism-previewer-color.js new file mode 100644 index 00000000..250e310f --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-color/prism-previewer-color.js @@ -0,0 +1,89 @@ +(function() { + + if ( + typeof self !== 'undefined' && !self.Prism || + typeof global !== 'undefined' && !global.Prism + ) { + return; + } + + var languages = { + 'css': true, + 'less': true, + 'markup': { + lang: 'markup', + before: 'punctuation', + inside: 'inside', + root: Prism.languages.markup && Prism.languages.markup['tag'].inside['attr-value'] + }, + 'sass': [ + { + lang: 'sass', + before: 'punctuation', + inside: 'inside', + root: Prism.languages.sass && Prism.languages.sass['variable-line'] + }, + { + lang: 'sass', + inside: 'inside', + root: Prism.languages.sass && Prism.languages.sass['property-line'] + } + ], + 'scss': true, + 'stylus': [ + { + lang: 'stylus', + before: 'hexcode', + inside: 'rest', + root: Prism.languages.stylus && Prism.languages.stylus['property-declaration'].inside + }, + { + lang: 'stylus', + before: 'hexcode', + inside: 'rest', + root: Prism.languages.stylus && Prism.languages.stylus['variable-declaration'].inside + } + ] + }; + + Prism.hooks.add('before-highlight', function (env) { + if (env.language && languages[env.language] && !languages[env.language].initialized) { + var lang = languages[env.language]; + if (Prism.util.type(lang) !== 'Array') { + lang = [lang]; + } + lang.forEach(function(lang) { + var before, inside, root, skip; + if (lang === true) { + before = 'important'; + inside = env.language; + lang = env.language; + } else { + before = lang.before || 'important'; + inside = lang.inside || lang.lang; + root = lang.root || Prism.languages; + skip = lang.skip; + lang = env.language; + } + + if (!skip && Prism.languages[lang]) { + Prism.languages.insertBefore(inside, before, { + 'color': /\B#(?:[0-9a-f]{3}){1,2}\b|\b(?:rgb|hsl)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:rgb|hsl)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B|\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGray|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGray|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGray|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gray|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGray|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGray|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGray|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i + }, root); + env.grammar = Prism.languages[lang]; + + languages[env.language] = {initialized: true}; + } + }); + } + }); + + if (Prism.plugins.Previewer) { + new Prism.plugins.Previewer('color', function(value) { + this.style.backgroundColor = ''; + this.style.backgroundColor = value; + return !!this.style.backgroundColor; + }); + } + +}()); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-color/prism-previewer-color.min.js b/MacDown/Resources/Prism/plugins/previewer-color/prism-previewer-color.min.js new file mode 100644 index 00000000..ae27d5a1 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-color/prism-previewer-color.min.js @@ -0,0 +1 @@ +!function(){if(("undefined"==typeof self||self.Prism)&&("undefined"==typeof global||global.Prism)){var e={css:!0,less:!0,markup:{lang:"markup",before:"punctuation",inside:"inside",root:Prism.languages.markup&&Prism.languages.markup.tag.inside["attr-value"]},sass:[{lang:"sass",before:"punctuation",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]},{lang:"sass",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]}],scss:!0,stylus:[{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]};Prism.hooks.add("before-highlight",function(a){if(a.language&&e[a.language]&&!e[a.language].initialized){var i=e[a.language];"Array"!==Prism.util.type(i)&&(i=[i]),i.forEach(function(i){var r,l,n,s;i===!0?(r="important",l=a.language,i=a.language):(r=i.before||"important",l=i.inside||i.lang,n=i.root||Prism.languages,s=i.skip,i=a.language),!s&&Prism.languages[i]&&(Prism.languages.insertBefore(l,r,{color:/\B#(?:[0-9a-f]{3}){1,2}\b|\b(?:rgb|hsl)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:rgb|hsl)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B|\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGray|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGray|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGray|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gray|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGray|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGray|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGray|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i},n),a.grammar=Prism.languages[i],e[a.language]={initialized:!0})})}}),Prism.plugins.Previewer&&new Prism.plugins.Previewer("color",function(e){return this.style.backgroundColor="",this.style.backgroundColor=e,!!this.style.backgroundColor})}}(); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-easing/index.html b/MacDown/Resources/Prism/plugins/previewer-easing/index.html new file mode 100644 index 00000000..679b79fd --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-easing/index.html @@ -0,0 +1,84 @@ + + + + + + + Previewer: Easing ▲ Prism plugins + + + + + + + + + + + + +
    +
    + +

    Previewer: Easing

    +

    Previewer for CSS easing functions.

    +
    + +
    +

    How to use

    + +

    You don't need to do anything. With this plugin loaded, a previewer will appear on hovering the easing values in code blocks.

    +

    This plugin is compatible with CSS, Less, Sass, Scss and Stylus.

    +
    + +
    +

    Examples

    + +

    CSS

    +
    div {
    +	transition: color 0.3s linear;
    +}
    + +

    Less

    +
    @easing: cubic-bezier(0.1,0.3,1,.4);
    +#header a {
    +	transition-timing-function: ease;
    +}
    + +

    Sass

    +
    $easing: ease-out
    +.foo
    +	transition: color 0.3s ease-in-out
    +
    + +

    Scss

    +
    $easing: linear;
    +$attr: background;
    +.foo {
    +    transition: #{$attr}-color 0.3s cubic-bezier(0.9,0.1,.2,.4);
    +}
    + +

    Stylus

    +
    easing = ease-in
    +.foo
    +	transition: color 0.3s ease-out
    +
    + +
    + +
    + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-easing/prism-previewer-easing.css b/MacDown/Resources/Prism/plugins/previewer-easing/prism-previewer-easing.css new file mode 100644 index 00000000..7b9c7f83 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-easing/prism-previewer-easing.css @@ -0,0 +1,29 @@ +.prism-previewer-easing { + margin-top: -76px; + margin-left: -30px; + width: 60px; + height: 60px; + background: #333; +} +.prism-previewer-easing.flipped { + margin-bottom: -116px; +} +.prism-previewer-easing svg { + width: 60px; + height: 60px; +} +.prism-previewer-easing circle { + fill: hsl(200, 10%, 20%); + stroke: white; +} +.prism-previewer-easing path { + fill: none; + stroke: white; + stroke-linecap: round; + stroke-width: 4; +} +.prism-previewer-easing line { + stroke: white; + stroke-opacity: 0.5; + stroke-width: 2; +} \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-easing/prism-previewer-easing.js b/MacDown/Resources/Prism/plugins/previewer-easing/prism-previewer-easing.js new file mode 100644 index 00000000..ad01dc33 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-easing/prism-previewer-easing.js @@ -0,0 +1,117 @@ +(function() { + + if ( + typeof self !== 'undefined' && !self.Prism || + typeof global !== 'undefined' && !global.Prism + ) { + return; + } + + var languages = { + 'css': true, + 'less': true, + 'sass': [ + { + lang: 'sass', + inside: 'inside', + before: 'punctuation', + root: Prism.languages.sass && Prism.languages.sass['variable-line'] + }, + { + lang: 'sass', + inside: 'inside', + root: Prism.languages.sass && Prism.languages.sass['property-line'] + } + ], + 'scss': true, + 'stylus': [ + { + lang: 'stylus', + before: 'hexcode', + inside: 'rest', + root: Prism.languages.stylus && Prism.languages.stylus['property-declaration'].inside + }, + { + lang: 'stylus', + before: 'hexcode', + inside: 'rest', + root: Prism.languages.stylus && Prism.languages.stylus['variable-declaration'].inside + } + ] + }; + + Prism.hooks.add('before-highlight', function (env) { + if (env.language && languages[env.language] && !languages[env.language].initialized) { + var lang = languages[env.language]; + if (Prism.util.type(lang) !== 'Array') { + lang = [lang]; + } + lang.forEach(function(lang) { + var before, inside, root, skip; + if (lang === true) { + before = 'important'; + inside = env.language; + lang = env.language; + } else { + before = lang.before || 'important'; + inside = lang.inside || lang.lang; + root = lang.root || Prism.languages; + skip = lang.skip; + lang = env.language; + } + + if (!skip && Prism.languages[lang]) { + Prism.languages.insertBefore(inside, before, { + 'easing': /\bcubic-bezier\((?:-?\d*\.?\d+,\s*){3}-?\d*\.?\d+\)\B|\b(?:linear|ease(?:-in)?(?:-out)?)(?=\s|[;}]|$)/i + }, root); + env.grammar = Prism.languages[lang]; + + languages[env.language] = {initialized: true}; + } + }); + } + }); + + if (Prism.plugins.Previewer) { + new Prism.plugins.Previewer('easing', function (value) { + + value = { + 'linear': '0,0,1,1', + 'ease': '.25,.1,.25,1', + 'ease-in': '.42,0,1,1', + 'ease-out': '0,0,.58,1', + 'ease-in-out':'.42,0,.58,1' + }[value] || value; + + var p = value.match(/-?\d*\.?\d+/g); + + if(p.length === 4) { + p = p.map(function(p, i) { return (i % 2? 1 - p : p) * 100; }); + + this.querySelector('path').setAttribute('d', 'M0,100 C' + p[0] + ',' + p[1] + ', ' + p[2] + ',' + p[3] + ', 100,0'); + + var lines = this.querySelectorAll('line'); + lines[0].setAttribute('x2', p[0]); + lines[0].setAttribute('y2', p[1]); + lines[1].setAttribute('x2', p[2]); + lines[1].setAttribute('y2', p[3]); + + return true; + } + + return false; + }, '*', function () { + this._elt.innerHTML = '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + ''; + }); + } + +}()); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-easing/prism-previewer-easing.min.js b/MacDown/Resources/Prism/plugins/previewer-easing/prism-previewer-easing.min.js new file mode 100644 index 00000000..c9d2e12d --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-easing/prism-previewer-easing.min.js @@ -0,0 +1 @@ +!function(){if(("undefined"==typeof self||self.Prism)&&("undefined"==typeof global||global.Prism)){var e={css:!0,less:!0,sass:[{lang:"sass",inside:"inside",before:"punctuation",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]},{lang:"sass",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]}],scss:!0,stylus:[{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]};Prism.hooks.add("before-highlight",function(r){if(r.language&&e[r.language]&&!e[r.language].initialized){var s=e[r.language];"Array"!==Prism.util.type(s)&&(s=[s]),s.forEach(function(s){var i,a,n,t;s===!0?(i="important",a=r.language,s=r.language):(i=s.before||"important",a=s.inside||s.lang,n=s.root||Prism.languages,t=s.skip,s=r.language),!t&&Prism.languages[s]&&(Prism.languages.insertBefore(a,i,{easing:/\bcubic-bezier\((?:-?\d*\.?\d+,\s*){3}-?\d*\.?\d+\)\B|\b(?:linear|ease(?:-in)?(?:-out)?)(?=\s|[;}]|$)/i},n),r.grammar=Prism.languages[s],e[r.language]={initialized:!0})})}}),Prism.plugins.Previewer&&new Prism.plugins.Previewer("easing",function(e){e={linear:"0,0,1,1",ease:".25,.1,.25,1","ease-in":".42,0,1,1","ease-out":"0,0,.58,1","ease-in-out":".42,0,.58,1"}[e]||e;var r=e.match(/-?\d*\.?\d+/g);if(4===r.length){r=r.map(function(e,r){return 100*(r%2?1-e:e)}),this.querySelector("path").setAttribute("d","M0,100 C"+r[0]+","+r[1]+", "+r[2]+","+r[3]+", 100,0");var s=this.querySelectorAll("line");return s[0].setAttribute("x2",r[0]),s[0].setAttribute("y2",r[1]),s[1].setAttribute("x2",r[2]),s[1].setAttribute("y2",r[3]),!0}return!1},"*",function(){this._elt.innerHTML=''})}}(); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-gradient/index.html b/MacDown/Resources/Prism/plugins/previewer-gradient/index.html new file mode 100644 index 00000000..420bf8a8 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-gradient/index.html @@ -0,0 +1,94 @@ + + + + + + + Previewer: Gradient ▲ Prism plugins + + + + + + + + + + + + +
    +
    + +

    Previewer: Gradient

    +

    Previewer for CSS gradients.

    +
    + +
    +

    How to use

    + +

    You don't need to do anything. With this plugin loaded, a previewer will appear on hovering the gradient values in code blocks.

    +

    Vendor-prefixed gradients are converted to W3C-valid ones, except the old Webkit syntax (-webkit-gradient(linear, ...) and -webkit-gradient(radial, ...)) is not supported.

    +

    This plugin is compatible with CSS, Less, Sass, Scss and Stylus.

    +
    + +
    +

    Examples

    + +

    CSS

    +
    div {
    +	background: -moz-linear-gradient(left,  #cb60b3 0%, #c146a1 50%, #a80077 51%, #db36a4 100%); /* FF3.6+ */
    +	background: -webkit-linear-gradient(left,  #cb60b3 0%,#c146a1 50%,#a80077 51%,#db36a4 100%); /* Chrome10+,Safari5.1+ */
    +	background: -o-linear-gradient(left,  #cb60b3 0%,#c146a1 50%,#a80077 51%,#db36a4 100%); /* Opera 11.10+ */
    +	background: -ms-linear-gradient(left,  #cb60b3 0%,#c146a1 50%,#a80077 51%,#db36a4 100%); /* IE10+ */
    +	background: linear-gradient(to right,  #cb60b3 0%,#c146a1 50%,#a80077 51%,#db36a4 100%); /* W3C */
    +}
    + +

    Less

    +
    @gradient: linear-gradient(135deg,  #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%);
    +#header a {
    +	background: -moz-linear-gradient(-45deg,  #9dd53a 0%, #a1d54f 50%, #80c217 51%, #7cbc0a 100%); /* FF3.6+ */
    +	background: -webkit-linear-gradient(-45deg,  #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* Chrome10+,Safari5.1+ */
    +	background: -o-linear-gradient(-45deg,  #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* Opera 11.10+ */
    +	background: -ms-linear-gradient(-45deg,  #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* IE10+ */
    +	background: linear-gradient(135deg,  #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%); /* W3C */
    +}
    + +

    Sass

    +
    $gradient: linear-gradient(135deg,  #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%)
    +@mixin foobar
    +	background: -moz-radial-gradient(center, ellipse cover,  #f2f6f8 0%, #d8e1e7 50%, #b5c6d0 51%, #e0eff9 100%)
    +	background: radial-gradient(ellipse at center,  #f2f6f8 0%,#d8e1e7 50%,#b5c6d0 51%,#e0eff9 100%)
    +
    + +

    Scss

    +
    $gradient: linear-gradient(135deg,  #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%);
    +$attr: background;
    +.foo {
    +    #{$attr}-image: repeating-linear-gradient(10deg, rgba(255,0,0,0), rgba(255,0,0,1) 10px, rgba(255,0,0,0) 20px);
    +}
    + +

    Stylus

    +
    gradient = linear-gradient(135deg,  #9dd53a 0%,#a1d54f 50%,#80c217 51%,#7cbc0a 100%)
    +.foo
    +	background-image: repeating-radial-gradient(circle, rgba(255,0,0,0), rgba(255,0,0,1) 10px, rgba(255,0,0,0) 20px)
    +
    + +
    + +
    + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-gradient/prism-previewer-gradient.css b/MacDown/Resources/Prism/plugins/previewer-gradient/prism-previewer-gradient.css new file mode 100644 index 00000000..6152a6ef --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-gradient/prism-previewer-gradient.css @@ -0,0 +1,27 @@ +.prism-previewer-gradient { + background-image: linear-gradient(45deg, #bbb 25%, transparent 25%, transparent 75%, #bbb 75%, #bbb), linear-gradient(45deg, #bbb 25%, #eee 25%, #eee 75%, #bbb 75%, #bbb); + background-size: 10px 10px; + background-position: 0 0, 5px 5px; + + width: 64px; + margin-left: -32px; +} +.prism-previewer-gradient:before { + content: none; +} +.prism-previewer-gradient div { + position: absolute; + top: -5px; + left: -5px; + right: -5px; + bottom: -5px; + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + border: 5px solid #fff; + -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.5) inset, 0 0 10px rgba(0, 0, 0, 0.75); + -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.5) inset, 0 0 10px rgba(0, 0, 0, 0.75); + -ms-box-shadow: 0 0 3px rgba(0, 0, 0, 0.5) inset, 0 0 10px rgba(0, 0, 0, 0.75); + -o-box-shadow: 0 0 3px rgba(0, 0, 0, 0.5) inset, 0 0 10px rgba(0, 0, 0, 0.75); + box-shadow: 0 0 3px rgba(0, 0, 0, 0.5) inset, 0 0 10px rgba(0, 0, 0, 0.75); +} \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-gradient/prism-previewer-gradient.js b/MacDown/Resources/Prism/plugins/previewer-gradient/prism-previewer-gradient.js new file mode 100644 index 00000000..11c2d061 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-gradient/prism-previewer-gradient.js @@ -0,0 +1,216 @@ +(function() { + + if ( + typeof self !== 'undefined' && !self.Prism || + typeof global !== 'undefined' && !global.Prism + ) { + return; + } + + var languages = { + 'css': true, + 'less': true, + 'sass': [ + { + lang: 'sass', + before: 'punctuation', + inside: 'inside', + root: Prism.languages.sass && Prism.languages.sass['variable-line'] + }, + { + lang: 'sass', + before: 'punctuation', + inside: 'inside', + root: Prism.languages.sass && Prism.languages.sass['property-line'] + } + ], + 'scss': true, + 'stylus': [ + { + lang: 'stylus', + before: 'func', + inside: 'rest', + root: Prism.languages.stylus && Prism.languages.stylus['property-declaration'].inside + }, + { + lang: 'stylus', + before: 'func', + inside: 'rest', + root: Prism.languages.stylus && Prism.languages.stylus['variable-declaration'].inside + } + ] + }; + + Prism.hooks.add('before-highlight', function (env) { + if (env.language && languages[env.language] && !languages[env.language].initialized) { + var lang = languages[env.language]; + if (Prism.util.type(lang) !== 'Array') { + lang = [lang]; + } + lang.forEach(function(lang) { + var before, inside, root, skip; + if (lang === true) { + // Insert before color previewer if it exists + before = Prism.plugins.Previewer && Prism.plugins.Previewer.byType['color'] ? 'color' : 'important'; + inside = env.language; + lang = env.language; + } else { + before = lang.before || 'important'; + inside = lang.inside || lang.lang; + root = lang.root || Prism.languages; + skip = lang.skip; + lang = env.language; + } + + if (!skip && Prism.languages[lang]) { + Prism.languages.insertBefore(inside, before, { + 'gradient': { + pattern: /(?:\b|\B-[a-z]{1,10}-)(?:repeating-)?(?:linear|radial)-gradient\((?:(?:rgb|hsl)a?\(.+?\)|[^\)])+\)/gi, + inside: { + 'function': /[\w-]+(?=\()/, + 'punctuation': /[(),]/ + } + } + }, root); + env.grammar = Prism.languages[lang]; + + languages[env.language] = {initialized: true}; + } + }); + } + }); + + // Stores already processed gradients so that we don't + // make the conversion every time the previewer is shown + var cache = {}; + + /** + * Returns a W3C-valid linear gradient + * @param {string} prefix Vendor prefix if any ("-moz-", "-webkit-", etc.) + * @param {string} func Gradient function name ("linear-gradient") + * @param {string[]} values Array of the gradient function parameters (["0deg", "red 0%", "blue 100%"]) + */ + var convertToW3CLinearGradient = function(prefix, func, values) { + // Default value for angle + var angle = '180deg'; + + if (/^(?:-?\d*\.?\d+(?:deg|rad)|to\b|top|right|bottom|left)/.test(values[0])) { + angle = values.shift(); + if (angle.indexOf('to ') < 0) { + // Angle uses old keywords + // W3C syntax uses "to" + opposite keywords + if (angle.indexOf('top') >= 0) { + if (angle.indexOf('left') >= 0) { + angle = 'to bottom right'; + } else if (angle.indexOf('right') >= 0) { + angle = 'to bottom left'; + } else { + angle = 'to bottom'; + } + } else if (angle.indexOf('bottom') >= 0) { + if (angle.indexOf('left') >= 0) { + angle = 'to top right'; + } else if (angle.indexOf('right') >= 0) { + angle = 'to top left'; + } else { + angle = 'to top'; + } + } else if (angle.indexOf('left') >= 0) { + angle = 'to right'; + } else if (angle.indexOf('right') >= 0) { + angle = 'to left'; + } else if (prefix) { + // Angle is shifted by 90deg in prefixed gradients + if (angle.indexOf('deg') >= 0) { + angle = (90 - parseFloat(angle)) + 'deg'; + } else if (angle.indexOf('rad') >= 0) { + angle = (Math.PI / 2 - parseFloat(angle)) + 'rad'; + } + } + } + } + + return func + '(' + angle + ',' + values.join(',') + ')'; + }; + + /** + * Returns a W3C-valid radial gradient + * @param {string} prefix Vendor prefix if any ("-moz-", "-webkit-", etc.) + * @param {string} func Gradient function name ("linear-gradient") + * @param {string[]} values Array of the gradient function parameters (["0deg", "red 0%", "blue 100%"]) + */ + var convertToW3CRadialGradient = function(prefix, func, values) { + if (values[0].indexOf('at') < 0) { + // Looks like old syntax + + // Default values + var position = 'center'; + var shape = 'ellipse'; + var size = 'farthest-corner'; + + if (/\bcenter|top|right|bottom|left\b|^\d+/.test(values[0])) { + // Found a position + // Remove angle value, if any + position = values.shift().replace(/\s*-?\d+(?:rad|deg)\s*/, ''); + } + if (/\bcircle|ellipse|closest|farthest|contain|cover\b/.test(values[0])) { + // Found a shape and/or size + var shapeSizeParts = values.shift().split(/\s+/); + if (shapeSizeParts[0] && (shapeSizeParts[0] === 'circle' || shapeSizeParts[0] === 'ellipse')) { + shape = shapeSizeParts.shift(); + } + if (shapeSizeParts[0]) { + size = shapeSizeParts.shift(); + } + + // Old keywords are converted to their synonyms + if (size === 'cover') { + size = 'farthest-corner'; + } else if (size === 'contain') { + size = 'clothest-side'; + } + } + + return func + '(' + shape + ' ' + size + ' at ' + position + ',' + values.join(',') + ')'; + } + return func + '(' + values.join(',') + ')'; + }; + + /** + * Converts a gradient to a W3C-valid one + * Does not support old webkit syntax (-webkit-gradient(linear...) and -webkit-gradient(radial...)) + * @param {string} gradient The CSS gradient + */ + var convertToW3CGradient = function(gradient) { + if (cache[gradient]) { + return cache[gradient]; + } + var parts = gradient.match(/^(\b|\B-[a-z]{1,10}-)((?:repeating-)?(?:linear|radial)-gradient)/); + // "", "-moz-", etc. + var prefix = parts && parts[1]; + // "linear-gradient", "radial-gradient", etc. + var func = parts && parts[2]; + + var values = gradient.replace(/^(?:\b|\B-[a-z]{1,10}-)(?:repeating-)?(?:linear|radial)-gradient\(|\)$/g, '').split(/\s*,\s*/); + + if (func.indexOf('linear') >= 0) { + return cache[gradient] = convertToW3CLinearGradient(prefix, func, values); + } else if (func.indexOf('radial') >= 0) { + return cache[gradient] = convertToW3CRadialGradient(prefix, func, values); + } + return cache[gradient] = func + '(' + values.join(',') + ')'; + }; + + + + if (Prism.plugins.Previewer) { + new Prism.plugins.Previewer('gradient', function(value) { + this.firstChild.style.backgroundImage = ''; + this.firstChild.style.backgroundImage = convertToW3CGradient(value); + return !!this.firstChild.style.backgroundImage; + }, '*', function () { + this._elt.innerHTML = '
    '; + }); + } + +}()); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-gradient/prism-previewer-gradient.min.js b/MacDown/Resources/Prism/plugins/previewer-gradient/prism-previewer-gradient.min.js new file mode 100644 index 00000000..28d222d0 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-gradient/prism-previewer-gradient.min.js @@ -0,0 +1 @@ +!function(){if(("undefined"==typeof self||self.Prism)&&("undefined"==typeof global||global.Prism)){var e={css:!0,less:!0,sass:[{lang:"sass",before:"punctuation",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]},{lang:"sass",before:"punctuation",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]}],scss:!0,stylus:[{lang:"stylus",before:"func",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"func",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]};Prism.hooks.add("before-highlight",function(i){if(i.language&&e[i.language]&&!e[i.language].initialized){var t=e[i.language];"Array"!==Prism.util.type(t)&&(t=[t]),t.forEach(function(t){var r,s,a,n;t===!0?(r=Prism.plugins.Previewer&&Prism.plugins.Previewer.byType.color?"color":"important",s=i.language,t=i.language):(r=t.before||"important",s=t.inside||t.lang,a=t.root||Prism.languages,n=t.skip,t=i.language),!n&&Prism.languages[t]&&(Prism.languages.insertBefore(s,r,{gradient:{pattern:/(?:\b|\B-[a-z]{1,10}-)(?:repeating-)?(?:linear|radial)-gradient\((?:(?:rgb|hsl)a?\(.+?\)|[^\)])+\)/gi,inside:{"function":/[\w-]+(?=\()/,punctuation:/[(),]/}}},a),i.grammar=Prism.languages[t],e[i.language]={initialized:!0})})}});var i={},t=function(e,i,t){var r="180deg";return/^(?:-?\d*\.?\d+(?:deg|rad)|to\b|top|right|bottom|left)/.test(t[0])&&(r=t.shift(),r.indexOf("to ")<0&&(r.indexOf("top")>=0?r=r.indexOf("left")>=0?"to bottom right":r.indexOf("right")>=0?"to bottom left":"to bottom":r.indexOf("bottom")>=0?r=r.indexOf("left")>=0?"to top right":r.indexOf("right")>=0?"to top left":"to top":r.indexOf("left")>=0?r="to right":r.indexOf("right")>=0?r="to left":e&&(r.indexOf("deg")>=0?r=90-parseFloat(r)+"deg":r.indexOf("rad")>=0&&(r=Math.PI/2-parseFloat(r)+"rad")))),i+"("+r+","+t.join(",")+")"},r=function(e,i,t){if(t[0].indexOf("at")<0){var r="center",s="ellipse",a="farthest-corner";if(/\bcenter|top|right|bottom|left\b|^\d+/.test(t[0])&&(r=t.shift().replace(/\s*-?\d+(?:rad|deg)\s*/,"")),/\bcircle|ellipse|closest|farthest|contain|cover\b/.test(t[0])){var n=t.shift().split(/\s+/);!n[0]||"circle"!==n[0]&&"ellipse"!==n[0]||(s=n.shift()),n[0]&&(a=n.shift()),"cover"===a?a="farthest-corner":"contain"===a&&(a="clothest-side")}return i+"("+s+" "+a+" at "+r+","+t.join(",")+")"}return i+"("+t.join(",")+")"},s=function(e){if(i[e])return i[e];var s=e.match(/^(\b|\B-[a-z]{1,10}-)((?:repeating-)?(?:linear|radial)-gradient)/),a=s&&s[1],n=s&&s[2],l=e.replace(/^(?:\b|\B-[a-z]{1,10}-)(?:repeating-)?(?:linear|radial)-gradient\(|\)$/g,"").split(/\s*,\s*/);return i[e]=n.indexOf("linear")>=0?t(a,n,l):n.indexOf("radial")>=0?r(a,n,l):n+"("+l.join(",")+")"};Prism.plugins.Previewer&&new Prism.plugins.Previewer("gradient",function(e){return this.firstChild.style.backgroundImage="",this.firstChild.style.backgroundImage=s(e),!!this.firstChild.style.backgroundImage},"*",function(){this._elt.innerHTML="
    "})}}(); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-time/index.html b/MacDown/Resources/Prism/plugins/previewer-time/index.html new file mode 100644 index 00000000..eb0ac213 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-time/index.html @@ -0,0 +1,85 @@ + + + + + + + Previewer: Time ▲ Prism plugins + + + + + + + + + + + + +
    +
    + +

    Previewer: Time

    +

    Previewer for CSS times.

    +
    + +
    +

    How to use

    + +

    You don't need to do anything. With this plugin loaded, a previewer will appear on hovering the time values in code blocks.

    +

    This plugin is compatible with CSS, Less, Sass, Scss and Stylus.

    +
    + +
    +

    Examples

    + +

    CSS

    +
    div {
    +	transition: all linear 3s;
    +}
    + +

    Less

    +
    @time: 1s;
    +#header a {
    +	transition: all linear 2s;
    +}
    + +

    Sass

    +
    $time: 3s
    +@mixin foobar
    +	transition: all linear 800ms
    +.foo
    +	transition: all linear 0.8s
    +
    + +

    Scss

    +
    $time: 1s;
    +.foo {
    +	transition: all linear 10s
    +}
    + +

    Stylus

    +
    time = 3s
    +.foo
    +	transition: all linear 0.5s
    +
    + +
    + +
    + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-time/prism-previewer-time.css b/MacDown/Resources/Prism/plugins/previewer-time/prism-previewer-time.css new file mode 100644 index 00000000..d0363a2a --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-time/prism-previewer-time.css @@ -0,0 +1,90 @@ +@-webkit-keyframes prism-previewer-time { + 0% { + stroke-dasharray: 0, 500; + stroke-dashoffset: 0; + } + 50% { + stroke-dasharray: 100, 500; + stroke-dashoffset: 0; + } + 100% { + stroke-dasharray: 0, 500; + stroke-dashoffset: -100; + } +} + +@-o-keyframes prism-previewer-time { + 0% { + stroke-dasharray: 0, 500; + stroke-dashoffset: 0; + } + 50% { + stroke-dasharray: 100, 500; + stroke-dashoffset: 0; + } + 100% { + stroke-dasharray: 0, 500; + stroke-dashoffset: -100; + } +} + +@-moz-keyframes prism-previewer-time { + 0% { + stroke-dasharray: 0, 500; + stroke-dashoffset: 0; + } + 50% { + stroke-dasharray: 100, 500; + stroke-dashoffset: 0; + } + 100% { + stroke-dasharray: 0, 500; + stroke-dashoffset: -100; + } +} + +@keyframes prism-previewer-time { + 0% { + stroke-dasharray: 0, 500; + stroke-dashoffset: 0; + } + 50% { + stroke-dasharray: 100, 500; + stroke-dashoffset: 0; + } + 100% { + stroke-dasharray: 0, 500; + stroke-dashoffset: -100; + } +} + +.prism-previewer-time:before { + -webkit-border-radius: 50%; + -moz-border-radius: 50%; + border-radius: 50%; + background: #fff; +} +.prism-previewer-time:after { + margin-top: 4px; +} +.prism-previewer-time svg { + width: 32px; + height: 32px; + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + transform: rotate(-90deg); +} +.prism-previewer-time circle { + fill: transparent; + stroke: hsl(200, 10%, 20%); + stroke-opacity: 0.9; + stroke-width: 32; + stroke-dasharray: 0, 500; + stroke-dashoffset: 0; + -webkit-animation: prism-previewer-time linear infinite 3s; + -moz-animation: prism-previewer-time linear infinite 3s; + -o-animation: prism-previewer-time linear infinite 3s; + animation: prism-previewer-time linear infinite 3s; +} \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-time/prism-previewer-time.js b/MacDown/Resources/Prism/plugins/previewer-time/prism-previewer-time.js new file mode 100644 index 00000000..c72f8bb2 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-time/prism-previewer-time.js @@ -0,0 +1,98 @@ +(function() { + + if ( + typeof self !== 'undefined' && !self.Prism || + typeof global !== 'undefined' && !global.Prism + ) { + return; + } + + var languages = { + 'css': true, + 'less': true, + 'markup': { + lang: 'markup', + before: 'punctuation', + inside: 'inside', + root: Prism.languages.markup && Prism.languages.markup['tag'].inside['attr-value'] + }, + 'sass': [ + { + lang: 'sass', + inside: 'inside', + root: Prism.languages.sass && Prism.languages.sass['property-line'] + }, + { + lang: 'sass', + before: 'operator', + inside: 'inside', + root: Prism.languages.sass && Prism.languages.sass['variable-line'] + } + ], + 'scss': true, + 'stylus': [ + { + lang: 'stylus', + before: 'hexcode', + inside: 'rest', + root: Prism.languages.stylus && Prism.languages.stylus['property-declaration'].inside + }, + { + lang: 'stylus', + before: 'hexcode', + inside: 'rest', + root: Prism.languages.stylus && Prism.languages.stylus['variable-declaration'].inside + } + ] + }; + + Prism.hooks.add('before-highlight', function (env) { + if (env.language && languages[env.language] && !languages[env.language].initialized) { + var lang = languages[env.language]; + if (Prism.util.type(lang) !== 'Array') { + lang = [lang]; + } + lang.forEach(function(lang) { + var before, inside, root, skip; + if (lang === true) { + before = 'important'; + inside = env.language; + lang = env.language; + } else { + before = lang.before || 'important'; + inside = lang.inside || lang.lang; + root = lang.root || Prism.languages; + skip = lang.skip; + lang = env.language; + } + + if (!skip && Prism.languages[lang]) { + Prism.languages.insertBefore(inside, before, { + 'time': /(?:\b|\B-|(?=\B\.))\d*\.?\d+m?s\b/i + }, root); + env.grammar = Prism.languages[lang]; + + languages[env.language] = {initialized: true}; + } + }); + } + }); + + if (Prism.plugins.Previewer) { + new Prism.plugins.Previewer('time', function(value) { + var num = parseFloat(value); + var unit = value.match(/[a-z]+$/i); + if (!num || !unit) { + return false; + } + unit = unit[0]; + this.querySelector('circle').style.animationDuration = 2 * num + unit; + return true; + }, '*', function () { + this._elt.innerHTML = '' + + '' + + ''; + }); + } + +}()); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/previewer-time/prism-previewer-time.min.js b/MacDown/Resources/Prism/plugins/previewer-time/prism-previewer-time.min.js new file mode 100644 index 00000000..0256b4a8 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/previewer-time/prism-previewer-time.min.js @@ -0,0 +1 @@ +!function(){if(("undefined"==typeof self||self.Prism)&&("undefined"==typeof global||global.Prism)){var s={css:!0,less:!0,markup:{lang:"markup",before:"punctuation",inside:"inside",root:Prism.languages.markup&&Prism.languages.markup.tag.inside["attr-value"]},sass:[{lang:"sass",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]},{lang:"sass",before:"operator",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]}],scss:!0,stylus:[{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]};Prism.hooks.add("before-highlight",function(e){if(e.language&&s[e.language]&&!s[e.language].initialized){var a=s[e.language];"Array"!==Prism.util.type(a)&&(a=[a]),a.forEach(function(a){var i,r,n,l;a===!0?(i="important",r=e.language,a=e.language):(i=a.before||"important",r=a.inside||a.lang,n=a.root||Prism.languages,l=a.skip,a=e.language),!l&&Prism.languages[a]&&(Prism.languages.insertBefore(r,i,{time:/(?:\b|\B-|(?=\B\.))\d*\.?\d+m?s\b/i},n),e.grammar=Prism.languages[a],s[e.language]={initialized:!0})})}}),Prism.plugins.Previewer&&new Prism.plugins.Previewer("time",function(s){var e=parseFloat(s),a=s.match(/[a-z]+$/i);return e&&a?(a=a[0],this.querySelector("circle").style.animationDuration=2*e+a,!0):!1},"*",function(){this._elt.innerHTML=''})}}(); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/remove-initial-line-feed/index.html b/MacDown/Resources/Prism/plugins/remove-initial-line-feed/index.html new file mode 100644 index 00000000..3c05bbc3 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/remove-initial-line-feed/index.html @@ -0,0 +1,59 @@ + + + + + + + Remove initial line feed ▲ Prism plugins + + + + + + + + + + +
    +
    + +

    Remove initial line feed

    +

    Removes the initial line feed in code blocks.

    +
    + +
    +

    How to use (DEPRECATED)

    + +

    This plugin will be removed in the future. Please use the general purpose Normalize Whitespace plugin instead.

    +

    Obviously, this is supposed to work only for code blocks (<pre><code>) and not for inline code.

    +

    With this plugin included, any initial line feed will be removed by default.

    +

    To bypass this behaviour, you may add the class keep-initial-line-feed to your desired <pre>.

    +
    + +
    +

    Examples

    + +

    Without adding the class

    +
    
    +<div></div>
    +
    + +

    With the class added

    +
    
    +<div></div>
    +
    + +
    + +
    + + + + + + + + + + \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js b/MacDown/Resources/Prism/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js new file mode 100644 index 00000000..4d9a6693 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.js @@ -0,0 +1,21 @@ +(function() { + +if (typeof self === 'undefined' || !self.Prism || !self.document) { + return; +} + +Prism.hooks.add('before-highlight', function (env) { + if (env.code) { + var pre = env.element.parentNode; + var clsReg = /\s*\bkeep-initial-line-feed\b\s*/; + if ( + pre && pre.nodeName.toLowerCase() === 'pre' && + // Apply only if nor the
     or the  have the class
    +			(!clsReg.test(pre.className) && !clsReg.test(env.element.className))
    +		) {
    +			env.code = env.code.replace(/^(?:\r?\n|\r)/, '');
    +		}
    +	}
    +});
    +
    +}());
    \ No newline at end of file
    diff --git a/MacDown/Resources/Prism/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.min.js b/MacDown/Resources/Prism/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.min.js
    new file mode 100644
    index 00000000..2cca50e7
    --- /dev/null
    +++ b/MacDown/Resources/Prism/plugins/remove-initial-line-feed/prism-remove-initial-line-feed.min.js
    @@ -0,0 +1 @@
    +!function(){"undefined"!=typeof self&&self.Prism&&self.document&&Prism.hooks.add("before-highlight",function(e){if(e.code){var s=e.element.parentNode,n=/\s*\bkeep-initial-line-feed\b\s*/;!s||"pre"!==s.nodeName.toLowerCase()||n.test(s.className)||n.test(e.element.className)||(e.code=e.code.replace(/^(?:\r?\n|\r)/,""))}})}();
    \ No newline at end of file
    diff --git a/MacDown/Resources/Prism/plugins/show-invisibles/index.html b/MacDown/Resources/Prism/plugins/show-invisibles/index.html
    new file mode 100644
    index 00000000..98c8719f
    --- /dev/null
    +++ b/MacDown/Resources/Prism/plugins/show-invisibles/index.html
    @@ -0,0 +1,46 @@
    +
    +
    +
    +
    +
    +
    +Show Invisibles ▲ Prism plugins
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +

    Show Invisibles

    +

    Show hidden characters such as tabs and line breaks.

    +
    + +
    +

    Examples

    + +
    
    +	
    +	
    
    +	
    +	
    
    +
    + +
    + + + + + + + + + + diff --git a/MacDown/Resources/Prism/plugins/show-invisibles/prism-show-invisibles.css b/MacDown/Resources/Prism/plugins/show-invisibles/prism-show-invisibles.css new file mode 100644 index 00000000..9af783d5 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/show-invisibles/prism-show-invisibles.css @@ -0,0 +1,33 @@ +.token.tab:not(:empty), +.token.cr, +.token.lf, +.token.space { + position: relative; +} + +.token.tab:not(:empty):before, +.token.cr:before, +.token.lf:before, +.token.space:before { + color: hsl(24, 20%, 85%); + position: absolute; +} + +.token.tab:not(:empty):before { + content: '\21E5'; +} + +.token.cr:before { + content: '\240D'; +} + +.token.crlf:before { + content: '\240D\240A'; +} +.token.lf:before { + content: '\240A'; +} + +.token.space:before { + content: '\00B7'; +} \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/show-invisibles/prism-show-invisibles.js b/MacDown/Resources/Prism/plugins/show-invisibles/prism-show-invisibles.js new file mode 100644 index 00000000..72833fa9 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/show-invisibles/prism-show-invisibles.js @@ -0,0 +1,19 @@ +(function(){ + +if ( + typeof self !== 'undefined' && !self.Prism || + typeof global !== 'undefined' && !global.Prism +) { + return; +} + +Prism.hooks.add('before-highlight', function(env) { + var tokens = env.grammar; + + tokens.tab = /\t/g; + tokens.crlf = /\r\n/g; + tokens.lf = /\n/g; + tokens.cr = /\r/g; + tokens.space = / /g; +}); +})(); diff --git a/MacDown/Resources/Prism/plugins/show-invisibles/prism-show-invisibles.min.js b/MacDown/Resources/Prism/plugins/show-invisibles/prism-show-invisibles.min.js new file mode 100644 index 00000000..a8562ec9 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/show-invisibles/prism-show-invisibles.min.js @@ -0,0 +1 @@ +!function(){"undefined"!=typeof self&&!self.Prism||"undefined"!=typeof global&&!global.Prism||Prism.hooks.add("before-highlight",function(e){var f=e.grammar;f.tab=/\t/g,f.crlf=/\r\n/g,f.lf=/\n/g,f.cr=/\r/g,f.space=/ /g})}(); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/show-language/index.html b/MacDown/Resources/Prism/plugins/show-language/index.html new file mode 100644 index 00000000..bbec50a8 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/show-language/index.html @@ -0,0 +1,53 @@ + + + + + + +Show Language ▲ Prism plugins + + + + + + + + + + + +
    +
    + +

    Show Language

    +

    Display the highlighted language in code blocks (inline code does not show the label).

    +
    + +
    +

    Examples

    + +

    JavaScript

    +
    
    +
    +	

    CSS

    +
    
    +
    +	

    HTML (Markup)

    +
    
    +
    +	

    SVG

    +

    The data-language attribute can be used to display a specific label whether it has been defined as a language or not.

    +
    
    +
    + +
    + + + + + + + + + + \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/show-language/prism-show-language.css b/MacDown/Resources/Prism/plugins/show-language/prism-show-language.css new file mode 100644 index 00000000..646daaf9 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/show-language/prism-show-language.css @@ -0,0 +1,29 @@ +div.prism-show-language { + position: relative; +} + +div.prism-show-language > div.prism-show-language-label { + color: black; + background-color: #CFCFCF; + display: inline-block; + position: absolute; + bottom: auto; + left: auto; + top: 0; + right: 0; + width: auto; + height: auto; + font-size: 0.9em; + border-radius: 0 0 0 5px; + padding: 0 0.5em; + text-shadow: none; + z-index: 1; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + -webkit-transform: none; + -moz-transform: none; + -ms-transform: none; + -o-transform: none; + transform: none; +} diff --git a/MacDown/Resources/Prism/plugins/show-language/prism-show-language.js b/MacDown/Resources/Prism/plugins/show-language/prism-show-language.js new file mode 100644 index 00000000..e878b08f --- /dev/null +++ b/MacDown/Resources/Prism/plugins/show-language/prism-show-language.js @@ -0,0 +1,38 @@ +(function(){ + +if (typeof self === 'undefined' || !self.Prism || !self.document) { + return; +} + +// The languages map is built automatically with gulp +var Languages = /*languages_placeholder[*/{"html":"HTML","xml":"XML","svg":"SVG","mathml":"MathML","css":"CSS","clike":"C-like","javascript":"JavaScript","abap":"ABAP","actionscript":"ActionScript","apacheconf":"Apache Configuration","apl":"APL","applescript":"AppleScript","asciidoc":"AsciiDoc","aspnet":"ASP.NET (C#)","autoit":"AutoIt","autohotkey":"AutoHotkey","basic":"BASIC","csharp":"C#","cpp":"C++","coffeescript":"CoffeeScript","css-extras":"CSS Extras","fsharp":"F#","glsl":"GLSL","http":"HTTP","inform7":"Inform 7","json":"JSON","latex":"LaTeX","lolcode":"LOLCODE","matlab":"MATLAB","mel":"MEL","nasm":"NASM","nginx":"nginx","nsis":"NSIS","objectivec":"Objective-C","ocaml":"OCaml","parigp":"PARI/GP","php":"PHP","php-extras":"PHP Extras","powershell":"PowerShell","jsx":"React JSX","rest":"reST (reStructuredText)","sas":"SAS","sass":"Sass (Sass)","scss":"Sass (Scss)","sql":"SQL","typescript":"TypeScript","vhdl":"VHDL","vim":"vim","wiki":"Wiki markup","yaml":"YAML"}/*]*/; +Prism.hooks.add('before-highlight', function(env) { + var pre = env.element.parentNode; + if (!pre || !/pre/i.test(pre.nodeName)) { + return; + } + var language = pre.getAttribute('data-language') || Languages[env.language] || (env.language.substring(0, 1).toUpperCase() + env.language.substring(1)); + + /* check if the divs already exist */ + var sib = pre.previousSibling; + var div, div2; + if (sib && /\s*\bprism-show-language\b\s*/.test(sib.className) && + sib.firstChild && + /\s*\bprism-show-language-label\b\s*/.test(sib.firstChild.className)) { + div2 = sib.firstChild; + } else { + div = document.createElement('div'); + div2 = document.createElement('div'); + + div2.className = 'prism-show-language-label'; + + div.className = 'prism-show-language'; + div.appendChild(div2); + + pre.parentNode.insertBefore(div, pre); + } + + div2.innerHTML = language; +}); + +})(); diff --git a/MacDown/Resources/Prism/plugins/show-language/prism-show-language.min.js b/MacDown/Resources/Prism/plugins/show-language/prism-show-language.min.js new file mode 100644 index 00000000..e4f5d15b --- /dev/null +++ b/MacDown/Resources/Prism/plugins/show-language/prism-show-language.min.js @@ -0,0 +1 @@ +!function(){if("undefined"!=typeof self&&self.Prism&&self.document){var e={html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",css:"CSS",clike:"C-like",javascript:"JavaScript",abap:"ABAP",actionscript:"ActionScript",apacheconf:"Apache Configuration",apl:"APL",applescript:"AppleScript",asciidoc:"AsciiDoc",aspnet:"ASP.NET (C#)",autoit:"AutoIt",autohotkey:"AutoHotkey",basic:"BASIC",csharp:"C#",cpp:"C++",coffeescript:"CoffeeScript","css-extras":"CSS Extras",fsharp:"F#",glsl:"GLSL",http:"HTTP",inform7:"Inform 7",json:"JSON",latex:"LaTeX",lolcode:"LOLCODE",matlab:"MATLAB",mel:"MEL",nasm:"NASM",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",ocaml:"OCaml",parigp:"PARI/GP",php:"PHP","php-extras":"PHP Extras",powershell:"PowerShell",jsx:"React JSX",rest:"reST (reStructuredText)",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (Scss)",sql:"SQL",typescript:"TypeScript",vhdl:"VHDL",vim:"vim",wiki:"Wiki markup",yaml:"YAML"};Prism.hooks.add("before-highlight",function(s){var a=s.element.parentNode;if(a&&/pre/i.test(a.nodeName)){var t,i,r=a.getAttribute("data-language")||e[s.language]||s.language.substring(0,1).toUpperCase()+s.language.substring(1),l=a.previousSibling;l&&/\s*\bprism-show-language\b\s*/.test(l.className)&&l.firstChild&&/\s*\bprism-show-language-label\b\s*/.test(l.firstChild.className)?i=l.firstChild:(t=document.createElement("div"),i=document.createElement("div"),i.className="prism-show-language-label",t.className="prism-show-language",t.appendChild(i),a.parentNode.insertBefore(t,a)),i.innerHTML=r}})}}(); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/unescaped-markup/index.html b/MacDown/Resources/Prism/plugins/unescaped-markup/index.html new file mode 100644 index 00000000..f29799cb --- /dev/null +++ b/MacDown/Resources/Prism/plugins/unescaped-markup/index.html @@ -0,0 +1,121 @@ + + + + + + + Unescaped markup ▲ Prism plugins + + + + + + + + + + + + +
    +
    + +

    Unescaped markup

    +

    Write markup without having to escape anything.

    +
    + +
    +

    How to use

    +

    Instead of using <pre><code> elements, use <script type="text/plain">:

    +
    + +
    +

    Examples

    + +

    View source to see that the following didn’t need escaping (except for </script>, that does):

    + + +
    + +
    +

    FAQ

    + +

    Why not use the HTML <template> tag?

    + +

    Because it is a PITA to get its textContent and needs to be pointlessly cloned. + Feel free to implement it yourself and send a pull request though, if you are so inclined.

    + +

    Can I use this inline?

    + +

    Not out of the box, because I figured it’s more of a hassle to type <script type="text/plain"> than escape the 1-2 < characters you need to escape in inline code. + Also inline code is not as frequently copy-pasted, which was the major source of annoyance that got me to write this plugin.

    +
    + +
    + + + + + + + + + diff --git a/MacDown/Resources/Prism/plugins/unescaped-markup/prism-unescaped-markup.css b/MacDown/Resources/Prism/plugins/unescaped-markup/prism-unescaped-markup.css new file mode 100644 index 00000000..5cd92bf0 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/unescaped-markup/prism-unescaped-markup.css @@ -0,0 +1,10 @@ +/* Fallback, in case JS does not run, to ensure the code is at least visible */ +.lang-markup script[type='text/plain'], +.language-markup script[type='text/plain'], +script[type='text/plain'].lang-markup, +script[type='text/plain'].language-markup { + display: block; + font: 100% Consolas, Monaco, monoscpace; + white-space: pre; + overflow: auto; +} diff --git a/MacDown/Resources/Prism/plugins/unescaped-markup/prism-unescaped-markup.js b/MacDown/Resources/Prism/plugins/unescaped-markup/prism-unescaped-markup.js new file mode 100644 index 00000000..a8cf4e2d --- /dev/null +++ b/MacDown/Resources/Prism/plugins/unescaped-markup/prism-unescaped-markup.js @@ -0,0 +1,34 @@ +(function () { + + if (typeof self === 'undefined' || !self.Prism || !self.document || !Prism.languages.markup) { + return; + } + + Prism.plugins.UnescapedMarkup = true; + + Prism.hooks.add('before-highlightall', function (env) { + env.selector += ", .lang-markup script[type='text/plain'], .language-markup script[type='text/plain']" + + ", script[type='text/plain'].lang-markup, script[type='text/plain'].language-markup"; + }); + + Prism.hooks.add('before-highlight', function (env) { + if (env.language != "markup") { + return; + } + + if (env.element.matches("script[type='text/plain']")) { + var code = document.createElement("code"); + var pre = document.createElement("pre"); + + pre.className = code.className = env.element.className; + + env.code = env.code.replace(/<\/script(>|>)/gi, ""); + code.textContent = env.code; + + pre.appendChild(code); + env.element.parentNode.replaceChild(pre, env.element); + env.element = code; + return; + } + }); +}()); diff --git a/MacDown/Resources/Prism/plugins/unescaped-markup/prism-unescaped-markup.min.js b/MacDown/Resources/Prism/plugins/unescaped-markup/prism-unescaped-markup.min.js new file mode 100644 index 00000000..e95fab31 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/unescaped-markup/prism-unescaped-markup.min.js @@ -0,0 +1 @@ +!function(){"undefined"!=typeof self&&self.Prism&&self.document&&Prism.languages.markup&&(Prism.plugins.UnescapedMarkup=!0,Prism.hooks.add("before-highlightall",function(e){e.selector+=", .lang-markup script[type='text/plain'], .language-markup script[type='text/plain'], script[type='text/plain'].lang-markup, script[type='text/plain'].language-markup"}),Prism.hooks.add("before-highlight",function(e){if("markup"==e.language&&e.element.matches("script[type='text/plain']")){var t=document.createElement("code"),a=document.createElement("pre");return a.className=t.className=e.element.className,e.code=e.code.replace(/<\/script(>|>)/gi,""),t.textContent=e.code,a.appendChild(t),e.element.parentNode.replaceChild(a,e.element),e.element=t,void 0}}))}(); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/wpd/index.html b/MacDown/Resources/Prism/plugins/wpd/index.html new file mode 100644 index 00000000..74663045 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/wpd/index.html @@ -0,0 +1,68 @@ + + + + + + +WebPlatform Docs ▲ Prism plugins + + + + + + + + + + + +
    +
    + +

    WebPlatform Docs

    +

    Makes tokens link to WebPlatform.org documentation. The links open in a new tab.

    +
    + +
    +

    How to use

    + +

    No setup required, just include the plugin in your download and you’re good to go!

    + +

    Tokens that currently link to documentation:

    + +
      +
    • HTML, MathML and SVG tags
    • +
    • HTML, MathML and SVG non-namespaced attributes
    • +
    • (Non-prefixed) CSS properties
    • +
    • (Non-prefixed) CSS @rules
    • +
    • (Non-prefixed) CSS pseudo-classes
    • +
    • (Non-prefixed) CSS pseudo-elements (starting with ::)
    • +
    + +

    Beta: This plugin is still in beta. Please help make it better: Test it and report any false positives etc!

    +
    + +
    +

    Examples

    + +

    CSS

    +
    
    +	
    
    +	
    +	

    HTML

    +
    
    +	
    +	

    SVG

    +
    
    +
    + +
    + + + + + + + + + \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/wpd/prism-wpd.css b/MacDown/Resources/Prism/plugins/wpd/prism-wpd.css new file mode 100644 index 00000000..43b7165a --- /dev/null +++ b/MacDown/Resources/Prism/plugins/wpd/prism-wpd.css @@ -0,0 +1,11 @@ +code[class*="language-"] a[href], +pre[class*="language-"] a[href] { + cursor: help; + text-decoration: none; +} + +code[class*="language-"] a[href]:hover, +pre[class*="language-"] a[href]:hover { + cursor: help; + text-decoration: underline; +} \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/wpd/prism-wpd.js b/MacDown/Resources/Prism/plugins/wpd/prism-wpd.js new file mode 100644 index 00000000..7900dd4c --- /dev/null +++ b/MacDown/Resources/Prism/plugins/wpd/prism-wpd.js @@ -0,0 +1,166 @@ +(function(){ + +if ( + typeof self !== 'undefined' && !self.Prism || + typeof global !== 'undefined' && !global.Prism +) { + return; +} + +if (Prism.languages.css) { + Prism.languages.css.atrule.inside['atrule-id'] = /^@[\w-]+/; + + // check whether the selector is an advanced pattern before extending it + if (Prism.languages.css.selector.pattern) + { + Prism.languages.css.selector.inside['pseudo-class'] = /:[\w-]+/; + Prism.languages.css.selector.inside['pseudo-element'] = /::[\w-]+/; + } + else + { + Prism.languages.css.selector = { + pattern: Prism.languages.css.selector, + inside: { + 'pseudo-class': /:[\w-]+/, + 'pseudo-element': /::[\w-]+/ + } + }; + } +} + +if (Prism.languages.markup) { + Prism.languages.markup.tag.inside.tag.inside['tag-id'] = /[\w-]+/; + + var Tags = { + HTML: { + 'a': 1, 'abbr': 1, 'acronym': 1, 'b': 1, 'basefont': 1, 'bdo': 1, 'big': 1, 'blink': 1, 'cite': 1, 'code': 1, 'dfn': 1, 'em': 1, 'kbd': 1, 'i': 1, + 'rp': 1, 'rt': 1, 'ruby': 1, 's': 1, 'samp': 1, 'small': 1, 'spacer': 1, 'strike': 1, 'strong': 1, 'sub': 1, 'sup': 1, 'time': 1, 'tt': 1, 'u': 1, + 'var': 1, 'wbr': 1, 'noframes': 1, 'summary': 1, 'command': 1, 'dt': 1, 'dd': 1, 'figure': 1, 'figcaption': 1, 'center': 1, 'section': 1, 'nav': 1, + 'article': 1, 'aside': 1, 'hgroup': 1, 'header': 1, 'footer': 1, 'address': 1, 'noscript': 1, 'isIndex': 1, 'main': 1, 'mark': 1, 'marquee': 1, + 'meter': 1, 'menu': 1 + }, + SVG: { + 'animateColor': 1, 'animateMotion': 1, 'animateTransform': 1, 'glyph': 1, 'feBlend': 1, 'feColorMatrix': 1, 'feComponentTransfer': 1, + 'feFuncR': 1, 'feFuncG': 1, 'feFuncB': 1, 'feFuncA': 1, 'feComposite': 1, 'feConvolveMatrix': 1, 'feDiffuseLighting': 1, 'feDisplacementMap': 1, + 'feFlood': 1, 'feGaussianBlur': 1, 'feImage': 1, 'feMerge': 1, 'feMergeNode': 1, 'feMorphology': 1, 'feOffset': 1, 'feSpecularLighting': 1, + 'feTile': 1, 'feTurbulence': 1, 'feDistantLight': 1, 'fePointLight': 1, 'feSpotLight': 1, 'linearGradient': 1, 'radialGradient': 1, 'altGlyph': 1, + 'textPath': 1, 'tref': 1, 'altglyph': 1, 'textpath': 1, 'altglyphdef': 1, 'altglyphitem': 1, 'clipPath': 1, 'color-profile': 1, 'cursor': 1, + 'font-face': 1, 'font-face-format': 1, 'font-face-name': 1, 'font-face-src': 1, 'font-face-uri': 1, 'foreignObject': 1, 'glyphRef': 1, + 'hkern': 1, 'vkern': 1 + }, + MathML: {} + } +} + +var language; + +Prism.hooks.add('wrap', function(env) { + if ((env.type == 'tag-id' + || (env.type == 'property' && env.content.indexOf('-') != 0) + || (env.type == 'atrule-id'&& env.content.indexOf('@-') != 0) + || (env.type == 'pseudo-class'&& env.content.indexOf(':-') != 0) + || (env.type == 'pseudo-element'&& env.content.indexOf('::-') != 0) + || (env.type == 'attr-name' && env.content.indexOf('data-') != 0) + ) && env.content.indexOf('<') === -1 + ) { + var searchURL = 'w/index.php?fulltext&search='; + + env.tag = 'a'; + + var href = 'http://docs.webplatform.org/'; + + if (env.language == 'css' || env.language == 'scss') { + href += 'wiki/css/'; + + if (env.type == 'property') { + href += 'properties/'; + } + else if (env.type == 'atrule-id') { + href += 'atrules/'; + } + else if (env.type == 'pseudo-class') { + href += 'selectors/pseudo-classes/'; + } + else if (env.type == 'pseudo-element') { + href += 'selectors/pseudo-elements/'; + } + } + else if (env.language == 'markup') { + if (env.type == 'tag-id') { + // Check language + language = getLanguage(env.content) || language; + + if (language) { + href += 'wiki/' + language + '/elements/'; + } + else { + href += searchURL; + } + } + else if (env.type == 'attr-name') { + if (language) { + href += 'wiki/' + language + '/attributes/'; + } + else { + href += searchURL; + } + } + } + + href += env.content; + + env.attributes.href = href; + env.attributes.target = '_blank'; + } +}); + +function getLanguage(tag) { + var tagL = tag.toLowerCase(); + + if (Tags.HTML[tagL]) { + return 'html'; + } + else if (Tags.SVG[tag]) { + return 'svg'; + } + else if (Tags.MathML[tag]) { + return 'mathml'; + } + + // Not in dictionary, perform check + if (Tags.HTML[tagL] !== 0 && typeof document !== 'undefined') { + var htmlInterface = (document.createElement(tag).toString().match(/\[object HTML(.+)Element\]/) || [])[1]; + + if (htmlInterface && htmlInterface != 'Unknown') { + Tags.HTML[tagL] = 1; + return 'html'; + } + } + + Tags.HTML[tagL] = 0; + + if (Tags.SVG[tag] !== 0 && typeof document !== 'undefined') { + var svgInterface = (document.createElementNS('http://www.w3.org/2000/svg', tag).toString().match(/\[object SVG(.+)Element\]/) || [])[1]; + + if (svgInterface && svgInterface != 'Unknown') { + Tags.SVG[tag] = 1; + return 'svg'; + } + } + + Tags.SVG[tag] = 0; + + // Lame way to detect MathML, but browsers don’t expose interface names there :( + if (Tags.MathML[tag] !== 0) { + if (tag.indexOf('m') === 0) { + Tags.MathML[tag] = 1; + return 'mathml'; + } + } + + Tags.MathML[tag] = 0; + + return null; +} + +})(); \ No newline at end of file diff --git a/MacDown/Resources/Prism/plugins/wpd/prism-wpd.min.js b/MacDown/Resources/Prism/plugins/wpd/prism-wpd.min.js new file mode 100644 index 00000000..445e1a34 --- /dev/null +++ b/MacDown/Resources/Prism/plugins/wpd/prism-wpd.min.js @@ -0,0 +1 @@ +!function(){function e(e){var a=e.toLowerCase();if(t.HTML[a])return"html";if(t.SVG[e])return"svg";if(t.MathML[e])return"mathml";if(0!==t.HTML[a]&&"undefined"!=typeof document){var n=(document.createElement(e).toString().match(/\[object HTML(.+)Element\]/)||[])[1];if(n&&"Unknown"!=n)return t.HTML[a]=1,"html"}if(t.HTML[a]=0,0!==t.SVG[e]&&"undefined"!=typeof document){var r=(document.createElementNS("http://www.w3.org/2000/svg",e).toString().match(/\[object SVG(.+)Element\]/)||[])[1];if(r&&"Unknown"!=r)return t.SVG[e]=1,"svg"}return t.SVG[e]=0,0!==t.MathML[e]&&0===e.indexOf("m")?(t.MathML[e]=1,"mathml"):(t.MathML[e]=0,null)}if(("undefined"==typeof self||self.Prism)&&("undefined"==typeof global||global.Prism)){if(Prism.languages.css&&(Prism.languages.css.atrule.inside["atrule-id"]=/^@[\w-]+/,Prism.languages.css.selector.pattern?(Prism.languages.css.selector.inside["pseudo-class"]=/:[\w-]+/,Prism.languages.css.selector.inside["pseudo-element"]=/::[\w-]+/):Prism.languages.css.selector={pattern:Prism.languages.css.selector,inside:{"pseudo-class":/:[\w-]+/,"pseudo-element":/::[\w-]+/}}),Prism.languages.markup){Prism.languages.markup.tag.inside.tag.inside["tag-id"]=/[\w-]+/;var t={HTML:{a:1,abbr:1,acronym:1,b:1,basefont:1,bdo:1,big:1,blink:1,cite:1,code:1,dfn:1,em:1,kbd:1,i:1,rp:1,rt:1,ruby:1,s:1,samp:1,small:1,spacer:1,strike:1,strong:1,sub:1,sup:1,time:1,tt:1,u:1,"var":1,wbr:1,noframes:1,summary:1,command:1,dt:1,dd:1,figure:1,figcaption:1,center:1,section:1,nav:1,article:1,aside:1,hgroup:1,header:1,footer:1,address:1,noscript:1,isIndex:1,main:1,mark:1,marquee:1,meter:1,menu:1},SVG:{animateColor:1,animateMotion:1,animateTransform:1,glyph:1,feBlend:1,feColorMatrix:1,feComponentTransfer:1,feFuncR:1,feFuncG:1,feFuncB:1,feFuncA:1,feComposite:1,feConvolveMatrix:1,feDiffuseLighting:1,feDisplacementMap:1,feFlood:1,feGaussianBlur:1,feImage:1,feMerge:1,feMergeNode:1,feMorphology:1,feOffset:1,feSpecularLighting:1,feTile:1,feTurbulence:1,feDistantLight:1,fePointLight:1,feSpotLight:1,linearGradient:1,radialGradient:1,altGlyph:1,textPath:1,tref:1,altglyph:1,textpath:1,altglyphdef:1,altglyphitem:1,clipPath:1,"color-profile":1,cursor:1,"font-face":1,"font-face-format":1,"font-face-name":1,"font-face-src":1,"font-face-uri":1,foreignObject:1,glyphRef:1,hkern:1,vkern:1},MathML:{}}}var a;Prism.hooks.add("wrap",function(t){if(("tag-id"==t.type||"property"==t.type&&0!=t.content.indexOf("-")||"atrule-id"==t.type&&0!=t.content.indexOf("@-")||"pseudo-class"==t.type&&0!=t.content.indexOf(":-")||"pseudo-element"==t.type&&0!=t.content.indexOf("::-")||"attr-name"==t.type&&0!=t.content.indexOf("data-"))&&-1===t.content.indexOf("<")){var n="w/index.php?fulltext&search=";t.tag="a";var r="http://docs.webplatform.org/";"css"==t.language||"scss"==t.language?(r+="wiki/css/","property"==t.type?r+="properties/":"atrule-id"==t.type?r+="atrules/":"pseudo-class"==t.type?r+="selectors/pseudo-classes/":"pseudo-element"==t.type&&(r+="selectors/pseudo-elements/")):"markup"==t.language&&("tag-id"==t.type?(a=e(t.content)||a,r+=a?"wiki/"+a+"/elements/":n):"attr-name"==t.type&&(r+=a?"wiki/"+a+"/attributes/":n)),r+=t.content,t.attributes.href=r,t.attributes.target="_blank"}})}}(); \ No newline at end of file diff --git a/MacDown/Resources/Prism/themes/prism-coy.css b/MacDown/Resources/Prism/themes/prism-coy.css new file mode 100644 index 00000000..cc871d36 --- /dev/null +++ b/MacDown/Resources/Prism/themes/prism-coy.css @@ -0,0 +1,235 @@ +/** + * prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML + * Based on https://github.com/tshedor/workshop-wp-theme (Example: http://workshop.kansan.com/category/sessions/basics or http://workshop.timshedor.com/category/sessions/basics); + * @author Tim Shedor + */ + +code[class*="language-"], +pre[class*="language-"] { + color: black; + background: none; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +/* Code blocks */ +pre[class*="language-"] { + position: relative; + margin: .5em 0; + -webkit-box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf; + -moz-box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf; + box-shadow: -1px 0px 0px 0px #358ccb, 0px 0px 0px 1px #dfdfdf; + border-left: 10px solid #358ccb; + background-color: #fdfdfd; + background-image: -webkit-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); + background-image: -moz-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); + background-image: -ms-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); + background-image: -o-linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); + background-image: linear-gradient(transparent 50%, rgba(69, 142, 209, 0.04) 50%); + background-size: 3em 3em; + background-origin: content-box; + overflow: visible; + padding: 0; +} + +code[class*="language"] { + max-height: inherit; + height: 100%; + padding: 0 1em; + display: block; + overflow: auto; +} + +/* Margin bottom to accomodate shadow */ +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background-color: #fdfdfd; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + margin-bottom: 1em; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + position: relative; + padding: .2em; + -webkit-border-radius: 0.3em; + -moz-border-radius: 0.3em; + -ms-border-radius: 0.3em; + -o-border-radius: 0.3em; + border-radius: 0.3em; + color: #c92c2c; + border: 1px solid rgba(0, 0, 0, 0.1); + display: inline; + white-space: normal; +} + +pre[class*="language-"]:before, +pre[class*="language-"]:after { + content: ''; + z-index: -2; + display: block; + position: absolute; + bottom: 0.75em; + left: 0.18em; + width: 40%; + height: 20%; + max-height: 13em; + -webkit-box-shadow: 0px 13px 8px #979797; + -moz-box-shadow: 0px 13px 8px #979797; + box-shadow: 0px 13px 8px #979797; + -webkit-transform: rotate(-2deg); + -moz-transform: rotate(-2deg); + -ms-transform: rotate(-2deg); + -o-transform: rotate(-2deg); + transform: rotate(-2deg); +} + +:not(pre) > code[class*="language-"]:after, +pre[class*="language-"]:after { + right: 0.75em; + left: auto; + -webkit-transform: rotate(2deg); + -moz-transform: rotate(2deg); + -ms-transform: rotate(2deg); + -o-transform: rotate(2deg); + transform: rotate(2deg); +} + +.token.comment, +.token.block-comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: #7D8B99; +} + +.token.punctuation { + color: #5F6364; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.function-name, +.token.constant, +.token.symbol, +.token.deleted { + color: #c92c2c; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.function, +.token.builtin, +.token.inserted { + color: #2f9c0a; +} + +.token.operator, +.token.entity, +.token.url, +.token.variable { + color: #a67f59; + background: rgba(255, 255, 255, 0.5); +} + +.token.atrule, +.token.attr-value, +.token.keyword, +.token.class-name { + color: #1990b8; +} + +.token.regex, +.token.important { + color: #e90; +} + +.language-css .token.string, +.style .token.string { + color: #a67f59; + background: rgba(255, 255, 255, 0.5); +} + +.token.important { + font-weight: normal; +} + +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + +.namespace { + opacity: .7; +} + +@media screen and (max-width: 767px) { + pre[class*="language-"]:before, + pre[class*="language-"]:after { + bottom: 14px; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + } + +} + +/* Plugin styles */ +.token.tab:not(:empty):before, +.token.cr:before, +.token.lf:before { + color: #e0d7d1; +} + +/* Plugin styles: Line Numbers */ +pre[class*="language-"].line-numbers { + padding-left: 0; +} + +pre[class*="language-"].line-numbers code { + padding-left: 3.8em; +} + +pre[class*="language-"].line-numbers .line-numbers-rows { + left: 0; +} + +/* Plugin styles: Line Highlight */ +pre[class*="language-"][data-line] { + padding-top: 0; + padding-bottom: 0; + padding-left: 0; +} +pre[data-line] code { + position: relative; + padding-left: 4em; +} +pre .line-highlight { + margin-top: 0; +} diff --git a/MacDown/Resources/Prism/themes/prism-dark.css b/MacDown/Resources/Prism/themes/prism-dark.css new file mode 100644 index 00000000..7f457287 --- /dev/null +++ b/MacDown/Resources/Prism/themes/prism-dark.css @@ -0,0 +1,128 @@ +/** + * prism.js Dark theme for JavaScript, CSS and HTML + * Based on the slides of the talk “/Reg(exp){2}lained/” + * @author Lea Verou + */ + +code[class*="language-"], +pre[class*="language-"] { + color: white; + background: none; + text-shadow: 0 -.1em .2em black; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +@media print { + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} + +pre[class*="language-"], +:not(pre) > code[class*="language-"] { + background: hsl(30, 20%, 25%); +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; + border: .3em solid hsl(30, 20%, 40%); + border-radius: .5em; + box-shadow: 1px 1px .5em black inset; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .15em .2em .05em; + border-radius: .3em; + border: .13em solid hsl(30, 20%, 40%); + box-shadow: 1px 1px .3em -.1em black inset; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: hsl(30, 20%, 50%); +} + +.token.punctuation { + opacity: .7; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol { + color: hsl(350, 40%, 70%); +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: hsl(75, 70%, 60%); +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string, +.token.variable { + color: hsl(40, 90%, 60%); +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: hsl(350, 40%, 70%); +} + +.token.regex, +.token.important { + color: #e90; +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + +.token.deleted { + color: red; +} diff --git a/MacDown/Resources/Prism/themes/prism-funky.css b/MacDown/Resources/Prism/themes/prism-funky.css new file mode 100644 index 00000000..dd3be061 --- /dev/null +++ b/MacDown/Resources/Prism/themes/prism-funky.css @@ -0,0 +1,116 @@ +/** + * prism.js Funky theme + * Based on “Polyfilling the gaps” talk slides http://lea.verou.me/polyfilling-the-gaps/ + * @author Lea Verou + */ + +code[class*="language-"], +pre[class*="language-"] { + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +/* Code blocks */ +pre[class*="language-"] { + padding: .4em .8em; + margin: .5em 0; + overflow: auto; + background: url('data:image/svg+xml;charset=utf-8,%0D%0A%0D%0A%0D%0A<%2Fsvg>'); + background-size: 1em 1em; +} + +code[class*="language-"] { + background: black; + color: white; + box-shadow: -.3em 0 0 .3em black, .3em 0 0 .3em black; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .2em; + border-radius: .3em; + box-shadow: none; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: #aaa; +} + +.token.punctuation { + color: #999; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol { + color: #0cf; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin { + color: yellow; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.toke.variable, +.token.inserted { + color: yellowgreen; +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: deeppink; +} + +.token.regex, +.token.important { + color: orange; +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + +.token.deleted { + color: red; +} diff --git a/MacDown/Resources/Prism/themes/prism-okaidia.css b/MacDown/Resources/Prism/themes/prism-okaidia.css new file mode 100644 index 00000000..3e0da357 --- /dev/null +++ b/MacDown/Resources/Prism/themes/prism-okaidia.css @@ -0,0 +1,121 @@ +/** + * okaidia theme for JavaScript, CSS and HTML + * Loosely based on Monokai textmate theme by http://www.monokai.nl/ + * @author ocodia + */ + +code[class*="language-"], +pre[class*="language-"] { + color: #f8f8f2; + background: none; + text-shadow: 0 1px rgba(0, 0, 0, 0.3); + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; + border-radius: 0.3em; +} + +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #272822; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #f8f8f2; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.constant, +.token.symbol, +.token.deleted { + color: #f92672; +} + +.token.boolean, +.token.number { + color: #ae81ff; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #a6e22e; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string, +.token.variable { + color: #f8f8f2; +} + +.token.atrule, +.token.attr-value, +.token.function { + color: #e6db74; +} + +.token.keyword { + color: #66d9ef; +} + +.token.regex, +.token.important { + color: #fd971f; +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} diff --git a/MacDown/Resources/Prism/themes/prism-solarizedlight.css b/MacDown/Resources/Prism/themes/prism-solarizedlight.css new file mode 100644 index 00000000..bad77039 --- /dev/null +++ b/MacDown/Resources/Prism/themes/prism-solarizedlight.css @@ -0,0 +1,148 @@ +/* + Solarized Color Schemes originally by Ethan Schoonover + http://ethanschoonover.com/solarized + + Ported for PrismJS by Hector Matos + Website: https://krakendev.io + Twitter Handle: https://twitter.com/allonsykraken) +*/ + +/* +SOLARIZED HEX +--------- ------- +base03 #002b36 +base02 #073642 +base01 #586e75 +base00 #657b83 +base0 #839496 +base1 #93a1a1 +base2 #eee8d5 +base3 #fdf6e3 +yellow #b58900 +orange #cb4b16 +red #dc322f +magenta #d33682 +violet #6c71c4 +blue #268bd2 +cyan #2aa198 +green #859900 +*/ + +code[class*="language-"], +pre[class*="language-"] { + color: #657b83; /* base00 */ + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { + background: #073642; /* base02 */ +} + +pre[class*="language-"]::selection, pre[class*="language-"] ::selection, +code[class*="language-"]::selection, code[class*="language-"] ::selection { + background: #073642; /* base02 */ +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; + border-radius: 0.3em; +} + +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background-color: #fdf6e3; /* base3 */ +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .1em; + border-radius: .3em; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: #93a1a1; /* base1 */ +} + +.token.punctuation { + color: #586e75; /* base01 */ +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #268bd2; /* blue */ +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.url, +.token.inserted { + color: #2aa198; /* cyan */ +} + +.token.entity { + color: #657b83; /* base00 */ + background: #eee8d5; /* base2 */ +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: #859900; /* green */ +} + +.token.function { + color: #b58900; /* yellow */ +} + +.token.regex, +.token.important, +.token.variable { + color: #cb4b16; /* orange */ +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} \ No newline at end of file diff --git a/MacDown/Resources/Prism/themes/prism-tomorrow.css b/MacDown/Resources/Prism/themes/prism-tomorrow.css new file mode 100644 index 00000000..6add2d26 --- /dev/null +++ b/MacDown/Resources/Prism/themes/prism-tomorrow.css @@ -0,0 +1,121 @@ +/** + * prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML + * Based on https://github.com/chriskempson/tomorrow-theme + * @author Rose Pritchard + */ + +code[class*="language-"], +pre[class*="language-"] { + color: #ccc; + background: none; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; + +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; +} + +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #2d2d2d; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; +} + +.token.comment, +.token.block-comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: #999; +} + +.token.punctuation { + color: #ccc; +} + +.token.tag, +.token.attr-name, +.token.namespace, +.token.deleted { + color: #e2777a; +} + +.token.function-name { + color: #6196cc; +} + +.token.boolean, +.token.number, +.token.function { + color: #f08d49; +} + +.token.property, +.token.class-name, +.token.constant, +.token.symbol { + color: #f8c555; +} + +.token.selector, +.token.important, +.token.atrule, +.token.keyword, +.token.builtin { + color: #cc99cd; +} + +.token.string, +.token.char, +.token.attr-value, +.token.regex, +.token.variable { + color: #7ec699; +} + +.token.operator, +.token.entity, +.token.url { + color: #67cdcc; +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + +.token.inserted { + color: green; +} diff --git a/MacDown/Resources/Prism/themes/prism-twilight.css b/MacDown/Resources/Prism/themes/prism-twilight.css new file mode 100644 index 00000000..0b47413b --- /dev/null +++ b/MacDown/Resources/Prism/themes/prism-twilight.css @@ -0,0 +1,201 @@ +/** + * prism.js Twilight theme + * Based (more or less) on the Twilight theme originally of Textmate fame. + * @author Remy Bach + */ +code[class*="language-"], +pre[class*="language-"] { + color: white; + background: none; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + text-shadow: 0 -.1em .2em black; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"], +:not(pre) > code[class*="language-"] { + background: hsl(0, 0%, 8%); /* #141414 */ +} + +/* Code blocks */ +pre[class*="language-"] { + border-radius: .5em; + border: .3em solid hsl(0, 0%, 33%); /* #282A2B */ + box-shadow: 1px 1px .5em black inset; + margin: .5em 0; + overflow: auto; + padding: 1em; +} + +pre[class*="language-"]::-moz-selection { + /* Firefox */ + background: hsl(200, 4%, 16%); /* #282A2B */ +} + +pre[class*="language-"]::selection { + /* Safari */ + background: hsl(200, 4%, 16%); /* #282A2B */ +} + +/* Text Selection colour */ +pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: hsla(0, 0%, 93%, 0.15); /* #EDEDED */ +} + +pre[class*="language-"]::selection, pre[class*="language-"] ::selection, +code[class*="language-"]::selection, code[class*="language-"] ::selection { + text-shadow: none; + background: hsla(0, 0%, 93%, 0.15); /* #EDEDED */ +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + border-radius: .3em; + border: .13em solid hsl(0, 0%, 33%); /* #545454 */ + box-shadow: 1px 1px .3em -.1em black inset; + padding: .15em .2em .05em; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: hsl(0, 0%, 47%); /* #777777 */ +} + +.token.punctuation { + opacity: .7; +} + +.namespace { + opacity: .7; +} + +.token.tag, +.token.boolean, +.token.number, +.token.deleted { + color: hsl(14, 58%, 55%); /* #CF6A4C */ +} + +.token.keyword, +.token.property, +.token.selector, +.token.constant, +.token.symbol, +.token.builtin { + color: hsl(53, 89%, 79%); /* #F9EE98 */ +} + +.token.attr-name, +.token.attr-value, +.token.string, +.token.char, +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string, +.token.variable, +.token.inserted { + color: hsl(76, 21%, 52%); /* #8F9D6A */ +} + +.token.atrule { + color: hsl(218, 22%, 55%); /* #7587A6 */ +} + +.token.regex, +.token.important { + color: hsl(42, 75%, 65%); /* #E9C062 */ +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + +pre[data-line] { + padding: 1em 0 1em 3em; + position: relative; +} + +/* Markup */ +.language-markup .token.tag, +.language-markup .token.attr-name, +.language-markup .token.punctuation { + color: hsl(33, 33%, 52%); /* #AC885B */ +} + +/* Make the tokens sit above the line highlight so the colours don't look faded. */ +.token { + position: relative; + z-index: 1; +} + +.line-highlight { + background: -moz-linear-gradient(to right, hsla(0, 0%, 33%, .1) 70%, hsla(0, 0%, 33%, 0)); /* #545454 */ + background: -o-linear-gradient(to right, hsla(0, 0%, 33%, .1) 70%, hsla(0, 0%, 33%, 0)); /* #545454 */ + background: -webkit-linear-gradient(to right, hsla(0, 0%, 33%, .1) 70%, hsla(0, 0%, 33%, 0)); /* #545454 */ + background: hsla(0, 0%, 33%, 0.25); /* #545454 */ + background: linear-gradient(to right, hsla(0, 0%, 33%, .1) 70%, hsla(0, 0%, 33%, 0)); /* #545454 */ + border-bottom: 1px dashed hsl(0, 0%, 33%); /* #545454 */ + border-top: 1px dashed hsl(0, 0%, 33%); /* #545454 */ + left: 0; + line-height: inherit; + margin-top: 0.75em; /* Same as .prism’s padding-top */ + padding: inherit 0; + pointer-events: none; + position: absolute; + right: 0; + white-space: pre; + z-index: 0; +} + +.line-highlight:before, +.line-highlight[data-end]:after { + background-color: hsl(215, 15%, 59%); /* #8794A6 */ + border-radius: 999px; + box-shadow: 0 1px white; + color: hsl(24, 20%, 95%); /* #F5F2F0 */ + content: attr(data-start); + font: bold 65%/1.5 sans-serif; + left: .6em; + min-width: 1em; + padding: 0 .5em; + position: absolute; + text-align: center; + text-shadow: none; + top: .4em; + vertical-align: .3em; +} + +.line-highlight[data-end]:after { + bottom: .4em; + content: attr(data-end); + top: auto; +} diff --git a/MacDown/Resources/Prism/themes/prism.css b/MacDown/Resources/Prism/themes/prism.css new file mode 100644 index 00000000..83ef295f --- /dev/null +++ b/MacDown/Resources/Prism/themes/prism.css @@ -0,0 +1,137 @@ +/** + * prism.js default theme for JavaScript, CSS and HTML + * Based on dabblet (http://dabblet.com) + * @author Lea Verou + */ + +code[class*="language-"], +pre[class*="language-"] { + color: black; + background: none; + text-shadow: 0 1px white; + font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + line-height: 1.5; + + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { + text-shadow: none; + background: #b3d4fc; +} + +pre[class*="language-"]::selection, pre[class*="language-"] ::selection, +code[class*="language-"]::selection, code[class*="language-"] ::selection { + text-shadow: none; + background: #b3d4fc; +} + +@media print { + code[class*="language-"], + pre[class*="language-"] { + text-shadow: none; + } +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: .5em 0; + overflow: auto; +} + +:not(pre) > code[class*="language-"], +pre[class*="language-"] { + background: #f5f2f0; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: .1em; + border-radius: .3em; + white-space: normal; +} + +.token.comment, +.token.prolog, +.token.doctype, +.token.cdata { + color: slategray; +} + +.token.punctuation { + color: #999; +} + +.namespace { + opacity: .7; +} + +.token.property, +.token.tag, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.deleted { + color: #905; +} + +.token.selector, +.token.attr-name, +.token.string, +.token.char, +.token.builtin, +.token.inserted { + color: #690; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #a67f59; + background: hsla(0, 0%, 100%, .5); +} + +.token.atrule, +.token.attr-value, +.token.keyword { + color: #07a; +} + +.token.function { + color: #DD4A68; +} + +.token.regex, +.token.important, +.token.variable { + color: #e90; +} + +.token.important, +.token.bold { + font-weight: bold; +} +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} diff --git a/MacDown/Resources/contribute.md b/MacDown/Resources/contribute.md deleted file mode 100644 index 18e959c0..00000000 --- a/MacDown/Resources/contribute.md +++ /dev/null @@ -1,32 +0,0 @@ -# Contributing to MacDown - -MacDown is open source and is a volunteer effort. This means that it depends on people to give some of their free time to improve it and make it even better. - -If you are reading this, then you are probably curious or want to contribute in some way. Read on to see how you can do so. - -## Getting the Source Code - -MacDown is hosted on GitHub: - -https://github.com/MacDownApp/macdown - -Here you can get the source code, read through the issues and start contributing. - -## But, I am not a Coder - -Contribution is not limited to software developers, since there are other ways you can help. For example, contributing towards documentation, translation and support. Join the room on Gitter to see how you can help (see below). - -If you want to help translate, then you can look at our project page on [Transifex](https://www.transifex.com/macdown/macdown/) and see whether to add a new languages or complete the work of an existing language. - -## Joining the Conversation - -If you are new the project, then a good place to start is Gitter: - -https://gitter.im/MacDownApp/macdown - -Join the room, introduce yourself and find out how you can help out. - -## License - -MacDown is released under the terms of MIT License. For more details take a look at the [README](https://github.com/MacDownApp/macdown/blob/master/README.md). - diff --git a/MacDown/Resources/help.md b/MacDown/Resources/help.md deleted file mode 100644 index 95b40181..00000000 --- a/MacDown/Resources/help.md +++ /dev/null @@ -1,358 +0,0 @@ -# MacDown - -![MacDown logo](https://macdown.uranusjr.com/static/images/logo-160.png) - -Hello there! I’m **MacDown**, the open source Markdown editor for OS X. - -Let me introduce myself. - - - -## Markdown and I - -**Markdown** is a plain text formatting syntax created by John Gruber, aiming to provide a easy-to-read and feasible markup. The original Markdown syntax specification can be found [here](https://daringfireball.net/projects/markdown/syntax). - -**MacDown** is created as a simple-to-use editor for Markdown documents. I render your Markdown contents real-time into HTML, and display them in a preview panel. - -![MacDown Screenshot](https://d.pr/i/10UGP+) - -I support all the original Markdown syntaxes. But I can do so much more! Various popular but non-standard syntaxes can be turned on/off from the [**Markdown** preference pane](#markdown-pane). - -You can specify extra HTML rendering options through the [**Rendering** preference pane](#rendering-pane). - -You can customize the editor window to your liking in the [**Editor** preferences pane](#editor-pane): - -You can configure various application (that's me!) behaviors in the [**General** preference pane](#general-pane). - -## The Basics -Before I tell you about all the extra syntaxes and capabilities I have, I'll introduce you to the basics of standard markdown. If you already know markdown, and want to jump straight to learning about the fancier things I can do, I suggest you skip to the [**Markdown** preference pane](#markdown-pane). Lets jump right in. - -### Line Breaks -To force a line break, put two spaces and a newline (return) at the end of the line. - -* This two-line bullet -won't break - -* This two-line bullet -will break - -Here is the code: - -``` -* This two-line bullet -won't break - -* This two-line bullet -will break -``` - -### Strong and Emphasize - -**Strong**: `**Strong**` or `__Strong__` (Command-B) -*Emphasize*: `*Emphasize*` or `_Emphasize_`[^emphasize] (Command-I) - -### Headers (like this one!) - - Header 1 - ======== - - Header 2 - -------- - -or - - # Header 1 - ## Header 2 - ### Header 3 - #### Header 4 - ##### Header 5 - ###### Header 6 - - - -### Links and Email -#### Inline -Just put angle brackets around an email and it becomes clickable: -`` - -Same thing with urls: -` ` - -Perhaps you want to link some text like this: [Macdown Website](https://macdown.uranusjr.com "Title") -`[Macdown Website](https://macdown.uranusjr.com "Title")` (The title is optional) - - -#### Reference style -Sometimes it looks too messy to include big long urls inline, or you want to keep all your urls together. - -Make [a link][arbitrary_id] `[a link][arbitrary_id]` then on it's own line anywhere else in the file: -`[arbitrary_id]: https://macdown.uranusjr.com "Title"` - -If the link text itself would make a good id, you can link [like this][] `[like this][]`, then on it's own line anywhere else in the file: -`[like this]: https://macdown.uranusjr.com` - -[arbitrary_id]: https://macdown.uranusjr.com "Title" -[like this]: https://macdown.uranusjr.com - - -### Images -#### Inline -`![Alt Image Text](path/or/url/to.jpg "Optional Title")` -#### Reference style -`![Alt Image Text][image-id]` -on it's own line elsewhere: -`[image-id]: path/or/url/to.jpg "Optional Title"` - - -### Lists - -* Lists must be preceded by a blank line (or block element) -* Unordered lists start each item with a `*` -- `-` works too - * Indent a level to make a nested list - 1. Ordered lists are supported. - 2. Start each item (number-period-space) like `1. ` - 42. It doesn't matter what number you use, I will render them sequentially - 1. So you might want to start each line with `1.` and let me sort it out - -Here is the code: - -``` -* Lists must be preceded by a blank line (or block element) -* Unordered lists start each item with a `*` -- `-` works too - * Indent a level to make a nested list - 1. Ordered lists are supported. - 2. Start each item (number-period-space) like `1. ` - 42. It doesn't matter what number you use, I will render them sequentially - 1. So you might want to start each line with `1.` and let me sort it out -``` - - - -### Block Quote - -> Angle brackets `>` are used for block quotes. -Technically not every line needs to start with a `>` as long as -there are no empty lines between paragraphs. -> Looks kinda ugly though. -> > Block quotes can be nested. -> > > Multiple Levels -> -> Most markdown syntaxes work inside block quotes. -> -> * Lists -> * [Links][arbitrary_id] -> * Etc. - -Here is the code: - -``` -> Angle brackets `>` are used for block quotes. -Technically not every line needs to start with a `>` as long as -there are no empty lines between paragraphs. -> Looks kinda ugly though. -> > Block quotes can be nested. -> > > Multiple Levels -> -> Most markdown syntaxes work inside block quotes. -> -> * Lists -> * [Links][arbitrary_id] -> * Etc. -``` - - -### Inline Code -`Inline code` is indicated by surrounding it with backticks: -`` `Inline code` `` - -If your ``code has `backticks` `` that need to be displayed, you can use double backticks: -```` ``Code with `backticks` `` ```` (mind the spaces preceding the final set of backticks) - - -### Block Code -If you indent at least four spaces or one tab, I'll display a code block. - - print('This is a code block') - print('The block must be preceded by a blank line') - print('Then indent at least 4 spaces or 1 tab') - print('Nesting does nothing. Your code is displayed Literally') - -I also know how to do something called [Fenced Code Blocks](#fenced-code-block) which I will tell you about later. - -### Horizontal Rules -If you type three asterisks `***` or three dashes `---` on a line, I'll display a horizontal rule: - -*** - - -## The Markdown Preference Pane -This is where I keep all preferences related to how I parse markdown into html. -![Markdown preferences pane](https://d.pr/i/RQEi+) - -### Document Formatting -The ***Smartypants*** extension automatically transforms straight quotes (`"` and `'`) in your text into typographer’s quotes (`“`, `”`, `‘`, and `’`) according to the context. Very useful if you’re a typography freak like I am. Quote and Smartypants are syntactically incompatible. If both are enabled, Quote takes precedence. - - -### Block Formatting - -#### Table - -This is a table: - -First Header | Second Header -------------- | ------------- -Content Cell | Content Cell -Content Cell | Content Cell - -You can align cell contents with syntax like this: - -| Left Aligned | Center Aligned | Right Aligned | -|:------------- |:---------------:| -------------:| -| col 3 is | some wordy text | $1600 | -| col 2 is | centered | $12 | -| zebra stripes | are neat | $1 | - -The left- and right-most pipes (`|`) are only aesthetic, and can be omitted. The spaces don’t matter, either. Alignment depends solely on `:` marks. - -#### Fenced Code Block - -This is a fenced code block: - -``` -print('Hello world!') -``` - -You can also use waves (`~`) instead of back ticks (`` ` ``): - -~~~ -print('Hello world!') -~~~ - - -You can add an optional language ID at the end of the first line. The language ID will only be used to highlight the code inside if you tick the ***Enable highlighting in code blocks*** option. This is what happens if you enable it: - -![Syntax highlighting example](https://d.pr/i/9HM6+) - -I support many popular languages as well as some generic syntax descriptions that can be used if your language of choice is not supported. See [relevant sections on the official site](https://macdown.uranusjr.com/features/) for a full list of supported syntaxes. - - -### Inline Formatting - -The following is a list of optional inline markups supported: - -Option name | Markup | Result if enabled | ---------------------|------------------|-----------------------| -Intra-word emphasis | So A\*maz\*ing | So Amazing | -Strikethrough | \~~Much wow\~~ | Much wow | -Underline [^under] | \_So doge\_ | So doge | -Quote [^quote] | \"Such editor\" | Such editor | -Highlight | \==So good\== | So good | -Superscript | hoge\^(fuga) | hogefuga | -Autolink | http://t.co | | -Footnotes | [\^4] and [\^4]: | [^4] and footnote 4 | - -[^4]: You don't have to use a number. Arbitrary things like `[^footy note4]` and `[^footy note4]:` will also work. But they will *render* as numbered footnotes. Also, no need to keep your footnotes in order, I will sort out the order for you so they appear in the same order they were referenced in the text body. You can even keep some footnotes near where you referenced them, and collect others at the bottom of the file in the traditional place for footnotes. - - - - -## The Rendering Preference Pane -This is where I keep preferences relating to how I render and style the parsed markdown in the preview window. -![Rendering preferences pane](https://d.pr/i/rT4d+) - -### CSS -You can choose different css files for me to use to render your html. You can even customize or add your own custom css files. - -### Syntax Highlighting -You have already seen how I can syntax highlight your fenced code blocks. See the [Fenced Code Block](#fenced-code-block) section if you haven’t! You can also choose different themes for syntax highlighting. - -### TeX-like Math Syntax -I can also render TeX-like math syntaxes, if you allow me to.[^math] I can do inline math like this: \\( 1 + 1 \\) or this (in MathML): 1+1, and block math: - -\\[ - A^T_S = B -\\] - -or (in MathML) - - - A S T - = - B - - - - -### Task List Syntax -1. [x] I can render checkbox list syntax - * [x] I support nesting - * [x] I support ordered *and* unordered lists -2. [ ] I don't support clicking checkboxes directly in the html window - - -### Jekyll front-matter -If you like, I can display Jekyll front-matter in a nice table. Just make sure you put the front-matter at the very beginning of the file, and fence it with `---`. For example: - -``` ---- -title: "Macdown is my friend" -date: 2014-06-06 20:00:00 ---- -``` - -### Render newline literally -Normally I require you to put two spaces and a newline (aka return) at the end of a line in order to create a line break. If you like, I can render a newline any time you end a line with a newline. However, if you enable this, markdown that looks lovely when I render it might look pretty funky when you let some *other* program render it. - - -## The General Preferences Pane - -This is where I keep preferences related to application behavior. -![General preferences pane](https://d.pr/i/rvwu+) - -The General Preferences Pane allows you to tell me how you want me to behave. For example, do you want me to make sure there is a document open when I launch? You can also tell me if I should constantly update the preview window as you type, or wait for you to hit `command-R` instead. Maybe you prefer your editor window on the right? Or to see the word-count as you type. This is also the place to tell me if you are interested in pre-releases of me, or just want to stick to better-tested official releases. - -## The Editor Preference Pane -This is where I keep preferences related to the behavior and styling of the editing window. -![Editor preferences pane](https://d.pr/i/6OL5+) - - -### Styling - -My editor provides syntax highlighting. You can edit the base font and the coloring/sizing theme. I provided some default themes (courtesy of [Mou](http://mouapp.com)’s creator, Chen Luo) if you don’t know where to start. - -You can also edit, or even add new themes if you want to! Just click the ***Reveal*** button, and start moving things around. Remember to use the correct file extension (`.styles`), though. I’m picky about that. - -I offer auto-completion and other functions to ease your editing experience. If you don’t like it, however, you can turn them off. - - -## Hidden preference - -You can see the HTML behind a preview by enabling the OS X built-in WebKit developer tools for MacDown in a terminal window: - -``` -defaults write com.uranusjr.macdown WebKitDeveloperExtras -bool true -``` - -Then select “Inspect Element” in the right-click context menu inside the preview pane. - -This is the exact same inspector you find in Safari if you turn on the developer tools. - - -## Hack On - -That’s about it. Thanks for listening. I’ll be quiet from now on (unless there’s an update about the app—I’ll remind you for that!). - -Happy writing! - - -[^emphasize]: If **Underlines** is turned on, `_this notation_` will render as underlined instead of emphasized - -[^under]: If **Underline** is disabled `_this_` will be rendered as *emphasized* instead of being underlined. - -[^quote]: **Quote** replaces literal `"` characters with html `` tags. **Quote** and **Smartypants** are syntactically incompatible. If both are enabled, **Quote** takes precedence. Note that **Quote** is different from *blockquote*, which is part of standard Markdown. - -[^math]: Internet connection required. - - diff --git a/MacDown.xcodeproj/project.pbxproj b/Markly.xcodeproj/project.pbxproj similarity index 97% rename from MacDown.xcodeproj/project.pbxproj rename to Markly.xcodeproj/project.pbxproj index 81f315a6..03a48357 100644 --- a/MacDown.xcodeproj/project.pbxproj +++ b/Markly.xcodeproj/project.pbxproj @@ -33,6 +33,9 @@ 1F27896B1973BEB100EE696A /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1F2789691973BEB100EE696A /* Localizable.strings */; }; 1F3386E61A6B999600FC88C4 /* DOMNode+Text.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F3386E51A6B999600FC88C4 /* DOMNode+Text.m */; }; 1F33F2A11A3B4B660001C849 /* MPDocumentSplitView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F33F2A01A3B4B660001C849 /* MPDocumentSplitView.m */; }; + RD00000001000000000000001 /* MPSidebarController.m in Sources */ = {isa = PBXBuildFile; fileRef = RD00000002000000000000001 /* MPSidebarController.m */; }; + RD00000004000000000000001 /* MPWritingTools.m in Sources */ = {isa = PBXBuildFile; fileRef = RD00000005000000000000001 /* MPWritingTools.m */; }; + RD00000006000000000000001 /* MPCommandPalette.m in Sources */ = {isa = PBXBuildFile; fileRef = RD00000007000000000000001 /* MPCommandPalette.m */; }; 1F33F2A41A3B56D20001C849 /* NSColor+HTML.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F33F2A31A3B56D20001C849 /* NSColor+HTML.m */; }; 1F3619E61F36DA0F00EDA15A /* MPTerminalPreferencesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1F3619E81F36DA0F00EDA15A /* MPTerminalPreferencesViewController.xib */; }; 1F396E6619B0EA17000D3EFC /* MPEditorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F396E6519B0EA17000D3EFC /* MPEditorView.m */; }; @@ -83,7 +86,6 @@ 1FFEB3271972DAB400B2254F /* MPHTMLTabularizeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1FFEB3261972DAB400B2254F /* MPHTMLTabularizeTests.m */; }; 1FFEB32B19737D6E00B2254F /* YAMLSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 1FFEB32A19737D6E00B2254F /* YAMLSerialization.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -Wno-unused-variable"; }; }; 1FFF301D1948A5320009AF24 /* MPStringLookupTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1FFF301C1948A5320009AF24 /* MPStringLookupTests.m */; }; - 3028039E1FD84EAC0055B0DA /* contribute.md in Resources */ = {isa = PBXBuildFile; fileRef = 3028039D1FD84EAB0055B0DA /* contribute.md */; }; 770BB49E962A302D0715A6A5 /* libPods-MacDown.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 42F926DD38559C7CEDB6E42F /* libPods-MacDown.a */; }; 852D523C1E260A6400BA7162 /* MPTerminalPreferencesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 852D523A1E260A6400BA7162 /* MPTerminalPreferencesViewController.m */; }; 85E24E5C1E5019C00056E696 /* MPToolbarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 85E24E5B1E5019C00056E696 /* MPToolbarController.m */; }; @@ -249,6 +251,12 @@ 1F3386E51A6B999600FC88C4 /* DOMNode+Text.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "DOMNode+Text.m"; sourceTree = ""; }; 1F33F29F1A3B4B660001C849 /* MPDocumentSplitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPDocumentSplitView.h; sourceTree = ""; }; 1F33F2A01A3B4B660001C849 /* MPDocumentSplitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDocumentSplitView.m; sourceTree = ""; }; + RD00000003000000000000001 /* MPSidebarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPSidebarController.h; sourceTree = ""; }; + RD00000002000000000000001 /* MPSidebarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPSidebarController.m; sourceTree = ""; }; + RD00000008000000000000001 /* MPWritingTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPWritingTools.h; sourceTree = ""; }; + RD00000005000000000000001 /* MPWritingTools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPWritingTools.m; sourceTree = ""; }; + RD00000009000000000000001 /* MPCommandPalette.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPCommandPalette.h; sourceTree = ""; }; + RD00000007000000000000001 /* MPCommandPalette.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPCommandPalette.m; sourceTree = ""; }; 1F33F2A21A3B56D20001C849 /* NSColor+HTML.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSColor+HTML.h"; sourceTree = ""; }; 1F33F2A31A3B56D20001C849 /* NSColor+HTML.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSColor+HTML.m"; sourceTree = ""; }; 1F3619E71F36DA0F00EDA15A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MPTerminalPreferencesViewController.xib; sourceTree = ""; }; @@ -302,8 +310,8 @@ 1F847BC31DCC9DA800A47385 /* MPGlobals.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPGlobals.h; sourceTree = ""; }; 1F847BC41DCC9DB600A47385 /* NSUserDefaults+Suite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSUserDefaults+Suite.h"; sourceTree = ""; }; 1F847BC51DCC9DB600A47385 /* NSUserDefaults+Suite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSUserDefaults+Suite.m"; sourceTree = ""; }; - 1F8858BA1A2D8D82008DC543 /* MPArgumentProcessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MPArgumentProcessor.h; path = "macdown-cmd/MPArgumentProcessor.h"; sourceTree = SOURCE_ROOT; }; - 1F8858BB1A2D8D82008DC543 /* MPArgumentProcessor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MPArgumentProcessor.m; path = "macdown-cmd/MPArgumentProcessor.m"; sourceTree = SOURCE_ROOT; }; + 1F8858BA1A2D8D82008DC543 /* MPArgumentProcessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MPArgumentProcessor.h; path = "markly-cmd/MPArgumentProcessor.h"; sourceTree = SOURCE_ROOT; }; + 1F8858BB1A2D8D82008DC543 /* MPArgumentProcessor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MPArgumentProcessor.m; path = "markly-cmd/MPArgumentProcessor.m"; sourceTree = SOURCE_ROOT; }; 1F8A82D819533E9300B6BF69 /* Prism */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Prism; path = Resources/Prism; sourceTree = ""; }; 1F8A83571953454F00B6BF69 /* HGMarkdownHighlighter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HGMarkdownHighlighter.h; path = "Dependency/peg-markdown-highlight/HGMarkdownHighlighter.h"; sourceTree = SOURCE_ROOT; }; 1F8A83581953454F00B6BF69 /* HGMarkdownHighlighter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HGMarkdownHighlighter.m; path = "Dependency/peg-markdown-highlight/HGMarkdownHighlighter.m"; sourceTree = SOURCE_ROOT; }; @@ -430,8 +438,8 @@ 1FBDFE9B196170FE00BEEA70 /* Extensions */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Extensions; path = Resources/Extensions; sourceTree = ""; }; 1FBDFE9E1962A25A00BEEA70 /* MPGeneralPreferencesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPGeneralPreferencesViewController.h; sourceTree = ""; }; 1FBDFE9F1962A25A00BEEA70 /* MPGeneralPreferencesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPGeneralPreferencesViewController.m; sourceTree = ""; }; - 1FBDFEA41962A27300BEEA70 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = MacDown/Localization/Base.lproj/MPGeneralPreferencesViewController.xib; sourceTree = SOURCE_ROOT; }; - 1FBE8E0E1A11DB1E003E1EF4 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = "macdown-cmd/main.m"; sourceTree = SOURCE_ROOT; }; + 1FBDFEA41962A27300BEEA70 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Markly/Localization/Base.lproj/MPGeneralPreferencesViewController.xib; sourceTree = SOURCE_ROOT; }; + 1FBE8E0E1A11DB1E003E1EF4 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = "markly-cmd/main.m"; sourceTree = SOURCE_ROOT; }; 1FC29F5B1944FC2600D616C7 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 1FCBDF0B1E536C8400C0F56B /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = Localization/sv.lproj/MainMenu.strings; sourceTree = ""; }; 1FCBDF0C1E536C8400C0F56B /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = Localization/sv.lproj/MPExportPanelAccessoryViewController.strings; sourceTree = ""; }; @@ -486,7 +494,6 @@ 1FFEB32A19737D6E00B2254F /* YAMLSerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YAMLSerialization.m; sourceTree = ""; }; 1FFF301C1948A5320009AF24 /* MPStringLookupTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPStringLookupTests.m; sourceTree = ""; }; 263367245B2D78A42C2F19D7 /* libPods-macdown-cmd.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-macdown-cmd.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 3028039D1FD84EAB0055B0DA /* contribute.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; name = contribute.md; path = Resources/contribute.md; sourceTree = ""; }; 39EFCAE04F60154F0C8C5469 /* Pods-MacDown.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MacDown.release.xcconfig"; path = "Pods/Target Support Files/Pods-MacDown/Pods-MacDown.release.xcconfig"; sourceTree = ""; }; 3C949FDE45493AE77DAD9BF4 /* libPods-MacDownTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-MacDownTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 3D175F0F1974282400A5EFE8 /* WebView+WebViewPrivateHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "WebView+WebViewPrivateHeaders.h"; sourceTree = ""; }; @@ -595,6 +602,8 @@ children = ( 1F70CCD81978F03E00703429 /* MPAutosaving.h */, 1F847BC31DCC9DA800A47385 /* MPGlobals.h */, + RD00000008000000000000001 /* MPWritingTools.h */, + RD00000005000000000000001 /* MPWritingTools.m */, 1F96BD7E1E584A03005E0456 /* MPHomebrewSubprocessController.h */, 1F96BD7F1E584A03005E0456 /* MPHomebrewSubprocessController.m */, 1F23A91F19928E650052DB78 /* MPMathJaxListener.h */, @@ -655,6 +664,10 @@ children = ( 1F33F29F1A3B4B660001C849 /* MPDocumentSplitView.h */, 1F33F2A01A3B4B660001C849 /* MPDocumentSplitView.m */, + RD00000003000000000000001 /* MPSidebarController.h */, + RD00000002000000000000001 /* MPSidebarController.m */, + RD00000009000000000000001 /* MPCommandPalette.h */, + RD00000007000000000000001 /* MPCommandPalette.m */, 1F396E6419B0EA17000D3EFC /* MPEditorView.h */, 1F396E6519B0EA17000D3EFC /* MPEditorView.m */, ); @@ -665,7 +678,6 @@ 1F4C8E9B194AE0C3004BF82E /* Resources */ = { isa = PBXGroup; children = ( - 3028039D1FD84EAB0055B0DA /* contribute.md */, 1FCE066319633D6B00DC83B4 /* Data */, 1F9A14EE194EEEDD00D1C6A9 /* Styles */, 1F9A14F3194EF6A600D1C6A9 /* Themes */, @@ -700,7 +712,7 @@ 1FFEB32819737D6E00B2254F /* YAML-framework */, ); name = Dependency; - path = MacDown; + path = Markly; sourceTree = ""; }; 1F8A83561953453A00B6BF69 /* peg-markdown-highlight */ = { @@ -822,7 +834,7 @@ 1F0D9D90194AC852008E1856 /* Document */, 1FCDCA2D1944F8F600B1F966 /* Supporting Files */, ); - path = MacDown; + path = Markly; sourceTree = ""; }; 1FCDCA2D1944F8F600B1F966 /* Supporting Files */ = { @@ -849,7 +861,7 @@ 1FFEB3261972DAB400B2254F /* MPHTMLTabularizeTests.m */, 1FCDCA371944F97800B1F966 /* Supporting Files */, ); - path = MacDownTests; + path = MarklyTests; sourceTree = ""; }; 1FCDCA371944F97800B1F966 /* Supporting Files */ = { @@ -882,7 +894,7 @@ 1F8858BB1A2D8D82008DC543 /* MPArgumentProcessor.m */, 1FBE8E0E1A11DB1E003E1EF4 /* main.m */, ); - path = "macdown-cmd"; + path = "markly-cmd"; sourceTree = ""; }; AC6D1A361B8B63012D598BC7 /* Pods */ = { @@ -1063,7 +1075,6 @@ 1FCE066419633D6C00DC83B4 /* Data in Resources */, 1F3FC8AA1C85AE9F000965E1 /* MacDown.sdef in Resources */, 1FB3C0241E5061A2002AEB6A /* MPExportPanelAccessoryViewController.xib in Resources */, - 3028039E1FD84EAC0055B0DA /* contribute.md in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1191,12 +1202,10 @@ inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-MacDown/Pods-MacDown-frameworks.sh", "${PODS_ROOT}/Sparkle/Sparkle.framework", - "${PODS_ROOT}/Sparkle/Sparkle.framework.dSYM", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Sparkle.framework", - "${DWARF_DSYM_FOLDER_PATH}/Sparkle.framework.dSYM", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -1234,6 +1243,9 @@ 1F3FC87C1C854E1C000965E1 /* NSPasteboard+Types.m in Sources */, 1F8A835E1953454F00B6BF69 /* HGMarkdownHighlightingStyle.m in Sources */, 1F33F2A11A3B4B660001C849 /* MPDocumentSplitView.m in Sources */, + RD00000001000000000000001 /* MPSidebarController.m in Sources */, + RD00000004000000000000001 /* MPWritingTools.m in Sources */, + RD00000006000000000000001 /* MPCommandPalette.m in Sources */, 1F23A92119928E650052DB78 /* MPMathJaxListener.m in Sources */, 1F2649B01A7406DB00EF6AF3 /* NSDocumentController+Document.m in Sources */, 1F0D9D67194AC7CF008E1856 /* MPUtilities.m in Sources */, @@ -1699,7 +1711,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 10.13; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; @@ -1744,7 +1756,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 10.13; SDKROOT = macosx; }; name = Release; @@ -1757,11 +1769,11 @@ CODE_SIGN_IDENTITY = ""; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "MacDown/Code/MacDown-Prefix.pch"; - INFOPLIST_FILE = "MacDown/MacDown-Info.plist"; - MACOSX_DEPLOYMENT_TARGET = 10.8; - PRODUCT_BUNDLE_IDENTIFIER = "com.uranusjr.${PRODUCT_NAME:rfc1034identifier:lower}-debug"; - PRODUCT_NAME = MacDown; + GCC_PREFIX_HEADER = "Markly/Code/MacDown-Prefix.pch"; + INFOPLIST_FILE = "Markly/MacDown-Info.plist"; + MACOSX_DEPLOYMENT_TARGET = 10.13; + PRODUCT_BUNDLE_IDENTIFIER = "com.markly.app-debug"; + PRODUCT_NAME = Markly; SDKROOT = macosx; WRAPPER_EXTENSION = app; }; @@ -1775,11 +1787,11 @@ CODE_SIGN_IDENTITY = ""; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "MacDown/Code/MacDown-Prefix.pch"; - INFOPLIST_FILE = "MacDown/MacDown-Info.plist"; - MACOSX_DEPLOYMENT_TARGET = 10.8; - PRODUCT_BUNDLE_IDENTIFIER = "com.uranusjr.${PRODUCT_NAME:rfc1034identifier:lower}"; - PRODUCT_NAME = MacDown; + GCC_PREFIX_HEADER = "Markly/Code/MacDown-Prefix.pch"; + INFOPLIST_FILE = "Markly/MacDown-Info.plist"; + MACOSX_DEPLOYMENT_TARGET = 10.13; + PRODUCT_BUNDLE_IDENTIFIER = "com.markly.app"; + PRODUCT_NAME = Markly; SDKROOT = macosx; WRAPPER_EXTENSION = app; }; @@ -1789,7 +1801,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 8CDC5EA0050D2F722FB1AADD /* Pods-MacDownTests.debug.xcconfig */; buildSettings = { - BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MacDown.app/Contents/MacOS/MacDown"; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Markly.app/Contents/MacOS/Markly"; CLANG_ENABLE_MODULES = NO; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -1797,17 +1809,17 @@ "$(inherited)", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "MacDown/Code/MacDown-Prefix.pch"; + GCC_PREFIX_HEADER = "Markly/Code/MacDown-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); - INFOPLIST_FILE = "MacDownTests/MacDownTests-Info.plist"; + INFOPLIST_FILE = "MarklyTests/MacDownTests-Info.plist"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/MacDown-ggdtxvuybojeqbhjydkhilziizrv/Build/Products/Debug", ); - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 10.13; PRODUCT_BUNDLE_IDENTIFIER = "com.uranusjr.${PRODUCT_NAME:rfc1034identifier:lower}"; PRODUCT_NAME = MacDownTests; TEST_HOST = "$(BUNDLE_LOADER)"; @@ -1819,7 +1831,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 0D0EC0DE9FEA22F962083921 /* Pods-MacDownTests.release.xcconfig */; buildSettings = { - BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MacDown.app/Contents/MacOS/MacDown"; + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Markly.app/Contents/MacOS/Markly"; CLANG_ENABLE_MODULES = NO; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -1827,13 +1839,13 @@ "$(inherited)", ); GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "MacDown/Code/MacDown-Prefix.pch"; - INFOPLIST_FILE = "MacDownTests/MacDownTests-Info.plist"; + GCC_PREFIX_HEADER = "Markly/Code/MacDown-Prefix.pch"; + INFOPLIST_FILE = "MarklyTests/MacDownTests-Info.plist"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(USER_LIBRARY_DIR)/Developer/Xcode/DerivedData/MacDown-ggdtxvuybojeqbhjydkhilziizrv/Build/Products/Debug", ); - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 10.13; PRODUCT_BUNDLE_IDENTIFIER = "com.uranusjr.${PRODUCT_NAME:rfc1034identifier:lower}"; PRODUCT_NAME = MacDownTests; TEST_HOST = "$(BUNDLE_LOADER)"; @@ -1851,7 +1863,7 @@ "DEBUG=1", "$(inherited)", ); - PRODUCT_NAME = macdown; + PRODUCT_NAME = markly; SKIP_INSTALL = YES; }; name = Debug; @@ -1862,7 +1874,7 @@ buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ""; - PRODUCT_NAME = macdown; + PRODUCT_NAME = markly; SKIP_INSTALL = YES; }; name = Release; diff --git a/MacDown.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Markly.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from MacDown.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Markly.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/MacDown.xcodeproj/xcshareddata/xcschemes/MacDown.xcscheme b/Markly.xcodeproj/xcshareddata/xcschemes/Markly.xcscheme similarity index 85% rename from MacDown.xcodeproj/xcshareddata/xcschemes/MacDown.xcscheme rename to Markly.xcodeproj/xcshareddata/xcschemes/Markly.xcscheme index e5486feb..97ca91d6 100644 --- a/MacDown.xcodeproj/xcshareddata/xcschemes/MacDown.xcscheme +++ b/Markly.xcodeproj/xcshareddata/xcschemes/Markly.xcscheme @@ -15,9 +15,9 @@ + ReferencedContainer = "container:Markly.xcodeproj"> @@ -27,6 +27,15 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + @@ -35,21 +44,10 @@ BlueprintIdentifier = "1FA6DE441941CC9E000409FB" BuildableName = "MacDownTests.xctest" BlueprintName = "MacDownTests" - ReferencedContainer = "container:MacDown.xcodeproj"> + ReferencedContainer = "container:Markly.xcodeproj"> - - - - - - + ReferencedContainer = "container:Markly.xcodeproj"> - - + ReferencedContainer = "container:Markly.xcodeproj"> diff --git a/MacDown.xcworkspace/contents.xcworkspacedata b/Markly.xcworkspace/contents.xcworkspacedata similarity index 80% rename from MacDown.xcworkspace/contents.xcworkspacedata rename to Markly.xcworkspace/contents.xcworkspacedata index 5deffd09..ed39c6c0 100644 --- a/MacDown.xcworkspace/contents.xcworkspacedata +++ b/Markly.xcworkspace/contents.xcworkspacedata @@ -2,7 +2,7 @@ + location = "group:Markly.xcodeproj"> diff --git a/MacDown.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Markly.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from MacDown.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to Markly.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/MacDown.xcworkspace/xcshareddata/MacDown.xccheckout b/Markly.xcworkspace/xcshareddata/MacDown.xccheckout similarity index 100% rename from MacDown.xcworkspace/xcshareddata/MacDown.xccheckout rename to Markly.xcworkspace/xcshareddata/MacDown.xccheckout diff --git a/MacDown.xcworkspace/xcshareddata/MacDown.xcscmblueprint b/Markly.xcworkspace/xcshareddata/MacDown.xcscmblueprint similarity index 100% rename from MacDown.xcworkspace/xcshareddata/MacDown.xcscmblueprint rename to Markly.xcworkspace/xcshareddata/MacDown.xcscmblueprint diff --git a/MacDown.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Markly.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from MacDown.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to Markly.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/MacDown/Code/Application/MPExportPanelAccessoryViewController.h b/Markly/Code/Application/MPExportPanelAccessoryViewController.h similarity index 100% rename from MacDown/Code/Application/MPExportPanelAccessoryViewController.h rename to Markly/Code/Application/MPExportPanelAccessoryViewController.h diff --git a/MacDown/Code/Application/MPExportPanelAccessoryViewController.m b/Markly/Code/Application/MPExportPanelAccessoryViewController.m similarity index 100% rename from MacDown/Code/Application/MPExportPanelAccessoryViewController.m rename to Markly/Code/Application/MPExportPanelAccessoryViewController.m diff --git a/MacDown/Code/Application/MPMainController.h b/Markly/Code/Application/MPMainController.h similarity index 100% rename from MacDown/Code/Application/MPMainController.h rename to Markly/Code/Application/MPMainController.h diff --git a/MacDown/Code/Application/MPMainController.m b/Markly/Code/Application/MPMainController.m similarity index 99% rename from MacDown/Code/Application/MPMainController.m rename to Markly/Code/Application/MPMainController.m index 5a46edce..188bea75 100644 --- a/MacDown/Code/Application/MPMainController.m +++ b/Markly/Code/Application/MPMainController.m @@ -220,11 +220,6 @@ - (IBAction)showHelp:(id)sender MPOpenBundledFile(@"help", @"md"); } -- (IBAction)showContributing:(id)sender -{ - MPOpenBundledFile(@"contribute", @"md"); -} - #pragma mark - Override @@ -357,7 +352,6 @@ - (void)openPendingPipedContent { - (void)showFirstLaunchTips { [self showHelp:nil]; - [self showContributing:nil]; } diff --git a/MacDown/Code/Application/MPPlugInController.h b/Markly/Code/Application/MPPlugInController.h similarity index 100% rename from MacDown/Code/Application/MPPlugInController.h rename to Markly/Code/Application/MPPlugInController.h diff --git a/MacDown/Code/Application/MPPlugInController.m b/Markly/Code/Application/MPPlugInController.m similarity index 100% rename from MacDown/Code/Application/MPPlugInController.m rename to Markly/Code/Application/MPPlugInController.m diff --git a/MacDown/Code/Application/MPToolbarController.h b/Markly/Code/Application/MPToolbarController.h similarity index 100% rename from MacDown/Code/Application/MPToolbarController.h rename to Markly/Code/Application/MPToolbarController.h diff --git a/MacDown/Code/Application/MPToolbarController.m b/Markly/Code/Application/MPToolbarController.m similarity index 90% rename from MacDown/Code/Application/MPToolbarController.m rename to Markly/Code/Application/MPToolbarController.m index a6caddd9..9f6f0477 100644 --- a/MacDown/Code/Application/MPToolbarController.m +++ b/Markly/Code/Application/MPToolbarController.m @@ -47,12 +47,15 @@ - (id)init - (void)setupToolbarItems { - // Set up layout drop down alternatives. title will be set in validateUserInterfaceItem: - NSMenuItem *toggleEditorMenuItem = [[NSMenuItem alloc] initWithTitle:@"" action:@selector(toggleEditorPane:) keyEquivalent:@"e"]; - NSMenuItem *togglePreviewMenuItem = [[NSMenuItem alloc] initWithTitle:@"" action:@selector(togglePreviewPane:) keyEquivalent:@"p"]; - - // Set up all available toolbar items + // Set up all available toolbar items — sidebar + view mode toggle first self->toolbarItems = @[ + [self toolbarItemWithIdentifier:@"toggle-sidebar" label:NSLocalizedString(@"Sidebar", @"Toggle sidebar toolbar button") icon:@"NSLeftFacingTriangleTemplate" action:@selector(toggleSidebar:)], + [self toolbarItemGroupWithIdentifier:@"view-mode-group" separated:NO label:NSLocalizedString(@"View Mode", @"") items:@[ + [self toolbarItemWithIdentifier:@"view-editor" label:NSLocalizedString(@"Editor Only", @"Editor only toolbar button") icon:@"ToolbarIconShiftLeft" action:@selector(showEditorOnly:)], + [self toolbarItemWithIdentifier:@"view-both" label:NSLocalizedString(@"Editor & Preview", @"Both panes toolbar button") icon:@"ToolbarIconEditorAndPreview" action:@selector(showBothPanes:)], + [self toolbarItemWithIdentifier:@"view-preview" label:NSLocalizedString(@"Preview Only", @"Preview only toolbar button") icon:@"ToolbarIconShiftRight" action:@selector(showPreviewOnly:)] + ] + ], [self toolbarItemGroupWithIdentifier:@"indent-group" separated:YES label:NSLocalizedString(@"Shift Left/Right", @"") items:@[ [self toolbarItemWithIdentifier:@"shift-left" label:NSLocalizedString(@"Shift Left", @"Shift text to the left toolbar button") icon:@"ToolbarIconShiftLeft" action:@selector(unindent:)], [self toolbarItemWithIdentifier:@"shift-right" label:NSLocalizedString(@"Shift Right", @"Shift text to the right toolbar button") icon:@"ToolbarIconShiftRight" action:@selector(indent:)] @@ -82,12 +85,7 @@ - (void)setupToolbarItems [self toolbarItemWithIdentifier:@"copy-html" label:NSLocalizedString(@"Copy HTML", @"Copy HTML toolbar button") icon:@"ToolbarIconCopyHTML" action:@selector(copyHtml:)], [self toolbarItemWithIdentifier:@"comment" label:NSLocalizedString(@"Comment", @"Comment toolbar button") icon:@"ToolbarIconComment" action:@selector(toggleComment:)], [self toolbarItemWithIdentifier:@"highlight" label:NSLocalizedString(@"Highlight", @"Highlight toolbar button") icon:@"ToolbarIconHighlight" action:@selector(toggleHighlight:)], - [self toolbarItemWithIdentifier:@"strikethrough" label:NSLocalizedString(@"Strikethrough", @"Strikethrough toolbar button") icon:@"ToolbarIconStrikethrough" action:@selector(toggleStrikethrough:)], - [self toolbarItemDropDownWithIdentifier:@"layout" label:NSLocalizedString(@"Layout", @"Layout toolbar button") icon:@"ToolbarIconEditorAndPreview" menuItems: - @[ - toggleEditorMenuItem, togglePreviewMenuItem - ] - ] + [self toolbarItemWithIdentifier:@"strikethrough" label:NSLocalizedString(@"Strikethrough", @"Strikethrough toolbar button") icon:@"ToolbarIconStrikethrough" action:@selector(toggleStrikethrough:)] ]; self->toolbarItemIdentifiers = [self toolbarItemIdentifiersFromItemsArray:self->toolbarItems]; @@ -109,16 +107,18 @@ - (NSArray *)toolbarItemIdentifiersFromItemsArray:(NSArray *)toolbarItemsArray { - (void)selectedToolbarItemGroupItem:(NSSegmentedControl *)sender { NSInteger selectedIndex = sender.selectedSegment; - + NSToolbarItemGroup *selectedGroup = self->toolbarItemIdentifierObjectDictionary[sender.identifier]; NSToolbarItem *selectedItem = selectedGroup.subitems[selectedIndex]; - - // Invoke the toolbar item's action - // Must convert to IMP to let the compiler know about the method definition + MPDocument *document = self.document; - IMP imp = [document methodForSelector:selectedItem.action]; - void (*impFunc)(id) = (void *)imp; - impFunc(document); + if (document && selectedItem.action) + { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + [document performSelector:selectedItem.action withObject:sender]; +#pragma clang diagnostic pop + } } @@ -134,7 +134,7 @@ - (void)selectedToolbarItemGroupItem:(NSSegmentedControl *)sender // Add space after the specified toolbar item indices int spaceAfterIndices[] = {}; // No space in the default set - int flexibleSpaceAfterIndices[] = {2, 3, 5, 7, 11}; + int flexibleSpaceAfterIndices[] = {1, 4, 5, 7, 9}; int i = 0; int j = 0; int k = 0; @@ -244,7 +244,8 @@ - (NSToolbarItem *)toolbarItemWithIdentifier:(NSString *)itemIdentifier label:(N toolbarItem.label = label; toolbarItem.paletteLabel = label; toolbarItem.toolTip = label; - + toolbarItem.action = action; + NSImage *itemImage = [NSImage imageNamed:iconImageName]; [itemImage setTemplate:YES]; [itemImage setSize:CGSizeMake(19, 19)]; diff --git a/MacDown/Code/Document/MPAsset.h b/Markly/Code/Document/MPAsset.h similarity index 100% rename from MacDown/Code/Document/MPAsset.h rename to Markly/Code/Document/MPAsset.h diff --git a/MacDown/Code/Document/MPAsset.m b/Markly/Code/Document/MPAsset.m similarity index 100% rename from MacDown/Code/Document/MPAsset.m rename to Markly/Code/Document/MPAsset.m diff --git a/MacDown/Code/Document/MPDocument.h b/Markly/Code/Document/MPDocument.h similarity index 56% rename from MacDown/Code/Document/MPDocument.h rename to Markly/Code/Document/MPDocument.h index 387f4675..c5ac6e6e 100644 --- a/MacDown/Code/Document/MPDocument.h +++ b/Markly/Code/Document/MPDocument.h @@ -19,4 +19,14 @@ @property (nonatomic, readwrite) NSString *markdown; @property (nonatomic, readonly) NSString *html; +- (IBAction)showEditorOnly:(id)sender; +- (IBAction)showPreviewOnly:(id)sender; +- (IBAction)showBothPanes:(id)sender; +- (IBAction)toggleSidebar:(id)sender; +- (IBAction)toggleFocusMode:(id)sender; +- (IBAction)toggleTypewriterMode:(id)sender; +- (IBAction)exportToDOCX:(id)sender; +- (IBAction)showCommandPalette:(id)sender; +- (IBAction)toggleProseAnalysis:(id)sender; + @end diff --git a/MacDown/Code/Document/MPDocument.m b/Markly/Code/Document/MPDocument.m similarity index 75% rename from MacDown/Code/Document/MPDocument.m rename to Markly/Code/Document/MPDocument.m index acbc77ff..5c328a6d 100644 --- a/MacDown/Code/Document/MPDocument.m +++ b/Markly/Code/Document/MPDocument.m @@ -30,6 +30,10 @@ #import "MPMathJaxListener.h" #import "WebView+WebViewPrivateHeaders.h" #import "MPToolbarController.h" +#import "MPSidebarController.h" +#import "MPGlobals.h" +#import "MPWritingTools.h" +#import "MPCommandPalette.h" #import static NSString * const kMPDefaultAutosaveName = @"Untitled"; @@ -191,6 +195,8 @@ typedef NS_ENUM(NSUInteger, MPWordCountType) { @property (weak) IBOutlet WebView *preview; @property (weak) IBOutlet NSPopUpButton *wordCountWidget; @property (strong) IBOutlet MPToolbarController *toolbarController; +@property (strong) MPSidebarController *sidebarController; +@property (strong) NSPopUpButton *fillerCountButton; @property (copy, nonatomic) NSString *autosaveName; @property (strong) HGMarkdownHighlighter *highlighter; @property (strong) MPRenderer *renderer; @@ -360,6 +366,13 @@ - (void)windowControllerDidLoadNib:(NSWindowController *)controller { [super windowControllerDidLoadNib:controller]; + // Enable native macOS window tabbing (10.12+) + if (@available(macOS 10.12, *)) + { + controller.window.tabbingMode = NSWindowTabbingModeAutomatic; + controller.window.tabbingIdentifier = @"MarklyDocumentWindow"; + } + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; // All files use their absolute path to keep their window states. @@ -449,6 +462,37 @@ - (void)windowControllerDidLoadNib:(NSWindowController *)controller wordCountWidget.hidden = !self.preferences.editorShowWordCount; wordCountWidget.enabled = NO; + // Create filler word count popup in the bottom-right corner + NSView *editorContainer = self.editorContainer; + self.fillerCountButton = [[NSPopUpButton alloc] initWithFrame:NSZeroRect pullsDown:YES]; + self.fillerCountButton.font = [NSFont monospacedDigitSystemFontOfSize:11 weight:NSFontWeightMedium]; + self.fillerCountButton.controlSize = NSControlSizeSmall; + self.fillerCountButton.wantsLayer = YES; + self.fillerCountButton.layer.backgroundColor = [[NSColor colorWithWhite:0.2 alpha:0.85] CGColor]; + self.fillerCountButton.layer.cornerRadius = 5; + self.fillerCountButton.translatesAutoresizingMaskIntoConstraints = NO; + self.fillerCountButton.hidden = !self.preferences.editorHighlightFillers; + [self.fillerCountButton addItemWithTitle:@"0 issues"]; + [editorContainer addSubview:self.fillerCountButton]; + [NSLayoutConstraint activateConstraints:@[ + [self.fillerCountButton.trailingAnchor constraintEqualToAnchor:editorContainer.trailingAnchor constant:-4], + [self.fillerCountButton.bottomAnchor constraintEqualToAnchor:editorContainer.bottomAnchor constant:-4], + ]]; + + // Install sidebar (file browser + document outline) + self.sidebarController = [[MPSidebarController alloc] initWithContentView:controller.window.contentView]; + [self.sidebarController installInWindow:controller.window aroundView:self.splitView]; + + // Set file browser root to the directory of the opened file + if (self.fileURL) + [self.sidebarController setRootURL:[self.fileURL URLByDeletingLastPathComponent]]; + + // Listen for heading selection from sidebar + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(sidebarDidSelectHeading:) + name:@"MPSidebarDidSelectHeading" + object:self.sidebarController]; + // These needs to be queued until after the window is shown, so that editor // can have the correct dimention for size-limiting and stuff. See // https://github.com/uranusjr/macdown/issues/236 @@ -456,6 +500,42 @@ - (void)windowControllerDidLoadNib:(NSWindowController *)controller [self setupEditor:nil]; [self redrawDivider]; [self reloadFromLoadedString]; + + // Apply view mode: per-file memory > opened-file preference > default + NSInteger viewMode = -1; + + // Check per-file memory first + if (self.fileURL && self.preferences.rememberViewModePerFile) + { + NSString *filePath = self.fileURL.absoluteString; + NSDictionary *perFileViewModes = [[NSUserDefaults standardUserDefaults] + dictionaryForKey:kMPPerFileViewModeKey]; + NSNumber *savedMode = perFileViewModes[filePath]; + if (savedMode) + viewMode = savedMode.integerValue; + } + + // Fall back to opened-file preference (existing files) or default (new) + if (viewMode < 0) + { + if (self.fileURL) + viewMode = self.preferences.openedFileViewMode; + else + viewMode = self.preferences.defaultViewMode; + } + + if (viewMode == 1) + [self showEditorOnly:nil]; + else if (viewMode == 2) + [self showPreviewOnly:nil]; + + // Apply focus/typewriter mode from preferences + self.editor.focusModeEnabled = self.preferences.editorFocusMode; + self.editor.typewriterModeEnabled = self.preferences.editorTypewriterMode; + + // Apply filler word highlighting if active + if (self.preferences.editorHighlightFillers) + [self updateFillerHighlights]; }]; } @@ -467,6 +547,9 @@ - (void)reloadFromLoadedString self.loadedString = nil; [self.renderer parseAndRenderNow]; [self.highlighter parseAndHighlightNow]; + + // Populate document outline + [self.sidebarController updateHeadingsFromMarkdown:self.editor.string]; } } @@ -684,6 +767,22 @@ - (BOOL)validateUserInterfaceItem:(id)item NSLocalizedString(@"Restore Editor Pane", @"Toggle editor pane menu item"); } + else if (action == @selector(toggleFocusMode:)) + { + ((NSMenuItem *)item).state = self.preferences.editorFocusMode ? NSOnState : NSOffState; + } + else if (action == @selector(toggleTypewriterMode:)) + { + ((NSMenuItem *)item).state = self.preferences.editorTypewriterMode ? NSOnState : NSOffState; + } + else if (action == @selector(toggleSidebar:)) + { + ((NSMenuItem *)item).state = self.sidebarController.sidebarVisible ? NSOnState : NSOffState; + } + else if (action == @selector(toggleProseAnalysis:)) + { + ((NSMenuItem *)item).state = self.preferences.editorHighlightFillers ? NSOnState : NSOffState; + } return result; } @@ -974,7 +1073,13 @@ - (BOOL)rendererLoading { - (NSString *)rendererMarkdown:(MPRenderer *)renderer { - return self.editor.string; + NSString *markdown = self.editor.string; + + // Process WikiLinks: [[target]] and [[target|display]] + NSURL *baseDir = [self.fileURL URLByDeletingLastPathComponent]; + markdown = [MPWikiLinkProcessor processWikiLinksInMarkdown:markdown baseURL:baseDir]; + + return markdown; } - (NSString *)rendererHTMLTitle:(MPRenderer *)renderer @@ -1013,17 +1118,17 @@ - (BOOL)rendererDetectsFrontMatter:(MPRenderer *)renderer - (BOOL)rendererHasSyntaxHighlighting:(MPRenderer *)renderer { - return self.preferences.htmlSyntaxHighlighting; + return YES; } - (BOOL)rendererHasMermaid:(MPRenderer *)renderer { - return self.preferences.htmlMermaid; + return YES; } - (BOOL)rendererHasGraphviz:(MPRenderer *)renderer { - return self.preferences.htmlGraphviz; + return YES; } - (MPCodeBlockAccessoryType)rendererCodeBlockAccesory:(MPRenderer *)renderer @@ -1111,6 +1216,37 @@ - (void)renderer:(MPRenderer *)renderer didProduceHTMLOutput:(NSString *)html } #endif + // Highlight filler words in preview if enabled + if (self.preferences.editorHighlightFillers) + { + html = [MPFillerHighlighter highlightFillersInHTML:html]; + // Inject CSS for categorized highlights + NSString *fillerCSS = @""; + NSRange headEnd = [html rangeOfString:@"" options:NSCaseInsensitiveSearch]; + if (headEnd.location != NSNotFound) + html = [html stringByReplacingCharactersInRange:headEnd + withString:[fillerCSS stringByAppendingString:@""]]; + else + html = [fillerCSS stringByAppendingString:html]; + } + + // Inject WikiLink CSS for all documents + NSString *wikiCSS = @""; + NSRange headEnd2 = [html rangeOfString:@"" options:NSCaseInsensitiveSearch]; + if (headEnd2.location != NSNotFound) + html = [html stringByReplacingCharactersInRange:headEnd2 + withString:[wikiCSS stringByAppendingString:@""]]; + else + html = [wikiCSS stringByAppendingString:html]; + // Reload the page if there's not valid tree to work with. [self.preview.mainFrame loadHTMLString:html baseURL:baseUrl]; self.currentBaseUrl = baseUrl; @@ -1123,6 +1259,13 @@ - (void)editorTextDidChange:(NSNotification *)notification { if (self.needsHtml) [self.renderer parseAndRenderLater]; + + // Update document outline in sidebar + [self.sidebarController updateHeadingsFromMarkdown:self.editor.string]; + + // Update filler word highlights if active + if (self.preferences.editorHighlightFillers) + [self updateFillerHighlights]; } - (void)userDefaultsDidChange:(NSNotification *)notification @@ -1483,6 +1626,273 @@ - (IBAction)toggleEditorPane:(id)sender [self toggleSplitterCollapsingEditorPane:YES]; } +- (IBAction)showEditorOnly:(id)sender +{ + CGFloat ratio = self.preferences.editorOnRight ? 0.0 : 1.0; + [self setSplitViewDividerLocation:ratio]; + [self savePerFileViewMode:1]; +} + +- (IBAction)showPreviewOnly:(id)sender +{ + CGFloat ratio = self.preferences.editorOnRight ? 1.0 : 0.0; + [self setSplitViewDividerLocation:ratio]; + [self savePerFileViewMode:2]; +} + +- (IBAction)showBothPanes:(id)sender +{ + CGFloat ratio = self.previousSplitRatio; + if (ratio <= 0.0 || ratio >= 1.0) + ratio = 0.5; + [self setSplitViewDividerLocation:ratio]; + [self savePerFileViewMode:0]; +} + +- (void)savePerFileViewMode:(NSInteger)mode +{ + if (!self.fileURL || !self.preferences.rememberViewModePerFile) + return; + NSString *filePath = self.fileURL.absoluteString; + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + NSMutableDictionary *perFileViewModes = + [[defaults dictionaryForKey:kMPPerFileViewModeKey] mutableCopy]; + if (!perFileViewModes) + perFileViewModes = [NSMutableDictionary new]; + perFileViewModes[filePath] = @(mode); + [defaults setObject:perFileViewModes forKey:kMPPerFileViewModeKey]; +} + +- (IBAction)toggleSidebar:(id)sender +{ + [self.sidebarController toggleSidebar]; +} + +- (IBAction)toggleFocusMode:(id)sender +{ + BOOL newValue = !self.preferences.editorFocusMode; + self.preferences.editorFocusMode = newValue; + self.editor.focusModeEnabled = newValue; +} + +- (IBAction)toggleTypewriterMode:(id)sender +{ + BOOL newValue = !self.preferences.editorTypewriterMode; + self.preferences.editorTypewriterMode = newValue; + self.editor.typewriterModeEnabled = newValue; +} + +- (IBAction)exportToDOCX:(id)sender +{ + NSSavePanel *panel = [NSSavePanel savePanel]; + panel.allowedFileTypes = @[@"docx"]; + panel.nameFieldStringValue = [[self.fileURL.lastPathComponent stringByDeletingPathExtension] + stringByAppendingPathExtension:@"docx"] ?: @"Untitled.docx"; + + [panel beginSheetModalForWindow:self.windowForSheet completionHandler:^(NSModalResponse result) { + if (result != NSModalResponseOK) + return; + + // Get the rendered HTML and convert to attributed string, then to DOCX + NSString *html = self.renderer.currentHtml; + if (!html) + return; + + NSData *htmlData = [html dataUsingEncoding:NSUTF8StringEncoding]; + NSAttributedString *attrStr = [[NSAttributedString alloc] + initWithHTML:htmlData + baseURL:self.fileURL + documentAttributes:nil]; + + if (!attrStr) + return; + + NSDictionary *docAttrs = @{ + NSDocumentTypeDocumentAttribute: NSOfficeOpenXMLTextDocumentType, + }; + NSError *error = nil; + NSFileWrapper *wrapper = [attrStr fileWrapperFromRange:NSMakeRange(0, attrStr.length) + documentAttributes:docAttrs + error:&error]; + if (wrapper && !error) + [wrapper writeToURL:panel.URL options:NSFileWrapperWritingAtomic + originalContentsURL:nil error:&error]; + + if (error) + { + NSAlert *alert = [NSAlert alertWithError:error]; + [alert runModal]; + } + }]; +} + +- (void)sidebarDidSelectHeading:(NSNotification *)notification +{ + NSRange range = [notification.userInfo[@"range"] rangeValue]; + if (range.location != NSNotFound && self.editor) + { + [self.editor setSelectedRange:NSMakeRange(range.location, 0)]; + [self.editor scrollRangeToVisible:NSMakeRange(range.location, 0)]; + [self.editor.window makeFirstResponder:self.editor]; + } +} + +- (IBAction)showCommandPalette:(id)sender +{ + NSArray *commands = @[ + [MPCommandItem toggleWithTitle:@"Highlight Filler Words" shortcut:@"" action:@selector(toggleProseAnalysis:) target:self isOn:self.preferences.editorHighlightFillers], + [MPCommandItem toggleWithTitle:@"Focus Mode" shortcut:@"\u2325\u2318F" action:@selector(toggleFocusMode:) target:self isOn:self.preferences.editorFocusMode], + [MPCommandItem toggleWithTitle:@"Typewriter Mode" shortcut:@"\u21E7\u2318T" action:@selector(toggleTypewriterMode:) target:self isOn:self.preferences.editorTypewriterMode], + [MPCommandItem toggleWithTitle:@"Toggle Sidebar" shortcut:@"\u2325\u2318S" action:@selector(toggleSidebar:) target:self isOn:self.sidebarController.sidebarVisible], + [MPCommandItem itemWithTitle:@"Show Editor Only" shortcut:@"" action:@selector(showEditorOnly:) target:self], + [MPCommandItem itemWithTitle:@"Show Preview Only" shortcut:@"" action:@selector(showPreviewOnly:) target:self], + [MPCommandItem itemWithTitle:@"Show Editor & Preview" shortcut:@"" action:@selector(showBothPanes:) target:self], + [MPCommandItem itemWithTitle:@"Bold" shortcut:@"\u2318B" action:@selector(toggleStrong:) target:self], + [MPCommandItem itemWithTitle:@"Italic" shortcut:@"\u2318I" action:@selector(toggleEmphasis:) target:self], + [MPCommandItem itemWithTitle:@"Underline" shortcut:@"\u2318U" action:@selector(toggleUnderline:) target:self], + [MPCommandItem itemWithTitle:@"Heading 1" shortcut:@"" action:@selector(convertToH1:) target:self], + [MPCommandItem itemWithTitle:@"Heading 2" shortcut:@"" action:@selector(convertToH2:) target:self], + [MPCommandItem itemWithTitle:@"Heading 3" shortcut:@"" action:@selector(convertToH3:) target:self], + [MPCommandItem itemWithTitle:@"Insert Link" shortcut:@"\u2318K" action:@selector(toggleLink:) target:self], + [MPCommandItem itemWithTitle:@"Insert Image" shortcut:@"" action:@selector(toggleImage:) target:self], + [MPCommandItem itemWithTitle:@"Code Block" shortcut:@"" action:@selector(toggleInlineCode:) target:self], + [MPCommandItem itemWithTitle:@"Blockquote" shortcut:@"" action:@selector(toggleBlockquote:) target:self], + [MPCommandItem itemWithTitle:@"Unordered List" shortcut:@"" action:@selector(toggleUnorderedList:) target:self], + [MPCommandItem itemWithTitle:@"Ordered List" shortcut:@"" action:@selector(toggleOrderedList:) target:self], + [MPCommandItem itemWithTitle:@"Strikethrough" shortcut:@"" action:@selector(toggleStrikethrough:) target:self], + [MPCommandItem itemWithTitle:@"Copy HTML" shortcut:@"\u2325\u2318C" action:@selector(copyHtml:) target:self], + [MPCommandItem itemWithTitle:@"Export HTML..." shortcut:@"\u2325\u2318E" action:@selector(exportHtml:) target:self], + [MPCommandItem itemWithTitle:@"Export PDF..." shortcut:@"\u2325\u2318P" action:@selector(exportPdf:) target:self], + [MPCommandItem itemWithTitle:@"Export DOCX..." shortcut:@"\u2325\u2318D" action:@selector(exportToDOCX:) target:self], + ]; + [MPCommandPalette showForWindow:self.windowForSheet withCommands:commands]; +} + +- (IBAction)toggleProseAnalysis:(id)sender +{ + BOOL newValue = !self.preferences.editorHighlightFillers; + self.preferences.editorHighlightFillers = newValue; + + if (newValue) + { + [self updateFillerHighlights]; + self.fillerCountButton.hidden = NO; + } + else + { + [self clearFillerHighlights]; + self.fillerCountButton.hidden = YES; + } +} + +- (void)updateFillerHighlights +{ + if (!self.preferences.editorHighlightFillers) + return; + + NSString *text = self.editor.string; + NSLayoutManager *lm = self.editor.layoutManager; + NSRange fullRange = NSMakeRange(0, text.length); + + [lm removeTemporaryAttribute:NSBackgroundColorAttributeName + forCharacterRange:fullRange]; + + if (text.length == 0) + { + [self.fillerCountButton removeAllItems]; + [self.fillerCountButton addItemWithTitle:@"0 issues"]; + return; + } + + MPProseAnalysis *analysis = [MPProseAnalysis analyzeText:text]; + + // Color per category + NSColor *qualifierColor = [NSColor colorWithRed:1.0 green:0.95 blue:0.4 alpha:0.45]; // yellow + NSColor *weaselColor = [NSColor colorWithRed:1.0 green:0.7 blue:0.3 alpha:0.45]; // orange + NSColor *indirectColor = [NSColor colorWithRed:1.0 green:0.75 blue:0.85 alpha:0.5]; // pink + NSColor *adverbColor = [NSColor colorWithRed:0.7 green:0.85 blue:1.0 alpha:0.5]; // blue + NSColor *repeatColor = [NSColor colorWithRed:1.0 green:0.5 blue:0.5 alpha:0.4]; // red + + for (MPWordIssue *issue in analysis.issues) + { + if (NSMaxRange(issue.range) > text.length) continue; + + NSColor *color; + switch (issue.type) { + case MPWordIssueQualifier: color = qualifierColor; break; + case MPWordIssueWeasel: color = weaselColor; break; + case MPWordIssueIndirect: color = indirectColor; break; + case MPWordIssueAdverb: color = adverbColor; break; + case MPWordIssueRepeated: color = repeatColor; break; + default: color = qualifierColor; break; + } + + [lm addTemporaryAttribute:NSBackgroundColorAttributeName + value:color + forCharacterRange:issue.range]; + } + + // Populate the dropdown with per-category breakdown using colored dots + NSUInteger total = analysis.issues.count; + [self.fillerCountButton removeAllItems]; + + // Title item (shown in the button) — use attributed string for visibility + NSString *titleStr = [NSString stringWithFormat:@"\u26A0 %lu issues", (unsigned long)total]; + NSAttributedString *titleAttr = [[NSAttributedString alloc] initWithString:titleStr attributes:@{ + NSForegroundColorAttributeName: [NSColor whiteColor], + NSFontAttributeName: [NSFont monospacedDigitSystemFontOfSize:11 weight:NSFontWeightBold], + }]; + [self.fillerCountButton addItemWithTitle:@""]; + self.fillerCountButton.itemArray.firstObject.attributedTitle = titleAttr; + + struct { NSUInteger count; NSString *label; NSColor *color; } rows[] = { + { analysis.qualifierCount, @"qualifiers", [NSColor colorWithRed:0.9 green:0.85 blue:0.0 alpha:1.0] }, + { analysis.weaselCount, @"weasel words", [NSColor orangeColor] }, + { analysis.indirectCount, @"indirect/vague",[NSColor colorWithRed:0.9 green:0.4 blue:0.6 alpha:1.0] }, + { analysis.adverbCount, @"weak adverbs", [NSColor colorWithRed:0.3 green:0.5 blue:0.9 alpha:1.0] }, + { analysis.repeatedCount, @"repeated words",[NSColor colorWithRed:0.9 green:0.3 blue:0.3 alpha:1.0] }, + }; + + for (int i = 0; i < 5; i++) + { + if (rows[i].count == 0) continue; + + NSString *text = [NSString stringWithFormat:@"%lu %@", (unsigned long)rows[i].count, rows[i].label]; + + // Create attributed title with a colored dot + NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] init]; + + // Colored dot + NSDictionary *dotAttrs = @{ + NSForegroundColorAttributeName: rows[i].color, + NSFontAttributeName: [NSFont systemFontOfSize:14], + }; + [attr appendAttributedString:[[NSAttributedString alloc] initWithString:@"\u25CF " attributes:dotAttrs]]; + + // Label text + NSDictionary *textAttrs = @{ + NSForegroundColorAttributeName: [NSColor labelColor], + NSFontAttributeName: [NSFont systemFontOfSize:12], + }; + [attr appendAttributedString:[[NSAttributedString alloc] initWithString:text attributes:textAttrs]]; + + [self.fillerCountButton addItemWithTitle:@""]; + self.fillerCountButton.lastItem.attributedTitle = attr; + } +} + +- (void)clearFillerHighlights +{ + NSString *text = self.editor.string; + if (text.length > 0) + { + [self.editor.layoutManager removeTemporaryAttribute:NSBackgroundColorAttributeName + forCharacterRange:NSMakeRange(0, text.length)]; + } + [self.fillerCountButton removeAllItems]; + [self.fillerCountButton addItemWithTitle:@"0 issues"]; +} + - (IBAction)render:(id)sender { [self.renderer parseAndRenderLater]; @@ -1899,6 +2309,63 @@ - (void)updateWordCount self.totalCharacters = count.characters; self.totalCharactersNoSpaces = count.characterWithoutSpaces; + // Update reading time and readability in word count menu + if (count.words > 0) + { + NSUInteger minutes = count.words / 200; // avg 200 wpm reading speed + NSUInteger seconds = (count.words % 200) * 60 / 200; + NSString *readingTime; + if (minutes > 0) + readingTime = [NSString stringWithFormat:@"~%lu min read", (unsigned long)minutes]; + else + readingTime = [NSString stringWithFormat:@"~%lu sec read", (unsigned long)seconds]; + + // Flesch-Kincaid readability (approximate from word/sentence ratio) + NSString *text = self.editor.string; + NSUInteger sentenceCount = 0; + NSArray *sentenceEnders = @[@".", @"!", @"?"]; + for (NSString *ender in sentenceEnders) + { + NSUInteger searchFrom = 0; + while (searchFrom < text.length) + { + NSRange r = [text rangeOfString:ender + options:0 + range:NSMakeRange(searchFrom, text.length - searchFrom)]; + if (r.location == NSNotFound) break; + sentenceCount++; + searchFrom = r.location + 1; + } + } + if (sentenceCount == 0) sentenceCount = 1; + + CGFloat avgWordsPerSentence = (CGFloat)count.words / sentenceCount; + // Simplified Flesch Reading Ease (without syllable count) + // Uses Coleman-Liau approximation: characters per word as proxy + CGFloat avgCharsPerWord = (CGFloat)count.characterWithoutSpaces / count.words; + CGFloat readability = 206.835 - (1.015 * avgWordsPerSentence) - (84.6 * (avgCharsPerWord / 4.5)); + readability = MAX(0, MIN(100, readability)); + + NSString *level; + if (readability >= 80) level = @"Easy"; + else if (readability >= 60) level = @"Standard"; + else if (readability >= 40) level = @"Moderate"; + else level = @"Complex"; + + // Add stats items if not already present + NSMenu *menu = self.wordCountWidget.menu; + while (menu.numberOfItems > 3) + [menu removeItemAtIndex:menu.numberOfItems - 1]; + + [menu addItem:[NSMenuItem separatorItem]]; + NSMenuItem *timeItem = [[NSMenuItem alloc] initWithTitle:readingTime action:NULL keyEquivalent:@""]; + [menu addItem:timeItem]; + NSMenuItem *readabilityItem = [[NSMenuItem alloc] initWithTitle: + [NSString stringWithFormat:@"%@ (%.0f)", level, readability] + action:NULL keyEquivalent:@""]; + [menu addItem:readabilityItem]; + } + if (self.isPreviewReady) self.wordCountWidget.enabled = YES; } diff --git a/MacDown/Code/Document/MPRenderer.h b/Markly/Code/Document/MPRenderer.h similarity index 100% rename from MacDown/Code/Document/MPRenderer.h rename to Markly/Code/Document/MPRenderer.h diff --git a/MacDown/Code/Document/MPRenderer.m b/Markly/Code/Document/MPRenderer.m similarity index 100% rename from MacDown/Code/Document/MPRenderer.m rename to Markly/Code/Document/MPRenderer.m diff --git a/MacDown/Code/Extension/DOMNode+Text.h b/Markly/Code/Extension/DOMNode+Text.h similarity index 100% rename from MacDown/Code/Extension/DOMNode+Text.h rename to Markly/Code/Extension/DOMNode+Text.h diff --git a/MacDown/Code/Extension/DOMNode+Text.m b/Markly/Code/Extension/DOMNode+Text.m similarity index 100% rename from MacDown/Code/Extension/DOMNode+Text.m rename to Markly/Code/Extension/DOMNode+Text.m diff --git a/MacDown/Code/Extension/NSColor+HTML.h b/Markly/Code/Extension/NSColor+HTML.h similarity index 100% rename from MacDown/Code/Extension/NSColor+HTML.h rename to Markly/Code/Extension/NSColor+HTML.h diff --git a/MacDown/Code/Extension/NSColor+HTML.m b/Markly/Code/Extension/NSColor+HTML.m similarity index 100% rename from MacDown/Code/Extension/NSColor+HTML.m rename to Markly/Code/Extension/NSColor+HTML.m diff --git a/MacDown/Code/Extension/NSDocumentController+Document.h b/Markly/Code/Extension/NSDocumentController+Document.h similarity index 100% rename from MacDown/Code/Extension/NSDocumentController+Document.h rename to Markly/Code/Extension/NSDocumentController+Document.h diff --git a/MacDown/Code/Extension/NSDocumentController+Document.m b/Markly/Code/Extension/NSDocumentController+Document.m similarity index 100% rename from MacDown/Code/Extension/NSDocumentController+Document.m rename to Markly/Code/Extension/NSDocumentController+Document.m diff --git a/MacDown/Code/Extension/NSJSONSerialization+File.h b/Markly/Code/Extension/NSJSONSerialization+File.h similarity index 100% rename from MacDown/Code/Extension/NSJSONSerialization+File.h rename to Markly/Code/Extension/NSJSONSerialization+File.h diff --git a/MacDown/Code/Extension/NSJSONSerialization+File.m b/Markly/Code/Extension/NSJSONSerialization+File.m similarity index 100% rename from MacDown/Code/Extension/NSJSONSerialization+File.m rename to Markly/Code/Extension/NSJSONSerialization+File.m diff --git a/MacDown/Code/Extension/NSObject+HTMLTabularize.h b/Markly/Code/Extension/NSObject+HTMLTabularize.h similarity index 100% rename from MacDown/Code/Extension/NSObject+HTMLTabularize.h rename to Markly/Code/Extension/NSObject+HTMLTabularize.h diff --git a/MacDown/Code/Extension/NSObject+HTMLTabularize.m b/Markly/Code/Extension/NSObject+HTMLTabularize.m similarity index 100% rename from MacDown/Code/Extension/NSObject+HTMLTabularize.m rename to Markly/Code/Extension/NSObject+HTMLTabularize.m diff --git a/MacDown/Code/Extension/NSPasteboard+Types.h b/Markly/Code/Extension/NSPasteboard+Types.h similarity index 100% rename from MacDown/Code/Extension/NSPasteboard+Types.h rename to Markly/Code/Extension/NSPasteboard+Types.h diff --git a/MacDown/Code/Extension/NSPasteboard+Types.m b/Markly/Code/Extension/NSPasteboard+Types.m similarity index 100% rename from MacDown/Code/Extension/NSPasteboard+Types.m rename to Markly/Code/Extension/NSPasteboard+Types.m diff --git a/MacDown/Code/Extension/NSString+Lookup.h b/Markly/Code/Extension/NSString+Lookup.h similarity index 100% rename from MacDown/Code/Extension/NSString+Lookup.h rename to Markly/Code/Extension/NSString+Lookup.h diff --git a/MacDown/Code/Extension/NSString+Lookup.m b/Markly/Code/Extension/NSString+Lookup.m similarity index 100% rename from MacDown/Code/Extension/NSString+Lookup.m rename to Markly/Code/Extension/NSString+Lookup.m diff --git a/MacDown/Code/Extension/NSTextView+Autocomplete.h b/Markly/Code/Extension/NSTextView+Autocomplete.h similarity index 100% rename from MacDown/Code/Extension/NSTextView+Autocomplete.h rename to Markly/Code/Extension/NSTextView+Autocomplete.h diff --git a/MacDown/Code/Extension/NSTextView+Autocomplete.m b/Markly/Code/Extension/NSTextView+Autocomplete.m similarity index 100% rename from MacDown/Code/Extension/NSTextView+Autocomplete.m rename to Markly/Code/Extension/NSTextView+Autocomplete.m diff --git a/MacDown/Code/Extension/NSUserDefaults+Suite.h b/Markly/Code/Extension/NSUserDefaults+Suite.h similarity index 100% rename from MacDown/Code/Extension/NSUserDefaults+Suite.h rename to Markly/Code/Extension/NSUserDefaults+Suite.h diff --git a/MacDown/Code/Extension/NSUserDefaults+Suite.m b/Markly/Code/Extension/NSUserDefaults+Suite.m similarity index 100% rename from MacDown/Code/Extension/NSUserDefaults+Suite.m rename to Markly/Code/Extension/NSUserDefaults+Suite.m diff --git a/MacDown/Code/Extension/WebView+WebViewPrivateHeaders.h b/Markly/Code/Extension/WebView+WebViewPrivateHeaders.h similarity index 100% rename from MacDown/Code/Extension/WebView+WebViewPrivateHeaders.h rename to Markly/Code/Extension/WebView+WebViewPrivateHeaders.h diff --git a/MacDown/Code/Extension/hoedown_html_patch.c b/Markly/Code/Extension/hoedown_html_patch.c similarity index 100% rename from MacDown/Code/Extension/hoedown_html_patch.c rename to Markly/Code/Extension/hoedown_html_patch.c diff --git a/MacDown/Code/Extension/hoedown_html_patch.h b/Markly/Code/Extension/hoedown_html_patch.h similarity index 100% rename from MacDown/Code/Extension/hoedown_html_patch.h rename to Markly/Code/Extension/hoedown_html_patch.h diff --git a/MacDown/Code/MacDown-Prefix.pch b/Markly/Code/MacDown-Prefix.pch similarity index 100% rename from MacDown/Code/MacDown-Prefix.pch rename to Markly/Code/MacDown-Prefix.pch diff --git a/MacDown/Code/Preferences/MPEditorPreferencesViewController.h b/Markly/Code/Preferences/MPEditorPreferencesViewController.h similarity index 100% rename from MacDown/Code/Preferences/MPEditorPreferencesViewController.h rename to Markly/Code/Preferences/MPEditorPreferencesViewController.h diff --git a/MacDown/Code/Preferences/MPEditorPreferencesViewController.m b/Markly/Code/Preferences/MPEditorPreferencesViewController.m similarity index 100% rename from MacDown/Code/Preferences/MPEditorPreferencesViewController.m rename to Markly/Code/Preferences/MPEditorPreferencesViewController.m diff --git a/MacDown/Code/Preferences/MPGeneralPreferencesViewController.h b/Markly/Code/Preferences/MPGeneralPreferencesViewController.h similarity index 100% rename from MacDown/Code/Preferences/MPGeneralPreferencesViewController.h rename to Markly/Code/Preferences/MPGeneralPreferencesViewController.h diff --git a/MacDown/Code/Preferences/MPGeneralPreferencesViewController.m b/Markly/Code/Preferences/MPGeneralPreferencesViewController.m similarity index 60% rename from MacDown/Code/Preferences/MPGeneralPreferencesViewController.m rename to Markly/Code/Preferences/MPGeneralPreferencesViewController.m index bd1ff757..8d978a6b 100644 --- a/MacDown/Code/Preferences/MPGeneralPreferencesViewController.m +++ b/Markly/Code/Preferences/MPGeneralPreferencesViewController.m @@ -12,11 +12,20 @@ @interface MPGeneralPreferencesViewController () @property (weak) IBOutlet NSButton *autoRenderingToggle; +@property (weak) IBOutlet NSPopUpButton *defaultViewModePopup; +@property (weak) IBOutlet NSPopUpButton *openedFileViewModePopup; @end @implementation MPGeneralPreferencesViewController +- (void)viewDidLoad +{ + [super viewDidLoad]; + [self.defaultViewModePopup selectItemWithTag:self.preferences.defaultViewMode]; + [self.openedFileViewModePopup selectItemWithTag:self.preferences.openedFileViewMode]; +} + #pragma mark - MASPreferencesViewController - (NSString *)viewIdentifier @@ -37,6 +46,16 @@ - (NSString *)toolbarItemLabel #pragma mark - IBAction +- (IBAction)defaultViewModeChanged:(id)sender +{ + self.preferences.defaultViewMode = self.defaultViewModePopup.selectedTag; +} + +- (IBAction)openedFileViewModeChanged:(id)sender +{ + self.preferences.openedFileViewMode = self.openedFileViewModePopup.selectedTag; +} + - (IBAction)updateWordCounterVisibility:(id)sender { if (sender == self.autoRenderingToggle) diff --git a/MacDown/Code/Preferences/MPHtmlPreferencesViewController.h b/Markly/Code/Preferences/MPHtmlPreferencesViewController.h similarity index 100% rename from MacDown/Code/Preferences/MPHtmlPreferencesViewController.h rename to Markly/Code/Preferences/MPHtmlPreferencesViewController.h diff --git a/MacDown/Code/Preferences/MPHtmlPreferencesViewController.m b/Markly/Code/Preferences/MPHtmlPreferencesViewController.m similarity index 100% rename from MacDown/Code/Preferences/MPHtmlPreferencesViewController.m rename to Markly/Code/Preferences/MPHtmlPreferencesViewController.m diff --git a/MacDown/Code/Preferences/MPMarkdownPreferencesViewController.h b/Markly/Code/Preferences/MPMarkdownPreferencesViewController.h similarity index 100% rename from MacDown/Code/Preferences/MPMarkdownPreferencesViewController.h rename to Markly/Code/Preferences/MPMarkdownPreferencesViewController.h diff --git a/MacDown/Code/Preferences/MPMarkdownPreferencesViewController.m b/Markly/Code/Preferences/MPMarkdownPreferencesViewController.m similarity index 100% rename from MacDown/Code/Preferences/MPMarkdownPreferencesViewController.m rename to Markly/Code/Preferences/MPMarkdownPreferencesViewController.m diff --git a/MacDown/Code/Preferences/MPPreferences.h b/Markly/Code/Preferences/MPPreferences.h similarity index 85% rename from MacDown/Code/Preferences/MPPreferences.h rename to Markly/Code/Preferences/MPPreferences.h index e14d2621..08ff4916 100644 --- a/MacDown/Code/Preferences/MPPreferences.h +++ b/Markly/Code/Preferences/MPPreferences.h @@ -19,6 +19,12 @@ extern NSString * const MPDidDetectFreshInstallationNotification; @property (assign) BOOL updateIncludesPreReleases; @property (assign) BOOL supressesUntitledDocumentOnLaunch; @property (assign) BOOL createFileForLinkTarget; +@property (assign) NSInteger defaultViewMode; // 0=Both, 1=Editor Only, 2=Preview Only +@property (assign) NSInteger openedFileViewMode; // View mode for existing files: 0=Both, 1=Editor, 2=Preview +@property (assign) BOOL rememberViewModePerFile; // Remember per-file view mode +@property (assign) BOOL editorFocusMode; // Focus mode: dim non-active paragraph +@property (assign) BOOL editorTypewriterMode; // Typewriter mode: keep cursor centered +@property (assign) BOOL editorHighlightFillers; // Highlight filler words // Extension flags. @property (assign) BOOL extensionIntraEmphasis; diff --git a/MacDown/Code/Preferences/MPPreferences.m b/Markly/Code/Preferences/MPPreferences.m similarity index 95% rename from MacDown/Code/Preferences/MPPreferences.m rename to Markly/Code/Preferences/MPPreferences.m index 4f54f8e9..952c3b1c 100644 --- a/MacDown/Code/Preferences/MPPreferences.m +++ b/Markly/Code/Preferences/MPPreferences.m @@ -75,6 +75,11 @@ - (instancetype)init @dynamic updateIncludesPreReleases; @dynamic supressesUntitledDocumentOnLaunch; @dynamic createFileForLinkTarget; +@dynamic openedFileViewMode; +@dynamic rememberViewModePerFile; +@dynamic editorFocusMode; +@dynamic editorTypewriterMode; +@dynamic editorHighlightFillers; @dynamic extensionIntraEmphasis; @dynamic extensionTables; @@ -283,6 +288,10 @@ - (void)loadDefaultUserDefaults self.editorInsertPrefixInBlock = YES; if (![defaults objectForKey:@"htmlTemplateName"]) self.htmlTemplateName = @"Default"; + if (![defaults objectForKey:@"openedFileViewMode"]) + self.openedFileViewMode = 2; // Preview only for opened files + if (![defaults objectForKey:@"rememberViewModePerFile"]) + self.rememberViewModePerFile = YES; } @end diff --git a/MacDown/Code/Preferences/MPPreferencesViewController.h b/Markly/Code/Preferences/MPPreferencesViewController.h similarity index 100% rename from MacDown/Code/Preferences/MPPreferencesViewController.h rename to Markly/Code/Preferences/MPPreferencesViewController.h diff --git a/MacDown/Code/Preferences/MPPreferencesViewController.m b/Markly/Code/Preferences/MPPreferencesViewController.m similarity index 100% rename from MacDown/Code/Preferences/MPPreferencesViewController.m rename to Markly/Code/Preferences/MPPreferencesViewController.m diff --git a/MacDown/Code/Preferences/MPTerminalPreferencesViewController.h b/Markly/Code/Preferences/MPTerminalPreferencesViewController.h similarity index 100% rename from MacDown/Code/Preferences/MPTerminalPreferencesViewController.h rename to Markly/Code/Preferences/MPTerminalPreferencesViewController.h diff --git a/MacDown/Code/Preferences/MPTerminalPreferencesViewController.m b/Markly/Code/Preferences/MPTerminalPreferencesViewController.m similarity index 100% rename from MacDown/Code/Preferences/MPTerminalPreferencesViewController.m rename to Markly/Code/Preferences/MPTerminalPreferencesViewController.m diff --git a/MacDown/Code/Utility/MPAutosaving.h b/Markly/Code/Utility/MPAutosaving.h similarity index 100% rename from MacDown/Code/Utility/MPAutosaving.h rename to Markly/Code/Utility/MPAutosaving.h diff --git a/MacDown/Code/Utility/MPGlobals.h b/Markly/Code/Utility/MPGlobals.h similarity index 57% rename from MacDown/Code/Utility/MPGlobals.h rename to Markly/Code/Utility/MPGlobals.h index a54e1f05..3460b218 100644 --- a/MacDown/Code/Utility/MPGlobals.h +++ b/Markly/Code/Utility/MPGlobals.h @@ -9,21 +9,22 @@ #import "version.h" // These should match the main bundle's values. -static NSString * const kMPApplicationName = @"MacDown"; +static NSString * const kMPApplicationName = @"Markly"; #ifdef DEBUG -static NSString * const kMPApplicationBundleIdentifier = @"com.uranusjr.macdown-debug"; +static NSString * const kMPApplicationBundleIdentifier = @"com.markly.app-debug"; #else -static NSString * const kMPApplicationBundleIdentifier = @"com.uranusjr.macdown"; +static NSString * const kMPApplicationBundleIdentifier = @"com.markly.app"; #endif -static NSString * const kMPApplicationSuiteName = @"com.uranusjr.macdown"; +static NSString * const kMPApplicationSuiteName = @"com.markly.app"; -static NSString * const MPCommandInstallationPath = @"/usr/local/bin/macdown"; -static NSString * const kMPCommandName = @"macdown"; +static NSString * const MPCommandInstallationPath = @"/usr/local/bin/markly"; +static NSString * const kMPCommandName = @"markly"; static NSString * const kMPHelpKey = @"help"; static NSString * const kMPVersionKey = @"version"; static NSString * const kMPFilesToOpenKey = @"filesToOpenOnNextLaunch"; static NSString * const kMPPipedContentFileToOpen = @"pipedContentFileToOpenOnNextLaunch"; +static NSString * const kMPPerFileViewModeKey = @"perFileViewModes"; diff --git a/MacDown/Code/Utility/MPHomebrewSubprocessController.h b/Markly/Code/Utility/MPHomebrewSubprocessController.h similarity index 100% rename from MacDown/Code/Utility/MPHomebrewSubprocessController.h rename to Markly/Code/Utility/MPHomebrewSubprocessController.h diff --git a/MacDown/Code/Utility/MPHomebrewSubprocessController.m b/Markly/Code/Utility/MPHomebrewSubprocessController.m similarity index 100% rename from MacDown/Code/Utility/MPHomebrewSubprocessController.m rename to Markly/Code/Utility/MPHomebrewSubprocessController.m diff --git a/MacDown/Code/Utility/MPMathJaxListener.h b/Markly/Code/Utility/MPMathJaxListener.h similarity index 100% rename from MacDown/Code/Utility/MPMathJaxListener.h rename to Markly/Code/Utility/MPMathJaxListener.h diff --git a/MacDown/Code/Utility/MPMathJaxListener.m b/Markly/Code/Utility/MPMathJaxListener.m similarity index 100% rename from MacDown/Code/Utility/MPMathJaxListener.m rename to Markly/Code/Utility/MPMathJaxListener.m diff --git a/MacDown/Code/Utility/MPPlugIn.h b/Markly/Code/Utility/MPPlugIn.h similarity index 100% rename from MacDown/Code/Utility/MPPlugIn.h rename to Markly/Code/Utility/MPPlugIn.h diff --git a/MacDown/Code/Utility/MPPlugIn.m b/Markly/Code/Utility/MPPlugIn.m similarity index 100% rename from MacDown/Code/Utility/MPPlugIn.m rename to Markly/Code/Utility/MPPlugIn.m diff --git a/MacDown/Code/Utility/MPUtilities.h b/Markly/Code/Utility/MPUtilities.h similarity index 100% rename from MacDown/Code/Utility/MPUtilities.h rename to Markly/Code/Utility/MPUtilities.h diff --git a/MacDown/Code/Utility/MPUtilities.m b/Markly/Code/Utility/MPUtilities.m similarity index 100% rename from MacDown/Code/Utility/MPUtilities.m rename to Markly/Code/Utility/MPUtilities.m diff --git a/Markly/Code/Utility/MPWritingTools.h b/Markly/Code/Utility/MPWritingTools.h new file mode 100644 index 00000000..e9a83be7 --- /dev/null +++ b/Markly/Code/Utility/MPWritingTools.h @@ -0,0 +1,43 @@ +// +// MPWritingTools.h +// Markly +// + +#import + +// Word issue categories +typedef NS_ENUM(NSUInteger, MPWordIssueType) { + MPWordIssueQualifier, // unnecessary qualifiers: actually, really, very, basically + MPWordIssueWeasel, // weasel words: should, might, could, significant, better + MPWordIssueIndirect, // indirect language: believe, in general, would like to + MPWordIssueAdverb, // adverbs that weaken: quickly, slowly, extremely + MPWordIssueRepeated, // repeated consecutive words +}; + +// A single flagged word with its type and range +@interface MPWordIssue : NSObject +@property (nonatomic, strong) NSString *word; +@property (nonatomic) MPWordIssueType type; +@property (nonatomic) NSRange range; +@end + +// WikiLink processing +@interface MPWikiLinkProcessor : NSObject ++ (NSString *)processWikiLinksInMarkdown:(NSString *)markdown baseURL:(NSURL *)baseURL; +@end + +// Filler word highlighting in HTML +@interface MPFillerHighlighter : NSObject ++ (NSString *)highlightFillersInHTML:(NSString *)html; +@end + +// Prose quality analysis +@interface MPProseAnalysis : NSObject +@property (nonatomic, strong) NSArray *issues; +@property (nonatomic) NSUInteger qualifierCount; +@property (nonatomic) NSUInteger weaselCount; +@property (nonatomic) NSUInteger indirectCount; +@property (nonatomic) NSUInteger adverbCount; +@property (nonatomic) NSUInteger repeatedCount; ++ (MPProseAnalysis *)analyzeText:(NSString *)text; +@end diff --git a/Markly/Code/Utility/MPWritingTools.m b/Markly/Code/Utility/MPWritingTools.m new file mode 100644 index 00000000..0499546f --- /dev/null +++ b/Markly/Code/Utility/MPWritingTools.m @@ -0,0 +1,349 @@ +// +// MPWritingTools.m +// Markly +// + +#import "MPWritingTools.h" + + +#pragma mark - MPWordIssue + +@implementation MPWordIssue +@end + + +#pragma mark - WikiLink Processor + +@implementation MPWikiLinkProcessor + ++ (NSString *)processWikiLinksInMarkdown:(NSString *)markdown baseURL:(NSURL *)baseURL +{ + if (!markdown.length) + return markdown; + + static NSRegularExpression *wikiLinkRegex = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + wikiLinkRegex = [NSRegularExpression regularExpressionWithPattern: + @"\\[\\[([^\\]|]+?)(?:\\|([^\\]]+?))?\\]\\]" + options:0 error:nil]; + }); + + NSMutableString *result = [markdown mutableCopy]; + NSArray *matches = [wikiLinkRegex matchesInString:markdown options:0 + range:NSMakeRange(0, markdown.length)]; + + for (NSTextCheckingResult *match in [matches reverseObjectEnumerator]) + { + NSString *target = [markdown substringWithRange:[match rangeAtIndex:1]]; + NSString *display = nil; + if ([match rangeAtIndex:2].location != NSNotFound) + display = [markdown substringWithRange:[match rangeAtIndex:2]]; + else + display = target; + + NSString *filename = target; + if (![filename.pathExtension isEqualToString:@"md"] && + ![filename.pathExtension isEqualToString:@"markdown"]) + filename = [filename stringByAppendingPathExtension:@"md"]; + + NSString *link; + if (baseURL) + { + NSURL *targetURL = [baseURL URLByAppendingPathComponent:filename]; + BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:targetURL.path]; + NSString *cssClass = exists ? @"wikilink" : @"wikilink wikilink-new"; + link = [NSString stringWithFormat:@"%@", + filename, cssClass, display]; + } + else + { + // No base URL (unsaved doc) — mark as missing + link = [NSString stringWithFormat:@"%@", + filename, display]; + } + + [result replaceCharactersInRange:match.range withString:link]; + } + + return result; +} + +@end + + +#pragma mark - Word Categories + +// Unnecessary qualifiers — words that add no meaning +static NSDictionary *MPWordCategories() +{ + static NSDictionary *categories = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + // Unnecessary qualifiers (yellow) — Amazon: "delete unnecessary qualifiers" + NSSet *qualifiers = [NSSet setWithArray:@[ + @"actually", @"basically", @"certainly", @"clearly", @"definitely", + @"effectively", @"essentially", @"extremely", @"fairly", @"frankly", + @"honestly", @"hopefully", @"importantly", @"incredibly", @"indeed", + @"interestingly", @"ironically", @"just", @"largely", @"literally", + @"merely", @"mostly", @"naturally", @"notably", @"obviously", + @"overall", @"particularly", @"personally", @"practically", + @"presumably", @"pretty", @"primarily", @"quite", @"rather", + @"really", @"relatively", @"seriously", @"simply", @"slightly", + @"somewhat", @"specifically", @"strongly", @"surely", @"technically", + @"totally", @"truly", @"typically", @"ultimately", @"undoubtedly", + @"unfortunately", @"unnecessarily", @"utterly", @"very", @"virtually", + ]]; + + // Weasel words (orange) — Amazon: "replace weasel words with data" + NSSet *weasels = [NSSet setWithArray:@[ + @"should", @"might", @"could", @"often", @"generally", @"usually", + @"probably", @"significant", @"significantly", @"better", @"worse", + @"soon", @"some", @"most", @"fewer", @"faster", @"slower", + @"higher", @"lower", @"many", @"few", @"more", @"less", + @"several", @"numerous", @"various", @"approximately", + @"roughly", @"nearly", @"almost", @"around", + ]]; + + // Indirect/vague language (pink) — Amazon: "remove indirect language" + NSSet *indirect = [NSSet setWithArray:@[ + @"believe", @"think", @"feel", @"seems", @"appears", @"perhaps", + @"maybe", @"possibly", @"conceivably", @"arguably", @"seemingly", + @"supposedly", @"allegedly", @"reportedly", @"apparently", + @"stuff", @"thing", @"things", @"complex", + ]]; + + // Weak adverbs (blue) — Amazon: "remove adverbs and adjectives" + NSSet *adverbs = [NSSet setWithArray:@[ + @"quickly", @"slowly", @"greatly", @"highly", @"deeply", + @"vastly", @"remarkably", @"tremendously", @"immensely", + @"exceedingly", @"enormously", @"drastically", @"substantially", + @"considerably", @"massively", @"fundamentally", @"profoundly", + ]]; + + categories = @{ + @(MPWordIssueQualifier): qualifiers, + @(MPWordIssueWeasel): weasels, + @(MPWordIssueIndirect): indirect, + @(MPWordIssueAdverb): adverbs, + }; + }); + return categories; +} + +// Flat set of ALL flagged words for HTML highlighting +static NSSet *MPAllFlaggedWords() +{ + static NSSet *all = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + NSMutableSet *combined = [NSMutableSet set]; + for (NSSet *cat in [MPWordCategories() allValues]) + [combined unionSet:cat]; + all = [combined copy]; + }); + return all; +} + + +#pragma mark - Prose Analysis + +@implementation MPProseAnalysis + ++ (MPProseAnalysis *)analyzeText:(NSString *)text +{ + MPProseAnalysis *analysis = [[MPProseAnalysis alloc] init]; + NSMutableArray *issues = [NSMutableArray array]; + + if (!text.length) + { + analysis.issues = issues; + return analysis; + } + + NSDictionary *categories = MPWordCategories(); + + static NSRegularExpression *wordRegex = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + wordRegex = [NSRegularExpression regularExpressionWithPattern:@"\\b[a-zA-Z]+\\b" + options:0 error:nil]; + }); + + NSArray *matches = [wordRegex matchesInString:text options:0 + range:NSMakeRange(0, text.length)]; + + NSUInteger qualCount = 0, weaselCount = 0, indirectCount = 0, adverbCount = 0, repeatCount = 0; + NSString *prevWord = nil; + + for (NSTextCheckingResult *match in matches) + { + NSRange range = match.range; + NSString *word = [[text substringWithRange:range] lowercaseString]; + + // Check each category + BOOL found = NO; + for (NSNumber *typeNum in categories) + { + NSSet *wordSet = categories[typeNum]; + if ([wordSet containsObject:word]) + { + MPWordIssue *issue = [[MPWordIssue alloc] init]; + issue.word = word; + issue.type = typeNum.unsignedIntegerValue; + issue.range = range; + [issues addObject:issue]; + + switch (issue.type) { + case MPWordIssueQualifier: qualCount++; break; + case MPWordIssueWeasel: weaselCount++; break; + case MPWordIssueIndirect: indirectCount++; break; + case MPWordIssueAdverb: adverbCount++; break; + default: break; + } + found = YES; + break; // one category per word + } + } + + // Repeated consecutive words + if (prevWord && [prevWord isEqualToString:word] && word.length > 1) + { + MPWordIssue *issue = [[MPWordIssue alloc] init]; + issue.word = word; + issue.type = MPWordIssueRepeated; + issue.range = range; + [issues addObject:issue]; + repeatCount++; + } + + prevWord = word; + } + + analysis.issues = issues; + analysis.qualifierCount = qualCount; + analysis.weaselCount = weaselCount; + analysis.indirectCount = indirectCount; + analysis.adverbCount = adverbCount; + analysis.repeatedCount = repeatCount; + return analysis; +} + +@end + + +#pragma mark - Filler Highlighter for HTML + +@implementation MPFillerHighlighter + ++ (NSString *)highlightFillersInHTML:(NSString *)html +{ + if (!html.length) + return html; + + NSSet *allWords = MPAllFlaggedWords(); + NSDictionary *categories = MPWordCategories(); + + // Build per-category regexes with different CSS classes + // For HTML we use a combined regex and assign class based on lookup + NSString *pattern = [NSString stringWithFormat:@"\\b(%@)\\b", + [[allWords allObjects] componentsJoinedByString:@"|"]]; + + NSRegularExpression *regex = [NSRegularExpression + regularExpressionWithPattern:pattern + options:NSRegularExpressionCaseInsensitive + error:nil]; + + NSMutableString *result = [NSMutableString string]; + NSRegularExpression *tagRegex = [NSRegularExpression + regularExpressionWithPattern:@"(<[^>]*>)" + options:0 error:nil]; + + NSArray *tagMatches = [tagRegex matchesInString:html options:0 + range:NSMakeRange(0, html.length)]; + + NSUInteger lastEnd = 0; + BOOL insideCode = NO; + + for (NSTextCheckingResult *tagMatch in tagMatches) + { + if (tagMatch.range.location > lastEnd) + { + NSRange textRange = NSMakeRange(lastEnd, tagMatch.range.location - lastEnd); + NSString *textPart = [html substringWithRange:textRange]; + + if (!insideCode) + { + // Replace each match with colored mark based on category + NSMutableString *highlighted = [textPart mutableCopy]; + NSArray *wordMatches = [regex matchesInString:textPart options:0 + range:NSMakeRange(0, textPart.length)]; + for (NSTextCheckingResult *wm in [wordMatches reverseObjectEnumerator]) + { + NSString *word = [[textPart substringWithRange:wm.range] lowercaseString]; + NSString *cssClass = @"weasel-qual"; // default + for (NSNumber *typeNum in categories) + { + if ([categories[typeNum] containsObject:word]) + { + switch (typeNum.unsignedIntegerValue) { + case MPWordIssueQualifier: cssClass = @"weasel-qual"; break; + case MPWordIssueWeasel: cssClass = @"weasel-weasel"; break; + case MPWordIssueIndirect: cssClass = @"weasel-indirect"; break; + case MPWordIssueAdverb: cssClass = @"weasel-adverb"; break; + default: break; + } + break; + } + } + NSString *original = [textPart substringWithRange:wm.range]; + NSString *replacement = [NSString stringWithFormat: + @"%@", cssClass, original]; + [highlighted replaceCharactersInRange:wm.range withString:replacement]; + } + [result appendString:highlighted]; + } + else + { + [result appendString:textPart]; + } + } + + NSString *tag = [html substringWithRange:tagMatch.range]; + [result appendString:tag]; + + NSString *tagLower = tag.lowercaseString; + if ([tagLower hasPrefix:@"%@", original]]; + } + [result appendString:highlighted]; + } + else + { + [result appendString:textPart]; + } + } + + return result; +} + +@end diff --git a/Markly/Code/View/MPCommandPalette.h b/Markly/Code/View/MPCommandPalette.h new file mode 100644 index 00000000..27788937 --- /dev/null +++ b/Markly/Code/View/MPCommandPalette.h @@ -0,0 +1,22 @@ +// +// MPCommandPalette.h +// Markly +// + +#import + +@interface MPCommandItem : NSObject +@property (nonatomic, strong) NSString *title; +@property (nonatomic, strong) NSString *shortcut; +@property (nonatomic) SEL action; +@property (nonatomic, weak) id target; +@property (nonatomic) BOOL isOn; ++ (MPCommandItem *)itemWithTitle:(NSString *)title shortcut:(NSString *)shortcut action:(SEL)action target:(id)target; ++ (MPCommandItem *)toggleWithTitle:(NSString *)title shortcut:(NSString *)shortcut action:(SEL)action target:(id)target isOn:(BOOL)isOn; +@end + +@interface MPCommandPalette : NSWindowController + ++ (void)showForWindow:(NSWindow *)parentWindow withCommands:(NSArray *)commands; + +@end diff --git a/Markly/Code/View/MPCommandPalette.m b/Markly/Code/View/MPCommandPalette.m new file mode 100644 index 00000000..f7769c20 --- /dev/null +++ b/Markly/Code/View/MPCommandPalette.m @@ -0,0 +1,243 @@ +// +// MPCommandPalette.m +// Markly +// + +#import "MPCommandPalette.h" +#import + +static CGFloat const kPaletteWidth = 500; +static CGFloat const kPaletteRowHeight = 28; +static CGFloat const kPaletteMaxVisibleRows = 12; + + +@implementation MPCommandItem + ++ (MPCommandItem *)itemWithTitle:(NSString *)title shortcut:(NSString *)shortcut action:(SEL)action target:(id)target +{ + MPCommandItem *item = [[MPCommandItem alloc] init]; + item.title = title; + item.shortcut = shortcut; + item.action = action; + item.target = target; + item.isOn = NO; + return item; +} + ++ (MPCommandItem *)toggleWithTitle:(NSString *)title shortcut:(NSString *)shortcut action:(SEL)action target:(id)target isOn:(BOOL)isOn +{ + MPCommandItem *item = [self itemWithTitle:title shortcut:shortcut action:action target:target]; + item.isOn = isOn; + return item; +} + +@end + + +@interface MPCommandPalette () +@property (nonatomic, strong) NSTextField *searchField; +@property (nonatomic, strong) NSTableView *tableView; +@property (nonatomic, strong) NSScrollView *scrollView; +@property (nonatomic, strong) NSArray *allCommands; +@property (nonatomic, strong) NSArray *filteredCommands; +@end + + +@implementation MPCommandPalette + ++ (void)showForWindow:(NSWindow *)parentWindow withCommands:(NSArray *)commands +{ + // Create a panel-style window + NSRect parentFrame = parentWindow.frame; + CGFloat panelHeight = 44 + MIN(commands.count, kPaletteMaxVisibleRows) * kPaletteRowHeight; + CGFloat x = parentFrame.origin.x + (parentFrame.size.width - kPaletteWidth) / 2; + CGFloat y = parentFrame.origin.y + parentFrame.size.height - panelHeight - 80; + NSRect frame = NSMakeRect(x, y, kPaletteWidth, panelHeight); + + NSPanel *panel = [[NSPanel alloc] initWithContentRect:frame + styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskFullSizeContentView + backing:NSBackingStoreBuffered defer:NO]; + panel.titleVisibility = NSWindowTitleHidden; + panel.titlebarAppearsTransparent = YES; + panel.movableByWindowBackground = YES; + panel.level = NSFloatingWindowLevel; + panel.becomesKeyOnlyIfNeeded = NO; + + MPCommandPalette *controller = [[MPCommandPalette alloc] initWithWindow:panel]; + controller.allCommands = commands; + controller.filteredCommands = commands; + + // Search field + controller.searchField = [[NSTextField alloc] initWithFrame:NSMakeRect(12, panelHeight - 36, kPaletteWidth - 24, 28)]; + controller.searchField.placeholderString = @"Type a command..."; + controller.searchField.font = [NSFont systemFontOfSize:16]; + controller.searchField.bezelStyle = NSTextFieldRoundedBezel; + controller.searchField.focusRingType = NSFocusRingTypeNone; + controller.searchField.delegate = controller; + [panel.contentView addSubview:controller.searchField]; + + // Table in scroll view + CGFloat tableHeight = panelHeight - 44; + controller.scrollView = [[NSScrollView alloc] initWithFrame:NSMakeRect(0, 0, kPaletteWidth, tableHeight)]; + controller.scrollView.hasVerticalScroller = YES; + controller.scrollView.autohidesScrollers = YES; + controller.scrollView.borderType = NSNoBorder; + + controller.tableView = [[NSTableView alloc] initWithFrame:NSZeroRect]; + controller.tableView.headerView = nil; + controller.tableView.rowHeight = kPaletteRowHeight; + controller.tableView.selectionHighlightStyle = NSTableViewSelectionHighlightStyleRegular; + controller.tableView.dataSource = controller; + controller.tableView.delegate = controller; + controller.tableView.doubleAction = @selector(executeSelected:); + controller.tableView.target = controller; + + NSTableColumn *titleCol = [[NSTableColumn alloc] initWithIdentifier:@"title"]; + titleCol.width = kPaletteWidth - 120; + [controller.tableView addTableColumn:titleCol]; + + NSTableColumn *shortcutCol = [[NSTableColumn alloc] initWithIdentifier:@"shortcut"]; + shortcutCol.width = 100; + [controller.tableView addTableColumn:shortcutCol]; + + controller.scrollView.documentView = controller.tableView; + [panel.contentView addSubview:controller.scrollView]; + + if (controller.filteredCommands.count > 0) + [controller.tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO]; + + // Keep controller alive while panel is visible + objc_setAssociatedObject(panel, "controller", controller, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + + [parentWindow addChildWindow:panel ordered:NSWindowAbove]; + [panel makeKeyAndOrderFront:nil]; + [panel makeFirstResponder:controller.searchField]; + + // Close on escape or losing focus + [[NSNotificationCenter defaultCenter] addObserverForName:NSWindowDidResignKeyNotification + object:panel queue:nil usingBlock:^(NSNotification *note) { + [panel.parentWindow removeChildWindow:panel]; + [panel orderOut:nil]; + }]; +} + +- (void)controlTextDidChange:(NSNotification *)notification +{ + NSString *query = self.searchField.stringValue.lowercaseString; + if (query.length == 0) + { + self.filteredCommands = self.allCommands; + } + else + { + NSMutableArray *filtered = [NSMutableArray array]; + for (MPCommandItem *cmd in self.allCommands) + { + if ([cmd.title.lowercaseString containsString:query]) + [filtered addObject:cmd]; + } + self.filteredCommands = filtered; + } + [self.tableView reloadData]; + if (self.filteredCommands.count > 0) + [self.tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO]; +} + +- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector +{ + if (commandSelector == @selector(moveDown:)) + { + NSInteger row = self.tableView.selectedRow + 1; + if (row < (NSInteger)self.filteredCommands.count) + [self.tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; + return YES; + } + if (commandSelector == @selector(moveUp:)) + { + NSInteger row = self.tableView.selectedRow - 1; + if (row >= 0) + [self.tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; + return YES; + } + if (commandSelector == @selector(insertNewline:)) + { + [self executeSelected:nil]; + return YES; + } + if (commandSelector == @selector(cancelOperation:)) + { + [self.window.parentWindow removeChildWindow:self.window]; + [self.window orderOut:nil]; + return YES; + } + return NO; +} + +- (void)executeSelected:(id)sender +{ + NSInteger row = self.tableView.selectedRow; + if (row < 0 || row >= (NSInteger)self.filteredCommands.count) + return; + + MPCommandItem *cmd = self.filteredCommands[row]; + NSWindow *parent = self.window.parentWindow; + + [parent removeChildWindow:self.window]; + [self.window orderOut:nil]; + + if (cmd.target && cmd.action) + { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Warc-performSelector-leaks" + [cmd.target performSelector:cmd.action withObject:nil]; +#pragma clang diagnostic pop + } +} + + +#pragma mark - NSTableViewDataSource + +- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView +{ + return self.filteredCommands.count; +} + +- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row +{ + MPCommandItem *cmd = self.filteredCommands[row]; + NSString *identifier = tableColumn.identifier; + + NSTableCellView *cell = [tableView makeViewWithIdentifier:identifier owner:self]; + if (!cell) + { + cell = [[NSTableCellView alloc] initWithFrame:NSZeroRect]; + cell.identifier = identifier; + NSTextField *tf = [NSTextField labelWithString:@""]; + tf.translatesAutoresizingMaskIntoConstraints = NO; + [cell addSubview:tf]; + cell.textField = tf; + [NSLayoutConstraint activateConstraints:@[ + [tf.leadingAnchor constraintEqualToAnchor:cell.leadingAnchor constant:8], + [tf.trailingAnchor constraintEqualToAnchor:cell.trailingAnchor constant:-4], + [tf.centerYAnchor constraintEqualToAnchor:cell.centerYAnchor], + ]]; + } + + if ([identifier isEqualToString:@"title"]) + { + NSString *prefix = cmd.isOn ? @"\u2713 " : @""; + cell.textField.stringValue = [prefix stringByAppendingString:cmd.title]; + cell.textField.font = [NSFont systemFontOfSize:13]; + } + else + { + cell.textField.stringValue = cmd.shortcut ?: @""; + cell.textField.font = [NSFont systemFontOfSize:11]; + cell.textField.textColor = [NSColor secondaryLabelColor]; + cell.textField.alignment = NSTextAlignmentRight; + } + + return cell; +} + +@end diff --git a/MacDown/Code/View/MPDocumentSplitView.h b/Markly/Code/View/MPDocumentSplitView.h similarity index 100% rename from MacDown/Code/View/MPDocumentSplitView.h rename to Markly/Code/View/MPDocumentSplitView.h diff --git a/MacDown/Code/View/MPDocumentSplitView.m b/Markly/Code/View/MPDocumentSplitView.m similarity index 100% rename from MacDown/Code/View/MPDocumentSplitView.m rename to Markly/Code/View/MPDocumentSplitView.m diff --git a/MacDown/Code/View/MPEditorView.h b/Markly/Code/View/MPEditorView.h similarity index 73% rename from MacDown/Code/View/MPEditorView.h rename to Markly/Code/View/MPEditorView.h index 286c450b..3b0733be 100644 --- a/MacDown/Code/View/MPEditorView.h +++ b/Markly/Code/View/MPEditorView.h @@ -11,6 +11,9 @@ @interface MPEditorView : NSTextView @property BOOL scrollsPastEnd; +@property BOOL focusModeEnabled; +@property BOOL typewriterModeEnabled; - (NSRect)contentRect; +- (void)updateFocusMode; @end diff --git a/MacDown/Code/View/MPEditorView.m b/Markly/Code/View/MPEditorView.m similarity index 66% rename from MacDown/Code/View/MPEditorView.m rename to Markly/Code/View/MPEditorView.m index 6c7804ac..51eb3ba1 100644 --- a/MacDown/Code/View/MPEditorView.m +++ b/Markly/Code/View/MPEditorView.m @@ -31,6 +31,8 @@ @implementation MPEditorView @synthesize contentRect = _contentRect; @synthesize scrollsPastEnd = _scrollsPastEnd; +@synthesize focusModeEnabled = _focusModeEnabled; +@synthesize typewriterModeEnabled = _typewriterModeEnabled; - (BOOL)scrollsPastEnd { @@ -176,6 +178,17 @@ - (void)didChangeText [super didChangeText]; if (self.scrollsPastEnd) [self updateContentGeometry]; + if (self.focusModeEnabled) + [self updateFocusMode]; +} + +- (void)setSelectedRange:(NSRange)charRange affinity:(NSSelectionAffinity)affinity stillSelecting:(BOOL)stillSelectingFlag +{ + [super setSelectedRange:charRange affinity:affinity stillSelecting:stillSelectingFlag]; + if (self.focusModeEnabled) + [self updateFocusMode]; + if (self.typewriterModeEnabled && !stillSelectingFlag) + [self scrollCursorToCenter]; } @@ -217,4 +230,83 @@ - (void)updateContentGeometry [self setFrameSize:self.frame.size]; // Force size update. } + +#pragma mark - Focus Mode + +- (void)setFocusModeEnabled:(BOOL)enabled +{ + _focusModeEnabled = enabled; + if (enabled) + [self updateFocusMode]; + else + [self clearFocusDimming]; +} + +- (void)updateFocusMode +{ + if (!self.focusModeEnabled) + return; + + NSString *text = self.string; + if (text.length == 0) + return; + + NSRange selectedRange = self.selectedRange; + if (selectedRange.location > text.length) + return; + + // Find the current paragraph range + NSRange paragraphRange = [text paragraphRangeForRange:NSMakeRange(selectedRange.location, 0)]; + + // Use temporary attributes on the layout manager so the syntax + // highlighter doesn't overwrite them + NSLayoutManager *lm = self.layoutManager; + NSRange fullRange = NSMakeRange(0, text.length); + + // Dim everything with a semi-transparent overlay color + NSColor *dimColor = [[NSColor blackColor] colorWithAlphaComponent:0.55]; + [lm removeTemporaryAttribute:NSForegroundColorAttributeName forCharacterRange:fullRange]; + [lm addTemporaryAttribute:NSForegroundColorAttributeName value:dimColor + forCharacterRange:fullRange]; + + // Remove dimming from the active paragraph to reveal original colors + [lm removeTemporaryAttribute:NSForegroundColorAttributeName + forCharacterRange:paragraphRange]; +} + +- (void)clearFocusDimming +{ + NSString *text = self.string; + if (text.length == 0) + return; + + [self.layoutManager removeTemporaryAttribute:NSForegroundColorAttributeName + forCharacterRange:NSMakeRange(0, text.length)]; +} + + +#pragma mark - Typewriter Mode + +- (void)scrollCursorToCenter +{ + NSRange range = self.selectedRange; + if (range.location == NSNotFound || self.string.length == 0) + return; + + NSLayoutManager *lm = self.layoutManager; + NSUInteger glyphIndex = [lm glyphIndexForCharacterAtIndex: + MIN(range.location, self.string.length - 1)]; + NSRect lineRect = [lm lineFragmentRectForGlyphAtIndex:glyphIndex + effectiveRange:NULL]; + + CGFloat cursorY = lineRect.origin.y + lineRect.size.height / 2.0; + CGFloat visibleHeight = self.enclosingScrollView.contentSize.height; + CGFloat scrollY = cursorY - visibleHeight / 2.0; + if (scrollY < 0) scrollY = 0; + + NSPoint scrollPoint = NSMakePoint(0, scrollY); + [self.enclosingScrollView.contentView scrollToPoint:scrollPoint]; + [self.enclosingScrollView reflectScrolledClipView:self.enclosingScrollView.contentView]; +} + @end diff --git a/Markly/Code/View/MPSidebarController.h b/Markly/Code/View/MPSidebarController.h new file mode 100644 index 00000000..f4013ef8 --- /dev/null +++ b/Markly/Code/View/MPSidebarController.h @@ -0,0 +1,44 @@ +// +// MPSidebarController.h +// Markly +// + +#import + +@interface MPSidebarController : NSObject + +@property (nonatomic, readonly) NSSplitView *outerSplitView; +@property (nonatomic, readonly) NSView *sidebarView; +@property (nonatomic, readonly) BOOL sidebarVisible; + +- (instancetype)initWithContentView:(NSView *)contentView; +- (void)installInWindow:(NSWindow *)window aroundView:(NSView *)contentSplitView; +- (void)toggleSidebar; +- (void)showSidebar; +- (void)hideSidebar; + +// File browser +- (void)setRootURL:(NSURL *)url; + +// Document outline +- (void)updateHeadingsFromMarkdown:(NSString *)markdown; + +@end + + +// Represents a file/folder in the file tree +@interface MPFileNode : NSObject +@property (nonatomic, strong) NSString *name; +@property (nonatomic, strong) NSURL *url; +@property (nonatomic, strong) NSArray *children; +@property (nonatomic, readonly) BOOL isDirectory; +@end + + +// Represents a heading in the document outline +@interface MPHeadingNode : NSObject +@property (nonatomic, strong) NSString *title; +@property (nonatomic) NSInteger level; // 1-6 +@property (nonatomic) NSRange range; +@property (nonatomic, strong) NSMutableArray *children; +@end diff --git a/Markly/Code/View/MPSidebarController.m b/Markly/Code/View/MPSidebarController.m new file mode 100644 index 00000000..593188fe --- /dev/null +++ b/Markly/Code/View/MPSidebarController.m @@ -0,0 +1,509 @@ +// +// MPSidebarController.m +// Markly +// + +#import "MPSidebarController.h" + +static CGFloat const kMPSidebarMinWidth = 150.0; +static CGFloat const kMPSidebarDefaultWidth = 220.0; +static CGFloat const kMPSidebarMaxWidth = 400.0; + + +#pragma mark - MPFileNode + +@implementation MPFileNode + +- (BOOL)isDirectory +{ + return self.children != nil; +} + ++ (MPFileNode *)nodeWithURL:(NSURL *)url +{ + MPFileNode *node = [[MPFileNode alloc] init]; + node.name = url.lastPathComponent; + node.url = url; + + NSFileManager *fm = [NSFileManager defaultManager]; + BOOL isDir = NO; + [fm fileExistsAtPath:url.path isDirectory:&isDir]; + + if (isDir) + { + NSMutableArray *kids = [NSMutableArray array]; + NSArray *contents = [fm contentsOfDirectoryAtURL:url + includingPropertiesForKeys:@[NSURLIsDirectoryKey, NSURLNameKey] + options:NSDirectoryEnumerationSkipsHiddenFiles + error:nil]; + + // Sort: directories first, then alphabetical + contents = [contents sortedArrayUsingComparator:^NSComparisonResult(NSURL *a, NSURL *b) { + NSNumber *aIsDir, *bIsDir; + [a getResourceValue:&aIsDir forKey:NSURLIsDirectoryKey error:nil]; + [b getResourceValue:&bIsDir forKey:NSURLIsDirectoryKey error:nil]; + if (aIsDir.boolValue != bIsDir.boolValue) + return aIsDir.boolValue ? NSOrderedAscending : NSOrderedDescending; + return [a.lastPathComponent localizedCaseInsensitiveCompare:b.lastPathComponent]; + }]; + + for (NSURL *childURL in contents) + { + // Only show markdown-related files and directories + NSString *ext = childURL.pathExtension.lowercaseString; + NSNumber *childIsDir; + [childURL getResourceValue:&childIsDir forKey:NSURLIsDirectoryKey error:nil]; + + if (childIsDir.boolValue || + [ext isEqualToString:@"md"] || + [ext isEqualToString:@"markdown"] || + [ext isEqualToString:@"txt"] || + [ext isEqualToString:@"mdown"] || + [ext isEqualToString:@"mkd"]) + { + [kids addObject:[MPFileNode nodeWithURL:childURL]]; + } + } + node.children = kids; + } + + return node; +} + +@end + + +#pragma mark - MPHeadingNode + +@implementation MPHeadingNode + +- (instancetype)init +{ + self = [super init]; + if (self) + _children = [NSMutableArray array]; + return self; +} + ++ (NSArray *)headingsFromMarkdown:(NSString *)markdown +{ + if (!markdown.length) + return @[]; + + NSMutableArray *allHeadings = [NSMutableArray array]; + NSArray *lines = [markdown componentsSeparatedByCharactersInSet: + [NSCharacterSet newlineCharacterSet]]; + NSUInteger offset = 0; + + for (NSString *line in lines) + { + NSString *trimmed = [line stringByTrimmingCharactersInSet: + [NSCharacterSet whitespaceCharacterSet]]; + + if ([trimmed hasPrefix:@"#"]) + { + NSInteger level = 0; + for (NSUInteger i = 0; i < trimmed.length && i < 6; i++) + { + if ([trimmed characterAtIndex:i] == '#') + level++; + else + break; + } + + if (level > 0 && level <= 6 && trimmed.length > level) + { + NSString *title = [[trimmed substringFromIndex:level] + stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + // Strip trailing #s + while ([title hasSuffix:@"#"]) + title = [[title substringToIndex:title.length - 1] + stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; + + if (title.length > 0) + { + MPHeadingNode *heading = [[MPHeadingNode alloc] init]; + heading.title = title; + heading.level = level; + heading.range = NSMakeRange(offset, line.length); + [allHeadings addObject:heading]; + } + } + } + offset += line.length + 1; // +1 for newline + } + + // Build hierarchy: nest lower-level headings under higher-level ones + NSMutableArray *roots = [NSMutableArray array]; + NSMutableArray *stack = [NSMutableArray array]; + + for (MPHeadingNode *heading in allHeadings) + { + while (stack.count > 0 && stack.lastObject.level >= heading.level) + [stack removeLastObject]; + + if (stack.count > 0) + [stack.lastObject.children addObject:heading]; + else + [roots addObject:heading]; + + [stack addObject:heading]; + } + + return roots; +} + +@end + + +#pragma mark - MPSidebarController + +@interface MPSidebarController () +@property (nonatomic, strong) NSSplitView *outerSplitView; +@property (nonatomic, strong) NSView *sidebarView; +@property (nonatomic, strong) NSTabView *tabView; +@property (nonatomic, strong) NSOutlineView *fileOutlineView; +@property (nonatomic, strong) NSOutlineView *headingOutlineView; +@property (nonatomic, strong) MPFileNode *rootFileNode; +@property (nonatomic, strong) NSArray *headingRoots; +@property (nonatomic) BOOL sidebarVisible; +@property (nonatomic) CGFloat savedSidebarWidth; +@end + + +@implementation MPSidebarController + +- (instancetype)initWithContentView:(NSView *)contentView +{ + self = [super init]; + if (!self) + return nil; + + self.savedSidebarWidth = kMPSidebarDefaultWidth; + self.headingRoots = @[]; + + // Create the outer split view + self.outerSplitView = [[NSSplitView alloc] initWithFrame:contentView.bounds]; + self.outerSplitView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; + self.outerSplitView.dividerStyle = NSSplitViewDividerStyleThin; + self.outerSplitView.vertical = YES; + self.outerSplitView.delegate = self; + + // Create sidebar container + self.sidebarView = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, kMPSidebarDefaultWidth, contentView.bounds.size.height)]; + self.sidebarView.autoresizingMask = NSViewHeightSizable; + + // Create tab view for Files / Outline tabs + self.tabView = [[NSTabView alloc] initWithFrame:self.sidebarView.bounds]; + self.tabView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; + self.tabView.tabViewType = NSTopTabsBezelBorder; + self.tabView.controlSize = NSControlSizeSmall; + + // Files tab + NSTabViewItem *filesTab = [[NSTabViewItem alloc] initWithIdentifier:@"files"]; + filesTab.label = @"Files"; + [self setupFileOutlineInView:filesTab]; + [self.tabView addTabViewItem:filesTab]; + + // Outline tab + NSTabViewItem *outlineTab = [[NSTabViewItem alloc] initWithIdentifier:@"outline"]; + outlineTab.label = @"Outline"; + [self setupHeadingOutlineInView:outlineTab]; + [self.tabView addTabViewItem:outlineTab]; + + [self.sidebarView addSubview:self.tabView]; + + // Start hidden + self.sidebarVisible = NO; + + return self; +} + +- (void)setupFileOutlineInView:(NSTabViewItem *)tabItem +{ + NSScrollView *scrollView = [[NSScrollView alloc] initWithFrame:NSZeroRect]; + scrollView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; + scrollView.hasVerticalScroller = YES; + scrollView.autohidesScrollers = YES; + + self.fileOutlineView = [[NSOutlineView alloc] initWithFrame:NSZeroRect]; + self.fileOutlineView.headerView = nil; + self.fileOutlineView.rowHeight = 22; + self.fileOutlineView.indentationPerLevel = 16; + self.fileOutlineView.autoresizesOutlineColumn = YES; + self.fileOutlineView.selectionHighlightStyle = NSTableViewSelectionHighlightStyleSourceList; + self.fileOutlineView.dataSource = self; + self.fileOutlineView.delegate = self; + self.fileOutlineView.doubleAction = @selector(fileDoubleClicked:); + self.fileOutlineView.target = self; + + NSTableColumn *col = [[NSTableColumn alloc] initWithIdentifier:@"name"]; + col.editable = NO; + [self.fileOutlineView addTableColumn:col]; + self.fileOutlineView.outlineTableColumn = col; + + scrollView.documentView = self.fileOutlineView; + tabItem.view = scrollView; +} + +- (void)setupHeadingOutlineInView:(NSTabViewItem *)tabItem +{ + NSScrollView *scrollView = [[NSScrollView alloc] initWithFrame:NSZeroRect]; + scrollView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; + scrollView.hasVerticalScroller = YES; + scrollView.autohidesScrollers = YES; + + self.headingOutlineView = [[NSOutlineView alloc] initWithFrame:NSZeroRect]; + self.headingOutlineView.headerView = nil; + self.headingOutlineView.rowHeight = 20; + self.headingOutlineView.indentationPerLevel = 14; + self.headingOutlineView.autoresizesOutlineColumn = YES; + self.headingOutlineView.selectionHighlightStyle = NSTableViewSelectionHighlightStyleSourceList; + self.headingOutlineView.dataSource = self; + self.headingOutlineView.delegate = self; + self.headingOutlineView.doubleAction = @selector(headingDoubleClicked:); + self.headingOutlineView.target = self; + + NSTableColumn *col = [[NSTableColumn alloc] initWithIdentifier:@"heading"]; + col.editable = NO; + [self.headingOutlineView addTableColumn:col]; + self.headingOutlineView.outlineTableColumn = col; + + scrollView.documentView = self.headingOutlineView; + tabItem.view = scrollView; +} + + +#pragma mark - Public API + +- (void)installInWindow:(NSWindow *)window aroundView:(NSView *)contentSplitView +{ + NSView *windowContentView = window.contentView; + NSRect frame = contentSplitView.frame; + + // Remove existing content from window + [contentSplitView removeFromSuperview]; + + // Configure outer split view + self.outerSplitView.frame = frame; + + // Add sidebar + content + [self.outerSplitView addSubview:self.sidebarView]; + [self.outerSplitView addSubview:contentSplitView]; + + // Pin outer split view to fill window content + self.outerSplitView.translatesAutoresizingMaskIntoConstraints = NO; + [windowContentView addSubview:self.outerSplitView]; + [NSLayoutConstraint activateConstraints:@[ + [self.outerSplitView.topAnchor constraintEqualToAnchor:windowContentView.topAnchor], + [self.outerSplitView.bottomAnchor constraintEqualToAnchor:windowContentView.bottomAnchor], + [self.outerSplitView.leadingAnchor constraintEqualToAnchor:windowContentView.leadingAnchor], + [self.outerSplitView.trailingAnchor constraintEqualToAnchor:windowContentView.trailingAnchor], + ]]; + + // Start with sidebar hidden + [self hideSidebar]; +} + +- (void)toggleSidebar +{ + if (self.sidebarVisible) + [self hideSidebar]; + else + [self showSidebar]; +} + +- (void)showSidebar +{ + if (self.sidebarVisible) + return; + self.sidebarVisible = YES; + [self.outerSplitView setPosition:self.savedSidebarWidth + ofDividerAtIndex:0]; + + // Auto-set root to the current file's directory if not set + if (!self.rootFileNode) + { + // Will be set by the document when it opens + } +} + +- (void)hideSidebar +{ + if (!self.sidebarVisible && self.sidebarView.frame.size.width == 0) + return; + if (self.sidebarView.frame.size.width > 0) + self.savedSidebarWidth = self.sidebarView.frame.size.width; + self.sidebarVisible = NO; + [self.outerSplitView setPosition:0 ofDividerAtIndex:0]; +} + +- (void)setRootURL:(NSURL *)url +{ + if (!url) + return; + self.rootFileNode = [MPFileNode nodeWithURL:url]; + [self.fileOutlineView reloadData]; + [self.fileOutlineView expandItem:self.rootFileNode]; +} + +- (void)updateHeadingsFromMarkdown:(NSString *)markdown +{ + self.headingRoots = [MPHeadingNode headingsFromMarkdown:markdown]; + [self.headingOutlineView reloadData]; + [self.headingOutlineView expandItem:nil expandChildren:YES]; +} + + +#pragma mark - Actions + +- (void)fileDoubleClicked:(id)sender +{ + MPFileNode *node = [self.fileOutlineView itemAtRow:self.fileOutlineView.clickedRow]; + if (!node || node.isDirectory) + return; + + NSDocumentController *dc = [NSDocumentController sharedDocumentController]; + [dc openDocumentWithContentsOfURL:node.url display:YES + completionHandler:^(NSDocument *doc, BOOL wasOpen, NSError *err) {}]; +} + +- (void)headingDoubleClicked:(id)sender +{ + // Handled by document via notification + MPHeadingNode *heading = [self.headingOutlineView itemAtRow:self.headingOutlineView.clickedRow]; + if (!heading) + return; + + [[NSNotificationCenter defaultCenter] + postNotificationName:@"MPSidebarDidSelectHeading" + object:self + userInfo:@{@"range": [NSValue valueWithRange:heading.range]}]; +} + + +#pragma mark - NSOutlineViewDataSource + +- (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item +{ + if (outlineView == self.fileOutlineView) + { + if (!item) + return self.rootFileNode ? self.rootFileNode.children.count : 0; + return ((MPFileNode *)item).children.count; + } + else + { + if (!item) + return self.headingRoots.count; + return ((MPHeadingNode *)item).children.count; + } +} + +- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item +{ + if (outlineView == self.fileOutlineView) + { + if (!item) + return self.rootFileNode.children[index]; + return ((MPFileNode *)item).children[index]; + } + else + { + if (!item) + return self.headingRoots[index]; + return ((MPHeadingNode *)item).children[index]; + } +} + +- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item +{ + if (outlineView == self.fileOutlineView) + return ((MPFileNode *)item).isDirectory; + else + return ((MPHeadingNode *)item).children.count > 0; +} + + +#pragma mark - NSOutlineViewDelegate + +- (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item +{ + NSTableCellView *cell = [outlineView makeViewWithIdentifier:@"cell" owner:self]; + if (!cell) + { + cell = [[NSTableCellView alloc] initWithFrame:NSMakeRect(0, 0, 200, 20)]; + cell.identifier = @"cell"; + + NSImageView *imageView = [[NSImageView alloc] initWithFrame:NSMakeRect(0, 0, 16, 16)]; + imageView.imageScaling = NSImageScaleProportionallyUpOrDown; + [cell addSubview:imageView]; + cell.imageView = imageView; + + NSTextField *textField = [NSTextField labelWithString:@""]; + textField.font = [NSFont systemFontOfSize:12]; + textField.lineBreakMode = NSLineBreakByTruncatingTail; + [cell addSubview:textField]; + cell.textField = textField; + + // Layout + imageView.translatesAutoresizingMaskIntoConstraints = NO; + textField.translatesAutoresizingMaskIntoConstraints = NO; + [NSLayoutConstraint activateConstraints:@[ + [imageView.leadingAnchor constraintEqualToAnchor:cell.leadingAnchor constant:2], + [imageView.centerYAnchor constraintEqualToAnchor:cell.centerYAnchor], + [imageView.widthAnchor constraintEqualToConstant:16], + [imageView.heightAnchor constraintEqualToConstant:16], + [textField.leadingAnchor constraintEqualToAnchor:imageView.trailingAnchor constant:4], + [textField.trailingAnchor constraintEqualToAnchor:cell.trailingAnchor constant:-2], + [textField.centerYAnchor constraintEqualToAnchor:cell.centerYAnchor], + ]]; + } + + if (outlineView == self.fileOutlineView) + { + MPFileNode *node = (MPFileNode *)item; + cell.textField.stringValue = node.name; + if (node.isDirectory) + cell.imageView.image = [NSImage imageNamed:NSImageNameFolder]; + else + cell.imageView.image = [[NSWorkspace sharedWorkspace] iconForFileType:node.url.pathExtension]; + } + else + { + MPHeadingNode *heading = (MPHeadingNode *)item; + cell.textField.stringValue = heading.title; + // Indent visually by font size based on heading level + CGFloat fontSize = MAX(13.0 - heading.level, 10.0); + cell.textField.font = (heading.level <= 2) + ? [NSFont boldSystemFontOfSize:fontSize] + : [NSFont systemFontOfSize:fontSize]; + cell.imageView.image = nil; + } + + return cell; +} + + +#pragma mark - NSSplitViewDelegate + +- (CGFloat)splitView:(NSSplitView *)splitView constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex +{ + if (splitView == self.outerSplitView && dividerIndex == 0) + return kMPSidebarMinWidth; + return proposedMinimumPosition; +} + +- (CGFloat)splitView:(NSSplitView *)splitView constrainMaxCoordinate:(CGFloat)proposedMaximumPosition ofSubviewAt:(NSInteger)dividerIndex +{ + if (splitView == self.outerSplitView && dividerIndex == 0) + return kMPSidebarMaxWidth; + return proposedMaximumPosition; +} + +- (BOOL)splitView:(NSSplitView *)splitView canCollapseSubview:(NSView *)subview +{ + return (subview == self.sidebarView); +} + +@end diff --git a/MacDown/Code/main.m b/Markly/Code/main.m similarity index 100% rename from MacDown/Code/main.m rename to Markly/Code/main.m diff --git a/MacDown/Images.xcassets/AppIcon.appiconset/Contents.json b/Markly/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/AppIcon.appiconset/Contents.json rename to Markly/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/MacDown/Images.xcassets/AppIcon.appiconset/icon_128x128.png b/Markly/Images.xcassets/AppIcon.appiconset/icon_128x128.png similarity index 100% rename from MacDown/Images.xcassets/AppIcon.appiconset/icon_128x128.png rename to Markly/Images.xcassets/AppIcon.appiconset/icon_128x128.png diff --git a/MacDown/Images.xcassets/AppIcon.appiconset/icon_128x128@2x.png b/Markly/Images.xcassets/AppIcon.appiconset/icon_128x128@2x.png similarity index 100% rename from MacDown/Images.xcassets/AppIcon.appiconset/icon_128x128@2x.png rename to Markly/Images.xcassets/AppIcon.appiconset/icon_128x128@2x.png diff --git a/MacDown/Images.xcassets/AppIcon.appiconset/icon_16x16.png b/Markly/Images.xcassets/AppIcon.appiconset/icon_16x16.png similarity index 100% rename from MacDown/Images.xcassets/AppIcon.appiconset/icon_16x16.png rename to Markly/Images.xcassets/AppIcon.appiconset/icon_16x16.png diff --git a/MacDown/Images.xcassets/AppIcon.appiconset/icon_16x16@2x.png b/Markly/Images.xcassets/AppIcon.appiconset/icon_16x16@2x.png similarity index 100% rename from MacDown/Images.xcassets/AppIcon.appiconset/icon_16x16@2x.png rename to Markly/Images.xcassets/AppIcon.appiconset/icon_16x16@2x.png diff --git a/MacDown/Images.xcassets/AppIcon.appiconset/icon_256x256.png b/Markly/Images.xcassets/AppIcon.appiconset/icon_256x256.png similarity index 100% rename from MacDown/Images.xcassets/AppIcon.appiconset/icon_256x256.png rename to Markly/Images.xcassets/AppIcon.appiconset/icon_256x256.png diff --git a/MacDown/Images.xcassets/AppIcon.appiconset/icon_256x256@2x.png b/Markly/Images.xcassets/AppIcon.appiconset/icon_256x256@2x.png similarity index 100% rename from MacDown/Images.xcassets/AppIcon.appiconset/icon_256x256@2x.png rename to Markly/Images.xcassets/AppIcon.appiconset/icon_256x256@2x.png diff --git a/MacDown/Images.xcassets/AppIcon.appiconset/icon_32x32.png b/Markly/Images.xcassets/AppIcon.appiconset/icon_32x32.png similarity index 100% rename from MacDown/Images.xcassets/AppIcon.appiconset/icon_32x32.png rename to Markly/Images.xcassets/AppIcon.appiconset/icon_32x32.png diff --git a/MacDown/Images.xcassets/AppIcon.appiconset/icon_32x32@2x.png b/Markly/Images.xcassets/AppIcon.appiconset/icon_32x32@2x.png similarity index 100% rename from MacDown/Images.xcassets/AppIcon.appiconset/icon_32x32@2x.png rename to Markly/Images.xcassets/AppIcon.appiconset/icon_32x32@2x.png diff --git a/MacDown/Images.xcassets/AppIcon.appiconset/icon_512x512.png b/Markly/Images.xcassets/AppIcon.appiconset/icon_512x512.png similarity index 100% rename from MacDown/Images.xcassets/AppIcon.appiconset/icon_512x512.png rename to Markly/Images.xcassets/AppIcon.appiconset/icon_512x512.png diff --git a/MacDown/Images.xcassets/AppIcon.appiconset/icon_512x512@2x.png b/Markly/Images.xcassets/AppIcon.appiconset/icon_512x512@2x.png similarity index 100% rename from MacDown/Images.xcassets/AppIcon.appiconset/icon_512x512@2x.png rename to Markly/Images.xcassets/AppIcon.appiconset/icon_512x512@2x.png diff --git a/MacDown/Images.xcassets/Contents.json b/Markly/Images.xcassets/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Contents.json rename to Markly/Images.xcassets/Contents.json diff --git a/MacDown/Images.xcassets/Preferences Icons/Contents.json b/Markly/Images.xcassets/Preferences Icons/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Preferences Icons/Contents.json rename to Markly/Images.xcassets/Preferences Icons/Contents.json diff --git a/MacDown/Images.xcassets/Preferences Icons/PreferencesEditor.imageset/Contents.json b/Markly/Images.xcassets/Preferences Icons/PreferencesEditor.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Preferences Icons/PreferencesEditor.imageset/Contents.json rename to Markly/Images.xcassets/Preferences Icons/PreferencesEditor.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Preferences Icons/PreferencesEditor.imageset/PreferencesEditor.png b/Markly/Images.xcassets/Preferences Icons/PreferencesEditor.imageset/PreferencesEditor.png similarity index 100% rename from MacDown/Images.xcassets/Preferences Icons/PreferencesEditor.imageset/PreferencesEditor.png rename to Markly/Images.xcassets/Preferences Icons/PreferencesEditor.imageset/PreferencesEditor.png diff --git a/MacDown/Images.xcassets/Preferences Icons/PreferencesEditor.imageset/PreferencesEditor@2x.png b/Markly/Images.xcassets/Preferences Icons/PreferencesEditor.imageset/PreferencesEditor@2x.png similarity index 100% rename from MacDown/Images.xcassets/Preferences Icons/PreferencesEditor.imageset/PreferencesEditor@2x.png rename to Markly/Images.xcassets/Preferences Icons/PreferencesEditor.imageset/PreferencesEditor@2x.png diff --git a/MacDown/Images.xcassets/Preferences Icons/PreferencesGeneral.imageset/Contents.json b/Markly/Images.xcassets/Preferences Icons/PreferencesGeneral.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Preferences Icons/PreferencesGeneral.imageset/Contents.json rename to Markly/Images.xcassets/Preferences Icons/PreferencesGeneral.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Preferences Icons/PreferencesGeneral.imageset/PreferencesGeneral.png b/Markly/Images.xcassets/Preferences Icons/PreferencesGeneral.imageset/PreferencesGeneral.png similarity index 100% rename from MacDown/Images.xcassets/Preferences Icons/PreferencesGeneral.imageset/PreferencesGeneral.png rename to Markly/Images.xcassets/Preferences Icons/PreferencesGeneral.imageset/PreferencesGeneral.png diff --git a/MacDown/Images.xcassets/Preferences Icons/PreferencesGeneral.imageset/PreferencesGeneral@2x.png b/Markly/Images.xcassets/Preferences Icons/PreferencesGeneral.imageset/PreferencesGeneral@2x.png similarity index 100% rename from MacDown/Images.xcassets/Preferences Icons/PreferencesGeneral.imageset/PreferencesGeneral@2x.png rename to Markly/Images.xcassets/Preferences Icons/PreferencesGeneral.imageset/PreferencesGeneral@2x.png diff --git a/MacDown/Images.xcassets/Preferences Icons/PreferencesMarkdown.imageset/Contents.json b/Markly/Images.xcassets/Preferences Icons/PreferencesMarkdown.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Preferences Icons/PreferencesMarkdown.imageset/Contents.json rename to Markly/Images.xcassets/Preferences Icons/PreferencesMarkdown.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Preferences Icons/PreferencesMarkdown.imageset/PreferencesMarkdown.png b/Markly/Images.xcassets/Preferences Icons/PreferencesMarkdown.imageset/PreferencesMarkdown.png similarity index 100% rename from MacDown/Images.xcassets/Preferences Icons/PreferencesMarkdown.imageset/PreferencesMarkdown.png rename to Markly/Images.xcassets/Preferences Icons/PreferencesMarkdown.imageset/PreferencesMarkdown.png diff --git a/MacDown/Images.xcassets/Preferences Icons/PreferencesMarkdown.imageset/PreferencesMarkdown@2x.png b/Markly/Images.xcassets/Preferences Icons/PreferencesMarkdown.imageset/PreferencesMarkdown@2x.png similarity index 100% rename from MacDown/Images.xcassets/Preferences Icons/PreferencesMarkdown.imageset/PreferencesMarkdown@2x.png rename to Markly/Images.xcassets/Preferences Icons/PreferencesMarkdown.imageset/PreferencesMarkdown@2x.png diff --git a/MacDown/Images.xcassets/Preferences Icons/PreferencesRendering.imageset/Contents.json b/Markly/Images.xcassets/Preferences Icons/PreferencesRendering.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Preferences Icons/PreferencesRendering.imageset/Contents.json rename to Markly/Images.xcassets/Preferences Icons/PreferencesRendering.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Preferences Icons/PreferencesRendering.imageset/PreferencesRendering.png b/Markly/Images.xcassets/Preferences Icons/PreferencesRendering.imageset/PreferencesRendering.png similarity index 100% rename from MacDown/Images.xcassets/Preferences Icons/PreferencesRendering.imageset/PreferencesRendering.png rename to Markly/Images.xcassets/Preferences Icons/PreferencesRendering.imageset/PreferencesRendering.png diff --git a/MacDown/Images.xcassets/Preferences Icons/PreferencesRendering.imageset/PreferencesRendering@2x.png b/Markly/Images.xcassets/Preferences Icons/PreferencesRendering.imageset/PreferencesRendering@2x.png similarity index 100% rename from MacDown/Images.xcassets/Preferences Icons/PreferencesRendering.imageset/PreferencesRendering@2x.png rename to Markly/Images.xcassets/Preferences Icons/PreferencesRendering.imageset/PreferencesRendering@2x.png diff --git a/MacDown/Images.xcassets/Preferences Icons/PreferencesTerminal.imageset/Contents.json b/Markly/Images.xcassets/Preferences Icons/PreferencesTerminal.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Preferences Icons/PreferencesTerminal.imageset/Contents.json rename to Markly/Images.xcassets/Preferences Icons/PreferencesTerminal.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Preferences Icons/PreferencesTerminal.imageset/PreferencesTerminal.png b/Markly/Images.xcassets/Preferences Icons/PreferencesTerminal.imageset/PreferencesTerminal.png similarity index 100% rename from MacDown/Images.xcassets/Preferences Icons/PreferencesTerminal.imageset/PreferencesTerminal.png rename to Markly/Images.xcassets/Preferences Icons/PreferencesTerminal.imageset/PreferencesTerminal.png diff --git a/MacDown/Images.xcassets/Preferences Icons/PreferencesTerminal.imageset/PreferencesTerminal@2x.png b/Markly/Images.xcassets/Preferences Icons/PreferencesTerminal.imageset/PreferencesTerminal@2x.png similarity index 100% rename from MacDown/Images.xcassets/Preferences Icons/PreferencesTerminal.imageset/PreferencesTerminal@2x.png rename to Markly/Images.xcassets/Preferences Icons/PreferencesTerminal.imageset/PreferencesTerminal@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/Contents.json b/Markly/Images.xcassets/Toolbar Icons/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconBlockquote.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconBlockquote.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconBlockquote.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconBlockquote.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconBlockquote.imageset/ToolbarIconBlockquote.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconBlockquote.imageset/ToolbarIconBlockquote.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconBlockquote.imageset/ToolbarIconBlockquote.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconBlockquote.imageset/ToolbarIconBlockquote.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconBlockquote.imageset/ToolbarIconBlockquote@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconBlockquote.imageset/ToolbarIconBlockquote@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconBlockquote.imageset/ToolbarIconBlockquote@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconBlockquote.imageset/ToolbarIconBlockquote@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconBold.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconBold.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconBold.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconBold.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconBold.imageset/ToolbarIconBold.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconBold.imageset/ToolbarIconBold.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconBold.imageset/ToolbarIconBold.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconBold.imageset/ToolbarIconBold.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconBold.imageset/ToolbarIconBold@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconBold.imageset/ToolbarIconBold@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconBold.imageset/ToolbarIconBold@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconBold.imageset/ToolbarIconBold@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconComment.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconComment.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconComment.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconComment.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconComment.imageset/ToolbarIconComment.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconComment.imageset/ToolbarIconComment.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconComment.imageset/ToolbarIconComment.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconComment.imageset/ToolbarIconComment.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconComment.imageset/ToolbarIconComment@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconComment.imageset/ToolbarIconComment@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconComment.imageset/ToolbarIconComment@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconComment.imageset/ToolbarIconComment@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconCopyHTML.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconCopyHTML.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconCopyHTML.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconCopyHTML.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconCopyHTML.imageset/ToolbarIconCopyHTML.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconCopyHTML.imageset/ToolbarIconCopyHTML.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconCopyHTML.imageset/ToolbarIconCopyHTML.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconCopyHTML.imageset/ToolbarIconCopyHTML.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconCopyHTML.imageset/ToolbarIconCopyHTML@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconCopyHTML.imageset/ToolbarIconCopyHTML@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconCopyHTML.imageset/ToolbarIconCopyHTML@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconCopyHTML.imageset/ToolbarIconCopyHTML@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconEditorAndPreview.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconEditorAndPreview.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconEditorAndPreview.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconEditorAndPreview.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconEditorAndPreview.imageset/ToolbarIconEditorAndPreview.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconEditorAndPreview.imageset/ToolbarIconEditorAndPreview.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconEditorAndPreview.imageset/ToolbarIconEditorAndPreview.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconEditorAndPreview.imageset/ToolbarIconEditorAndPreview.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconEditorAndPreview.imageset/ToolbarIconEditorAndPreview@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconEditorAndPreview.imageset/ToolbarIconEditorAndPreview@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconEditorAndPreview.imageset/ToolbarIconEditorAndPreview@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconEditorAndPreview.imageset/ToolbarIconEditorAndPreview@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading1.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading1.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading1.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading1.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading1.imageset/ToolbarIconHeading1.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading1.imageset/ToolbarIconHeading1.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading1.imageset/ToolbarIconHeading1.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading1.imageset/ToolbarIconHeading1.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading1.imageset/ToolbarIconHeading1@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading1.imageset/ToolbarIconHeading1@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading1.imageset/ToolbarIconHeading1@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading1.imageset/ToolbarIconHeading1@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading2.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading2.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading2.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading2.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading2.imageset/ToolbarIconHeading2.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading2.imageset/ToolbarIconHeading2.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading2.imageset/ToolbarIconHeading2.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading2.imageset/ToolbarIconHeading2.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading2.imageset/ToolbarIconHeading2@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading2.imageset/ToolbarIconHeading2@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading2.imageset/ToolbarIconHeading2@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading2.imageset/ToolbarIconHeading2@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading3.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading3.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading3.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading3.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading3.imageset/ToolbarIconHeading3.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading3.imageset/ToolbarIconHeading3.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading3.imageset/ToolbarIconHeading3.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading3.imageset/ToolbarIconHeading3.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading3.imageset/ToolbarIconHeading3@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading3.imageset/ToolbarIconHeading3@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHeading3.imageset/ToolbarIconHeading3@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHeading3.imageset/ToolbarIconHeading3@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHideEditor.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHideEditor.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHideEditor.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHideEditor.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHideEditor.imageset/ToolbarIconHideEditor.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHideEditor.imageset/ToolbarIconHideEditor.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHideEditor.imageset/ToolbarIconHideEditor.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHideEditor.imageset/ToolbarIconHideEditor.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHideEditor.imageset/ToolbarIconHideEditor@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHideEditor.imageset/ToolbarIconHideEditor@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHideEditor.imageset/ToolbarIconHideEditor@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHideEditor.imageset/ToolbarIconHideEditor@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHidePreview.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHidePreview.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHidePreview.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHidePreview.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHidePreview.imageset/ToolbarIconHidePreview.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHidePreview.imageset/ToolbarIconHidePreview.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHidePreview.imageset/ToolbarIconHidePreview.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHidePreview.imageset/ToolbarIconHidePreview.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHidePreview.imageset/ToolbarIconHidePreview@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHidePreview.imageset/ToolbarIconHidePreview@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHidePreview.imageset/ToolbarIconHidePreview@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHidePreview.imageset/ToolbarIconHidePreview@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHighlight.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHighlight.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHighlight.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHighlight.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHighlight.imageset/ToolbarIconHighlight.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHighlight.imageset/ToolbarIconHighlight.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHighlight.imageset/ToolbarIconHighlight.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHighlight.imageset/ToolbarIconHighlight.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHighlight.imageset/ToolbarIconHighlight@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconHighlight.imageset/ToolbarIconHighlight@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconHighlight.imageset/ToolbarIconHighlight@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconHighlight.imageset/ToolbarIconHighlight@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconImage.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconImage.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconImage.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconImage.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconImage.imageset/ToolbarIconImage.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconImage.imageset/ToolbarIconImage.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconImage.imageset/ToolbarIconImage.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconImage.imageset/ToolbarIconImage.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconImage.imageset/ToolbarIconImage@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconImage.imageset/ToolbarIconImage@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconImage.imageset/ToolbarIconImage@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconImage.imageset/ToolbarIconImage@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconInlineCode.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconInlineCode.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconInlineCode.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconInlineCode.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconInlineCode.imageset/ToolbarIconInlineCode.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconInlineCode.imageset/ToolbarIconInlineCode.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconInlineCode.imageset/ToolbarIconInlineCode.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconInlineCode.imageset/ToolbarIconInlineCode.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconInlineCode.imageset/ToolbarIconInlineCode@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconInlineCode.imageset/ToolbarIconInlineCode@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconInlineCode.imageset/ToolbarIconInlineCode@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconInlineCode.imageset/ToolbarIconInlineCode@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconItalic.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconItalic.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconItalic.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconItalic.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconItalic.imageset/ToolbarIconItalic.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconItalic.imageset/ToolbarIconItalic.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconItalic.imageset/ToolbarIconItalic.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconItalic.imageset/ToolbarIconItalic.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconItalic.imageset/ToolbarIconItalic@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconItalic.imageset/ToolbarIconItalic@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconItalic.imageset/ToolbarIconItalic@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconItalic.imageset/ToolbarIconItalic@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconLink.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconLink.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconLink.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconLink.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconLink.imageset/ToolbarIconLink.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconLink.imageset/ToolbarIconLink.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconLink.imageset/ToolbarIconLink.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconLink.imageset/ToolbarIconLink.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconLink.imageset/ToolbarIconLink@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconLink.imageset/ToolbarIconLink@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconLink.imageset/ToolbarIconLink@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconLink.imageset/ToolbarIconLink@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconOrderedList.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconOrderedList.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconOrderedList.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconOrderedList.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconOrderedList.imageset/ToolbarIconOrderedList.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconOrderedList.imageset/ToolbarIconOrderedList.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconOrderedList.imageset/ToolbarIconOrderedList.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconOrderedList.imageset/ToolbarIconOrderedList.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconOrderedList.imageset/ToolbarIconOrderedList@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconOrderedList.imageset/ToolbarIconOrderedList@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconOrderedList.imageset/ToolbarIconOrderedList@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconOrderedList.imageset/ToolbarIconOrderedList@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconShiftLeft.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconShiftLeft.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconShiftLeft.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconShiftLeft.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconShiftLeft.imageset/ToolbarIconShiftLeft.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconShiftLeft.imageset/ToolbarIconShiftLeft.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconShiftLeft.imageset/ToolbarIconShiftLeft.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconShiftLeft.imageset/ToolbarIconShiftLeft.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconShiftLeft.imageset/ToolbarIconShiftLeft@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconShiftLeft.imageset/ToolbarIconShiftLeft@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconShiftLeft.imageset/ToolbarIconShiftLeft@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconShiftLeft.imageset/ToolbarIconShiftLeft@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconShiftRight.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconShiftRight.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconShiftRight.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconShiftRight.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconShiftRight.imageset/ToolbarIconShiftRight.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconShiftRight.imageset/ToolbarIconShiftRight.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconShiftRight.imageset/ToolbarIconShiftRight.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconShiftRight.imageset/ToolbarIconShiftRight.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconShiftRight.imageset/ToolbarIconShiftRight@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconShiftRight.imageset/ToolbarIconShiftRight@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconShiftRight.imageset/ToolbarIconShiftRight@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconShiftRight.imageset/ToolbarIconShiftRight@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconStrikethrough.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconStrikethrough.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconStrikethrough.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconStrikethrough.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconStrikethrough.imageset/ToolbarIconStrikethrough.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconStrikethrough.imageset/ToolbarIconStrikethrough.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconStrikethrough.imageset/ToolbarIconStrikethrough.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconStrikethrough.imageset/ToolbarIconStrikethrough.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconStrikethrough.imageset/ToolbarIconStrikethrough@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconStrikethrough.imageset/ToolbarIconStrikethrough@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconStrikethrough.imageset/ToolbarIconStrikethrough@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconStrikethrough.imageset/ToolbarIconStrikethrough@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconUnderlined.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconUnderlined.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconUnderlined.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconUnderlined.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconUnderlined.imageset/ToolbarIconUnderlined.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconUnderlined.imageset/ToolbarIconUnderlined.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconUnderlined.imageset/ToolbarIconUnderlined.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconUnderlined.imageset/ToolbarIconUnderlined.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconUnderlined.imageset/ToolbarIconUnderlined@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconUnderlined.imageset/ToolbarIconUnderlined@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconUnderlined.imageset/ToolbarIconUnderlined@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconUnderlined.imageset/ToolbarIconUnderlined@2x.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconUnorderedList.imageset/Contents.json b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconUnorderedList.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconUnorderedList.imageset/Contents.json rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconUnorderedList.imageset/Contents.json diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconUnorderedList.imageset/ToolbarIconUnorderedList.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconUnorderedList.imageset/ToolbarIconUnorderedList.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconUnorderedList.imageset/ToolbarIconUnorderedList.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconUnorderedList.imageset/ToolbarIconUnorderedList.png diff --git a/MacDown/Images.xcassets/Toolbar Icons/ToolbarIconUnorderedList.imageset/ToolbarIconUnorderedList@2x.png b/Markly/Images.xcassets/Toolbar Icons/ToolbarIconUnorderedList.imageset/ToolbarIconUnorderedList@2x.png similarity index 100% rename from MacDown/Images.xcassets/Toolbar Icons/ToolbarIconUnorderedList.imageset/ToolbarIconUnorderedList@2x.png rename to Markly/Images.xcassets/Toolbar Icons/ToolbarIconUnorderedList.imageset/ToolbarIconUnorderedList@2x.png diff --git a/MacDown/Images.xcassets/TouchBar Icons/Contents.json b/Markly/Images.xcassets/TouchBar Icons/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconBlockquote.imageset/Contents.json b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconBlockquote.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconBlockquote.imageset/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconBlockquote.imageset/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconBlockquote.imageset/TouchBarIconBlockquote@2x.png b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconBlockquote.imageset/TouchBarIconBlockquote@2x.png similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconBlockquote.imageset/TouchBarIconBlockquote@2x.png rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconBlockquote.imageset/TouchBarIconBlockquote@2x.png diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconComment.imageset/Contents.json b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconComment.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconComment.imageset/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconComment.imageset/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconComment.imageset/TouchBarIconComment@2x.png b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconComment.imageset/TouchBarIconComment@2x.png similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconComment.imageset/TouchBarIconComment@2x.png rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconComment.imageset/TouchBarIconComment@2x.png diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconCopyHTML.imageset/Contents.json b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconCopyHTML.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconCopyHTML.imageset/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconCopyHTML.imageset/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconCopyHTML.imageset/TouchBarIconCopyHTML@2x.png b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconCopyHTML.imageset/TouchBarIconCopyHTML@2x.png similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconCopyHTML.imageset/TouchBarIconCopyHTML@2x.png rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconCopyHTML.imageset/TouchBarIconCopyHTML@2x.png diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconEditorAndPreview.imageset/Contents.json b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconEditorAndPreview.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconEditorAndPreview.imageset/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconEditorAndPreview.imageset/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconEditorAndPreview.imageset/TouchBarIconEditorAndPreview@2x.png b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconEditorAndPreview.imageset/TouchBarIconEditorAndPreview@2x.png similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconEditorAndPreview.imageset/TouchBarIconEditorAndPreview@2x.png rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconEditorAndPreview.imageset/TouchBarIconEditorAndPreview@2x.png diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconHeadings.imageset/Contents.json b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconHeadings.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconHeadings.imageset/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconHeadings.imageset/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconHeadings.imageset/TouchBarIconHeadings@2x.png b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconHeadings.imageset/TouchBarIconHeadings@2x.png similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconHeadings.imageset/TouchBarIconHeadings@2x.png rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconHeadings.imageset/TouchBarIconHeadings@2x.png diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconHideEditor.imageset/Contents.json b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconHideEditor.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconHideEditor.imageset/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconHideEditor.imageset/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconHideEditor.imageset/TouchBarIconHideEditor@2x.png b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconHideEditor.imageset/TouchBarIconHideEditor@2x.png similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconHideEditor.imageset/TouchBarIconHideEditor@2x.png rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconHideEditor.imageset/TouchBarIconHideEditor@2x.png diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconHidePreview.imageset/Contents.json b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconHidePreview.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconHidePreview.imageset/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconHidePreview.imageset/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconHidePreview.imageset/TouchBarIconHidePreview@2x.png b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconHidePreview.imageset/TouchBarIconHidePreview@2x.png similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconHidePreview.imageset/TouchBarIconHidePreview@2x.png rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconHidePreview.imageset/TouchBarIconHidePreview@2x.png diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconHighlight.imageset/Contents.json b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconHighlight.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconHighlight.imageset/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconHighlight.imageset/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconHighlight.imageset/TouchBarIconHighlight@2x.png b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconHighlight.imageset/TouchBarIconHighlight@2x.png similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconHighlight.imageset/TouchBarIconHighlight@2x.png rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconHighlight.imageset/TouchBarIconHighlight@2x.png diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconImage.imageset/Contents.json b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconImage.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconImage.imageset/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconImage.imageset/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconImage.imageset/TouchBarIconImage@2x.png b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconImage.imageset/TouchBarIconImage@2x.png similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconImage.imageset/TouchBarIconImage@2x.png rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconImage.imageset/TouchBarIconImage@2x.png diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconInlineCode.imageset/Contents.json b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconInlineCode.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconInlineCode.imageset/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconInlineCode.imageset/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconInlineCode.imageset/TouchBarIconInlineCode@2x.png b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconInlineCode.imageset/TouchBarIconInlineCode@2x.png similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconInlineCode.imageset/TouchBarIconInlineCode@2x.png rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconInlineCode.imageset/TouchBarIconInlineCode@2x.png diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconLink.imageset/Contents.json b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconLink.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconLink.imageset/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconLink.imageset/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconLink.imageset/TouchBarIconLink@2x.png b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconLink.imageset/TouchBarIconLink@2x.png similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconLink.imageset/TouchBarIconLink@2x.png rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconLink.imageset/TouchBarIconLink@2x.png diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconOrderedList.imageset/Contents.json b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconOrderedList.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconOrderedList.imageset/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconOrderedList.imageset/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconOrderedList.imageset/TouchBarIconOrderedList@2x.png b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconOrderedList.imageset/TouchBarIconOrderedList@2x.png similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconOrderedList.imageset/TouchBarIconOrderedList@2x.png rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconOrderedList.imageset/TouchBarIconOrderedList@2x.png diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconShiftLeft.imageset/Contents.json b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconShiftLeft.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconShiftLeft.imageset/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconShiftLeft.imageset/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconShiftLeft.imageset/TouchBarIconShiftLeft@2x.png b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconShiftLeft.imageset/TouchBarIconShiftLeft@2x.png similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconShiftLeft.imageset/TouchBarIconShiftLeft@2x.png rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconShiftLeft.imageset/TouchBarIconShiftLeft@2x.png diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconShiftRight.imageset/Contents.json b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconShiftRight.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconShiftRight.imageset/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconShiftRight.imageset/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconShiftRight.imageset/TouchBarIconShiftRight@2x.png b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconShiftRight.imageset/TouchBarIconShiftRight@2x.png similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconShiftRight.imageset/TouchBarIconShiftRight@2x.png rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconShiftRight.imageset/TouchBarIconShiftRight@2x.png diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconStrikethrough.imageset/Contents.json b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconStrikethrough.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconStrikethrough.imageset/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconStrikethrough.imageset/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconStrikethrough.imageset/TouchBarIconStrikethrough@2x.png b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconStrikethrough.imageset/TouchBarIconStrikethrough@2x.png similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconStrikethrough.imageset/TouchBarIconStrikethrough@2x.png rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconStrikethrough.imageset/TouchBarIconStrikethrough@2x.png diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconUnorderedList.imageset/Contents.json b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconUnorderedList.imageset/Contents.json similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconUnorderedList.imageset/Contents.json rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconUnorderedList.imageset/Contents.json diff --git a/MacDown/Images.xcassets/TouchBar Icons/TouchBarIconUnorderedList.imageset/TouchBarIconUnorderedList@2x.png b/Markly/Images.xcassets/TouchBar Icons/TouchBarIconUnorderedList.imageset/TouchBarIconUnorderedList@2x.png similarity index 100% rename from MacDown/Images.xcassets/TouchBar Icons/TouchBarIconUnorderedList.imageset/TouchBarIconUnorderedList@2x.png rename to Markly/Images.xcassets/TouchBar Icons/TouchBarIconUnorderedList.imageset/TouchBarIconUnorderedList@2x.png diff --git a/MacDown/Localization/Base.lproj/MPDocument.xib b/Markly/Localization/Base.lproj/MPDocument.xib similarity index 100% rename from MacDown/Localization/Base.lproj/MPDocument.xib rename to Markly/Localization/Base.lproj/MPDocument.xib diff --git a/MacDown/Localization/Base.lproj/MPEditorPreferencesViewController.xib b/Markly/Localization/Base.lproj/MPEditorPreferencesViewController.xib similarity index 100% rename from MacDown/Localization/Base.lproj/MPEditorPreferencesViewController.xib rename to Markly/Localization/Base.lproj/MPEditorPreferencesViewController.xib diff --git a/MacDown/Localization/Base.lproj/MPExportPanelAccessoryViewController.xib b/Markly/Localization/Base.lproj/MPExportPanelAccessoryViewController.xib similarity index 100% rename from MacDown/Localization/Base.lproj/MPExportPanelAccessoryViewController.xib rename to Markly/Localization/Base.lproj/MPExportPanelAccessoryViewController.xib diff --git a/MacDown/Localization/Base.lproj/MPGeneralPreferencesViewController.xib b/Markly/Localization/Base.lproj/MPGeneralPreferencesViewController.xib similarity index 63% rename from MacDown/Localization/Base.lproj/MPGeneralPreferencesViewController.xib rename to Markly/Localization/Base.lproj/MPGeneralPreferencesViewController.xib index 454499c4..7b6afc69 100644 --- a/MacDown/Localization/Base.lproj/MPGeneralPreferencesViewController.xib +++ b/Markly/Localization/Base.lproj/MPGeneralPreferencesViewController.xib @@ -9,13 +9,15 @@ + + - + @@ -169,6 +171,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -177,7 +268,10 @@ - + + + + diff --git a/MacDown/Localization/Base.lproj/MPHtmlPreferencesViewController.xib b/Markly/Localization/Base.lproj/MPHtmlPreferencesViewController.xib similarity index 93% rename from MacDown/Localization/Base.lproj/MPHtmlPreferencesViewController.xib rename to Markly/Localization/Base.lproj/MPHtmlPreferencesViewController.xib index 3fba7005..303e42ac 100644 --- a/MacDown/Localization/Base.lproj/MPHtmlPreferencesViewController.xib +++ b/Markly/Localization/Base.lproj/MPHtmlPreferencesViewController.xib @@ -17,7 +17,7 @@ - + @@ -114,25 +114,23 @@ - - @@ -166,7 +164,7 @@