├── .gitignore ├── BBEdit Additions ├── CriticMarkup.bbpackage │ └── Contents │ │ ├── Clippings │ │ ├── CM Add │ │ ├── CM Delete │ │ ├── CM Comment │ │ ├── CM Substitute │ │ └── CM Highlight │ │ ├── Scripts │ │ ├── Find Next CMark.scpt │ │ └── Find Previous CMark.scpt │ │ ├── Text Filters │ │ ├── 00)Reject CMark │ │ └── 00)Accept CMark │ │ └── Language Modules │ │ └── CriticCodelessLanguageModule.plist └── README.md ├── PopClip ├── CriticMarks.popclipextz ├── CriticMarks.popclipext │ ├── add.png │ ├── delete.png │ ├── podstaw.png │ ├── zaznacz.png │ ├── podstaw.php │ ├── inc.php │ ├── usun.php │ ├── dodaj.php │ ├── komentuj.php │ └── Config.plist └── README.md ├── Sublime Text Package └── Critic Markup │ ├── list_critics.pyc │ ├── mark_critic.pyc │ ├── accept_critic.pyc │ ├── Critic.tmTheme.cache │ ├── Critic.tmLanguage.cache │ ├── list_critics_comments.pyc │ ├── Critic.JSON-tmLanguage │ ├── Critic.sublime-settings │ ├── list_critics_comments.py │ ├── list_critics.py │ ├── mark_critic.py │ ├── Critic.tmLanguage │ ├── accept_critic.py │ └── Critic.tmTheme ├── .gitmodules ├── Marked Preprocessor ├── About.md └── critic.py ├── Objective-C ├── CriticMarkupRenderer.h ├── README.md └── CriticMarkupRenderer.m ├── Mac System Services ├── Accept Critic Mark.workflow │ └── Contents │ │ ├── QuickLook │ │ └── Preview.png │ │ ├── Info.plist │ │ └── document.wflow └── Reject Critic Mark.workflow │ └── Contents │ ├── QuickLook │ └── Preview.png │ ├── Info.plist │ └── document.wflow ├── Swift ├── README.md └── CriticMarkupRenderer.swift ├── Sublime Text 3 Package └── Critic Markup │ ├── Critic.JSON-tmLanguage │ ├── critic_edits.py │ ├── Critic.sublime-settings │ ├── list_critics_comments.py │ ├── list_critics.py │ ├── Critic.tmLanguage │ ├── mark_critic.py │ ├── accept_critic.py │ └── Monokai Soda + Critic.tmTheme ├── CLI ├── About.md └── criticParser_CLI.py ├── TextExpander Snippets └── Critic.textexpander ├── Marked Processor └── critic.py ├── README.md └── Keyboard Maestro Macros └── Critic Markup Library.kmlibrary /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /BBEdit Additions/CriticMarkup.bbpackage/Contents/Clippings/CM Add: -------------------------------------------------------------------------------- 1 | {++#insertion#++} -------------------------------------------------------------------------------- /BBEdit Additions/CriticMarkup.bbpackage/Contents/Clippings/CM Delete: -------------------------------------------------------------------------------- 1 | {--#selection#--} -------------------------------------------------------------------------------- /BBEdit Additions/CriticMarkup.bbpackage/Contents/Clippings/CM Comment: -------------------------------------------------------------------------------- 1 | {>>#PLACEHOLDERSTART#comment#PLACEHOLDEREND#<<} -------------------------------------------------------------------------------- /BBEdit Additions/CriticMarkup.bbpackage/Contents/Clippings/CM Substitute: -------------------------------------------------------------------------------- 1 | {~~#selection#~>#SELSTART##SELECT##SELEND#~~} -------------------------------------------------------------------------------- /PopClip/CriticMarks.popclipextz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttscoff/CriticMarkup-toolkit/master/PopClip/CriticMarks.popclipextz -------------------------------------------------------------------------------- /BBEdit Additions/CriticMarkup.bbpackage/Contents/Clippings/CM Highlight: -------------------------------------------------------------------------------- 1 | {==#selection#==}{>>#PLACEHOLDERSTART#comment#PLACEHOLDEREND#<<} -------------------------------------------------------------------------------- /PopClip/CriticMarks.popclipext/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttscoff/CriticMarkup-toolkit/master/PopClip/CriticMarks.popclipext/add.png -------------------------------------------------------------------------------- /PopClip/CriticMarks.popclipext/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttscoff/CriticMarkup-toolkit/master/PopClip/CriticMarks.popclipext/delete.png -------------------------------------------------------------------------------- /PopClip/CriticMarks.popclipext/podstaw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttscoff/CriticMarkup-toolkit/master/PopClip/CriticMarks.popclipext/podstaw.png -------------------------------------------------------------------------------- /PopClip/CriticMarks.popclipext/zaznacz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttscoff/CriticMarkup-toolkit/master/PopClip/CriticMarks.popclipext/zaznacz.png -------------------------------------------------------------------------------- /Sublime Text Package/Critic Markup/list_critics.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttscoff/CriticMarkup-toolkit/master/Sublime Text Package/Critic Markup/list_critics.pyc -------------------------------------------------------------------------------- /Sublime Text Package/Critic Markup/mark_critic.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttscoff/CriticMarkup-toolkit/master/Sublime Text Package/Critic Markup/mark_critic.pyc -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "TextMate/CriticMarkup.tmbundle"] 2 | path = TextMate/CriticMarkup.tmbundle 3 | url = https://github.com/DivineDominion/criticmarkup.tmbundle 4 | -------------------------------------------------------------------------------- /PopClip/CriticMarks.popclipext/podstaw.php: -------------------------------------------------------------------------------- 1 | ~~}"; 5 | ?> -------------------------------------------------------------------------------- /Sublime Text Package/Critic Markup/accept_critic.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttscoff/CriticMarkup-toolkit/master/Sublime Text Package/Critic Markup/accept_critic.pyc -------------------------------------------------------------------------------- /Sublime Text Package/Critic Markup/Critic.tmTheme.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttscoff/CriticMarkup-toolkit/master/Sublime Text Package/Critic Markup/Critic.tmTheme.cache -------------------------------------------------------------------------------- /Marked Preprocessor/About.md: -------------------------------------------------------------------------------- 1 | ## Attention ## 2 | 3 | This is a Pre-processor for a soon to be released new version of Marked.app for the Mac. This will not work with versions < 1.5. -------------------------------------------------------------------------------- /Sublime Text Package/Critic Markup/Critic.tmLanguage.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttscoff/CriticMarkup-toolkit/master/Sublime Text Package/Critic Markup/Critic.tmLanguage.cache -------------------------------------------------------------------------------- /Objective-C/CriticMarkupRenderer.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface CriticMarkupRenderer : NSObject 4 | + (NSString *)renderCriticMarkup:(NSString *)input; 5 | @end -------------------------------------------------------------------------------- /Sublime Text Package/Critic Markup/list_critics_comments.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttscoff/CriticMarkup-toolkit/master/Sublime Text Package/Critic Markup/list_critics_comments.pyc -------------------------------------------------------------------------------- /BBEdit Additions/CriticMarkup.bbpackage/Contents/Scripts/Find Next CMark.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttscoff/CriticMarkup-toolkit/master/BBEdit Additions/CriticMarkup.bbpackage/Contents/Scripts/Find Next CMark.scpt -------------------------------------------------------------------------------- /Mac System Services/Accept Critic Mark.workflow/Contents/QuickLook/Preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttscoff/CriticMarkup-toolkit/master/Mac System Services/Accept Critic Mark.workflow/Contents/QuickLook/Preview.png -------------------------------------------------------------------------------- /Mac System Services/Reject Critic Mark.workflow/Contents/QuickLook/Preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttscoff/CriticMarkup-toolkit/master/Mac System Services/Reject Critic Mark.workflow/Contents/QuickLook/Preview.png -------------------------------------------------------------------------------- /BBEdit Additions/CriticMarkup.bbpackage/Contents/Scripts/Find Previous CMark.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ttscoff/CriticMarkup-toolkit/master/BBEdit Additions/CriticMarkup.bbpackage/Contents/Scripts/Find Previous CMark.scpt -------------------------------------------------------------------------------- /Swift/README.md: -------------------------------------------------------------------------------- 1 | A simple class with a `renderCriticMarkup` static method. 2 | 3 | I converted this from the Objective-C implementation. It's not tested, if you make any updates, please add a PR! 4 | 5 | ```swift 6 | let html = CriticMarkupRenderer.renderCriticMarkup(markdownString) 7 | ``` -------------------------------------------------------------------------------- /Objective-C/README.md: -------------------------------------------------------------------------------- 1 | An Objective-C CriticMarkup implementation. 2 | 3 | I built this for [Marked](https://marked2app.com) and thought I'd share. 4 | 5 | ``` 6 | #import "CriticMarkupRenderer.h" 7 | [CriticMarkupRenderer renderCriticMarkup:@"This is a test. delete insert."]; 8 | ``` -------------------------------------------------------------------------------- /PopClip/CriticMarks.popclipext/inc.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PopClip/CriticMarks.popclipext/usun.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /PopClip/CriticMarks.popclipext/dodaj.php: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /PopClip/CriticMarks.popclipext/komentuj.php: -------------------------------------------------------------------------------- 1 | > <<}"; 11 | ?> -------------------------------------------------------------------------------- /Sublime Text Package/Critic Markup/Critic.JSON-tmLanguage: -------------------------------------------------------------------------------- 1 | { "name": "Critic", 2 | "scopeName": "source.critic", 3 | "fileTypes": ["critic"], 4 | "patterns": [ 5 | { 6 | "match": "\\{\\+\\+(.*?)\\+\\+[ \\t]*(\\[(.*?)\\])?[ \\t]*\\}", 7 | "name": "string.addition", 8 | "comment": "Editorial Addition" 9 | }, 10 | { 11 | "match": "\\{\\-\\-(.*?)\\-\\-[ \\t]*(\\[(.*?)\\])?[ \\t]*\\}", 12 | "name": "string.deletion", 13 | "comment": "Editorial Deletion" 14 | }, 15 | { 16 | "match": "\\{~~(.*?)~~[ \\t]*(\\[(.*?)\\])?[ \\t]*\\}", 17 | "name": "string.comment", 18 | "comment": "Editorial Deletion" 19 | } 20 | ], 21 | "uuid": "2a1dd069-4748-4825-bf5f-0bb7d2db26dd" 22 | } -------------------------------------------------------------------------------- /Sublime Text 3 Package/Critic Markup/Critic.JSON-tmLanguage: -------------------------------------------------------------------------------- 1 | { "name": "Critic", 2 | "scopeName": "source.critic", 3 | "fileTypes": ["critic"], 4 | "patterns": [ 5 | { 6 | "match": "\\{\\+\\+(.*?)\\+\\+[ \\t]*(\\[(.*?)\\])?[ \\t]*\\}", 7 | "name": "string.addition", 8 | "comment": "Editorial Addition" 9 | }, 10 | { 11 | "match": "\\{\\-\\-(.*?)\\-\\-[ \\t]*(\\[(.*?)\\])?[ \\t]*\\}", 12 | "name": "string.deletion", 13 | "comment": "Editorial Deletion" 14 | }, 15 | { 16 | "match": "\\{~~(.*?)~~[ \\t]*(\\[(.*?)\\])?[ \\t]*\\}", 17 | "name": "string.comment", 18 | "comment": "Editorial Deletion" 19 | } 20 | ], 21 | "uuid": "2a1dd069-4748-4825-bf5f-0bb7d2db26dd" 22 | } -------------------------------------------------------------------------------- /Sublime Text 3 Package/Critic Markup/critic_edits.py: -------------------------------------------------------------------------------- 1 | import sublime 2 | import sublime_plugin 3 | 4 | class CriticReplaceCommand(sublime_plugin.TextCommand): 5 | def run(self, edit, a, b, txt): 6 | sel = sublime.Region(a, b) 7 | self.view.replace(edit, sel, txt) 8 | 9 | class CriticEraseCommand(sublime_plugin.TextCommand): 10 | def run(self, edit, a, b): 11 | sel = sublime.Region(a, b) 12 | self.view.erase(edit, sel) 13 | 14 | class CriticReplaceAndMoveCommand(sublime_plugin.TextCommand): 15 | def run(self, edit, a, b, txt, newPos): 16 | sel = sublime.Region(a, b) 17 | self.view.replace(edit, sel, txt) 18 | self.view.sel().clear() 19 | self.view.sel().add(newPos) 20 | self.view.show(newPos) 21 | -------------------------------------------------------------------------------- /Mac System Services/Accept Critic Mark.workflow/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSServices 6 | 7 | 8 | NSMenuItem 9 | 10 | default 11 | Accept Critic Mark 12 | 13 | NSMessage 14 | runWorkflowAsService 15 | NSReturnTypes 16 | 17 | public.utf8-plain-text 18 | 19 | NSSendTypes 20 | 21 | public.utf8-plain-text 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Mac System Services/Reject Critic Mark.workflow/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSServices 6 | 7 | 8 | NSMenuItem 9 | 10 | default 11 | Reject Critic Mark 12 | 13 | NSMessage 14 | runWorkflowAsService 15 | NSReturnTypes 16 | 17 | public.utf8-plain-text 18 | 19 | NSSendTypes 20 | 21 | public.utf8-plain-text 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /BBEdit Additions/CriticMarkup.bbpackage/Contents/Text Filters/00)Reject CMark: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # CriticMarkup reject change script for BBEdit 3 | 4 | myMark = STDIN.read 5 | 6 | # CriticMarks 7 | # ----------- 8 | # Addition {++ ++} 9 | # Deletion {-- --} 10 | # Substitution {~~ ~> ~~} 11 | # Comment {>> <<} 12 | # Highlight {== ==}{>> <<} 13 | 14 | addition_mark = /^\{\+\+(.+?)\+\+\}$/ 15 | deletion_mark = /^\{\-\-(.+?)\-\-\}$/ 16 | sub_mark = /^\{\~\~(.+?)\~\>(.+?)\~\~\}$/ 17 | comment_mark = /^\{\>\>(.+?)\<\<\}/ 18 | highlight_mark = /^\{\=\=(.+?)\=\=\}\{\>\>(.+?)\<\<\}$/ 19 | 20 | if addition_mark =~ myMark 21 | print "" 22 | elsif deletion_mark =~ myMark 23 | print myMark.gsub(deletion_mark, "\\1") 24 | elsif sub_mark =~ myMark 25 | print myMark.gsub(sub_mark, "\\1") 26 | else 27 | 28 | end -------------------------------------------------------------------------------- /BBEdit Additions/CriticMarkup.bbpackage/Contents/Text Filters/00)Accept CMark: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # CriticMarkup accept change script for BBEdit 3 | 4 | myMark = STDIN.read 5 | 6 | # CriticMarks 7 | # ----------- 8 | # Addition {++ ++} 9 | # Deletion {-- --} 10 | # Substitution {~~ ~> ~~} 11 | # Comment {>> <<} 12 | # Highlight {== ==}{>> <<} 13 | 14 | addition_mark = /^\{\+\+(.+?)\+\+\}$/ 15 | deletion_mark = /^\{\-\-(.+?)\-\-\}$/ 16 | sub_mark = /^\{\~\~(.+?)\~\>(.+?)\~\~\}$/ 17 | comment_mark = /^\{\>\>(.+?)\<\<\}/ 18 | highlight_mark = /^\{\=\=(.+?)\=\=\}\{\>\>(.+?)\<\<\}$/ 19 | 20 | if addition_mark =~ myMark 21 | print myMark.gsub(addition_mark, "\\1").chomp 22 | elsif deletion_mark =~ myMark 23 | print "" 24 | elsif sub_mark =~ myMark 25 | print myMark.gsub(sub_mark, "\\2").chomp 26 | else 27 | end -------------------------------------------------------------------------------- /Sublime Text Package/Critic Markup/Critic.sublime-settings: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": 3 | [ 4 | "md", 5 | "mdown", 6 | "mmd", 7 | "txt" 8 | ], 9 | "trim_trailing_white_space_on_save": false, 10 | "font_face": "Menlo", 11 | "font_size": 15, 12 | "font_options": [ "subpixel_antialias", "no_round", "directwrite"], 13 | "color_scheme": "Packages/Critic Markup/Critic.tmTheme", 14 | // "color_scheme": "Packages/MarkdownEditing/MarkdownEditor-Focus.tmTheme", 15 | "translate_tabs_to_spaces": true, 16 | "word_wrap": true, 17 | "wrap_width": 70, 18 | "draw_centered": true, 19 | "auto_match_enabled": true, 20 | "line_padding_top": 10, 21 | "caret_style": "smooth", 22 | "indent_subsequent_lines": false, 23 | "highlight_line": true, 24 | "auto_complete_commit_on_tab": true, 25 | "auto_complete_with_fields": true, 26 | // add trailing #'s to headlines 27 | "match_header_hashes": false 28 | } 29 | -------------------------------------------------------------------------------- /Sublime Text 3 Package/Critic Markup/Critic.sublime-settings: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": 3 | [ 4 | "md", 5 | "mdown", 6 | "mmd", 7 | "txt" 8 | ], 9 | "trim_trailing_white_space_on_save": false, 10 | "font_face": "Menlo", 11 | "font_size": 15, 12 | "font_options": [ "subpixel_antialias", "no_round", "directwrite"], 13 | "color_scheme": "Packages/Critic Markup/Critic.tmTheme", 14 | // "color_scheme": "Packages/MarkdownEditing/MarkdownEditor-Focus.tmTheme", 15 | "translate_tabs_to_spaces": true, 16 | "word_wrap": true, 17 | "wrap_width": 70, 18 | "draw_centered": true, 19 | "auto_match_enabled": true, 20 | "line_padding_top": 10, 21 | "caret_style": "smooth", 22 | "indent_subsequent_lines": false, 23 | "highlight_line": true, 24 | "auto_complete_commit_on_tab": true, 25 | "auto_complete_with_fields": true, 26 | // add trailing #'s to headlines 27 | "match_header_hashes": false 28 | } 29 | -------------------------------------------------------------------------------- /Sublime Text 3 Package/Critic Markup/list_critics_comments.py: -------------------------------------------------------------------------------- 1 | import sublime, sublime_plugin 2 | import re 3 | 4 | class ListCriticsCommentsCommand(sublime_plugin.TextCommand): 5 | def run(self, edit): 6 | self.markers = [] 7 | self.view.find_all(r'''(?s)((\{>>(.*?)<<\})|(\{==(.*?)==\}\{>>(.*?)<<\}))''', 0, "$1", self.markers) 8 | self.view.window().show_quick_panel(self.markers, self.goto_critic, sublime.MONOSPACE_FONT) 9 | 10 | def goto_critic(self, choice): 11 | if choice == -1: 12 | return 13 | else: 14 | findmarker = self.markers[choice] 15 | #print re.escape(findmarker) 16 | self.view.sel().clear() 17 | 18 | # re.escape escapes a single quote. That breaks the Sublime find function. 19 | # Need to substitute escaped single quote with just single quote 20 | findmarker = findmarker.replace("{", "\{").replace("}", "\}") 21 | pt = self.view.find(findmarker, 0) 22 | self.view.sel().add(pt) 23 | self.view.show(pt) -------------------------------------------------------------------------------- /Sublime Text Package/Critic Markup/list_critics_comments.py: -------------------------------------------------------------------------------- 1 | import sublime, sublime_plugin 2 | import re 3 | 4 | class ListCriticsCommentsCommand(sublime_plugin.TextCommand): 5 | def run(self, edit): 6 | self.markers = [] 7 | self.view.find_all(r'''(?s)((\{>>(.*?)<<\})|(\{\=\=(.*?)\=\=\}\{>>(.*?)<<\}))''', 0, "$1", self.markers) 8 | self.view.window().show_quick_panel(self.markers, self.goto_critic, sublime.MONOSPACE_FONT) 9 | 10 | def goto_critic(self, choice): 11 | if choice == -1: 12 | return 13 | else: 14 | findmarker = self.markers[choice] 15 | #print re.escape(findmarker) 16 | self.view.sel().clear() 17 | 18 | # re.escape escapes a single quote. That breaks the Sublime find function. 19 | # Need to substitute escaped single quote with just single quote 20 | findmarker = findmarker.replace("{", "\{").replace("}", "\}") 21 | pt = self.view.find(findmarker, 0) 22 | self.view.sel().add(pt) 23 | self.view.show(pt) -------------------------------------------------------------------------------- /Sublime Text Package/Critic Markup/list_critics.py: -------------------------------------------------------------------------------- 1 | import sublime, sublime_plugin 2 | import re 3 | 4 | class ListCriticsCommand(sublime_plugin.TextCommand): 5 | def run(self, edit): 6 | self.markers = [] 7 | self.view.find_all(r'((?s)\{([\+\+|\-\-|\~\~])(.*?)([\+\+|\-\-|\~\~])[ \t]*(\[(.*?)\])?[ \t]*\})', 0, "$1", self.markers) 8 | self.view.window().show_quick_panel(self.markers, self.goto_critic, sublime.MONOSPACE_FONT) 9 | 10 | def goto_critic(self, choice): 11 | if choice == -1: 12 | return 13 | else: 14 | findmarker = self.markers[choice] 15 | self.view.sel().clear() 16 | 17 | # re.escape escapes a single quote. That breaks the Sublime find function. 18 | # Need to substitute escaped single quote with just single quote 19 | findmarker = findmarker.replace("{", "\{").replace("}", "\}").replace("[", "\[").replace("]", "\]").replace("(", "\(").replace(")", "\)").replace("+", "\+") 20 | 21 | pt = self.view.find(findmarker, 0) 22 | self.view.sel().add(pt) 23 | self.view.show(pt) -------------------------------------------------------------------------------- /Sublime Text 3 Package/Critic Markup/list_critics.py: -------------------------------------------------------------------------------- 1 | import sublime, sublime_plugin 2 | import re 3 | 4 | class ListCriticsCommand(sublime_plugin.TextCommand): 5 | def run(self, edit): 6 | self.markers = [] 7 | self.view.find_all(r'((?s)\{([\+\+|\-\-|\~\~])(.*?)([\+\+|\-\-|\~\~])[ \t]*(\[(.*?)\])?[ \t]*\})', 0, "$1", self.markers) 8 | self.view.window().show_quick_panel(self.markers, self.goto_critic, sublime.MONOSPACE_FONT) 9 | 10 | def goto_critic(self, choice): 11 | if choice == -1: 12 | return 13 | else: 14 | findmarker = self.markers[choice] 15 | self.view.sel().clear() 16 | 17 | # re.escape escapes a single quote. That breaks the Sublime find function. 18 | # Need to substitute escaped single quote with just single quote 19 | findmarker = findmarker.replace("{", "\{").replace("}", "\}").replace("[", "\[").replace("]", "\]").replace("(", "\(").replace(")", "\)").replace("+", "\+") 20 | 21 | pt = self.view.find(findmarker, 0) 22 | self.view.sel().add(pt) 23 | self.view.show(pt) -------------------------------------------------------------------------------- /PopClip/README.md: -------------------------------------------------------------------------------- 1 | # Critic Markup Extension # 2 | 3 | *Version 1.0 15 Apr 2013* 4 | 5 | This is extension for using [Critic Markup](http://criticmarkup.com) syntax in multimarkdown documents. 6 | 7 | ## Usage ## 8 | 9 | If you edit someone's documents, use one of four critical marks: 10 | 11 | - **addition** 12 | - **deletion** 13 | - **text substitution** 14 | - **highlight part of the text for comment** 15 | 16 | Each selected mark may be accepted or rejected using System Services. If you don't have them in your OS download [Critical Markup Toolbox](https://github.com/CriticMarkup/CriticMarkup-toolkit/archive/master.zip) 17 | and put available Services inside your `~/Library/Services` directory. 18 | 19 | 20 | ## To-Do ## 21 | 22 | - [ ] Rewrite System Services for accepting and rejecting critic marks 23 | - [ ] Add actions for accepting/rejecting marks in whole document at once 24 | - [X] Actions should not appear in Firefox,Opera and Chrome 25 | 26 | ## Credits ## 27 | 28 | Extension and icons made by [Sebastian Szwarc](https://twitter.com/Behinder). 29 | -------------------------------------------------------------------------------- /BBEdit Additions/CriticMarkup.bbpackage/Contents/Language Modules/CriticCodelessLanguageModule.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BBEditDocumentType 6 | CodelessLanguageModule 7 | BBLMLanguageDisplayName 8 | Critic 9 | BBLMLanguageCode 10 | crit 11 | BBLMColorsSyntax 12 | 13 | BBLMScansFunctions 14 | 15 | BBLMIsCaseSensitive 16 | 17 | BBLMKeywordList 18 | 19 | 20 | BBLMSuffixMap 21 | 22 | 23 | BBLMLanguageSuffix 24 | .crit 25 | 26 | 27 | Language Features 28 | 29 | Comment Pattern 30 | 31 | \{>>(.*?)<<\} 32 | 33 | Function Pattern 34 | 35 | Identifier and Keyword Character Class 36 | 37 | 0-9A-Z_a-z',." 38 | 39 | Skip Pattern 40 | 41 | String Pattern 42 | (?s)(\{((\+\+)|(\-\-)|(\~\~))(.*?)((\+\+)|(\-\-)|(\~\~))[ \t]*(\[(.*?)\])?[ \t]*\})) 44 | ]]> 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Sublime Text Package/Critic Markup/mark_critic.py: -------------------------------------------------------------------------------- 1 | import sublime, sublime_plugin 2 | 3 | class MarkCritic(sublime_plugin.TextCommand): 4 | def run(self, edit): 5 | self.options = ['Deletion', 'Addition', 'Substitution', 'Comment', "highlight"] 6 | # Need to find scope limits then do regex find within current scope 7 | self.view.window().show_quick_panel(self.options, self.process_critic_mark, sublime.MONOSPACE_FONT) 8 | 9 | def process_critic_mark(self, choice): 10 | # Choice 0 is accept 11 | sels = self.view.sel() 12 | edit = self.view.begin_edit() 13 | for sel in sels: 14 | text = self.view.substr(sel) 15 | # Deletion 16 | if choice == 0: 17 | self.view.replace(edit, sel, "{--"+text+"--}") 18 | if choice == 1: 19 | self.view.replace(edit, sel, "{++"+text+"++}") 20 | if choice == 2: 21 | self.view.replace(edit, sel, "{~~"+text+"~>~~}") 22 | myRegion = self.view.sel() 23 | oldPos = self.view.sel()[0].end() 24 | newPos = oldPos - 3 25 | self.view.sel().clear() 26 | self.view.sel().add(newPos) 27 | self.view.show(newPos) 28 | if choice == 3: 29 | self.view.replace(edit, sel, "{>>"+text+"<<}") 30 | if choice == 4: 31 | self.view.replace(edit, sel, "{=="+text+"==}") 32 | 33 | self.view.end_edit(edit) 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Sublime Text 3 Package/Critic Markup/Critic.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | critic 8 | 9 | name 10 | Critic 11 | patterns 12 | 13 | 14 | comment 15 | Editorial Substitution 16 | match 17 | \{~~(.*?)~~\} 18 | name 19 | string.substitution 20 | 21 | 22 | comment 23 | Editorial Addition 24 | match 25 | \{\+\+(.*?)\+\+[ \t]*(\[(.*?)\])?[ \t]*\} 26 | name 27 | string.addition 28 | 29 | 30 | comment 31 | Editorial Deletion 32 | match 33 | \{\-\-(.*?)\-\-[ \t]*(\[(.*?)\])?[ \t]*\} 34 | name 35 | string.deletion 36 | 37 | 38 | highlight 39 | Editorial Highlight 40 | match 41 | \{==(.*?)[ \t]*(\[(.*?)\])?[ \t]*==\} 42 | name 43 | string.highlight 44 | 45 | 46 | comment 47 | Editorial Mark 48 | match 49 | \{>>(.*?)<<\} 50 | name 51 | string.comment 52 | 53 | 54 | 55 | scopeName 56 | text.html.markdown.critic 57 | uuid 58 | 2a1dd069-4748-4825-bf5f-0bb7d2db26dd 59 | 60 | 61 | -------------------------------------------------------------------------------- /Sublime Text Package/Critic Markup/Critic.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | critic 8 | 9 | name 10 | Critic 11 | patterns 12 | 13 | 14 | comment 15 | Editorial Substitution 16 | match 17 | \{~~(.*?)~~\} 18 | name 19 | string.substitution 20 | 21 | 22 | comment 23 | Editorial Addition 24 | match 25 | \{\+\+(.*?)\+\+[ \t]*(\[(.*?)\])?[ \t]*\} 26 | name 27 | string.addition 28 | 29 | 30 | comment 31 | Editorial Deletion 32 | match 33 | \{\-\-(.*?)\-\-[ \t]*(\[(.*?)\])?[ \t]*\} 34 | name 35 | string.deletion 36 | 37 | 38 | highlight 39 | Editorial Highlight 40 | match 41 | \{\=\=(.*?)[ \t]*(\[(.*?)\])?[ \t]*\=\=\} 42 | name 43 | string.highlight 44 | 45 | 46 | comment 47 | Editorial Mark 48 | match 49 | \{>>(.*?)<<\} 50 | name 51 | string.comment 52 | 53 | 54 | 55 | scopeName 56 | text.html.markdown.critic 57 | uuid 58 | 2a1dd069-4748-4825-bf5f-0bb7d2db26dd 59 | 60 | 61 | -------------------------------------------------------------------------------- /Sublime Text Package/Critic Markup/accept_critic.py: -------------------------------------------------------------------------------- 1 | import sublime, sublime_plugin 2 | import re 3 | 4 | class AcceptCriticCommand(sublime_plugin.TextCommand): 5 | def run(self, edit): 6 | self.options = ['Accept', 'Reject'] 7 | # Need to find scope limits then do regex find within current scope 8 | self.view.window().show_quick_panel(self.options, self.process_critic, sublime.MONOSPACE_FONT) 9 | 10 | def process_critic(self, choice): 11 | # Choice 0 is accept 12 | sels = self.view.sel() 13 | caret = [] 14 | add_edit = re.compile(r'(?s)\{\+\+(.*?)\+\+[ \t]*(\[(.*?)\])?[ \t]*\}') 15 | del_edit = re.compile(r'(?s)\{\-\-(.*?)\-\-[ \t]*(\[(.*?)\])?[ \t]*\}') 16 | sub_edit = re.compile(r'''(?s)\{\~\~(?P(?:[^\~\>]|(?:\~(?!\>)))+)\~\>(?P(?:[^\~\~]|(?:\~(?!\~\})))+)\~\~\}''') 17 | for sel in sels: 18 | text = self.view.substr(sel) 19 | # If something is selected... 20 | if len(text) > 0: 21 | a = add_edit.search(text) 22 | d = del_edit.search(text) 23 | s = sub_edit.search(text) 24 | edit = self.view.begin_edit() 25 | if choice == 0: 26 | if a: 27 | self.view.replace(edit, sel, a.group(1)) 28 | if d: 29 | self.view.erase(edit, sel) 30 | if s: 31 | self.view.replace(edit, sel, s.group('new')) 32 | 33 | #if m.group(2) 34 | # ... turn the selected text into the link text 35 | #view.replace(edit, sel, "[{0}][{1}]".format(text, title)) 36 | # Reject 37 | elif choice == 1: 38 | if a: 39 | self.view.erase(edit, sel) 40 | if d: 41 | self.view.replace(edit, sel, d.group(1)) 42 | if s: 43 | self.view.replace(edit, sel, s.group('original')) 44 | self.view.end_edit(edit) 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Sublime Text 3 Package/Critic Markup/mark_critic.py: -------------------------------------------------------------------------------- 1 | import sublime, sublime_plugin 2 | 3 | class MarkCriticCommand(sublime_plugin.TextCommand): 4 | def run(self, edit): 5 | self.options = ['Deletion', 'Addition', 'Substitution', 'Comment', "Highlight"] 6 | # Need to find scope limits then do regex find within current scope 7 | self.view.window().show_quick_panel(self.options, self.process_critic_mark, sublime.MONOSPACE_FONT) 8 | 9 | def process_critic_mark(self, choice): 10 | # Choice 0 is accept 11 | sels = self.view.sel() 12 | # edit = self.view.begin_edit() 13 | for sel in sels: 14 | text = self.view.substr(sel) 15 | # Deletion 16 | if choice == 0: 17 | # self.view.replace(edit, sel, "{--"+text+"--}") 18 | edit = self.view.run_command("critic_replace", {"a": sel.a, "b": sel.b, "txt": "{--" + text + "--}"}) 19 | if choice == 1: 20 | # self.view.replace(edit, sel, "{++"+text+"++}") 21 | edit = self.view.run_command("critic_replace", {"a": sel.a, "b": sel.b, "txt": "{++" + text + "++}"}) 22 | if choice == 2: 23 | # self.view.replace(edit, sel, "{~~"+text+"~>~~}") 24 | myRegion = self.view.sel() 25 | oldPos = self.view.sel()[0].end() 26 | newPos = oldPos - 3 27 | self.view.sel().clear() 28 | self.view.sel().add(newPos) 29 | self.view.show(newPos) 30 | edit = self.view.run_command("critic_replace_and_move", 31 | {"a": sel.a, "b": sel.b, "txt": "{~~" + text + "~>~~}", "newPos": newPos}) 32 | if choice == 3: 33 | # self.view.replace(edit, sel, "{>>"+text+"<<}") 34 | edit = self.view.run_command("critic_replace", {"a": sel.a, "b": sel.b, "txt": "{>>" + text + "<<}"}) 35 | if choice == 4: 36 | # self.view.replace(edit, sel, "{=="+text+"==}") 37 | edit = self.view.run_command("critic_replace", {"a": sel.a, "b": sel.b, "txt": "{==" + text + "==}"}) 38 | -------------------------------------------------------------------------------- /PopClip/CriticMarks.popclipext/Config.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blocked Apps 6 | 7 | Name 8 | com.apple.Safari 9 | Name 10 | com.google.Chrome 11 | Name 12 | org.mozilla.firefox 13 | 14 | Actions 15 | 16 | 17 | Image File 18 | add.png 19 | Script Interpreter 20 | /usr/bin/env php 21 | Shell Script File 22 | dodaj.php 23 | After 24 | paste-result 25 | Title 26 | Addition 27 | 28 | 29 | Image File 30 | delete.png 31 | Script Interpreter 32 | /usr/bin/env php 33 | Shell Script File 34 | usun.php 35 | After 36 | paste-result 37 | Title 38 | Deletion 39 | 40 | 41 | Image File 42 | zaznacz.png 43 | Script Interpreter 44 | /usr/bin/env php 45 | Shell Script File 46 | komentuj.php 47 | After 48 | paste-result 49 | Title 50 | Highlght+Comment 51 | 52 | 53 | Image File 54 | podstaw.png 55 | Script Interpreter 56 | /usr/bin/env php 57 | Shell Script File 58 | podstaw.php 59 | After 60 | paste-result 61 | Title 62 | Substitution 63 | 64 | 65 | 66 | Title 67 | ACM 68 | Service Name 69 | Accept Critic Mark 70 | 71 | 72 | Title 73 | RCM 74 | Service Name 75 | Reject Critic Mark 76 | 77 | 78 | Credits 79 | 80 | 81 | Name 82 | Sebastian Szwarc 83 | 84 | 85 | Extension Identifier 86 | com.sebaszwarc.criticmarks 87 | Extension Name 88 | Critic Marks 89 | Extension Image File 90 | quotes.png 91 | Required Software Version 92 | 701 93 | 94 | 95 | -------------------------------------------------------------------------------- /Sublime Text 3 Package/Critic Markup/accept_critic.py: -------------------------------------------------------------------------------- 1 | import sublime, sublime_plugin 2 | import re 3 | 4 | class AcceptCriticCommand(sublime_plugin.TextCommand): 5 | def run(self, edit): 6 | self.options = ['Accept', 'Reject'] 7 | # Need to find scope limits then do regex find within current scope 8 | self.view.window().show_quick_panel(self.options, self.process_critic, sublime.MONOSPACE_FONT) 9 | 10 | def process_critic(self, choice): 11 | # Choice 0 is accept 12 | sels = self.view.sel() 13 | caret = [] 14 | add_edit = re.compile(r'(?s)\{\+\+(.*?)\+\+[ \t]*(\[(.*?)\])?[ \t]*\}') 15 | del_edit = re.compile(r'(?s)\{\-\-(.*?)\-\-[ \t]*(\[(.*?)\])?[ \t]*\}') 16 | sub_edit = re.compile(r'''(?s)\{\~\~(?P(?:[^\~\>]|(?:\~(?!\>)))+)\~\>(?P(?:[^\~\~]|(?:\~(?!\~\})))+)\~\~\}''') 17 | for sel in sels: 18 | text = self.view.substr(sel) 19 | # If something is selected... 20 | if len(text) > 0: 21 | a = add_edit.search(text) 22 | d = del_edit.search(text) 23 | s = sub_edit.search(text) 24 | # edit = self.view.begin_edit() 25 | if choice == 0: 26 | if a: 27 | # self.view.replace(edit, sel, a.group(1)) 28 | self.view.run_command("critic_replace", {"a": sel.a, "b": sel.b, "txt": a.group(1)}) 29 | if d: 30 | # self.view.erase(edit, sel) 31 | self.view.run_command("critic_erase", {"a": sel.a, "b": sel.b}) 32 | if s: 33 | # self.view.replace(edit, sel, s.group('new')) 34 | self.view.run_command("critic_replace", {"a": sel.a, "b": sel.b, "txt": s.group('new')}) 35 | 36 | #if m.group(2) 37 | # ... turn the selected text into the link text 38 | #view.replace(edit, sel, "[{0}][{1}]".format(text, title)) 39 | # Reject 40 | elif choice == 1: 41 | if a: 42 | # self.view.erase(edit, sel) 43 | self.view.run_command("critic_erase", {"a": sel.a, "b": sel.b}) 44 | if d: 45 | # self.view.replace(edit, sel, d.group(1)) 46 | self.view.run_command("critic_replace", {"a": sel.a, "b": sel.b, "txt": d.group(1)}) 47 | if s: 48 | # self.view.replace(edit, sel, s.group('original')) 49 | self.view.run_command("critic_replace", {"a": sel.a, "b": sel.b, "txt": s.group('original')}) 50 | -------------------------------------------------------------------------------- /CLI/About.md: -------------------------------------------------------------------------------- 1 | ## Introduction ## 2 | 3 | The Critic Markup CLI is for use with the [Critic Markup Syntax](http://criticmarkup.com). The CLI is a Command Line Interface to convert a Critic Markup file into styled HTML for use with any browser. 4 | 5 | ## Dependencies ## 6 | 7 | The CLI script requires a Python module for converting Multimarkdown into HTML. The default is for the CLI to use the [Python-Markdown](http://pythonhosted.org/Markdown/) module with the 'extra', 'codehilite', 'meta' extensions enabled. 8 | 9 | To use the Critic Markup CLI, please [install the module](http://pythonhosted.org/Markdown/install.html). 10 | 11 | As an alternative, the CLI can use the [Python-Markdown2](https://github.com/trentm/python-markdown2) module with the 'footnotes', 'fenced-code-blocks', 'cuddled-lists', 'code-friendly' extensions enabled. 12 | 13 | To use Python-Markdown2, please [install the library manually](https://github.com/trentm/python-markdown2/#install), using one of several methods. 14 | 15 | ## Features ## 16 | 17 | To see the basic usage of the parser, execute the script as follows: 18 | 19 | >> python criticParser_CLI.py -h 20 | usage: criticParser_CLI.py [-h] [-m2] [-o out-file] [-css in-file] [-b] source 21 | 22 | Convert Critic Markup to HTML 23 | 24 | positional arguments: 25 | source The source file path, including file name 26 | 27 | optional arguments: 28 | -h, --help show this help message and exit 29 | -m2 Use the markdown2 python module. If left blank then markdown module is used 30 | -o out-file, --output out-file 31 | Path to store the output file, including file name 32 | -css in-file, --css in-file 33 | Path to a custom CSS file, including file name 34 | -b, --browser View the output file in the default browser after saving. 35 | 36 | The Critic Markup CLI requires at least one argument consisting of the file path to a text file and is executed from the command line as a Python script. 37 | 38 | python criticParser_CLI.py 39 | 40 | By default, the CLI tool will output an HTML file in the same location as the source file appended with _CriticParserOut. 41 | 42 | ### Options ### 43 | 44 | There are several optional flags available with the CLI. 45 | 46 | The `-m2` option allows the user to convert Markdown using the Python-Markdown2 module. Some may prefer the results of this module in comparison to the original Python-Markdown module. 47 | 48 | The `-o` option allows a user to specify an output file and location. The result file saves with overwrite. 49 | 50 | The `-css` option allows a uer to override the default CSS, JavaScript and JQuery imports with a user specified file. The `-css` option must be followed by the file path to an alternative. 51 | 52 | The `-b` flags immediately opens the output file in the default browser. 53 | 54 | ### Example Usage ### 55 | 56 | From the terminal, the following command will convert a Critic Markup file to HTML using a custom CSS file and open it in the default browser. 57 | 58 | python criticParser_CLI.py 'my_CM_File.md' -o 'my_CM_Output.html' -m2 -css custom_CM_CSS.css -v 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /BBEdit Additions/README.md: -------------------------------------------------------------------------------- 1 | # CriticMarkup toolkit for BBEdit 2 | 3 | To install the CriticMarkup toolkit for BBEdit, copy `CriticMarkup.bbpackage` to the `Library/Application Support/BBEdit/Packages` folder in your home folder, then restart BBEdit. 4 | 5 | If your BBEdit version doesn't support Packages, or you prefer to manually install some or all of the toolkit, right-click or option-click `CriticMarkup.bbpackage` and click `Show Package Contents`. In the Contents folder, copy each folder's contents to the corresponding folders in your `Library/Application Support/BBEdit/` folder. 6 | 7 | ## Clippings 8 | 9 | The CriticMarkup toolkit adds clippings that insert CriticMarkup tags in text, either at the cursor's location or selected text. 10 | 11 | - For the substitution, deletion or highlight marks, select some text then double-click the appropriate clipping in the Markdown clippings palette. 12 | - For the insertion or comment marks, place the cursor at the appropriate place in the text and click the appropriate clipping in the Markdown clippings palette. 13 | 14 | To assign keyboard shortcuts to each of the clippings: 15 | 16 | 1. Open the Clippings palette (**Windows** → **Palettes** → **Clippings**). 17 | 2. Click the Clipping for which you want to set a keyboard shortcut. 18 | 3. Click the Set Shortcut button at the top right of the palette. 19 | 4. Enter your preferred keyboard shortcut. 20 | - Control key combinations are largely unused in BBEdit (with the exception of `control-s`, which is used for progressive search). 21 | 22 | ## Find Next/Previous CriticMarkup Scripts 23 | 24 | These scripts help you move between CriticMarkup tags in a file. Each script selects both the opening and closing CriticMarkup tags as well as any contained text. You can change this behavior by opening the scripts inside `CriticMarkup.bbpackage` with an AppleScript editor and removing `with selecting match` from the end of the `find` command. 25 | 26 | If a script reaches the end of the file without finding a tag, it wraps around to the top of the file and continues searching. To change this behavior, open the scripts in an AppleScript editor and change `wrap around:true` to `wrap around:false`. 27 | 28 | To assign keyboard shortcuts to each of the scripts: 29 | 30 | 1. Open BBEdit's preferences (**BBEdit&& → **Preferences**). 31 | 2. Access the Scripts keyboard shortcut preferences (**Menus & Shortcuts** → **Scripts**). 32 | 3. Double-click the grayed-out "none" or any existing keyboard shortcut next to each script. 33 | 4. Enter your preferred keyboard shortcut. 34 | 35 | Control key combinations are largely unused in BBEdit (with the exception of `control-s`, which is used for progressive search). 36 | 37 | ## Text Filters 38 | 39 | The CriticMarkup toolkit's text filters (**Text menu** → **Apply Text Filter** → **Accept CMark and Reject CMark**) make it easy to accept or reject CriticMarkup tags in a file. With keyboard shortcuts, you can rule on each successive tag automatically without scrolling or manually moving the cursor through the file. 40 | 41 | To assign keyboard shortcuts to each of the filters: 42 | 43 | 1. Open BBEdit's preferences (**BBEdit&& → **Preferences**). 44 | 2. Access the Text Filter keyboard shortcut preferences (**Menus & Shortcuts** → **Text** → **Apply Text Filter**). 45 | 3. Double-click the grayed-out "none" or any existing keyboard shortcut next to each Text Filter. 46 | 4. Enter your preferred keyboard shortcut. 47 | - Control key combinations are largely unused in BBEdit (with the exception of `control-s`, which is used for progressive search). 48 | -------------------------------------------------------------------------------- /TextExpander Snippets/Critic.textexpander: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | groupInfo 6 | 7 | expandAfterMode 8 | 2 9 | groupName 10 | Critic 11 | 12 | snippetsTE2 13 | 14 | 15 | abbreviation 16 | ;sub 17 | abbreviationMode 18 | 0 19 | creationDate 20 | 2013-01-08T00:03:51Z 21 | flags 22 | 0 23 | label 24 | Substitution 25 | lastUsed 26 | 2013-02-09T19:04:48Z 27 | modificationDate 28 | 2013-02-09T23:12:32Z 29 | plainText 30 | {~~%|~> ~~} 31 | snippetType 32 | 0 33 | useCount 34 | 9 35 | uuidString 36 | 457432D0-F43B-4303-B37F-87D7932B0744 37 | 38 | 39 | abbreviation 40 | ;com 41 | abbreviationMode 42 | 0 43 | creationDate 44 | 2013-01-07T23:58:17Z 45 | flags 46 | 0 47 | label 48 | Comment 49 | lastUsed 50 | 2013-01-20T14:03:04Z 51 | modificationDate 52 | 2013-02-09T23:13:33Z 53 | plainText 54 | {>>%|<<} 55 | snippetType 56 | 0 57 | useCount 58 | 13 59 | uuidString 60 | EC8CA1F3-FF98-45AB-9F79-B3B7A3E20FAF 61 | 62 | 63 | abbreviation 64 | ;ins 65 | abbreviationMode 66 | 0 67 | creationDate 68 | 2012-12-29T13:40:25Z 69 | flags 70 | 0 71 | label 72 | Insertion 73 | lastUsed 74 | 2013-02-09T19:43:09Z 75 | modificationDate 76 | 2013-01-24T13:28:07Z 77 | plainText 78 | {++%|++} 79 | snippetType 80 | 0 81 | useCount 82 | 69 83 | uuidString 84 | F8D4182B-5E61-4255-B7B9-24270F150948 85 | 86 | 87 | abbreviation 88 | ;del 89 | abbreviationMode 90 | 0 91 | creationDate 92 | 2012-12-29T13:37:25Z 93 | flags 94 | 0 95 | label 96 | Deletion 97 | lastUsed 98 | 2013-02-09T19:51:39Z 99 | modificationDate 100 | 2013-01-16T00:51:20Z 101 | plainText 102 | {--%|--} 103 | snippetType 104 | 0 105 | useCount 106 | 66 107 | uuidString 108 | 49839A7D-4D24-4FDC-846A-73EF2D3E4F3C 109 | 110 | 111 | abbreviation 112 | ;hi 113 | abbreviationMode 114 | 0 115 | creationDate 116 | 2012-12-29T13:33:02Z 117 | flags 118 | 0 119 | label 120 | Highlight 121 | lastUsed 122 | 2013-01-24T15:22:59Z 123 | modificationDate 124 | 2013-02-16T03:31:29Z 125 | plainText 126 | {==%|==}{>><<} 127 | snippetType 128 | 0 129 | useCount 130 | 20 131 | uuidString 132 | B0C1CB1C-073A-4375-9E8F-B2EDF31131B9 133 | 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /Mac System Services/Accept Critic Mark.workflow/Contents/document.wflow: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AMApplicationBuild 6 | 346 7 | AMApplicationVersion 8 | 2.3 9 | AMDocumentVersion 10 | 2 11 | actions 12 | 13 | 14 | action 15 | 16 | AMAccepts 17 | 18 | Container 19 | List 20 | Optional 21 | 22 | Types 23 | 24 | com.apple.cocoa.string 25 | 26 | 27 | AMActionVersion 28 | 2.0.3 29 | AMApplication 30 | 31 | Automator 32 | 33 | AMParameterProperties 34 | 35 | COMMAND_STRING 36 | 37 | CheckedForUserDefaultShell 38 | 39 | inputMethod 40 | 41 | shell 42 | 43 | source 44 | 45 | 46 | AMProvides 47 | 48 | Container 49 | List 50 | Types 51 | 52 | com.apple.cocoa.string 53 | 54 | 55 | ActionBundlePath 56 | /System/Library/Automator/Run Shell Script.action 57 | ActionName 58 | Run Shell Script 59 | ActionParameters 60 | 61 | COMMAND_STRING 62 | import re 63 | import sys 64 | 65 | 66 | selected_string = sys.argv[1] 67 | 68 | add_edit = re.compile(r'(?s)\{\+\+(.*?)\+\+[ \t]*(\[(.*?)\])?[ \t]*\}') 69 | del_edit = re.compile(r'(?s)\{\-\-(.*?)\-\-[ \t]*(\[(.*?)\])?[ \t]*\}') 70 | sub_edit = re.compile(r'''(?s)\{\~\~(?P<original>(?:[^\~\>]|(?:\~(?!\>)))+)\~\>(?P<new>(?:[^\~\~]|(?:\~(?!\~\})))+)\~\~\}''') 71 | 72 | if len(selected_string) > 0: 73 | a = add_edit.sub(r'\1', selected_string) 74 | d = del_edit.sub(r'', a) 75 | s = sub_edit.sub(r'\2', d) 76 | print s 77 | else: 78 | print selected_string 79 | CheckedForUserDefaultShell 80 | 81 | inputMethod 82 | 1 83 | shell 84 | /usr/bin/python 85 | source 86 | 87 | 88 | BundleIdentifier 89 | com.apple.RunShellScript 90 | CFBundleVersion 91 | 2.0.3 92 | CanShowSelectedItemsWhenRun 93 | 94 | CanShowWhenRun 95 | 96 | Category 97 | 98 | AMCategoryUtilities 99 | 100 | Class Name 101 | RunShellScriptAction 102 | InputUUID 103 | 06C9D7AF-D83E-49A7-83B0-DC398DD05E52 104 | Keywords 105 | 106 | Shell 107 | Script 108 | Command 109 | Run 110 | Unix 111 | 112 | OutputUUID 113 | 61DC2F08-EF85-46B6-8424-73A1A3274C11 114 | UUID 115 | 5662F1AF-E613-484B-97E6-67F751505D26 116 | UnlocalizedApplications 117 | 118 | Automator 119 | 120 | arguments 121 | 122 | 0 123 | 124 | default value 125 | 0 126 | name 127 | inputMethod 128 | required 129 | 0 130 | type 131 | 0 132 | uuid 133 | 0 134 | 135 | 1 136 | 137 | default value 138 | 139 | name 140 | source 141 | required 142 | 0 143 | type 144 | 0 145 | uuid 146 | 1 147 | 148 | 2 149 | 150 | default value 151 | 152 | name 153 | CheckedForUserDefaultShell 154 | required 155 | 0 156 | type 157 | 0 158 | uuid 159 | 2 160 | 161 | 3 162 | 163 | default value 164 | 165 | name 166 | COMMAND_STRING 167 | required 168 | 0 169 | type 170 | 0 171 | uuid 172 | 3 173 | 174 | 4 175 | 176 | default value 177 | /bin/sh 178 | name 179 | shell 180 | required 181 | 0 182 | type 183 | 0 184 | uuid 185 | 4 186 | 187 | 188 | isViewVisible 189 | 190 | location 191 | 346.500000:782.000000 192 | nibPath 193 | /System/Library/Automator/Run Shell Script.action/Contents/Resources/English.lproj/main.nib 194 | 195 | isViewVisible 196 | 197 | 198 | 199 | connectors 200 | 201 | workflowMetaData 202 | 203 | serviceInputTypeIdentifier 204 | com.apple.Automator.text 205 | serviceOutputTypeIdentifier 206 | com.apple.Automator.text 207 | serviceProcessesInput 208 | 0 209 | workflowTypeIdentifier 210 | com.apple.Automator.servicesMenu 211 | 212 | 213 | 214 | -------------------------------------------------------------------------------- /Mac System Services/Reject Critic Mark.workflow/Contents/document.wflow: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AMApplicationBuild 6 | 346 7 | AMApplicationVersion 8 | 2.3 9 | AMDocumentVersion 10 | 2 11 | actions 12 | 13 | 14 | action 15 | 16 | AMAccepts 17 | 18 | Container 19 | List 20 | Optional 21 | 22 | Types 23 | 24 | com.apple.cocoa.string 25 | 26 | 27 | AMActionVersion 28 | 2.0.3 29 | AMApplication 30 | 31 | Automator 32 | 33 | AMParameterProperties 34 | 35 | COMMAND_STRING 36 | 37 | CheckedForUserDefaultShell 38 | 39 | inputMethod 40 | 41 | shell 42 | 43 | source 44 | 45 | 46 | AMProvides 47 | 48 | Container 49 | List 50 | Types 51 | 52 | com.apple.cocoa.string 53 | 54 | 55 | ActionBundlePath 56 | /System/Library/Automator/Run Shell Script.action 57 | ActionName 58 | Run Shell Script 59 | ActionParameters 60 | 61 | COMMAND_STRING 62 | import re 63 | import sys 64 | 65 | 66 | selected_string = sys.argv[1] 67 | 68 | add_edit = re.compile(r'(?s)\{\+\+(.*?)\+\+[ \t]*(\[(.*?)\])?[ \t]*\}') 69 | del_edit = re.compile(r'(?s)\{\-\-(.*?)\-\-[ \t]*(\[(.*?)\])?[ \t]*\}') 70 | sub_edit = re.compile(r'''(?s)\{\~\~(?P<original>(?:[^\~\>]|(?:\~(?!\>)))+)\~\>(?P<new>(?:[^\~\~]|(?:\~(?!\~\})))+)\~\~\}''') 71 | 72 | if len(selected_string) > 0: 73 | a = add_edit.sub(r'', selected_string) 74 | d = del_edit.sub(r'\1', a) 75 | s = sub_edit.sub(r'\1', d) 76 | print s 77 | 78 | else: 79 | print selected_string 80 | CheckedForUserDefaultShell 81 | 82 | inputMethod 83 | 1 84 | shell 85 | /usr/bin/python 86 | source 87 | 88 | 89 | BundleIdentifier 90 | com.apple.RunShellScript 91 | CFBundleVersion 92 | 2.0.3 93 | CanShowSelectedItemsWhenRun 94 | 95 | CanShowWhenRun 96 | 97 | Category 98 | 99 | AMCategoryUtilities 100 | 101 | Class Name 102 | RunShellScriptAction 103 | InputUUID 104 | 06C9D7AF-D83E-49A7-83B0-DC398DD05E52 105 | Keywords 106 | 107 | Shell 108 | Script 109 | Command 110 | Run 111 | Unix 112 | 113 | OutputUUID 114 | 61DC2F08-EF85-46B6-8424-73A1A3274C11 115 | UUID 116 | 5662F1AF-E613-484B-97E6-67F751505D26 117 | UnlocalizedApplications 118 | 119 | Automator 120 | 121 | arguments 122 | 123 | 0 124 | 125 | default value 126 | 0 127 | name 128 | inputMethod 129 | required 130 | 0 131 | type 132 | 0 133 | uuid 134 | 0 135 | 136 | 1 137 | 138 | default value 139 | 140 | name 141 | source 142 | required 143 | 0 144 | type 145 | 0 146 | uuid 147 | 1 148 | 149 | 2 150 | 151 | default value 152 | 153 | name 154 | CheckedForUserDefaultShell 155 | required 156 | 0 157 | type 158 | 0 159 | uuid 160 | 2 161 | 162 | 3 163 | 164 | default value 165 | 166 | name 167 | COMMAND_STRING 168 | required 169 | 0 170 | type 171 | 0 172 | uuid 173 | 3 174 | 175 | 4 176 | 177 | default value 178 | /bin/sh 179 | name 180 | shell 181 | required 182 | 0 183 | type 184 | 0 185 | uuid 186 | 4 187 | 188 | 189 | isViewVisible 190 | 191 | location 192 | 346.500000:782.000000 193 | nibPath 194 | /System/Library/Automator/Run Shell Script.action/Contents/Resources/English.lproj/main.nib 195 | 196 | isViewVisible 197 | 198 | 199 | 200 | connectors 201 | 202 | workflowMetaData 203 | 204 | serviceInputTypeIdentifier 205 | com.apple.Automator.text 206 | serviceOutputTypeIdentifier 207 | com.apple.Automator.text 208 | serviceProcessesInput 209 | 0 210 | workflowTypeIdentifier 211 | com.apple.Automator.servicesMenu 212 | 213 | 214 | 215 | -------------------------------------------------------------------------------- /Marked Preprocessor/critic.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import sys 3 | import os 4 | import re 5 | 6 | 7 | 8 | add_pattern = r'''(?s)\{\+\+(?P.*?)\+\+[ \t]*(\[(?P.*?)\])?[ \t]*\}''' 9 | 10 | del_pattern = r'''(?s)\{\-\-(?P.*?)\-\-[ \t]*(\[(?P.*?)\])?[ \t]*\}''' 11 | 12 | comm_pattern = r'''(?s)\{\>\>(?P.*?)\<\<\}''' 13 | 14 | gen_comm_pattern = r'''(?s)\{[ \t]*\[(?P.*?)\][ \t]*\}''' 15 | 16 | subs_pattern = r'''(?s)\{\~\~(?P(?:[^\~\>]|(?:\~(?!\>)))+)\~\>(?P(?:[^\~\~]|(?:\~(?!\~\})))+)\~\~\}''' 17 | 18 | 19 | 20 | mark_pattern = r'''(?s)\{\=\=(?P.*?)\=\=\}''' 21 | 22 | 23 | test_pattern = '''{~~Eighty-seven~>Four score and seven~~} years ago our fathers brought forth on this continent a new {~~state~>nation~~}, conceived in liberty, and dedicated to the proposition that all men {--and women--}{>>Tackle this after the war<<} are created equal.''' 24 | 25 | 26 | 27 | def deletionProcess(group_object): 28 | replaceString = '' 29 | if group_object.group('value') == '\n\n': 30 | replaceString = " " 31 | else: 32 | replaceString = '' + group_object.group('value').replace("\n\n", " ") + '' 33 | return replaceString 34 | 35 | 36 | 37 | def subsProcess(group_object): 38 | delString = '' + group_object.group('original') + '' 39 | insString = '' + group_object.group('new') + '' 40 | return delString + insString 41 | 42 | 43 | # Converts Addition markup to HTML 44 | def additionProcess(group_object): 45 | replaceString = '' 46 | 47 | # Is there a new paragraph followed by new text 48 | if group_object.group('value').startswith('\n\n') and group_object.group('value') != "\n\n": 49 | replaceString = "\n\n \n\n" 50 | replaceString = replaceString + '' + group_object.group('value').replace("\n", " ") 51 | replaceString = replaceString + '' 52 | 53 | 54 | # Is the addition just a single new paragraph 55 | elif group_object.group('value') == "\n\n": 56 | replaceString = "\n\n " + '\n\n' 57 | 58 | # Is it added text followed by a new paragraph? 59 | elif group_object.group('value').endswith('\n\n') and group_object.group('value') != "\n\n": 60 | replaceString = '' + group_object.group('value').replace("\n", " ") + '' 61 | replaceString = replaceString + "\n\n \n\n" 62 | 63 | else: 64 | replaceString = '' + group_object.group('value').replace("\n", " ") + '' 65 | 66 | 67 | return replaceString 68 | 69 | def highlightProcess(group_object): 70 | replaceString = '' + group_object.group('value').replace("\n", " ") + '' 71 | return replaceString 72 | 73 | 74 | def markProcess(group_object): 75 | replaceString = '' + group_object.group('value') + '' 76 | return replaceString 77 | 78 | a = ''' 79 | 80 | 205 | 206 |
207 |
    208 |
  • Markup
  • 209 |
  • Original
  • 210 |
  • Edited
  • 211 |
212 | 213 |
214 | 215 | 268 | ''' 269 | 270 | 271 | # Accept input from Marked.app 272 | 273 | h = sys.stdin.read() 274 | 275 | #h = test_pattern 276 | 277 | 278 | 279 | 280 | 281 | h = re.sub(del_pattern, deletionProcess, h, flags=re.DOTALL) 282 | 283 | h = re.sub(add_pattern, additionProcess, h, flags=re.DOTALL) 284 | 285 | h = re.sub(comm_pattern, highlightProcess, h, flags=re.DOTALL) 286 | 287 | h = re.sub(mark_pattern, markProcess, h, flags=re.DOTALL) 288 | 289 | h = re.sub(subs_pattern, subsProcess, h, flags=re.DOTALL) 290 | 291 | # print h 292 | 293 | z = h + a 294 | 295 | sys.stdout.write(z) 296 | 297 | -------------------------------------------------------------------------------- /Swift/CriticMarkupRenderer.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | class CriticMarkupRenderer { 4 | static func renderCriticMarkup(_ input: String) -> String { 5 | var output = input 6 | let addPattern = try! NSRegularExpression( 7 | pattern: #"\{\+\+(?.*?)\+\+[ \t]*(?:\[(?.*?)\])?[ \t]*\}"#, 8 | options: [.dotMatchesLineSeparators]) 9 | let delPattern = try! NSRegularExpression( 10 | pattern: #"\{--(?.*?)--[ \t]*(?:\[(?.*?)\])?[ \t]*\}"#, 11 | options: [.dotMatchesLineSeparators]) 12 | let subsPattern = try! NSRegularExpression( 13 | pattern: 14 | #"\{~~(?(?:[^~>]|(?:~(?!>)))+)~>(?(?:[^~]+|(?:~(?!~\})))+)~~\}"#, 15 | options: [.dotMatchesLineSeparators]) 16 | let commPattern = try! NSRegularExpression( 17 | pattern: #"\{>>(.*?)<<\}"#, options: [.dotMatchesLineSeparators]) 18 | let insdelCommPattern = try! NSRegularExpression( 19 | pattern: #"(?<=[-+=~<]\})[ \t]*\{>>(.*?)?<<\}"#, options: [.dotMatchesLineSeparators]) 20 | let markPattern = try! NSRegularExpression( 21 | pattern: #"\{==(.*?)==\}"#, options: [.dotMatchesLineSeparators]) 22 | 23 | var subCounter = 0 24 | 25 | func replace( 26 | _ regex: NSRegularExpression, in string: String, 27 | using block: (NSTextCheckingResult, String) -> String 28 | ) -> String { 29 | var result = "" 30 | var lastIndex = string.startIndex 31 | let nsString = string as NSString 32 | let matches = regex.matches( 33 | in: string, options: [], range: NSRange(location: 0, length: nsString.length)) 34 | for match in matches { 35 | let range = Range(match.range, in: string)! 36 | result += String(string[lastIndex..†" 52 | } 53 | 54 | // del_pattern 55 | output = replace(delPattern, in: output) { match, str in 56 | let value = 57 | match.range(withName: "value").location != NSNotFound 58 | ? (str as NSString).substring(with: match.range(withName: "value")) : "" 59 | if value == "\n\n" { 60 | return " " 61 | } else { 62 | let parts = value.components(separatedBy: "\n\n") 63 | return parts.map { "\($0)" }.joined(separator: "\n\n") 64 | } 65 | } 66 | 67 | // add_pattern 68 | output = replace(addPattern, in: output) { match, str in 69 | let value = 70 | match.range(withName: "value").location != NSNotFound 71 | ? (str as NSString).substring(with: match.range(withName: "value")) : "" 72 | if value.hasPrefix("\n\n") && value != "\n\n" { 73 | let replace = 74 | "\n\n \n\n" 75 | let parts = value.components(separatedBy: "\n\n") 76 | let insParts = parts.map { "\($0)" } 77 | return replace + insParts.joined(separator: "\n\n") 78 | } else if value == "\n\n" { 79 | return 80 | "\n\n \n\n" 81 | } else if value.hasSuffix("\n\n") && value != "\n\n" { 82 | let parts = value.components(separatedBy: "\n\n") 83 | let insParts = parts.map { "\($0)" } 84 | return insParts.joined(separator: "\n\n") 85 | + "\n\n \n\n" 86 | } else { 87 | let parts = value.components(separatedBy: "\n\n") 88 | let insParts = parts.map { "\($0)" } 89 | return insParts.joined(separator: "\n\n") 90 | } 91 | } 92 | 93 | // comm_pattern 94 | output = replace(commPattern, in: output) { match, str in 95 | let value = 96 | match.range(at: 1).location != NSNotFound 97 | ? (str as NSString).substring(with: match.range(at: 1)) : "" 98 | let content = value.replacingOccurrences(of: "\n", with: " ") 99 | return "\(content)" 100 | } 101 | 102 | // mark_pattern 103 | output = replace(markPattern, in: output) { match, str in 104 | let value = 105 | match.range(at: 1).location != NSNotFound 106 | ? (str as NSString).substring(with: match.range(at: 1)) : "" 107 | return "\(value)" 108 | } 109 | 110 | // add_pattern again (as in Ruby) 111 | output = replace(addPattern, in: output) { match, str in 112 | let value = 113 | match.range(withName: "value").location != NSNotFound 114 | ? (str as NSString).substring(with: match.range(withName: "value")) : "" 115 | if value.hasPrefix("\n\n") && value != "\n\n" { 116 | let replace = 117 | "\n\n \n\n" 118 | let parts = value.components(separatedBy: "\n\n") 119 | let insParts = parts.map { "\($0)" } 120 | return replace + insParts.joined(separator: "\n\n") 121 | } else if value == "\n\n" { 122 | return 123 | "\n\n \n\n" 124 | } else if value.hasSuffix("\n\n") && value != "\n\n" { 125 | let parts = value.components(separatedBy: "\n\n") 126 | let insParts = parts.map { "\($0)" } 127 | return insParts.joined(separator: "\n\n") 128 | + "\n\n \n\n" 129 | } else { 130 | let parts = value.components(separatedBy: "\n\n") 131 | let insParts = parts.map { "\($0)" } 132 | return insParts.joined(separator: "\n\n") 133 | } 134 | } 135 | 136 | // subs_pattern 137 | output = replace(subsPattern, in: output) { match, str in 138 | subCounter += 1 139 | let original = 140 | match.range(withName: "original").location != NSNotFound 141 | ? (str as NSString).substring(with: match.range(withName: "original")) : "" 142 | let newVal = 143 | match.range(withName: "new").location != NSNotFound 144 | ? (str as NSString).substring(with: match.range(withName: "new")) : "" 145 | let delString = "\(original)" 146 | let insString = "\(newVal)" 147 | return delString + insString 148 | } 149 | 150 | return output 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /Marked Processor/critic.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import sys 3 | import re 4 | import subprocess 5 | 6 | add_pattern = r'''(?s)\{\+\+(?P.*?)\+\+[ \t]*(\[(?P.*?)\])?[ \t]*\}''' 7 | 8 | del_pattern = r'''(?s)\{\-\-(?P.*?)\-\-[ \t]*(\[(?P.*?)\])?[ \t]*\}''' 9 | 10 | comm_pattern = r'''(?s)\{\>\>(?P.*?)\<\<\}''' 11 | 12 | gen_comm_pattern = r'''(?s)\{[ \t]*\[(?P.*?)\][ \t]*\}''' 13 | 14 | subs_pattern = r'''(?s)\{\~\~(?P(?:[^\~\>]|(?:\~(?!\>)))+)\~\>(?P(?:[^\~\~]|(?:\~(?!\~\})))+)\~\~\}''' 15 | 16 | mark_pattern = r'''(?s)\{\=\=(?P.*?)\=\=\}''' 17 | 18 | test_pattern = '''{~~Eighty-seven~>Four score and seven~~} years ago our fathers brought forth on this continent a new {~~state~>nation~~}, conceived in liberty, and dedicated to the proposition that all men {--and women--}{>>Tackle this after the war<<} are created equal.''' 19 | 20 | 21 | def deletionProcess(group_object): 22 | replaceString = '' 23 | if group_object.group('value') == '\n\n': 24 | replaceString = " " 25 | else: 26 | replaceString = '' + group_object.group('value').replace("\n\n", " ") + '' 27 | return replaceString 28 | 29 | 30 | def subsProcess(group_object): 31 | delString = '' + group_object.group('original') + '' 32 | insString = '' + group_object.group('new') + '' 33 | return delString + insString 34 | 35 | 36 | # Converts Addition markup to HTML 37 | def additionProcess(group_object): 38 | replaceString = '' 39 | 40 | # Is there a new paragraph followed by new text 41 | if group_object.group('value').startswith('\n\n') and group_object.group('value') != "\n\n": 42 | replaceString = "\n\n \n\n" 43 | replaceString = replaceString + '' + group_object.group('value').replace("\n", " ") 44 | replaceString = replaceString + '' 45 | 46 | # Is the addition just a single new paragraph 47 | elif group_object.group('value') == "\n\n": 48 | replaceString = "\n\n " + '\n\n' 49 | 50 | # Is it added text followed by a new paragraph? 51 | elif group_object.group('value').endswith('\n\n') and group_object.group('value') != "\n\n": 52 | replaceString = '' + group_object.group('value').replace("\n", " ") + '' 53 | replaceString = replaceString + "\n\n \n\n" 54 | 55 | else: 56 | replaceString = '' + group_object.group('value').replace("\n", " ") + '' 57 | 58 | return replaceString 59 | 60 | 61 | def highlightProcess(group_object): 62 | replaceString = '' + group_object.group('value').replace("\n", " ") + '' 63 | return replaceString 64 | 65 | 66 | def markProcess(group_object): 67 | replaceString = '' + group_object.group('value') + '' 68 | return replaceString 69 | 70 | a = ''' 71 | 72 | 198 | 199 |
200 |
    201 |
  • Markup
  • 202 |
  • Original
  • 203 |
  • Edited
  • 204 |
205 | 206 |
207 | 208 | 260 | ''' 261 | 262 | 263 | # Accept input from Marked.app 264 | 265 | h = sys.stdin.read() 266 | 267 | h = re.sub(del_pattern, deletionProcess, h, flags=re.DOTALL) 268 | 269 | h = re.sub(add_pattern, additionProcess, h, flags=re.DOTALL) 270 | 271 | h = re.sub(comm_pattern, highlightProcess, h, flags=re.DOTALL) 272 | 273 | h = re.sub(mark_pattern, markProcess, h, flags=re.DOTALL) 274 | 275 | h = re.sub(subs_pattern, subsProcess, h, flags=re.DOTALL) 276 | 277 | # print h 278 | 279 | z = h + a 280 | 281 | # sys.stdout.write(z) 282 | proc = subprocess.Popen(['/usr/local/bin/multimarkdown'], stdin=subprocess.PIPE) 283 | proc.communicate(input=z) 284 | -------------------------------------------------------------------------------- /Objective-C/CriticMarkupRenderer.m: -------------------------------------------------------------------------------- 1 | #import "CriticMarkupRenderer.h" 2 | 3 | // Helper function to replace regex matches with a block 4 | static NSString * 5 | ReplaceWithBlock(NSRegularExpression *regex, NSString *input, 6 | NSString * (^block)(NSTextCheckingResult *result)) { 7 | NSMutableString *resultString = [NSMutableString string]; 8 | __block NSUInteger lastLocation = 0; 9 | [regex enumerateMatchesInString:input 10 | options:0 11 | range:NSMakeRange(0, input.length) 12 | usingBlock:^(NSTextCheckingResult *match, 13 | NSMatchingFlags flags, BOOL *stop) { 14 | if (!match) 15 | return; 16 | NSRange matchRange = match.range; 17 | if (matchRange.location > lastLocation) { 18 | [resultString 19 | appendString:[input substringWithRange: 20 | NSMakeRange( 21 | lastLocation, 22 | matchRange.location - 23 | lastLocation)]]; 24 | } 25 | NSString *replacement = block(match); 26 | if (replacement) { 27 | [resultString appendString:replacement]; 28 | } 29 | lastLocation = matchRange.location + matchRange.length; 30 | }]; 31 | if (lastLocation < input.length) { 32 | [resultString appendString:[input substringFromIndex:lastLocation]]; 33 | } 34 | return resultString; 35 | } 36 | 37 | @implementation CriticMarkupRenderer 38 | 39 | + (NSString *)renderCriticMarkup:(NSString *)input { 40 | if (!input) 41 | return @""; 42 | NSString *output = [input copy]; 43 | static NSRegularExpression *addPattern, *delPattern, *subsPattern, 44 | *commPattern, *insdelCommPattern, *markPattern; 45 | static dispatch_once_t onceToken; 46 | dispatch_once(&onceToken, ^{ 47 | addPattern = [NSRegularExpression 48 | regularExpressionWithPattern:@"\\{\\+\\+(?.*?)\\+\\+[ " 49 | @"\\t]*(?:\\[(?.*?)\\])?[ \\t]*\\}" 50 | options:NSRegularExpressionDotMatchesLineSeparators 51 | error:nil]; 52 | delPattern = [NSRegularExpression 53 | regularExpressionWithPattern: 54 | @"\\{--(?.*?)--[ \\t]*(?:\\[(?.*?)\\])?[ \\t]*\\}" 55 | options:NSRegularExpressionDotMatchesLineSeparators 56 | error:nil]; 57 | subsPattern = [NSRegularExpression 58 | regularExpressionWithPattern:@"\\{~~(?(?:[^~>]|(?:~(?!>)))+)~" 59 | @">(?(?:[^~]+|(?:~(?!~\\})))+)~~\\}" 60 | options:NSRegularExpressionDotMatchesLineSeparators 61 | error:nil]; 62 | commPattern = [NSRegularExpression 63 | regularExpressionWithPattern:@"\\{>>(?.*?)<<\\}" 64 | options:NSRegularExpressionDotMatchesLineSeparators 65 | error:nil]; 66 | insdelCommPattern = [NSRegularExpression 67 | regularExpressionWithPattern: 68 | @"(?<=[-+=~<]\\})[ \\t]*\\{>>(?.*?)?<<\\}" 69 | options:NSRegularExpressionDotMatchesLineSeparators 70 | error:nil]; 71 | markPattern = [NSRegularExpression 72 | regularExpressionWithPattern:@"\\{==(?.*?)==\\}" 73 | options:NSRegularExpressionDotMatchesLineSeparators 74 | error:nil]; 75 | }); 76 | 77 | // Substitution counter 78 | __block NSInteger subCounter = 0; 79 | 80 | // Helper blocks 81 | NSString * (^deletionProcess)(NSString *) = ^NSString *(NSString *value) { 82 | if ([value isEqualToString:@"\n\n"]) { 83 | return @" "; 84 | } else { 85 | NSArray *parts = [value componentsSeparatedByString:@"\n\n"]; 86 | NSMutableArray *delParts = [NSMutableArray arrayWithCapacity:parts.count]; 87 | for (NSString *part in parts) { 88 | [delParts 89 | addObject:[NSString 90 | stringWithFormat:@"%@", 91 | part]]; 92 | } 93 | return [delParts componentsJoinedByString:@"\n\n"]; 94 | } 95 | }; 96 | 97 | NSString * (^additionProcess)(NSString *) = ^NSString *(NSString *value) { 98 | if ([value hasPrefix:@"\n\n"] && ![value isEqualToString:@"\n\n"]) { 99 | NSString *replace = @"\n\n \n\n"; 101 | NSArray *parts = [value componentsSeparatedByString:@"\n\n"]; 102 | NSMutableArray *insParts = [NSMutableArray arrayWithCapacity:parts.count]; 103 | for (NSString *part in parts) { 104 | [insParts 105 | addObject:[NSString 106 | stringWithFormat:@"%@", 107 | part]]; 108 | } 109 | return [NSString 110 | stringWithFormat:@"%@%@", replace, 111 | [insParts componentsJoinedByString:@"\n\n"]]; 112 | } else if ([value isEqualToString:@"\n\n"]) { 113 | return @"\n\n \n\n"; 115 | } else if ([value hasSuffix:@"\n\n"] && ![value isEqualToString:@"\n\n"]) { 116 | NSArray *parts = [value componentsSeparatedByString:@"\n\n"]; 117 | NSMutableArray *insParts = [NSMutableArray arrayWithCapacity:parts.count]; 118 | for (NSString *part in parts) { 119 | [insParts 120 | addObject:[NSString 121 | stringWithFormat:@"%@", 122 | part]]; 123 | } 124 | return [NSString 125 | stringWithFormat:@"%@\n\n \n\n", 127 | [insParts componentsJoinedByString:@"\n\n"]]; 128 | } else { 129 | NSArray *parts = [value componentsSeparatedByString:@"\n\n"]; 130 | NSMutableArray *insParts = [NSMutableArray arrayWithCapacity:parts.count]; 131 | for (NSString *part in parts) { 132 | [insParts 133 | addObject:[NSString 134 | stringWithFormat:@"%@", 135 | part]]; 136 | } 137 | return [insParts componentsJoinedByString:@"\n\n"]; 138 | } 139 | }; 140 | 141 | NSString * (^subsProcess)(NSString *, NSString *) = ^NSString *( 142 | NSString *original, NSString *newVal) { 143 | subCounter++; 144 | NSString *delString = [NSString 145 | stringWithFormat:@"%@", 146 | (long)subCounter, original]; 147 | NSString *insString = [NSString 148 | stringWithFormat:@"%@", 149 | (long)subCounter, newVal]; 150 | return [NSString stringWithFormat:@"%@%@", delString, insString]; 151 | }; 152 | 153 | NSString * (^insDelHighlightProcess)(NSString *) = 154 | ^NSString *(NSString *value) { 155 | NSString *content = 156 | [value stringByReplacingOccurrencesOfString:@"\n" withString:@" "]; 157 | return [NSString 158 | stringWithFormat:@"", 160 | content]; 161 | }; 162 | 163 | NSString * (^highlightProcess)(NSString *) = ^NSString *(NSString *value) { 164 | NSString *content = 165 | [value stringByReplacingOccurrencesOfString:@"\n" withString:@" "]; 166 | return [NSString 167 | stringWithFormat:@"%@", 168 | content]; 169 | }; 170 | 171 | NSString * (^markProcess)(NSString *) = ^NSString *(NSString *value) { 172 | return [NSString stringWithFormat:@"%@", value]; 173 | }; 174 | 175 | // insdel_comm_pattern 176 | output = [insdelCommPattern 177 | stringByReplacingMatchesInString:output 178 | options:0 179 | range:NSMakeRange(0, output.length) 180 | withTemplate:@"$0"]; 181 | output = ReplaceWithBlock( 182 | insdelCommPattern, output, ^NSString *(NSTextCheckingResult *result) { 183 | NSString *value = 184 | [output substringWithRange:[result rangeWithName:@"value"]]; 185 | return insDelHighlightProcess(value); 186 | }); 187 | 188 | // del_pattern 189 | output = ReplaceWithBlock( 190 | delPattern, output, ^NSString *(NSTextCheckingResult *result) { 191 | NSString *value = 192 | [output substringWithRange:[result rangeWithName:@"value"]]; 193 | return deletionProcess(value); 194 | }); 195 | 196 | // add_pattern 197 | output = ReplaceWithBlock( 198 | addPattern, output, ^NSString *(NSTextCheckingResult *result) { 199 | NSString *value = 200 | [output substringWithRange:[result rangeWithName:@"value"]]; 201 | return additionProcess(value); 202 | }); 203 | 204 | // comm_pattern 205 | output = ReplaceWithBlock( 206 | commPattern, output, ^NSString *(NSTextCheckingResult *result) { 207 | NSString *value = 208 | [output substringWithRange:[result rangeWithName:@"value"]]; 209 | return highlightProcess(value); 210 | }); 211 | 212 | // mark_pattern 213 | output = ReplaceWithBlock( 214 | markPattern, output, ^NSString *(NSTextCheckingResult *result) { 215 | NSString *value = 216 | [output substringWithRange:[result rangeWithName:@"value"]]; 217 | return markProcess(value); 218 | }); 219 | 220 | // add_pattern again (as in Ruby) 221 | output = ReplaceWithBlock( 222 | addPattern, output, ^NSString *(NSTextCheckingResult *result) { 223 | NSString *value = 224 | [output substringWithRange:[result rangeWithName:@"value"]]; 225 | return additionProcess(value); 226 | }); 227 | 228 | // subs_pattern 229 | output = ReplaceWithBlock( 230 | subsPattern, output, ^NSString *(NSTextCheckingResult *result) { 231 | NSString *original = 232 | [output substringWithRange:[result rangeWithName:@"original"]]; 233 | NSString *newVal = 234 | [output substringWithRange:[result rangeWithName:@"new"]]; 235 | return subsProcess(original, newVal); 236 | }); 237 | 238 | return output; 239 | } 240 | 241 | @end -------------------------------------------------------------------------------- /CLI/criticParser_CLI.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import codecs 4 | import sys 5 | import os 6 | import re 7 | import argparse 8 | import subprocess 9 | 10 | # Input is quoted UNIX type file path. 11 | 12 | # Output is HTML formated text using ins, del, and aside tags 13 | 14 | # File is written to the same directory as the source unless specified with the -o flag 15 | 16 | # -m2 Uses the markdown2 module 17 | 18 | # -o Writes file to specified path. Must include file name 19 | # 20 | # -b Opens the output HTML file in the defualt browser 21 | 22 | 23 | 24 | add_pattern = r'''(?s)\{\+\+(?P.*?)\+\+[ \t]*(\[(?P.*?)\])?[ \t]*\}''' 25 | 26 | del_pattern = r'''(?s)\{\-\-(?P.*?)\-\-[ \t]*(\[(?P.*?)\])?[ \t]*\}''' 27 | 28 | comm_pattern = r'''(?s)\{\>\>(?P.*?)\<\<\}''' 29 | 30 | gen_comm_pattern = r'''(?s)\{[ \t]*\[(?P.*?)\][ \t]*\}''' 31 | 32 | subs_pattern = r'''(?s)\{\~\~(?P(?:[^\~\>]|(?:\~(?!\>)))+)\~\>(?P(?:[^\~\~]|(?:\~(?!\~\})))+)\~\~\}''' 33 | 34 | mark_pattern = r'''(?s)\{\=\=(?P.*?)\=\=\}\{\>\>(?P.*?)\<\<\}''' 35 | 36 | 37 | # Considered for future standalone highlight without comment 38 | # mark_pattern = r'''(?s)\{\{(?P.*?)\}\}''' 39 | 40 | 41 | def deletionProcess(group_object): 42 | replaceString = '' 43 | if group_object.group('value') == '\n\n': 44 | replaceString = " " 45 | else: 46 | replaceString = '' + group_object.group('value').replace("\n\n", " ") + '' 47 | return replaceString 48 | 49 | 50 | 51 | def subsProcess(group_object): 52 | delString = '' + group_object.group('original') + '' 53 | insString = '' + group_object.group('new') + '' 54 | newString = delString + insString 55 | return newString 56 | 57 | 58 | # Converts Addition markup to HTML 59 | def additionProcess(group_object): 60 | replaceString = '' 61 | 62 | # Is there a new paragraph followed by new text 63 | if group_object.group('value').startswith('\n\n') and group_object.group('value') != "\n\n": 64 | replaceString = "\n\n \n\n" 65 | replaceString = replaceString + '' + group_object.group('value').replace("\n", " ") 66 | replaceString = replaceString + '' 67 | 68 | 69 | # Is the addition just a single new paragraph 70 | elif group_object.group('value') == "\n\n": 71 | replaceString = "\n\n " + '\n\n' 72 | 73 | # Is it added text followed by a new paragraph? 74 | elif group_object.group('value').endswith('\n\n') and group_object.group('value') != "\n\n": 75 | replaceString = '' + group_object.group('value').replace("\n", " ") + '' 76 | replaceString = replaceString + "\n\n \n\n" 77 | 78 | else: 79 | replaceString = '' + group_object.group('value').replace("\n", " ") + '' 80 | 81 | 82 | return replaceString 83 | 84 | def highlightProcess(group_object): 85 | replaceString = '' + group_object.group('value').replace("\n", " ") + '' 86 | return replaceString 87 | 88 | 89 | def markProcess(group_object): 90 | replaceString = '' + group_object.group('value') + '' + group_object.group('comment').replace("\n", " ") + '' 91 | return replaceString 92 | 93 | 94 | 95 | a = ''' 96 | 97 | 222 | 223 |
224 |
    225 |
  • Markup
  • 226 |
  • Original
  • 227 |
  • Edited
  • 228 |
229 | 230 |
231 | 232 | 285 | ''' 286 | 287 | jq = ''' 288 | 289 | 290 | Critic Markup Output''' 291 | 292 | head = ''' 293 | 294 | 295 | Critic Markup Output''' 296 | 297 | bodybegin = '''
''' 298 | 299 | headend = '''
''' 300 | 301 | 302 | # Accept input from Marked.app 303 | 304 | # h = sys.stdin.read() 305 | 306 | 307 | 308 | parser = argparse.ArgumentParser(description='Convert Critic Markup to HTML') 309 | parser.add_argument('source', help='The source file path, including file name') 310 | parser.add_argument('-m2', help='Use the markdown2 python module. If left blank then markdown module is used', action='store_true') 311 | parser.add_argument('-o','--output', help='Path to store the output file, including file name', metavar='out-file', type=argparse.FileType('wt'), required=False) 312 | parser.add_argument('-css','--css', help='Path to a custom CSS file, including file name', metavar='in-file', type=argparse.FileType('rt'),required=False) 313 | parser.add_argument('-b', '--browser', help='View the output file in the default browser after saving.', action='store_true') 314 | 315 | args = parser.parse_args() 316 | try: 317 | 318 | 319 | 320 | if args.source: 321 | inputFile = open(args.source, "r") 322 | inputText = inputFile.read() 323 | inputFile.close() 324 | else: 325 | log("No source file specified") 326 | print "No source file specified" 327 | sys.exit(1) 328 | 329 | h = inputText 330 | 331 | h = re.sub(del_pattern, deletionProcess, inputText, flags=re.DOTALL) 332 | 333 | h = re.sub(add_pattern, additionProcess, h, flags=re.DOTALL) 334 | 335 | h = re.sub(mark_pattern, markProcess, h, flags=re.DOTALL) 336 | 337 | # comment processing must come after highlights 338 | h = re.sub(comm_pattern, highlightProcess, h, flags=re.DOTALL) 339 | 340 | h = re.sub(subs_pattern, subsProcess, h, flags=re.DOTALL) 341 | 342 | if (args.m2): 343 | import markdown2 344 | h = markdown2.markdown(h, extras=['footnotes', 'fenced-code-blocks', 'cuddled-lists', 'code-friendly']) 345 | print '\nUsing the Markdown2 module for processing' 346 | else: 347 | import markdown 348 | h = markdown.markdown(h, extensions=['extra', 'codehilite', 'meta']) 349 | 350 | 351 | 352 | 353 | 354 | if (args.css): 355 | css_file = args.css 356 | cssText = css_file.read() 357 | css_file.close() 358 | h = head + cssText + bodybegin + h + headend 359 | else: 360 | h = jq + a + bodybegin + h + headend 361 | 362 | 363 | 364 | # If an output file is specified, write to it 365 | if args.output: 366 | filesource = args.output 367 | abs_path = os.path.abspath(filesource.name) 368 | output_file = abs_path 369 | print output_file 370 | #file = open(filename, 'wb') 371 | filesource.write(h) 372 | filesource.close() 373 | print "\nOutput file created: ", abs_path 374 | else: 375 | path, filename = os.path.split(args.source) 376 | print "Converting >> " + args.source 377 | output_file = path+'/'+filename.split(os.extsep, 1)[0]+'_CriticParseOut.html' 378 | file = open(output_file, 'w') 379 | file.write(h.encode('utf-8')) 380 | file.close() 381 | print "\nOutput file created: "+ output_file 382 | 383 | if (args.browser): 384 | try: 385 | retcode = subprocess.call("open " + output_file, shell=True) 386 | if retcode < 0: 387 | print >>sys.stderr, "Child was terminated by signal", -retcode 388 | else: 389 | print >>sys.stderr, "Child returned", retcode 390 | except OSError, e: 391 | print >>sys.stderr, "Execution failed:", e 392 | 393 | except: 394 | print "Unexpected Error: ", sys.exc_info()[0] 395 | raise 396 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![CriticMarkup](http://high90.com/img/CriticMarkup-400px.png) 2 | 3 | Welcome to the CriticMarkup Toolkit 4 | ==================== 5 | 6 | Critic Markup is intended to provide basic editorial change tracking in plain text files. The syntax is compatible with Markdown, MultiMarkdown and HTML. 7 | 8 | [PanDiff](https://github.com/davidar/pandiff) is a diff generator with CriticMarkup output support. 9 | 10 | ### The Three Laws ### 11 | 12 | 1. Critic Markup shall be human readable. A human with a simple text editor can easily read and comprehend any text containing Critic Markup. 13 | 2. Critic Markup shall be computer readable except where it conflicts with rule 1. Markup syntax should be easily parsed with simple regular expressions to support a wide variety of implementations. 14 | 3. Critic Markup shall be compatible with existing markup syntax for Markdown, MultiMarkdown and HTML except where it conflicts with rules one or two. Many users of plain text write in combinations of Markdown and HTML. Critic Markup should work alongside that syntax. 15 | 16 | ### The Goal ### 17 | 18 | Critic Markup can be used in any writing environment without special applications or tool kits. While we have supplied processors and plugins that are compatible with popular apps, they are not required. 19 | 20 | Critic Markup should be readable inline and clearly indicate the intent of the editor and author. 21 | 22 | Critic Markup should support change tracking with multiple authors and editors through the use of comments. 23 | 24 | ### Plain Text and HTML ### 25 | 26 | Critic Markup may be used without a conversion to HTML. However, as with Markdown, HTML may be a desirable format for a more stylized presentation. We have several recommendations for how Critic Markup may be converted to HTML. The intent is to allow the HTML to be used without custom CSS. However, custom CSS may be used to enhance the review process. 27 | 28 | ### The Basic Syntax ### 29 | 30 | There are five types of Critic marks: 31 | 32 | * Addition `{++ ++}` 33 | * Deletion `{-- --}` 34 | * Substitution `{~~ ~> ~~}` 35 | * Comment `{>> <<}` 36 | * Highlight `{== ==}{>> <<}` 37 | 38 | Using these five basic marks you can successfully copy edit in plain text. 39 | 40 | #### Additions #### 41 | 42 | Additions are inserted inline by surrounding the desired text with curly braces and double plus marks as shown: 43 | 44 | Lorem ipsum dolor{++ sit++} amet... 45 | 46 | A space character and "sit" are to be added at the position of the left (or right) most curly brace. The additions may be rendered as `` tags in the processed HTML: 47 | 48 | Lorem ipsum dolor sit amet… 49 | 50 | Paragraphs may be inserted in the same manner. 51 | 52 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum at orci 53 | magna. Phasellus augue justo, sodales eu pulvinar ac, vulputate eget nulla. 54 | Mauris massa sem, tempor sed cursus et, semper tincidunt lacus.{++ 55 | 56 | ++}Praesent sagittis, quam id egestas consequat, nisl orci vehicula libero, 57 | quis ultricies nulla magna interdum sem. Maecenas eget orci vitae eros 58 | accumsan mollis. Cras mi mi, rutrum id aliquam in, aliquet vitae tellus. 59 | Sed neque justo, cursus in commodo eget, facilisis eget nunc. Cras 60 | tincidunt auctor varius. 61 | 62 | To ensure the Markdown processor outputs valid HTML, the `` tag encloses a non-breaking space and is followed by two newlines. The result is that both paragraphs render separately. The non-breaking-space gives the tag enough content to render properly, and we assign class=break to allow for custom styling. 63 | 64 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum at orci 65 | magna. Phasellus augue justo, sodales eu pulvinar ac, vulputate eget nulla. 66 | Mauris massa sem, tempor sed cursus et, semper tincidunt lacus. 67 | 68 |   69 | 70 | Praesent sagittis, quam id egestas consequat, nisl orci vehicula libero, 71 | quis ultricies nulla magna interdum sem. Maecenas eget orci vitae eros 72 | accumsan mollis. Cras mi mi, rutrum id aliquam in, aliquet vitae tellus. Sed 73 | neque justo, cursus in commodo eget, facilisis eget nunc. Cras tincidunt 74 | auctor varius. 75 | 76 | Rules for proper use of the `` element can be found in the [HTML 4 spec](http://www.w3.org/TR/REC-html40/struct/text.html#h-9.4). 77 | 78 | #### Deletions #### 79 | 80 | Deletions are denoted with a similar syntax. The text to be deleted is surrounded with curly braces and double hyphens. 81 | 82 | Lorem{‐‐ ipsum‐‐} dolor sit amet… 83 | 84 | The word "ipsum" and a space character are marked for deletion in the above example. These deletions are rendered as `` tags in the processed HTML. 85 | 86 | Lorem ipsum dolor sit amet… 87 | 88 | Paragraphs may also be deleted. 89 | 90 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum at orci 91 | magna. Phasellus augue justo, sodales eu pulvinar ac, vulputate eget nulla. 92 | Mauris massa sem, tempor sed cursus et, semper tincidunt lacus.{‐‐ 93 | 94 | ‐‐}Praesent sagittis, quam id egestas consequat, nisl orci vehicula libero, 95 | quis ultricies nulla magna interdum sem. Maecenas eget orci vitae eros 96 | accumsan mollis. Cras mi mi, rutrum id aliquam in, aliquet vitae tellus. 97 | Sed neque justo, cursus in commodo eget, facilisis eget nunc. Cras 98 | tincidunt auctor varius. 99 | 100 | The newlines will be removed by the processor and replaced by an inline `` tag. Again, the non-breaking-space gives the tag enough content to render properly. 101 | 102 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum at orci 103 | magna. Phasellus augue justo, sodales eu pulvinar ac, vulputate eget nulla. 104 | Mauris massa sem, tempor sed cursus et, semper tincidunt lacus. 105 |   Praesent sagittis, quam id egestas consequat, nisl 106 | orci vehicula libero, quis ultricies nulla magna interdum sem. Maecenas eget 107 | orci vitae eros accumsan mollis. Cras mi mi, rutrum id aliquam in, aliquet 108 | vitae tellus. Sed neque justo, cursus in commodo eget, facilisis eget nunc. 109 | Cras tincidunt auctor varius. 110 | 111 | Rules for proper use of the `` element can be found in the [HTML 4 spec](http://www.w3.org/TR/REC-html40/struct/text.html#h-9.4). 112 | 113 | #### Substitutions #### 114 | 115 | Substitutions combine a delete with an insert in one snippet, and are written as curly braces and double tildes. A squiggly arrow made up of a tilde and greater-than symbol separates the old and new text. The characters to be deleted always occur to the left of the squiggly arrow. 116 | 117 | Lorem {~~hipsum~>ipsum~~} dolor sit amet… 118 | 119 | Despite the unique syntax, substitutions should render as a deletion followed by an insertion. 120 | 121 | Lorem hipsumipsum dolor sit amet… 122 | 123 | Newlines are treated the same as a deletion or insertion, depending on where they're located. 124 | 125 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum at orci 126 | magna. Phasellus augue justo, sodales eu pulvinar ac, vulputate eget nulla. 127 | {~~Mauris massa sem, tempor sed cursus et, semper tincidunt lacus.~> 128 | 129 | ~~}Praesent sagittis, quam id egestas consequat, nisl orci vehicula libero, 130 | quis ultricies nulla magna interdum sem. Maecenas eget orci vitae eros 131 | accumsan mollis. Cras mi mi, rutrum id aliquam in, aliquet vitae tellus. 132 | Sed neque justo, cursus in commodo eget, facilisis eget nunc. Cras 133 | tincidunt auctor varius. 134 | 135 | After rendering this example, the deletion and insertion are added to the end of the first paragraph and two newlines ensure the proper paragraph break. 136 | 137 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum at orci 138 | magna. Phasellus augue justo, sodales eu pulvinar ac, vulputate eget nulla. 139 | Mauris massa sem, tempor sed cursus et, semper tincidunt 140 | lacus.  141 | 142 | Praesent sagittis, quam id egestas consequat, nisl orci vehicula libero, 143 | quis ultricies nulla magna interdum sem. Maecenas eget orci vitae eros 144 | accumsan mollis. Cras mi mi, rutrum id aliquam in, aliquet vitae tellus. Sed 145 | neque justo, cursus in commodo eget, facilisis eget nunc. Cras tincidunt 146 | auctor varius. 147 | 148 | #### Comments #### 149 | 150 | Critic Markup supports generic comments for metadata. A comment may include a note, time stamp, author initial or similar annotation. 151 | 152 | Comments are added via a set of curly braces and double greater-than/less-than symbols. 153 | 154 | Lorem ipsum dolor sit amet.{>>This is a comment<<} 155 | 156 | The contents of a metadata field should render as `` after the relevant change. 157 | 158 | Lorem ipsum dolor sit amet.This is a comment 159 | 160 | Metadata may be used however you like, whether as explanations for the changes, time stamps or more. The `` element is for inline content only, so all newlines will be stripped during conversion to HTML. 161 | 162 | Rules for proper use of the `` element can be found in the [HTML 4 spec](http://www.w3.org/TR/html401/struct/global.html#edef-SPAN). 163 | 164 | #### Highlights #### 165 | 166 | Highlights may be added as required by an editor or author, and are noted by curly braces and double equal signs. While a highlight can be used on it's own, we recommend that it always be followed by a comment related to the highlighted passage. 167 | 168 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. {==Vestibulum at 169 | orci magna. Phasellus augue justo, sodales eu pulvinar ac, vulputate eget 170 | nulla.==}{>>confusing<<} Mauris massa sem, tempor sed cursus et, semper 171 | tincidunt lacus. 172 | 173 | Highlights should be rendered as `` tags in the processed HTML. 174 | 175 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum at 176 | orci magna. Phasellus augue justo, sodales eu pulvinar ac, vulputate eget 177 | nulla.confusing Mauris massa 178 | sem, tempor sed cursus et, semper tincidunt lacus. 179 | 180 | Rules for proper use of the `` element can be found in the [HTML 5 spec](http://www.w3.org/html/wg/drafts/html/master/single-page.html#the-mark-element). 181 | 182 | ### Putting it all together ### 183 | 184 | When used in combination the marks can indicate more complex changes. 185 | 186 | Don’t go around saying{‐‐ to people that‐‐} the world owes you a living. The 187 | world owes you nothing. It was here first. {~~One~>Only one~~} thing is 188 | impossible for God: To find {++any++} sense in any copyright law on the 189 | planet. {==Truth is stranger than fiction==}{>>true<<}, but it is because 190 | Fiction is obliged to stick to possibilities; Truth isn’t. 191 | 192 | The above paragraphs should render to HTML in the following manner. 193 | 194 | Don’t go around saying to people that the world owes you a 195 | living. The world owes you nothing. It was here first. 196 | OneOnly one thing is impossible for God: To find 197 | any sense in any copyright law on the planet. Truth is 198 | stranger than fictiontrue, but it 199 | is because Fiction is obliged to stick to possibilities; Truth isn’t. 200 | 201 | ### Caveats ### 202 | 203 | There are a few limitations to consider when using CriticMarkup. 204 | 205 | #### Avoid Newlines in CriticMarkup #### 206 | 207 | Newlines should be avoided as much as possible within CriticMarkup tags. Many of the HTML elements we use are inline elements only. While we've crafted CriticMarkup with as much care as possible, it is possible for you to break the syntax and output invalid HTML if you try hard enough. 208 | 209 | #### Wrap Markdown Tags Completely #### 210 | 211 | While it may support incomplete Markdown tags in the future, the CriticMarkup processor currently chokes on them. Avoid this: 212 | 213 | I really love *italic {~~fonts*~>font-styles*~~}. 214 | 215 | Instead, wrap the asterisks completely: 216 | 217 | I really love {~~*italic fonts*~>*italic font-styles*~~}. 218 | 219 | --- 220 | 221 | Copyright 2013 Gabe Weatherhead and Erik Hess 222 | 223 | Licensed under the Apache License, Version 2.0 (the "License"); 224 | you may not use this file except in compliance with the License. 225 | You may obtain a copy of the License at 226 | 227 | http://www.apache.org/licenses/LICENSE-2.0 228 | 229 | Unless required by applicable law or agreed to in writing, software 230 | distributed under the License is distributed on an "AS IS" BASIS, 231 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 232 | See the License for the specific language governing permissions and 233 | limitations under the License. 234 | 235 | -------------------------------------------------------------------------------- /Sublime Text 3 Package/Critic Markup/Monokai Soda + Critic.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Monokai Soda 7 | settings 8 | 9 | 10 | settings 11 | 12 | background 13 | #222222 14 | caret 15 | #F8F8F0 16 | foreground 17 | #F8F8F2 18 | invisibles 19 | #3B3A32 20 | lineHighlight 21 | #333333 22 | selection 23 | #444444 24 | findHighlight 25 | #FFE792 26 | findHighlightForeground 27 | #000000 28 | selectionBorder 29 | #73726b 30 | 31 | 32 | 33 | name 34 | Comment 35 | scope 36 | comment 37 | settings 38 | 39 | foreground 40 | #75715E 41 | 42 | 43 | 44 | name 45 | String 46 | scope 47 | string 48 | settings 49 | 50 | foreground 51 | #E6DB74 52 | 53 | 54 | 55 | name 56 | Number 57 | scope 58 | constant.numeric 59 | settings 60 | 61 | foreground 62 | #AE81FF 63 | 64 | 65 | 66 | name 67 | Built-in constant 68 | scope 69 | constant.language 70 | settings 71 | 72 | foreground 73 | #AE81FF 74 | 75 | 76 | 77 | name 78 | User-defined constant 79 | scope 80 | constant.character, constant.other 81 | settings 82 | 83 | foreground 84 | #AE81FF 85 | 86 | 87 | 88 | name 89 | Variable 90 | scope 91 | variable 92 | settings 93 | 94 | fontStyle 95 | 96 | 97 | 98 | 99 | name 100 | Keyword 101 | scope 102 | keyword 103 | settings 104 | 105 | foreground 106 | #F92672 107 | 108 | 109 | 110 | name 111 | Storage 112 | scope 113 | storage 114 | settings 115 | 116 | fontStyle 117 | 118 | foreground 119 | #F92672 120 | 121 | 122 | 123 | name 124 | Storage type 125 | scope 126 | storage.type 127 | settings 128 | 129 | fontStyle 130 | italic 131 | foreground 132 | #66D9EF 133 | 134 | 135 | 136 | name 137 | Class name 138 | scope 139 | entity.name.class 140 | settings 141 | 142 | fontStyle 143 | underline 144 | foreground 145 | #A6E22E 146 | 147 | 148 | 149 | name 150 | Inherited class 151 | scope 152 | entity.other.inherited-class 153 | settings 154 | 155 | fontStyle 156 | italic underline 157 | foreground 158 | #A6E22E 159 | 160 | 161 | 162 | name 163 | Function name 164 | scope 165 | entity.name.function 166 | settings 167 | 168 | fontStyle 169 | 170 | foreground 171 | #A6E22E 172 | 173 | 174 | 175 | name 176 | Function argument 177 | scope 178 | variable.parameter 179 | settings 180 | 181 | fontStyle 182 | italic 183 | foreground 184 | #FD971F 185 | 186 | 187 | 188 | name 189 | Tag name 190 | scope 191 | entity.name.tag 192 | settings 193 | 194 | fontStyle 195 | 196 | foreground 197 | #F92672 198 | 199 | 200 | 201 | name 202 | Tag attribute 203 | scope 204 | entity.other.attribute-name 205 | settings 206 | 207 | fontStyle 208 | 209 | foreground 210 | #A6E22E 211 | 212 | 213 | 214 | name 215 | Library function 216 | scope 217 | support.function 218 | settings 219 | 220 | fontStyle 221 | 222 | foreground 223 | #66D9EF 224 | 225 | 226 | 227 | name 228 | Library constant 229 | scope 230 | support.constant 231 | settings 232 | 233 | fontStyle 234 | 235 | foreground 236 | #66D9EF 237 | 238 | 239 | 240 | name 241 | Library class/type 242 | scope 243 | support.type, support.class 244 | settings 245 | 246 | fontStyle 247 | italic 248 | foreground 249 | #66D9EF 250 | 251 | 252 | 253 | name 254 | Library variable 255 | scope 256 | support.other.variable 257 | settings 258 | 259 | fontStyle 260 | 261 | 262 | 263 | 264 | name 265 | Invalid 266 | scope 267 | invalid 268 | settings 269 | 270 | background 271 | #F92672 272 | fontStyle 273 | 274 | foreground 275 | #F8F8F0 276 | 277 | 278 | 279 | name 280 | Invalid deprecated 281 | scope 282 | invalid.deprecated 283 | settings 284 | 285 | background 286 | #AE81FF 287 | foreground 288 | #F8F8F0 289 | 290 | 291 | 292 | name 293 | JSON String 294 | scope 295 | meta.structure.dictionary.json string.quoted.double.json 296 | settings 297 | 298 | foreground 299 | #CFCFC2 300 | 301 | 302 | 303 | 304 | name 305 | diff.header 306 | scope 307 | meta.diff, meta.diff.header 308 | settings 309 | 310 | foreground 311 | #75715E 312 | 313 | 314 | 315 | name 316 | diff.deleted 317 | scope 318 | markup.deleted 319 | settings 320 | 321 | foreground 322 | #F92672 323 | 324 | 325 | 326 | name 327 | diff.inserted 328 | scope 329 | markup.inserted 330 | settings 331 | 332 | foreground 333 | #A6E22E 334 | 335 | 336 | 337 | name 338 | diff.changed 339 | scope 340 | markup.changed 341 | settings 342 | 343 | foreground 344 | #E6DB74 345 | 346 | 347 | 348 | 349 | 350 | name 351 | Addition 352 | scope 353 | string.addition 354 | settings 355 | 356 | fontStyle 357 | 358 | foreground 359 | #00CD09 360 | 361 | 362 | 363 | name 364 | highlight 365 | scope 366 | string.highlight 367 | settings 368 | 369 | fontStyle 370 | italic 371 | foreground 372 | #DF37DD 373 | 374 | 375 | 376 | name 377 | Deletion 378 | scope 379 | string.deletion 380 | settings 381 | 382 | fontStyle 383 | 384 | foreground 385 | #D51D00 386 | 387 | 388 | 389 | name 390 | comment 391 | scope 392 | string.comment 393 | settings 394 | 395 | fontStyle 396 | 397 | foreground 398 | #4D5CD3 399 | 400 | 401 | 402 | name 403 | blockcomment 404 | scope 405 | string.blockcomment 406 | settings 407 | 408 | fontStyle 409 | 410 | foreground 411 | #4D5CD3 412 | 413 | 414 | 415 | name 416 | substitution 417 | scope 418 | string.substitution 419 | settings 420 | 421 | fontStyle 422 | 423 | foreground 424 | #E78400 425 | 426 | 427 | 428 | 429 | 430 | 431 | name 432 | Markup: Heading 433 | scope 434 | text.html.markdown markup.heading 435 | settings 436 | 437 | fontStyle 438 | bold 439 | foreground 440 | #cb4b16 441 | 442 | 443 | 444 | name 445 | Markup: Italic 446 | scope 447 | text.html.markdown markup.italic 448 | settings 449 | 450 | fontStyle 451 | italic 452 | foreground 453 | #839496 454 | 455 | 456 | 457 | name 458 | Markup: Bold 459 | scope 460 | text.html.markdown markup.bold 461 | settings 462 | 463 | fontStyle 464 | bold 465 | foreground 466 | #586e75 467 | 468 | 469 | 470 | name 471 | Markup: Underline 472 | scope 473 | text.html.markdown markup.underline 474 | settings 475 | 476 | fontStyle 477 | underline 478 | foreground 479 | #839496 480 | 481 | 482 | 483 | name 484 | Markup: Quote 485 | scope 486 | text.html.markdown markup.quote 487 | settings 488 | 489 | fontStyle 490 | italic 491 | foreground 492 | #268bd2 493 | 494 | 495 | 496 | name 497 | Markup: List 498 | scope 499 | text.html.markdown markup.list 500 | settings 501 | 502 | foreground 503 | #657b83 504 | 505 | 506 | 507 | name 508 | Markup: Raw 509 | scope 510 | text.html.markdown markup.raw 511 | settings 512 | 513 | foreground 514 | #b58900 515 | 516 | 517 | 518 | name 519 | Markup: Separator 520 | scope 521 | text.html.markdown meta.separator 522 | settings 523 | 524 | background 525 | #073642 526 | fontStyle 527 | bold 528 | foreground 529 | #268bd2 530 | 531 | 532 | 533 | 534 | uuid 535 | 32208330-767C-11E2-BCFD-0800200C9A66 536 | 537 | 538 | -------------------------------------------------------------------------------- /Keyboard Maestro Macros/Critic Markup Library.kmlibrary: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Author 6 | Gabriel Weatherhead 7 | AuthorURL 8 | http://criticmarkup.com 9 | CanDragToMacroGroup 10 | 11 | Category1 12 | Text 13 | Category2 14 | 15 | Description 16 | 17 | Items 18 | 19 | 20 | Activate 21 | Normal 22 | IsActive 23 | 24 | Macros 25 | 26 | 27 | Actions 28 | 29 | 30 | Action 31 | ByPasting 32 | IsActive 33 | 34 | IsDisclosed 35 | 36 | MacroActionType 37 | InsertText 38 | Paste 39 | 40 | Text 41 | {++++} 42 | 43 | 44 | IsActive 45 | 46 | IsDisclosed 47 | 48 | KeyCode 49 | 123 50 | MacroActionType 51 | SimulateKeystroke 52 | Modifiers 53 | 0 54 | ReleaseAll 55 | 56 | 57 | 58 | IsActive 59 | 60 | IsDisclosed 61 | 62 | KeyCode 63 | 123 64 | MacroActionType 65 | SimulateKeystroke 66 | Modifiers 67 | 0 68 | ReleaseAll 69 | 70 | 71 | 72 | IsActive 73 | 74 | IsDisclosed 75 | 76 | KeyCode 77 | 123 78 | MacroActionType 79 | SimulateKeystroke 80 | Modifiers 81 | 0 82 | ReleaseAll 83 | 84 | 85 | 86 | IsActive 87 | 88 | Name 89 | Critic Addition 90 | Triggers 91 | 92 | 93 | FireType 94 | Pressed 95 | KeyCode 96 | 0 97 | MacroTriggerType 98 | HotKey 99 | Modifiers 100 | 6912 101 | TriggerRepeat 102 | 103 | 104 | 105 | UID 106 | 0963401A-CCA1-4087-AD90-A24CF5CD2AB7 107 | 108 | 109 | Name 110 | Critic 111 | UID 112 | E41008BC-0D31-45D2-911F-32D6A9DD038C 113 | 114 | 115 | Activate 116 | Normal 117 | IsActive 118 | 119 | Macros 120 | 121 | 122 | Actions 123 | 124 | 125 | Action 126 | ByPasting 127 | IsActive 128 | 129 | IsDisclosed 130 | 131 | MacroActionType 132 | InsertText 133 | Paste 134 | 135 | Text 136 | {>><<} 137 | 138 | 139 | IsActive 140 | 141 | IsDisclosed 142 | 143 | KeyCode 144 | 123 145 | MacroActionType 146 | SimulateKeystroke 147 | Modifiers 148 | 0 149 | ReleaseAll 150 | 151 | 152 | 153 | IsActive 154 | 155 | IsDisclosed 156 | 157 | KeyCode 158 | 123 159 | MacroActionType 160 | SimulateKeystroke 161 | Modifiers 162 | 0 163 | ReleaseAll 164 | 165 | 166 | 167 | IsActive 168 | 169 | IsDisclosed 170 | 171 | KeyCode 172 | 123 173 | MacroActionType 174 | SimulateKeystroke 175 | Modifiers 176 | 0 177 | ReleaseAll 178 | 179 | 180 | 181 | IsActive 182 | 183 | Name 184 | Critic Comment 185 | Triggers 186 | 187 | 188 | FireType 189 | Pressed 190 | KeyCode 191 | 8 192 | MacroTriggerType 193 | HotKey 194 | Modifiers 195 | 6912 196 | TriggerRepeat 197 | 198 | 199 | 200 | UID 201 | 6442D281-DF0A-4316-B883-AE6500FA8A72 202 | 203 | 204 | Name 205 | Critic 206 | UID 207 | E41008BC-0D31-45D2-911F-32D6A9DD038C 208 | 209 | 210 | Activate 211 | Normal 212 | IsActive 213 | 214 | Macros 215 | 216 | 217 | Actions 218 | 219 | 220 | Conditions 221 | 222 | ConditionList 223 | 224 | 225 | ConditionType 226 | Menu 227 | MenuConditionSelectionType 228 | Is 229 | MenuConditionType 230 | IsEnabled 231 | MenuTitle 232 | Cut 233 | 234 | 235 | ConditionListMatch 236 | All 237 | 238 | ElseActions 239 | 240 | 241 | Action 242 | ByPasting 243 | IsActive 244 | 245 | IsDisclosed 246 | 247 | MacroActionType 248 | InsertText 249 | Paste 250 | 251 | Text 252 | {----} 253 | 254 | 255 | IsActive 256 | 257 | IsDisclosed 258 | 259 | KeyCode 260 | 123 261 | MacroActionType 262 | SimulateKeystroke 263 | Modifiers 264 | 0 265 | ReleaseAll 266 | 267 | 268 | 269 | IsActive 270 | 271 | IsDisclosed 272 | 273 | KeyCode 274 | 123 275 | MacroActionType 276 | SimulateKeystroke 277 | Modifiers 278 | 0 279 | ReleaseAll 280 | 281 | 282 | 283 | IsActive 284 | 285 | IsDisclosed 286 | 287 | KeyCode 288 | 123 289 | MacroActionType 290 | SimulateKeystroke 291 | Modifiers 292 | 0 293 | ReleaseAll 294 | 295 | 296 | 297 | IsActive 298 | 299 | IsDisclosed 300 | 301 | MacroActionType 302 | IfThenElse 303 | ThenActions 304 | 305 | 306 | IsActive 307 | 308 | IsDisclosed 309 | 310 | KeyCode 311 | 7 312 | MacroActionType 313 | SimulateKeystroke 314 | Modifiers 315 | 256 316 | ReleaseAll 317 | 318 | 319 | 320 | IsActive 321 | 322 | IsDisclosed 323 | 324 | MacroActionType 325 | SetVariableToText 326 | Text 327 | {--%CurrentClipboard%--} 328 | Variable 329 | temp 330 | 331 | 332 | Action 333 | ByPasting 334 | IsActive 335 | 336 | IsDisclosed 337 | 338 | MacroActionType 339 | InsertText 340 | Paste 341 | 342 | Text 343 | %Variable%temp% 344 | 345 | 346 | TimeOutAbortsMacro 347 | 348 | 349 | 350 | IsActive 351 | 352 | Name 353 | Critic Delete 354 | Triggers 355 | 356 | 357 | FireType 358 | Pressed 359 | KeyCode 360 | 2 361 | MacroTriggerType 362 | HotKey 363 | Modifiers 364 | 6912 365 | TriggerRepeat 366 | 367 | 368 | 369 | UID 370 | 10C29925-FC2E-495D-AA52-9A4B50459D57 371 | 372 | 373 | Name 374 | Critic 375 | UID 376 | E41008BC-0D31-45D2-911F-32D6A9DD038C 377 | 378 | 379 | Activate 380 | Normal 381 | IsActive 382 | 383 | Macros 384 | 385 | 386 | Actions 387 | 388 | 389 | Conditions 390 | 391 | ConditionList 392 | 393 | 394 | ConditionType 395 | Menu 396 | MenuConditionSelectionType 397 | Is 398 | MenuConditionType 399 | IsEnabled 400 | MenuTitle 401 | Cut 402 | 403 | 404 | ConditionListMatch 405 | All 406 | 407 | ElseActions 408 | 409 | 410 | Action 411 | ByPasting 412 | IsActive 413 | 414 | IsDisclosed 415 | 416 | MacroActionType 417 | InsertText 418 | Paste 419 | 420 | Text 421 | {====}{>><<} 422 | 423 | 424 | IsActive 425 | 426 | IsDisclosed 427 | 428 | KeyCode 429 | 123 430 | MacroActionType 431 | SimulateKeystroke 432 | Modifiers 433 | 0 434 | ReleaseAll 435 | 436 | 437 | 438 | IsActive 439 | 440 | IsDisclosed 441 | 442 | KeyCode 443 | 123 444 | MacroActionType 445 | SimulateKeystroke 446 | Modifiers 447 | 0 448 | ReleaseAll 449 | 450 | 451 | 452 | IsActive 453 | 454 | IsDisclosed 455 | 456 | KeyCode 457 | 123 458 | MacroActionType 459 | SimulateKeystroke 460 | Modifiers 461 | 0 462 | ReleaseAll 463 | 464 | 465 | 466 | IsActive 467 | 468 | IsDisclosed 469 | 470 | MacroActionType 471 | IfThenElse 472 | ThenActions 473 | 474 | 475 | IsActive 476 | 477 | IsDisclosed 478 | 479 | KeyCode 480 | 7 481 | MacroActionType 482 | SimulateKeystroke 483 | Modifiers 484 | 256 485 | ReleaseAll 486 | 487 | 488 | 489 | IsActive 490 | 491 | IsDisclosed 492 | 493 | MacroActionType 494 | SetVariableToText 495 | Text 496 | {==%CurrentClipboard%==}{>><<} 497 | Variable 498 | temp 499 | 500 | 501 | Action 502 | ByPasting 503 | IsActive 504 | 505 | IsDisclosed 506 | 507 | MacroActionType 508 | InsertText 509 | Paste 510 | 511 | Text 512 | %Variable%temp% 513 | 514 | 515 | TimeOutAbortsMacro 516 | 517 | 518 | 519 | IsActive 520 | 521 | Name 522 | Critic Highlight 523 | Triggers 524 | 525 | 526 | FireType 527 | Pressed 528 | KeyCode 529 | 4 530 | MacroTriggerType 531 | HotKey 532 | Modifiers 533 | 6912 534 | TriggerRepeat 535 | 536 | 537 | 538 | UID 539 | F2CA7EAE-FDD8-4CB3-8E35-939BAA74058F 540 | 541 | 542 | Name 543 | Critic 544 | UID 545 | E41008BC-0D31-45D2-911F-32D6A9DD038C 546 | 547 | 548 | Activate 549 | Normal 550 | IsActive 551 | 552 | Macros 553 | 554 | 555 | Actions 556 | 557 | 558 | Conditions 559 | 560 | ConditionList 561 | 562 | 563 | ConditionType 564 | Menu 565 | MenuConditionSelectionType 566 | Is 567 | MenuConditionType 568 | IsEnabled 569 | MenuTitle 570 | Cut 571 | 572 | 573 | ConditionListMatch 574 | All 575 | 576 | ElseActions 577 | 578 | 579 | Action 580 | ByPasting 581 | IsActive 582 | 583 | IsDisclosed 584 | 585 | MacroActionType 586 | InsertText 587 | Paste 588 | 589 | Text 590 | {~~ ~> ~~} 591 | 592 | 593 | IsActive 594 | 595 | IsDisclosed 596 | 597 | KeyCode 598 | 123 599 | MacroActionType 600 | SimulateKeystroke 601 | Modifiers 602 | 0 603 | ReleaseAll 604 | 605 | 606 | 607 | IsActive 608 | 609 | IsDisclosed 610 | 611 | KeyCode 612 | 123 613 | MacroActionType 614 | SimulateKeystroke 615 | Modifiers 616 | 0 617 | ReleaseAll 618 | 619 | 620 | 621 | IsActive 622 | 623 | IsDisclosed 624 | 625 | KeyCode 626 | 123 627 | MacroActionType 628 | SimulateKeystroke 629 | Modifiers 630 | 0 631 | ReleaseAll 632 | 633 | 634 | 635 | IsActive 636 | 637 | IsDisclosed 638 | 639 | MacroActionType 640 | IfThenElse 641 | ThenActions 642 | 643 | 644 | IsActive 645 | 646 | IsDisclosed 647 | 648 | KeyCode 649 | 7 650 | MacroActionType 651 | SimulateKeystroke 652 | Modifiers 653 | 256 654 | ReleaseAll 655 | 656 | 657 | 658 | IsActive 659 | 660 | IsDisclosed 661 | 662 | MacroActionType 663 | SetVariableToText 664 | Text 665 | {~~%CurrentClipboard%~>~~} 666 | Variable 667 | temp 668 | 669 | 670 | Action 671 | ByPasting 672 | IsActive 673 | 674 | IsDisclosed 675 | 676 | MacroActionType 677 | InsertText 678 | Paste 679 | 680 | Text 681 | %Variable%temp% 682 | 683 | 684 | IsActive 685 | 686 | IsDisclosed 687 | 688 | KeyCode 689 | 123 690 | MacroActionType 691 | SimulateKeystroke 692 | Modifiers 693 | 0 694 | ReleaseAll 695 | 696 | 697 | 698 | IsActive 699 | 700 | IsDisclosed 701 | 702 | KeyCode 703 | 123 704 | MacroActionType 705 | SimulateKeystroke 706 | Modifiers 707 | 0 708 | ReleaseAll 709 | 710 | 711 | 712 | IsActive 713 | 714 | IsDisclosed 715 | 716 | KeyCode 717 | 123 718 | MacroActionType 719 | SimulateKeystroke 720 | Modifiers 721 | 0 722 | ReleaseAll 723 | 724 | 725 | 726 | TimeOutAbortsMacro 727 | 728 | 729 | 730 | IsActive 731 | 732 | Name 733 | Critic Substitute 734 | Triggers 735 | 736 | 737 | FireType 738 | Pressed 739 | KeyCode 740 | 1 741 | MacroTriggerType 742 | HotKey 743 | Modifiers 744 | 6912 745 | TriggerRepeat 746 | 747 | 748 | 749 | UID 750 | C64DC72C-9727-4E65-AAB5-663E9A03EEEC 751 | 752 | 753 | Name 754 | Critic 755 | UID 756 | E41008BC-0D31-45D2-911F-32D6A9DD038C 757 | 758 | 759 | UID 760 | 5AC79290-A070-437A-9444-E94416BC1FCD 761 | 762 | 763 | -------------------------------------------------------------------------------- /Sublime Text Package/Critic Markup/Critic.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Critic 7 | settings 8 | 9 | 10 | settings 11 | 12 | background 13 | #ECECEC 14 | caret 15 | #00bdff 16 | foreground 17 | #555555 18 | invisibles 19 | #E0E0E0 20 | lineHighlight 21 | #e6e6e6 22 | selection 23 | #C2E8FF 24 | selectionBorder 25 | #AACBDF 26 | inactiveSelection 27 | #B5D3E5 28 | findHighlight 29 | #FFE792 30 | findHighlightForeground 31 | #000000 32 | shadow 33 | #808080 34 | shadowWidth 35 | 6 36 | 37 | 38 | 39 | name 40 | Comments 41 | scope 42 | comment, comment punctuation 43 | settings 44 | 45 | fontStyle 46 | 47 | foreground 48 | #ADADAD 49 | 50 | 51 | 52 | name 53 | Addition 54 | scope 55 | string.addition 56 | settings 57 | 58 | fontStyle 59 | 60 | foreground 61 | #00CD09 62 | 63 | 64 | 65 | name 66 | highlight 67 | scope 68 | string.highlight 69 | settings 70 | 71 | fontStyle 72 | italic 73 | foreground 74 | #DF37DD 75 | 76 | 77 | 78 | name 79 | Deletion 80 | scope 81 | string.deletion 82 | settings 83 | 84 | fontStyle 85 | 86 | foreground 87 | #D51D00 88 | 89 | 90 | 91 | name 92 | comment 93 | scope 94 | string.comment 95 | settings 96 | 97 | fontStyle 98 | 99 | foreground 100 | #4D5CD3 101 | 102 | 103 | 104 | name 105 | blockcomment 106 | scope 107 | string.blockcomment 108 | settings 109 | 110 | fontStyle 111 | 112 | foreground 113 | #4D5CD3 114 | 115 | 116 | 117 | name 118 | substitution 119 | scope 120 | string.substitution 121 | settings 122 | 123 | fontStyle 124 | 125 | foreground 126 | #E78400 127 | 128 | 129 | 130 | name 131 | Comments: Preprocessor 132 | scope 133 | comment.block.preprocessor 134 | settings 135 | 136 | fontStyle 137 | 138 | foreground 139 | #ADADAD 140 | 141 | 142 | 143 | name 144 | Comments: Documentation 145 | scope 146 | comment.documentation, comment.block.documentation 147 | settings 148 | 149 | background 150 | #FFFDF7 151 | fontStyle 152 | 153 | foreground 154 | #BC670F 155 | 156 | 157 | 158 | name 159 | Invalid - Deprecated 160 | scope 161 | invalid.deprecated 162 | settings 163 | 164 | background 165 | #EFCFCF 166 | fontStyle 167 | italic underline 168 | 169 | 170 | 171 | name 172 | Invalid - Illegal 173 | scope 174 | invalid.illegal 175 | settings 176 | 177 | background 178 | #F93232 179 | fontStyle 180 | 181 | foreground 182 | #F9F2CE 183 | 184 | 185 | 186 | name 187 | Operators 188 | scope 189 | keyword.operator 190 | settings 191 | 192 | fontStyle 193 | 194 | foreground 195 | #626FC9 196 | 197 | 198 | 199 | name 200 | Keywords 201 | scope 202 | keyword, storage 203 | settings 204 | 205 | fontStyle 206 | 207 | foreground 208 | #61862F 209 | 210 | 211 | 212 | name 213 | Types 214 | scope 215 | storage.type, support.type 216 | settings 217 | 218 | fontStyle 219 | 220 | foreground 221 | #6700B9 222 | 223 | 224 | 225 | name 226 | Language Constants 227 | scope 228 | constant.language, support.constant, variable.language 229 | settings 230 | 231 | background 232 | #E8E8E8 233 | fontStyle 234 | 235 | foreground 236 | #7653C1 237 | 238 | 239 | 240 | name 241 | Variables 242 | scope 243 | variable, support.variable 244 | settings 245 | 246 | fontStyle 247 | 248 | foreground 249 | #4C8FC7 250 | 251 | 252 | 253 | name 254 | Variables: Punctuation 255 | scope 256 | variable punctuation 257 | settings 258 | 259 | fontStyle 260 | 261 | foreground 262 | #4C8FC7 263 | 264 | 265 | 266 | name 267 | Functions 268 | scope 269 | entity.name.function, support.function, entity 270 | settings 271 | 272 | fontStyle 273 | 274 | foreground 275 | #61862F 276 | 277 | 278 | 279 | name 280 | Classes 281 | scope 282 | entity.name.type, entity.other.inherited-class, support.class 283 | settings 284 | 285 | fontStyle 286 | 287 | foreground 288 | #3A1D72 289 | 290 | 291 | 292 | name 293 | Exceptions 294 | scope 295 | entity.name.exception 296 | settings 297 | 298 | foreground 299 | #F93232 300 | 301 | 302 | 303 | name 304 | Sections 305 | scope 306 | entity.name.section,entity.name.section.markdown 307 | settings 308 | 309 | fontStyle 310 | bold 311 | foreground 312 | #333333 313 | 314 | 315 | 316 | name 317 | Numbers 318 | scope 319 | constant.numeric, constant 320 | settings 321 | 322 | background 323 | #F3F2FF 324 | fontStyle 325 | 326 | foreground 327 | #7653C1 328 | 329 | 330 | 331 | name 332 | Punctuation 333 | scope 334 | punctuation 335 | settings 336 | 337 | fontStyle 338 | 339 | foreground 340 | #000000 341 | 342 | 343 | 344 | name 345 | Strings 346 | scope 347 | constant.character, string 348 | settings 349 | 350 | background 351 | #FBE9AD1A 352 | fontStyle 353 | 354 | foreground 355 | #BC670F 356 | 357 | 358 | 359 | name 360 | Strings: Punctuation 361 | scope 362 | string punctuation 363 | settings 364 | 365 | fontStyle 366 | 367 | foreground 368 | #E69A4C 369 | 370 | 371 | 372 | name 373 | Strings: Escape Sequences 374 | scope 375 | constant.character.escape 376 | settings 377 | 378 | background 379 | #FBE9ADCC 380 | fontStyle 381 | bold 382 | 383 | 384 | 385 | name 386 | Strings: Regular Expressions 387 | scope 388 | string.regexp 389 | settings 390 | 391 | fontStyle 392 | 393 | foreground 394 | #699D36 395 | 396 | 397 | 398 | name 399 | Strings: Symbols 400 | scope 401 | constant.other.symbol 402 | settings 403 | 404 | background 405 | #E8FFD5 406 | fontStyle 407 | bold 408 | 409 | 410 | 411 | name 412 | Embedded Source 413 | scope 414 | string source, text source 415 | settings 416 | 417 | fontStyle 418 | 419 | foreground 420 | #434343 421 | 422 | 423 | 424 | name 425 | ----------------------------------- 426 | settings 427 | 428 | fontStyle 429 | 430 | 431 | 432 | 433 | name 434 | HTML: Doctype Declaration 435 | scope 436 | meta.tag.sgml.doctype 437 | settings 438 | 439 | fontStyle 440 | 441 | foreground 442 | #7F7F7F 443 | 444 | 445 | 446 | name 447 | HTML: Tags 448 | scope 449 | text.html.markdown entity.name.tag,text.html.markdown punctuation.definition.tag.html 450 | settings 451 | 452 | foreground 453 | #AAAAAA 454 | 455 | 456 | 457 | name 458 | HTML: Tags 459 | scope 460 | meta.disable-markdown 461 | settings 462 | 463 | foreground 464 | #AAAAAA 465 | 466 | 467 | 468 | name 469 | HTML: Embedded 470 | scope 471 | source.smarty.embedded.html 472 | settings 473 | 474 | foreground 475 | #777777 476 | 477 | 478 | 479 | name 480 | HTML: Attribute Punctuation 481 | scope 482 | meta.tag string punctuation,punctuation.definition.entity.html 483 | settings 484 | 485 | foreground 486 | #91accf 487 | 488 | 489 | 490 | name 491 | HTML: Tag Punctuation 492 | scope 493 | punctuation.definition.tag 494 | settings 495 | 496 | foreground 497 | #91accf 498 | 499 | 500 | 501 | name 502 | HTML: Entities 503 | scope 504 | constant.character.entity 505 | settings 506 | 507 | foreground 508 | #6d98cf 509 | 510 | 511 | 512 | name 513 | HTML: Attribute Names 514 | scope 515 | entity.other.attribute-name, text.html.markdown meta.disable-markdown meta.tag.block.any.html string.quoted.double.html, text.html.markdown meta.disable-markdown meta.tag.block.any.html string.quoted.double.html punctuation.definition 516 | settings 517 | 518 | fontStyle 519 | 520 | foreground 521 | #999999 522 | 523 | 524 | 525 | name 526 | HTML: Attribute Values 527 | scope 528 | meta.tag string.quoted, meta.tag string.quoted constant.character.entity 529 | settings 530 | 531 | foreground 532 | #6d98cf 533 | 534 | 535 | 536 | name 537 | ----------------------------------- 538 | settings 539 | 540 | fontStyle 541 | 542 | 543 | 544 | 545 | name 546 | CSS: Selectors 547 | scope 548 | meta.selector, meta.selector entity, meta.selector entity punctuation, entity.name.tag.css 549 | settings 550 | 551 | fontStyle 552 | 553 | foreground 554 | #3A77BF 555 | 556 | 557 | 558 | name 559 | CSS: Property Names 560 | scope 561 | meta.property-name, support.type.property-name 562 | settings 563 | 564 | foreground 565 | #D4430D 566 | 567 | 568 | 569 | name 570 | CSS: Property Values 571 | scope 572 | meta.property-value constant.numeric, meta.property-value constant, meta.property-value keyword 573 | settings 574 | 575 | background 576 | #FFFFFF 577 | fontStyle 578 | 579 | foreground 580 | #43A202 581 | 582 | 583 | 584 | name 585 | ----------------------------------- 586 | settings 587 | 588 | 589 | 590 | name 591 | Markup: Changed 592 | scope 593 | markup.changed 594 | settings 595 | 596 | background 597 | #FFFFDD 598 | fontStyle 599 | 600 | foreground 601 | #000000 602 | 603 | 604 | 605 | name 606 | Markup: Deletion 607 | scope 608 | markup.deleted 609 | settings 610 | 611 | background 612 | #FFDDDD 613 | foreground 614 | #000000 615 | 616 | 617 | 618 | name 619 | Markup: Emphasis 620 | scope 621 | markup.italic, markup.italic.markdown 622 | settings 623 | 624 | fontStyle 625 | italic 626 | foreground 627 | #777777 628 | background 629 | #E8E8E8 630 | 631 | 632 | 633 | name 634 | Markdown: Link 635 | scope 636 | string.other.link.title.markdown,string.other.link.description.markdown 637 | settings 638 | 639 | foreground 640 | #333333 641 | background 642 | #DDDDDD00 643 | 644 | 645 | 646 | name 647 | Markdown: Punctuation 648 | scope 649 | punctuation.definition.metadata.markdown,punctuation.definition.string.begin.markdown, punctuation.definition.string.end.markdown, punctuation.definition.constant.markdown, punctuation.separator.key-value.markdown, punctuation.definition.constant.begin.markdown, punctuation.definition.constant.end.markdown,punctuation.definition.bold.markdown, punctuation.definition.italic.markdown, punctuation.definition.heading.markdown 650 | settings 651 | 652 | foreground 653 | #AAAAAA 654 | background 655 | #EEEEEE00 656 | 657 | 658 | 659 | name 660 | Markdown: Punctuation 661 | scope 662 | markup.list.unnumbered.markdown meta.paragraph.list.markdown 663 | settings 664 | 665 | foreground 666 | #666666 667 | background 668 | #EEEEEE00 669 | 670 | 671 | 672 | name 673 | Markup: Error 674 | scope 675 | markup.error 676 | settings 677 | 678 | background 679 | #F93232 680 | fontStyle 681 | 682 | foreground 683 | #F9F2CE 684 | 685 | 686 | 687 | name 688 | Markup: Insertion 689 | scope 690 | markup.inserted 691 | settings 692 | 693 | background 694 | #DDFFDD 695 | fontStyle 696 | 697 | foreground 698 | #000000 699 | 700 | 701 | 702 | name 703 | Markup: Output 704 | scope 705 | markup.output, markup.raw 706 | settings 707 | 708 | foreground 709 | #7F7F7F 710 | 711 | 712 | 713 | name 714 | Markup: Prompt 715 | scope 716 | markup.prompt 717 | settings 718 | 719 | foreground 720 | #555555 721 | 722 | 723 | 724 | name 725 | Markup: Heading 726 | scope 727 | markup.heading 728 | settings 729 | 730 | fontStyle 731 | bold 732 | 733 | 734 | 735 | name 736 | Markup: Strong 737 | scope 738 | markup.bold, markup.bold.markdown 739 | settings 740 | 741 | fontStyle 742 | bold 743 | foreground 744 | #555555 745 | 746 | 747 | 748 | name 749 | Markup: Traceback 750 | scope 751 | markup.traceback 752 | settings 753 | 754 | foreground 755 | #F93232 756 | 757 | 758 | 759 | name 760 | Markup: Underline 761 | scope 762 | markup.underline,markup.underline.link.markdown,constant.other.reference.link.markdown,meta.image.reference.markdown 763 | settings 764 | 765 | background 766 | #E8E8E8 767 | foreground 768 | #AAAAAA 769 | 770 | 771 | 772 | name 773 | ----------------------------------- 774 | settings 775 | 776 | 777 | 778 | name 779 | Extra: Diff Range 780 | scope 781 | meta.diff.range, meta.diff.index, meta.separator 782 | settings 783 | 784 | background 785 | #EAF2F5 786 | fontStyle 787 | 788 | foreground 789 | #434343 790 | 791 | 792 | 793 | name 794 | Extra: Diff From 795 | scope 796 | meta.diff.header.from-file 797 | settings 798 | 799 | background 800 | #FFDDDD 801 | foreground 802 | #434343 803 | 804 | 805 | 806 | name 807 | Extra: Diff To 808 | scope 809 | meta.diff.header.to-file 810 | settings 811 | 812 | background 813 | #DDFFDD 814 | foreground 815 | #434343 816 | 817 | 818 | 819 | name 820 | Markdown Meta 821 | scope 822 | meta.header.multimarkdown,keyword.other.multimarkdown,string.unquoted.multimarkdown,punctuation.separator.key-value.multimarkdown 823 | settings 824 | 825 | background 826 | #DDDDDD 827 | foreground 828 | #BBBBBB 829 | 830 | 831 | 832 | name 833 | Markdown separator 834 | scope 835 | meta.separator.markdown 836 | settings 837 | 838 | background 839 | #BBBBBB11 840 | foreground 841 | #AAAAAA 842 | 843 | 844 | 845 | name 846 | Blockquote 847 | scope 848 | markup.quote.markdown 849 | settings 850 | 851 | foreground 852 | #777777 853 | 854 | 855 | 856 | name 857 | Blockquote punctuation 858 | scope 859 | punctuation.definition.blockquote.markdown 860 | settings 861 | 862 | foreground 863 | #aaaaaa 864 | 865 | 866 | 867 | name 868 | Markdown separator 869 | scope 870 | markup.raw.block.markdown 871 | settings 872 | 873 | background 874 | #dedede 875 | foreground 876 | #555555 877 | 878 | 879 | 880 | name 881 | Block Cursor 882 | scope 883 | block_cursor 884 | settings 885 | 886 | foreground 887 | #212121 888 | background 889 | #00bdff77 890 | 891 | 892 | 893 | name 894 | Brackets 895 | scope 896 | entity.name.class 897 | settings 898 | 899 | background 900 | #d5f6ff88 901 | 902 | 903 | 904 | uuid 905 | BF4E1964-0DB9-4E88-8142-E8F52D7EDEEC 906 | 907 | 908 | --------------------------------------------------------------------------------