├── .gitattributes ├── .gitignore ├── MarkdownViewer.sln ├── MarkdownViewer ├── App.config ├── Classes │ ├── Markdown.cs │ ├── MenuHandler.cs │ ├── PageController.cs │ ├── RequestHandler.cs │ └── SyntaxBrush.cs ├── MarkdownViewer.csproj ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Resources │ ├── HTML_TEMPLATE.html │ ├── MarkdownGuide.html │ ├── fa-arrow-circle-right.png │ ├── fa-search.png │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── images │ │ ├── ComputeIconSmall.jpg │ │ ├── Icon-sm.png │ │ ├── Icon.png │ │ ├── favicon.ico │ │ └── logo.ico │ ├── scripts │ │ ├── app.js │ │ ├── bootstrap.min.js │ │ ├── jquery.js │ │ ├── shAutoloader.js │ │ ├── shCore.js │ │ └── simplemde.min.js │ ├── shBrushes │ │ ├── shBrushAS3.js │ │ ├── shBrushAppleScript.js │ │ ├── shBrushBash.js │ │ ├── shBrushCSharp.js │ │ ├── shBrushColdFusion.js │ │ ├── shBrushCpp.js │ │ ├── shBrushCss.js │ │ ├── shBrushDelphi.js │ │ ├── shBrushDiff.js │ │ ├── shBrushErlang.js │ │ ├── shBrushGroovy.js │ │ ├── shBrushJScript.js │ │ ├── shBrushJava.js │ │ ├── shBrushJavaFX.js │ │ ├── shBrushPerl.js │ │ ├── shBrushPhp.js │ │ ├── shBrushPlain.js │ │ ├── shBrushPowerShell.js │ │ ├── shBrushPython.js │ │ ├── shBrushRuby.js │ │ ├── shBrushSass.js │ │ ├── shBrushScala.js │ │ ├── shBrushSql.js │ │ ├── shBrushVb.js │ │ └── shBrushXml.js │ └── styles │ │ ├── app.css │ │ ├── bootstrap.min.css │ │ ├── font-awesome.min.css │ │ ├── shCore.css │ │ ├── shCoreDefault.css │ │ └── simplemde.min.css ├── app.manifest ├── frmMain.Designer.cs ├── frmMain.cs ├── frmMain.resx ├── logo.ico └── packages.config └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.suo 2 | obj/ 3 | bin/ 4 | Thumbs.db 5 | *.user 6 | workspace.xml 7 | .vscode/ 8 | .vs 9 | packages/ 10 | -------------------------------------------------------------------------------- /MarkdownViewer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MarkdownViewer", "MarkdownViewer\MarkdownViewer.csproj", "{EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Debug|x86 = Debug|x86 13 | Debug64|Any CPU = Debug64|Any CPU 14 | Debug64|x64 = Debug64|x64 15 | Debug64|x86 = Debug64|x86 16 | Debug86|Any CPU = Debug86|Any CPU 17 | Debug86|x64 = Debug86|x64 18 | Debug86|x86 = Debug86|x86 19 | Release|Any CPU = Release|Any CPU 20 | Release|x64 = Release|x64 21 | Release|x86 = Release|x86 22 | Release64|Any CPU = Release64|Any CPU 23 | Release64|x64 = Release64|x64 24 | Release64|x86 = Release64|x86 25 | Release86|Any CPU = Release86|Any CPU 26 | Release86|x64 = Release86|x64 27 | Release86|x86 = Release86|x86 28 | EndGlobalSection 29 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 30 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug|Any CPU.ActiveCfg = Debug|x64 31 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug|Any CPU.Build.0 = Debug|x64 32 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug|x64.ActiveCfg = Debug|x64 33 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug|x64.Build.0 = Debug|x64 34 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug|x86.ActiveCfg = Debug|x64 35 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug|x86.Build.0 = Debug|x64 36 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug64|Any CPU.ActiveCfg = Debug64|Any CPU 37 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug64|Any CPU.Build.0 = Debug64|Any CPU 38 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug64|x64.ActiveCfg = Debug64|x64 39 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug64|x64.Build.0 = Debug64|x64 40 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug64|x86.ActiveCfg = Debug64|Any CPU 41 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug64|x86.Build.0 = Debug64|Any CPU 42 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug86|Any CPU.ActiveCfg = Debug86|Any CPU 43 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug86|Any CPU.Build.0 = Debug86|Any CPU 44 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug86|x64.ActiveCfg = Debug86|x64 45 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug86|x64.Build.0 = Debug86|x64 46 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug86|x86.ActiveCfg = Debug86|x86 47 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Debug86|x86.Build.0 = Debug86|x86 48 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release|Any CPU.ActiveCfg = Release|Any CPU 49 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release|Any CPU.Build.0 = Release|Any CPU 50 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release|x64.ActiveCfg = Release|x64 51 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release|x64.Build.0 = Release|x64 52 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release|x86.ActiveCfg = Release|x86 53 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release|x86.Build.0 = Release|x86 54 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release64|Any CPU.ActiveCfg = Release64|Any CPU 55 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release64|Any CPU.Build.0 = Release64|Any CPU 56 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release64|x64.ActiveCfg = Release64|x64 57 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release64|x64.Build.0 = Release64|x64 58 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release64|x86.ActiveCfg = Release64|Any CPU 59 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release64|x86.Build.0 = Release64|Any CPU 60 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release86|Any CPU.ActiveCfg = Release86|Any CPU 61 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release86|Any CPU.Build.0 = Release86|Any CPU 62 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release86|x64.ActiveCfg = Release86|x64 63 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release86|x64.Build.0 = Release86|x64 64 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release86|x86.ActiveCfg = Release86|x86 65 | {EF012DFC-F380-46B7-81ED-7D3D5F8F3AED}.Release86|x86.Build.0 = Release86|x86 66 | EndGlobalSection 67 | GlobalSection(SolutionProperties) = preSolution 68 | HideSolutionNode = FALSE 69 | EndGlobalSection 70 | EndGlobal 71 | -------------------------------------------------------------------------------- /MarkdownViewer/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | {{{RESOURCES_DIRECTORY}}}\HTML_TEMPLATE.html 18 | 19 | 20 | {{{RESOURCES_DIRECTORY}}}\MarkdownGuide.html 21 | 22 | 23 | http://nextstepwebs.github.io/simplemde-markdown-editor/markdown-guide 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /MarkdownViewer/Classes/MenuHandler.cs: -------------------------------------------------------------------------------- 1 | using CefSharp; 2 | namespace MarkdownViewer 3 | { 4 | internal class MenuHandler : IContextMenuHandler 5 | { 6 | private const CefMenuCommand EditMarkdown = (CefMenuCommand)26501; 7 | private const CefMenuCommand ViewFormatted = (CefMenuCommand)26502; 8 | private const CefMenuCommand SaveChanges = (CefMenuCommand)26503; 9 | private const CefMenuCommand ViewSideBySide = (CefMenuCommand)26504; 10 | 11 | void IContextMenuHandler.OnBeforeContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model) 12 | { 13 | model.Clear(); 14 | 15 | if (Program.BrowserState == BrowserStates.Previewing) 16 | { 17 | model.AddItem((CefMenuCommand)EditMarkdown, "Edit Markdown"); 18 | } 19 | else if (Program.BrowserState == BrowserStates.Editing) 20 | { 21 | model.AddItem((CefMenuCommand)SaveChanges, "Save Changes"); 22 | model.AddSeparator(); 23 | model.AddItem((CefMenuCommand)ViewFormatted, "View Formatted"); 24 | model.AddItem((CefMenuCommand)ViewSideBySide, "Edit and View Side-By-Side"); 25 | } 26 | model.AddSeparator(); 27 | model.AddItem(CefMenuCommand.Print, "Print"); 28 | model.AddSeparator(); 29 | model.AddItem(CefMenuCommand.Find, "Find"); 30 | model.AddSeparator(); 31 | model.AddItem(CefMenuCommand.Copy, "Copy"); 32 | if (Program.BrowserState == BrowserStates.Editing) 33 | { 34 | model.AddItem(CefMenuCommand.Cut, "Cut"); 35 | model.AddItem(CefMenuCommand.Paste, "Paste"); 36 | } 37 | model.AddSeparator(); 38 | model.AddItem(CefMenuCommand.Reload, "Reload File"); 39 | 40 | } 41 | 42 | public bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags) 43 | { 44 | switch (commandId) 45 | { 46 | case EditMarkdown: 47 | browser.MainFrame.ExecuteJavaScriptAsync("window.markdownViewer.editMarkdown();"); 48 | break; 49 | case ViewFormatted: 50 | browser.MainFrame.ExecuteJavaScriptAsync("window.markdownViewer.showFormatted();"); 51 | break; 52 | case SaveChanges: 53 | browser.MainFrame.ExecuteJavaScriptAsync("window.markdownViewer.saveChanges();"); 54 | break; 55 | case ViewSideBySide: 56 | browser.MainFrame.ExecuteJavaScriptAsync("window.markdownViewer.showSideBySide(true);"); 57 | break; 58 | } 59 | 60 | return false; 61 | } 62 | 63 | public void OnContextMenuDismissed(IWebBrowser browserControl, IBrowser browser, IFrame frame) 64 | { 65 | //throw new NotImplementedException(); 66 | } 67 | 68 | public bool RunContextMenu(IWebBrowser browserControl, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model, IRunContextMenuCallback callback) 69 | { 70 | return false; 71 | //throw new NotImplementedException(); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /MarkdownViewer/Classes/PageController.cs: -------------------------------------------------------------------------------- 1 | using MarkdownSharp; 2 | using System; 3 | using System.Diagnostics; 4 | using System.IO; 5 | using System.Windows.Forms; 6 | 7 | namespace MarkdownViewer 8 | { 9 | /// 10 | /// This class is accessed from the "client-side" javascript code as the "controller" class. 11 | /// 12 | public class PageController 13 | { 14 | public string MarkdownPath { get { return Program.MarkdownPath; } } 15 | 16 | public string MarkdownFileName { get { return Path.GetFileName(Program.MarkdownPath); } } 17 | 18 | public string ResourcesDirectory { get { return Program.ResourcesDirectory; } } 19 | 20 | public string MarkdownText 21 | { 22 | get { return Program.MarkdownText; } 23 | set { Program.MarkdownText = value; } 24 | } 25 | 26 | public string GetFormatted(string markdownText) 27 | { 28 | Markdown md = new Markdown(); 29 | string html = null; 30 | try 31 | { 32 | html = md.Transform(markdownText); 33 | } 34 | catch (Exception ex) 35 | { 36 | html = string.Format(@"

Oops!

We are terribly sorry, an error has occurred.

 

37 | {0}
{1}
", ex.Message, ex.StackTrace); 38 | Program.Log(this.MarkdownPath, "Exception converting Markdown to HTML\n\t{0}\n\t\t{1}", 39 | ex.Message, ex.StackTrace); 40 | } 41 | 42 | return html; 43 | } 44 | 45 | public bool SaveMarkdown() 46 | { 47 | return Program.SaveMarkdown(); 48 | } 49 | 50 | public void SaveHtml(string html) 51 | { 52 | using (SaveFileDialog d = new SaveFileDialog() 53 | { 54 | AddExtension = true, 55 | DefaultExt = "html", 56 | FileName = Program.MarkdownPath + ".html", 57 | OverwritePrompt = true, 58 | InitialDirectory = Path.GetDirectoryName(Program.MarkdownPath), 59 | Filter = "HTML files (*.html)|*.html|All files (*.*)|*.*", 60 | Title = "Save " + Path.GetFileName(Program.MarkdownPath) + " as..." 61 | }) 62 | { 63 | //As this will be called from within the browser, it will be on another UI thread 64 | Program.MainForm.Invoke(new Action(() => 65 | { 66 | if (d.ShowDialog(Program.MainForm) == DialogResult.OK) 67 | { 68 | File.WriteAllText(d.FileName, html); 69 | Program.MainForm.RunJavscript("alert('" + 70 | d.FileName.Replace(@"\", @"\\") + 71 | @"\nhas been successfully created.');"); 72 | } 73 | })); 74 | } 75 | } 76 | 77 | public bool SaveAsMarkdown() 78 | { 79 | bool success = false; 80 | using (SaveFileDialog d = new SaveFileDialog() 81 | { 82 | AddExtension = true, 83 | DefaultExt = "md", 84 | FileName = Program.MarkdownPath, 85 | OverwritePrompt = true, 86 | InitialDirectory = Path.GetDirectoryName(Program.MarkdownPath), 87 | Filter = "Markdown files (*.md)|*.md|All files (*.*)|*.*", 88 | Title = "Save " + Path.GetFileName(Program.MarkdownPath) + " as..." 89 | }) 90 | { 91 | //As this will be called from within the browser, it will be on another UI thread 92 | Program.MainForm.Invoke(new Action(() => 93 | { 94 | if (d.ShowDialog(Program.MainForm) == DialogResult.OK) 95 | { 96 | File.WriteAllText(d.FileName, this.MarkdownText); 97 | success = true; 98 | Program.MainForm.RunJavscript("alert('" + 99 | d.FileName.Replace(@"\", @"\\") + 100 | @"\nhas been successfully created.');"); 101 | } 102 | })); 103 | } 104 | return success; 105 | } 106 | 107 | public void OpenMarkdown() 108 | { 109 | if (!this.CheckForChanges()) 110 | { 111 | return; 112 | } 113 | using (OpenFileDialog d = new OpenFileDialog() 114 | { 115 | DefaultExt = "md", 116 | FileName = Program.MarkdownPath + ".html", 117 | InitialDirectory = Path.GetDirectoryName(Program.MarkdownPath), 118 | Filter = "Markdown files (*.md)|*.md|All files (*.*)|*.*", 119 | Title = "Open Markdown File" 120 | }) 121 | { 122 | //As this will be called from within the browser, it will be on another UI thread 123 | Program.MainForm.Invoke(new Action(() => 124 | { 125 | if (d.ShowDialog() == DialogResult.OK) 126 | { 127 | Program.ChangeFile(d.FileName); 128 | } 129 | })); 130 | } 131 | } 132 | 133 | public void ShowDevTools() 134 | { 135 | Program.MainForm.ShowDevTools(); 136 | } 137 | 138 | public void ShowGuide() 139 | { 140 | var mdPath = Properties.Settings.Default.MarkdownGuideFile.Replace( 141 | "{{{RESOURCES_DIRECTORY}}}", Program.ResourcesDirectory); 142 | if (!File.Exists(mdPath)) 143 | { 144 | mdPath = Properties.Settings.Default.MarkDownGuideURL; 145 | } 146 | Process.Start(mdPath); 147 | } 148 | 149 | public void PrintToPdf() 150 | { 151 | using (SaveFileDialog d = new SaveFileDialog() 152 | { 153 | AddExtension = true, 154 | DefaultExt = "pdf", 155 | FileName = Program.MarkdownPath + ".pdf", 156 | OverwritePrompt = true, 157 | InitialDirectory = Path.GetDirectoryName(Program.MarkdownPath), 158 | Filter = "PDF files (*.pdf)|*.pdf|All files (*.*)|*.*", 159 | Title = "Print to PDF - " + Path.GetFileName(Program.MarkdownPath) 160 | }) 161 | { 162 | //As this will be called from within the browser, it will be on another UI thread 163 | Program.MainForm.Invoke(new Action(() => 164 | { 165 | if (d.ShowDialog(Program.MainForm) == DialogResult.OK) 166 | { 167 | Program.MainForm.PrintToPdf(d.FileName); 168 | Program.MainForm.RunJavscript("alert('" + 169 | d.FileName.Replace(@"\", @"\\") + 170 | @"\nhas been successfully created.');"); 171 | } 172 | })); 173 | } 174 | } 175 | 176 | public void SetBrowserState(int state) 177 | { 178 | Program.BrowserState = (BrowserStates)state; 179 | } 180 | 181 | public void ToggleFind() 182 | { 183 | //As this will be called from within the browser, it will be on another UI thread 184 | Program.MainForm.Invoke(new Action(() => 185 | { 186 | Program.MainForm.ToggleFind(); 187 | })); 188 | } 189 | 190 | public string Version() 191 | { 192 | return System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString(); 193 | } 194 | 195 | public void DoKeyUp(int keyCode, bool control, bool shift, bool alt, string selectedText) 196 | { 197 | //As this will be called from within the browser, it will be on another UI thread 198 | Program.MainForm.Invoke(new Action(() => 199 | { 200 | Program.MainForm.DoKeyUp((Keys)keyCode, control, shift, alt, selectedText); 201 | })); 202 | } 203 | 204 | /// 205 | /// Checks for changes to the markdown text. Returns false if the user chose "Cancel" otherwise returns true. 206 | /// 207 | /// 208 | internal bool CheckForChanges() 209 | { 210 | bool situationDealtWith = true; 211 | if (this.HasUnsavedChanges()) 212 | { 213 | var result = MessageBox.Show("There are unsaved changes. Do you wish to save your changes?", "MarkdownViewer", 214 | MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); 215 | switch (result) 216 | { 217 | case DialogResult.Cancel: 218 | situationDealtWith = false; 219 | break; 220 | case DialogResult.Yes: 221 | if(this.SaveMarkdown() || this.SaveAsMarkdown()) 222 | { 223 | Program.MainForm.RunJavscript("alert('Your changes have been successfully saved.', 'success', 2);"); 224 | } 225 | else 226 | { 227 | situationDealtWith = false; 228 | } 229 | break; 230 | } 231 | } 232 | 233 | return situationDealtWith; 234 | } 235 | 236 | private bool HasUnsavedChanges() 237 | { 238 | //If there is no file open, we will return false. 239 | bool hasChanges = false; 240 | if (!string.IsNullOrEmpty(this.MarkdownPath) && File.Exists(this.MarkdownPath)) 241 | { 242 | hasChanges = (File.ReadAllText(this.MarkdownPath) != this.MarkdownText); 243 | } 244 | return hasChanges; 245 | } 246 | } 247 | } 248 | -------------------------------------------------------------------------------- /MarkdownViewer/Classes/RequestHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using CefSharp; 3 | using System.IO; 4 | 5 | namespace MarkdownViewer 6 | { 7 | public class RequestHandler : IRequestHandler 8 | { 9 | bool IRequestHandler.OnBeforeBrowse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, bool isRedirect) 10 | { 11 | var uri = new Uri(request.Url); 12 | if (uri.IsFile && File.Exists(uri.LocalPath)) 13 | { 14 | Program.ChangeFile(uri.LocalPath); 15 | return true; 16 | } 17 | if (!uri.IsFile) 18 | { 19 | System.Diagnostics.Process.Start(request.Url); 20 | return true; 21 | } 22 | 23 | return false; 24 | } 25 | 26 | bool IRequestHandler.OnOpenUrlFromTab(IWebBrowser browserControl, IBrowser browser, IFrame frame, string targetUrl, WindowOpenDisposition targetDisposition, bool userGesture) 27 | { 28 | return false; 29 | } 30 | 31 | bool IRequestHandler.OnCertificateError(IWebBrowser browserControl, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback) 32 | { 33 | callback.Dispose(); 34 | return false; 35 | } 36 | 37 | void IRequestHandler.OnPluginCrashed(IWebBrowser browserControl, IBrowser browser, string pluginPath) 38 | { } 39 | 40 | CefReturnValue IRequestHandler.OnBeforeResourceLoad(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IRequestCallback callback) 41 | { 42 | callback.Dispose(); 43 | return CefReturnValue.Continue; 44 | } 45 | 46 | bool IRequestHandler.GetAuthCredentials(IWebBrowser browserControl, IBrowser browser, IFrame frame, bool isProxy, string host, int port, string realm, string scheme, IAuthCallback callback) 47 | { 48 | callback.Dispose(); 49 | return false; 50 | } 51 | 52 | void IRequestHandler.OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status) 53 | { } 54 | 55 | bool IRequestHandler.OnQuotaRequest(IWebBrowser browserControl, IBrowser browser, string originUrl, long newSize, IRequestCallback callback) 56 | { 57 | callback.Dispose(); 58 | return false; 59 | } 60 | 61 | bool IRequestHandler.OnProtocolExecution(IWebBrowser browserControl, IBrowser browser, string url) 62 | { 63 | return url.StartsWith("mailto"); 64 | } 65 | 66 | void IRequestHandler.OnRenderViewReady(IWebBrowser browserControl, IBrowser browser) 67 | { } 68 | 69 | bool IRequestHandler.OnResourceResponse(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response) 70 | { 71 | //NOTE: You cannot modify the response, only the request 72 | // You can now access the headers 73 | //var headers = response.ResponseHeaders; 74 | 75 | return false; 76 | } 77 | 78 | IResponseFilter IRequestHandler.GetResourceResponseFilter(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response) 79 | { 80 | return null; 81 | } 82 | 83 | void IRequestHandler.OnResourceLoadComplete(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IResponse response, UrlRequestStatus status, long receivedContentLength) 84 | { } 85 | 86 | public void OnResourceRedirect(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, ref string newUrl) 87 | { } 88 | } 89 | } -------------------------------------------------------------------------------- /MarkdownViewer/Classes/SyntaxBrush.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Text; 4 | 5 | namespace MarkdownViewer 6 | { 7 | internal class SyntaxBrush 8 | { 9 | private static List _syntaxBrushList = new List(new SyntaxBrush[] { 10 | new SyntaxBrush(new string[] { "applescript" }, "shBrushAppleScript.js"), 11 | new SyntaxBrush(new string[] { "as3", "actionscript3" }, "shBrushAS3.js"), 12 | new SyntaxBrush(new string[] { "bash", "shell" }, "shBrushBash.js"), 13 | new SyntaxBrush(new string[] { "cf", "coldfusion" }, "shBrushColdFusion.js"), 14 | new SyntaxBrush(new string[] { "c-sharp", "csharp", "cs" }, "shBrushCSharp.js"), 15 | new SyntaxBrush(new string[] { "cpp", "c", "h" }, "shBrushCpp.js"), 16 | new SyntaxBrush(new string[] { "css" }, "shBrushCss.js"), 17 | new SyntaxBrush(new string[] { "delphi", "pas", "pascal" }, "shBrushDelphi.js"), 18 | new SyntaxBrush(new string[] { "diff", "patch" }, "shBrushDiff.js"), 19 | new SyntaxBrush(new string[] { "erl", "erlang" }, "shBrushErlang.js"), 20 | new SyntaxBrush(new string[] { "groovy" }, "shBrushGroovy.js"), 21 | new SyntaxBrush(new string[] { "js", "jscript", "javascript", "json" }, "shBrushJScript.js"), 22 | new SyntaxBrush(new string[] { "java" }, "shBrushJava.js"), 23 | new SyntaxBrush(new string[] { "jfx", "javafx" }, "shBrushJavaFX.js"), 24 | new SyntaxBrush(new string[] { "perl", "pl" }, "shBrushPerl.js"), 25 | new SyntaxBrush(new string[] { "php" }, "shBrushPhp.js"), 26 | new SyntaxBrush(new string[] { "plain", "text", "txt" }, "shBrushPlain.js"), 27 | new SyntaxBrush(new string[] { "ps", "powershell" }, "shBrushPowerShell.js"), 28 | new SyntaxBrush(new string[] { "py", "python" }, "shBrushPython.js"), 29 | new SyntaxBrush(new string[] { "rails", "ror", "ruby" }, "shBrushRuby.js"), 30 | new SyntaxBrush(new string[] { "scala" }, "shBrushScala.js"), 31 | new SyntaxBrush(new string[] { "sass", "scss" }, "shBrushSass.js"), 32 | new SyntaxBrush(new string[] { "sql" }, "shBrushSql.js"), 33 | new SyntaxBrush(new string[] { "vb", "vbnet" }, "shBrushVb.js"), 34 | new SyntaxBrush(new string[] { "xml", "xslt", "html", "xhtml", "htm", "asp", "aspx" }, "shBrushXml.js") 35 | }); 36 | 37 | internal string[] FileAliases { get; private set; } 38 | internal string BrushFilePath { get; private set; } 39 | internal SyntaxBrush(string[] aliases, string fileName) 40 | { 41 | this.FileAliases = aliases; 42 | this.BrushFilePath = "file://" + System.IO.Path.Combine(Program.ResourcesDirectory, "shBrushes", fileName); 43 | } 44 | 45 | internal string GetSyntaxHighlighterAutoLoaderDeclaration() 46 | { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.Append("\n\t\t\t["); 49 | foreach (string str in this.FileAliases) 50 | { 51 | sb.AppendFormat("'{0}',", str); 52 | } 53 | sb.AppendFormat("'{0}']", this.GetEscapedPath()); 54 | return sb.ToString(); 55 | } 56 | 57 | internal static bool DoesAliasHaveBrush(string alias) 58 | { 59 | return _syntaxBrushList.Any(sb => sb.FileAliases.Contains(alias)); 60 | } 61 | 62 | internal static string GetAutoLoaderDeclarationList() 63 | { 64 | string autoLoader = ""; 65 | foreach (var sh in _syntaxBrushList) 66 | { 67 | if (!string.IsNullOrEmpty(autoLoader)) 68 | { 69 | autoLoader += ","; 70 | } 71 | autoLoader += sh.GetSyntaxHighlighterAutoLoaderDeclaration(); 72 | } 73 | return autoLoader; 74 | } 75 | 76 | /// 77 | /// Javascript strings don't have a way to prevent escaping a backslash 78 | /// 79 | /// 80 | private string GetEscapedPath() 81 | { 82 | return this.BrushFilePath.Replace(@"\", @"\\").Replace("\"", "\\\"").Replace("'", "\'"); 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /MarkdownViewer/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Reflection; 4 | using System.Windows.Forms; 5 | 6 | namespace MarkdownViewer 7 | { 8 | enum BrowserStates 9 | { 10 | Previewing = 0, 11 | Editing = 1 12 | } 13 | 14 | class Program 15 | { 16 | internal static string ResourcesDirectory { get; private set; } 17 | 18 | internal static string MarkdownPath { get; private set; } 19 | 20 | internal static string MarkdownText { get; set; } 21 | 22 | internal static frmMain MainForm { get; private set; } 23 | 24 | internal static BrowserStates BrowserState { get; set; } 25 | 26 | private static FileSystemWatcher _fileSystemWatcher; 27 | 28 | [STAThread] 29 | static void Main(string[] args) 30 | { 31 | Program.Log(null, "Starting MarkdownViewer.exe " + string.Join(" ", args)); 32 | if (args.Length > 0) 33 | { 34 | MarkdownPath = args[0]; 35 | } 36 | ResourcesDirectory = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Resources"); 37 | 38 | Application.EnableVisualStyles(); 39 | Application.SetCompatibleTextRenderingDefault(false); 40 | 41 | MainForm = new frmMain(); 42 | BrowserState = BrowserStates.Previewing; 43 | if (!string.IsNullOrEmpty(MarkdownPath)) 44 | { 45 | Initialize(MarkdownPath); 46 | SetUpFileWatcher(MarkdownPath); 47 | } 48 | 49 | Application.Run(MainForm); 50 | } 51 | 52 | internal static string GetHtmlTemplate() 53 | { 54 | string templateFilePath = Properties.Settings.Default.HtmlTemplateFilePath.Replace( 55 | "{{{RESOURCES_DIRECTORY}}}", Program.ResourcesDirectory); 56 | string template; 57 | 58 | if (File.Exists(templateFilePath)) 59 | { 60 | template = File.ReadAllText(templateFilePath); 61 | } 62 | else 63 | { 64 | template = Properties.Resources.HTML_TEMPLATE; 65 | } 66 | 67 | return template 68 | .Replace("'{{{SYNTAX_AUTOLOADER}}}'", SyntaxBrush.GetAutoLoaderDeclarationList()); 69 | } 70 | 71 | internal static bool SaveMarkdown() 72 | { 73 | bool success = false; 74 | try 75 | { 76 | File.WriteAllText(MarkdownPath, MarkdownText); 77 | success = true; 78 | } 79 | catch (Exception ex) 80 | { 81 | Log(MarkdownPath, "Exception saving markdown file:\n\t{0}\n\t\t{1}", ex.Message, ex.StackTrace); 82 | } 83 | return success; 84 | } 85 | 86 | internal static void Log(string mdPath, string message, params object[] args) 87 | { 88 | 89 | #if DEBUG 90 | Console.WriteLine("{0}\t[{1}]\t{2}", 91 | DateTime.Now.TimeOfDay.ToString(), 92 | (string.IsNullOrEmpty(mdPath) ? " ? " : Path.GetFileName(mdPath)), 93 | string.Format(message, args)); 94 | #endif 95 | } 96 | 97 | internal static void ChangeFile(string path) 98 | { 99 | var doIt = new Action(() => 100 | { 101 | Initialize(path); 102 | SetUpFileWatcher(MarkdownPath); 103 | MainForm.RunJavscript("window.markdownViewer.initialize();"); 104 | }); 105 | if (Program.MainForm.InvokeRequired) 106 | { 107 | Program.MainForm.Invoke(doIt); 108 | } 109 | else 110 | { 111 | doIt(); 112 | } 113 | } 114 | 115 | private static void Initialize(string path) 116 | { 117 | MarkdownPath = path; 118 | try 119 | { 120 | Log(MarkdownPath, "Reading markdown file: {0}", MarkdownPath); 121 | MarkdownText = File.ReadAllText(MarkdownPath); 122 | MainForm.Text = MarkdownPath + " - Markdown Viewer"; 123 | } 124 | catch (Exception ex) 125 | { 126 | Log(MarkdownPath, "Exception reading markdown file:\n\t{0}\n\t\t{1}", ex.Message, ex.StackTrace); 127 | return; 128 | } 129 | 130 | if (string.IsNullOrWhiteSpace(MarkdownText)) 131 | { 132 | Program.Log(MarkdownPath, "Markdown file is empty"); 133 | return; 134 | } 135 | } 136 | 137 | private static void SetUpFileWatcher(string mdPath) 138 | { 139 | if (_fileSystemWatcher == null) 140 | { 141 | _fileSystemWatcher = new FileSystemWatcher() 142 | { 143 | NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName, 144 | IncludeSubdirectories = false 145 | 146 | }; 147 | _fileSystemWatcher.Deleted += delegate (object sender, FileSystemEventArgs e) 148 | { 149 | MainForm.RunJavscript("if(window.markdownViewer.fileWasDeleted) window.markdownViewer.fileWasDeleted();"); 150 | }; 151 | _fileSystemWatcher.Changed += delegate (object sender, FileSystemEventArgs e) 152 | { 153 | MainForm.RunJavscript("if(window.markdownViewer.fileWasChanged) window.markdownViewer.fileWasChanged();"); 154 | }; 155 | } 156 | 157 | _fileSystemWatcher.EnableRaisingEvents = false; 158 | _fileSystemWatcher.Path = Path.GetDirectoryName(mdPath); 159 | _fileSystemWatcher.Filter = Path.GetFileName(mdPath); 160 | 161 | _fileSystemWatcher.EnableRaisingEvents = true; 162 | } 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /MarkdownViewer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Markdown Viewer")] 9 | [assembly: AssemblyDescription("Simply view Markdown as it was meant to be viewed!")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Compute Software Solutions")] 12 | [assembly: AssemblyProduct("Markdown Viewer")] 13 | [assembly: AssemblyCopyright("Copyright © Compute Software Solutions 2024")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ef012dfc-f380-46b7-81ed-7d3d5f8f3aed")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.2.5.1")] 36 | [assembly: AssemblyFileVersion("1.2.5.1")] 37 | -------------------------------------------------------------------------------- /MarkdownViewer/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace MarkdownViewer.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MarkdownViewer.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap fa_arrow_circle_right { 67 | get { 68 | object obj = ResourceManager.GetObject("fa-arrow-circle-right", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap fa_search { 77 | get { 78 | object obj = ResourceManager.GetObject("fa-search", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized string similar to <!DOCTYPE html> 85 | ///<html> 86 | ///<head> 87 | /// <title>Markdown Viewer</title> 88 | /// <meta charset="utf-8" /> 89 | /// <link href="styles\bootstrap.min.css" rel="stylesheet" /> 90 | /// <link href="styles\shCore.css" rel="stylesheet" /> 91 | /// <link href="styles\shCoreDefault.css" rel="stylesheet" /> 92 | /// <link href="styles\simplemde.min.css" rel="stylesheet" /> 93 | /// <link href="styles\font-awesome.min.css" rel="stylesheet" /> 94 | /// <link href="styles\app.css" rel="stylesheet" /> 95 | ///</head> 96 | ///<body> 97 | /// <!--<NAV_BAR>--> 98 | /// <nav c [rest of string was truncated]";. 99 | /// 100 | internal static string HTML_TEMPLATE { 101 | get { 102 | return ResourceManager.GetString("HTML_TEMPLATE", resourceCulture); 103 | } 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /MarkdownViewer/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\fa-search.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\Resources\HTML_TEMPLATE.html;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 126 | 127 | 128 | ..\Resources\fa-arrow-circle-right.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 129 | 130 | -------------------------------------------------------------------------------- /MarkdownViewer/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace MarkdownViewer.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("{{{RESOURCES_DIRECTORY}}}\\HTML_TEMPLATE.html")] 29 | public string HtmlTemplateFilePath { 30 | get { 31 | return ((string)(this["HtmlTemplateFilePath"])); 32 | } 33 | set { 34 | this["HtmlTemplateFilePath"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("{{{RESOURCES_DIRECTORY}}}\\MarkdownGuide.html")] 41 | public string MarkdownGuideFile { 42 | get { 43 | return ((string)(this["MarkdownGuideFile"])); 44 | } 45 | set { 46 | this["MarkdownGuideFile"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("http://nextstepwebs.github.io/simplemde-markdown-editor/markdown-guide")] 53 | public string MarkDownGuideURL { 54 | get { 55 | return ((string)(this["MarkDownGuideURL"])); 56 | } 57 | set { 58 | this["MarkDownGuideURL"] = value; 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /MarkdownViewer/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | {{{RESOURCES_DIRECTORY}}}\HTML_TEMPLATE.html 7 | 8 | 9 | {{{RESOURCES_DIRECTORY}}}\MarkdownGuide.html 10 | 11 | 12 | http://nextstepwebs.github.io/simplemde-markdown-editor/markdown-guide 13 | 14 | 15 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/HTML_TEMPLATE.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Markdown Viewer 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 52 | 53 | 54 |
55 |
56 |
57 |

58 |

59 | Welcome to the Markdown Viewer! 60 |

61 | 62 | 63 | Open Markdown File 64 | 65 |
66 |
67 |   68 | You can also drag a markdown file over this Window. 69 |

70 |
71 |
72 |
73 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/MarkdownGuide.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Markdown Guide 7 | 8 | 9 | 10 | 11 | 34 | 35 | 36 | 37 |
38 |
39 |
40 |

Markdown Guide

41 |

Emphasis

42 |
**bold**
43 | *italics*
44 | ~~strikethrough~~
45 |

Headers

46 |
# Big header
47 | ## Medium header
48 | ### Small header
49 | #### Tiny header
50 |

Lists

51 |
* Generic list item
52 | * Generic list item
53 | * Generic list item
54 | 1. Numbered list item
55 | 2. Numbered list item
56 | 3. Numbered list item
57 |

Links

58 |
[Text to display](http://www.example.com)
59 |

Quotes

60 |
> This is a quote.
61 | > It can span multiple lines!
62 |

Images   Need to upload an image? Imgur has a great interface.

63 |
![](http://www.example.com/image.jpg)
64 |

Tables

65 |
| Column 1 | Column 2 | Column 3 |
66 | | -------- | -------- | -------- |
67 | | John     | Doe      | Male     |
68 | | Mary     | Smith    | Female   |
69 | Or without aligning the columns...
70 | | Column 1 | Column 2 | Column 3 |
71 | | -------- | -------- | -------- |
72 | | John | Doe | Male |
73 | | Mary | Smith | Female |
74 | 
75 |

Displaying code

76 |
`var example = "hello!";`
77 | Or spanning multiple lines...
78 | ```
79 | var example = "hello!";
80 | alert(example);
81 | ```
82 | 83 |
84 |
85 |
86 | 87 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/fa-arrow-circle-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbsom/MarkdownViewer/e03d53e1bc82243a8d3affa37a2ca94b38710682/MarkdownViewer/Resources/fa-arrow-circle-right.png -------------------------------------------------------------------------------- /MarkdownViewer/Resources/fa-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbsom/MarkdownViewer/e03d53e1bc82243a8d3affa37a2ca94b38710682/MarkdownViewer/Resources/fa-search.png -------------------------------------------------------------------------------- /MarkdownViewer/Resources/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbsom/MarkdownViewer/e03d53e1bc82243a8d3affa37a2ca94b38710682/MarkdownViewer/Resources/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /MarkdownViewer/Resources/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbsom/MarkdownViewer/e03d53e1bc82243a8d3affa37a2ca94b38710682/MarkdownViewer/Resources/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /MarkdownViewer/Resources/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbsom/MarkdownViewer/e03d53e1bc82243a8d3affa37a2ca94b38710682/MarkdownViewer/Resources/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /MarkdownViewer/Resources/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbsom/MarkdownViewer/e03d53e1bc82243a8d3affa37a2ca94b38710682/MarkdownViewer/Resources/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /MarkdownViewer/Resources/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbsom/MarkdownViewer/e03d53e1bc82243a8d3affa37a2ca94b38710682/MarkdownViewer/Resources/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /MarkdownViewer/Resources/images/ComputeIconSmall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbsom/MarkdownViewer/e03d53e1bc82243a8d3affa37a2ca94b38710682/MarkdownViewer/Resources/images/ComputeIconSmall.jpg -------------------------------------------------------------------------------- /MarkdownViewer/Resources/images/Icon-sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbsom/MarkdownViewer/e03d53e1bc82243a8d3affa37a2ca94b38710682/MarkdownViewer/Resources/images/Icon-sm.png -------------------------------------------------------------------------------- /MarkdownViewer/Resources/images/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbsom/MarkdownViewer/e03d53e1bc82243a8d3affa37a2ca94b38710682/MarkdownViewer/Resources/images/Icon.png -------------------------------------------------------------------------------- /MarkdownViewer/Resources/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbsom/MarkdownViewer/e03d53e1bc82243a8d3affa37a2ca94b38710682/MarkdownViewer/Resources/images/favicon.ico -------------------------------------------------------------------------------- /MarkdownViewer/Resources/images/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbsom/MarkdownViewer/e03d53e1bc82243a8d3affa37a2ca94b38710682/MarkdownViewer/Resources/images/logo.ico -------------------------------------------------------------------------------- /MarkdownViewer/Resources/scripts/app.js: -------------------------------------------------------------------------------- 1 | /******************************************************************************************************* 2 | NOTE: The controller class comes directly from the ChromiumWebBrowser object. 3 | It was registered to this browser instance by the main form constructor 4 | as an instance of the MarkdownViewer.PageController class. 5 | *******************************************************************************************************/ 6 | 'use strict'; 7 | const global = this; 8 | const State_Previewing = 0; 9 | const State_Editing = 1; 10 | 11 | class MarkdownViewer { 12 | constructor(global) { 13 | this.global = global; 14 | this.showingSideBySide = false; 15 | this.state = State_Previewing; 16 | this.initialize(); 17 | } 18 | 19 | initialize() { 20 | if (!!controller.markdownFileName) { 21 | $('#h4MdPath').html(controller.markdownFileName); 22 | //Load the html converted from the markdown contained in Program.MarkdownText. 23 | $('#divContent').html(controller.getFormatted(controller.markdownText)); 24 | $('#btnEditMarkdown').on('click', () => this.editMarkdown()); 25 | 26 | //The html has loaded onto the page. We can now format the code sections. 27 | this.global.loadBrushes(); 28 | SyntaxHighlighter.all(); 29 | 30 | //If this function is being called by the controller, for example if a new file is being opened, 31 | //we want to make sure that we show the html preview - even if the user was in middle of editing the original file. 32 | if (this.state !== State_Previewing) { 33 | this.showFormatted(); 34 | } 35 | } 36 | } 37 | 38 | editMarkdown() { 39 | //The MenuHandler class customizes the right-click menu according to the current state. 40 | controller.setBrowserState(State_Editing); 41 | this.state = State_Editing; 42 | 43 | //The SimpleMDE component loves textareas 44 | $('#divContent').html(''); 45 | 46 | //Now that we have a textarea for it to eat, we can create the SimpleMDE component 47 | this.createEditor(); 48 | 49 | $('#btnEditMarkdown').addClass('active').off('click'); 50 | $('#btnShowFormatted').removeClass('active').one('click', () => this.showFormatted()); 51 | $('#divMain').removeClass('container'); 52 | 53 | 54 | //If the user was previously editing side-by-side before previewing, they probably want to go back to that. 55 | if (this.showingSideBySide === true) { 56 | this.showSideBySide(true); 57 | } 58 | } 59 | 60 | showFormatted() { 61 | //The MenuHandler class customizes the right-click menu according to the current state. 62 | controller.setBrowserState(State_Previewing); 63 | this.state = State_Previewing; 64 | 65 | if (this.simplemde) { 66 | //We are changing from editing to viewing: copy the contents of the editor back into the controller. 67 | //Note, this does not update the changes back to the physical file. Only controller.saveMarkdown() does that. 68 | controller.markdownText = this.simplemde.value(); 69 | 70 | if (this.simplemde.isFullscreenActive()) { 71 | this.simplemde.toggleFullScreen(); 72 | } 73 | } 74 | //We need to convert the markdown to html and load it into the page content. 75 | this.initialize(); 76 | 77 | $('#btnShowFormatted').addClass('active').off('click'); 78 | $('#btnEditMarkdown').removeClass('active').one('click', () => this.editMarkdown()); 79 | $('#divMain').addClass('container'); 80 | 81 | //Due to an issue with the simplemde side-by-side functionality, the body sometimes stays overflow:hidden even after the side-by-side is closed 82 | $('body').css('overflow', 'auto'); 83 | } 84 | 85 | //Open a different Markdown file 86 | openFile() { 87 | controller.openMarkdown(); 88 | } 89 | 90 | //Save the current Markdown as html 91 | saveAsHtml() { 92 | var html = ` 93 | 94 | ${document.head.outerHTML} 95 | ${document.body.outerHTML} 96 | `.replace(/src *= *"scripts\\/gi, 'src="file://' + controller.resourcesDirectory + '\\scripts\\') 97 | .replace(/href *= *"styles\\/gi, 'href="file://' + controller.resourcesDirectory + '\\styles\\') 98 | .replace(/src *= *"images\\/gi, 'src="file://' + controller.resourcesDirectory + '\\images\\') 99 | .replace(/[^]+/, ''); 100 | controller.saveHtml(html); 101 | } 102 | 103 | //Save the current Markdown file as... 104 | saveAsMarkdown() { 105 | controller.saveAsMarkdown(); 106 | } 107 | 108 | //Calls the browser components PrintToPdfAsync function 109 | printToPdf() { 110 | controller.printToPdf(); 111 | } 112 | 113 | //Show Chromes DevTools 114 | showDevTools() { 115 | controller.showDevTools(); 116 | } 117 | 118 | //You always need (at least) one of these 119 | showAbout() { 120 | alert(`    121 | Markdown Viewer 122 |   ${controller.version()} 123 |
124 | ... view Markdown as it was meant to be viewed ... 125 |
A clean and quick Markdown file viewer for Windows.
126 |
127 | Compute Software Solutions©
`, 'info'); 128 | } 129 | 130 | //The PageController calls this function if the file we are viewing gets itself deleted. 131 | fileWasDeleted() { 132 | alert('The Markdown file has been deleted!', 'warning', 3); 133 | } 134 | 135 | //Create a SimpleMDEeditor component - cooked the way we like it 136 | createEditor() { 137 | this.simplemde = new SimpleMDE({ 138 | element: $("#txtEditor")[0], 139 | autoDownloadFontAwesome: false, 140 | initialValue: controller.markdownText, 141 | toolbar: [{ 142 | name: "save", 143 | action: (() => this.saveChanges()), 144 | className: "fa fa-floppy-o", 145 | title: "Save Changes" 146 | }, 147 | //The fullscreen button will be hidden by the css. It was only added here to prevent errors in the side-by-side button 148 | "|", "bold", "italic", "strikethrough", "heading", "|", "quote", "unordered-list", "ordered-list", "|", "link", "image", "table", "fullscreen", "|", 149 | { 150 | name: "side-by-side", 151 | action: (() => this.showSideBySide()), 152 | className: "fa fa-columns", 153 | title: "Side by Side Editing" 154 | }, "|", 155 | { 156 | name: "guide", 157 | action: (() => this.showGuide()), 158 | className: "fa fa-question-circle", 159 | title: "Markdown Guide" 160 | }] 161 | }); 162 | this.simplemde.codemirror.on("change", 163 | () => controller.markdownText = this.simplemde.value()); 164 | } 165 | 166 | saveChanges() { 167 | if (controller.saveMarkdown()) { 168 | alert('The file has been successfully saved.', 'success', 2); 169 | } 170 | else { 171 | alert('The file could not be saved at this time.', 'warning'); 172 | } 173 | } 174 | 175 | showSideBySide(show) { 176 | this.showingSideBySide = show || !this.simplemde.isSideBySideActive(); 177 | if (typeof show === 'undefined' || show !== this.simplemde.isSideBySideActive()) { 178 | this.simplemde.toggleSideBySide(); 179 | } 180 | 181 | //There are some issues with the simplemde side-by-side code. 182 | if (this.showingSideBySide && (!this.simplemde.isSideBySideActive())) { 183 | this.simplemde.toggleSideBySide(); 184 | } 185 | } 186 | 187 | showGuide() { 188 | controller.showGuide(); 189 | } 190 | 191 | find() { 192 | controller.toggleFind(); 193 | } 194 | 195 | doKeyUp(evt) { 196 | var keyCode = evt.keyCode, 197 | ctrlKey = evt.ctrlKey, 198 | shiftKey = evt.shiftKey, 199 | altKey = evt.altKey, 200 | selectedText = this.global.getSelection().toString(); 201 | this.global.setTimeout(function () { 202 | controller.doKeyUp(keyCode, ctrlKey, shiftKey, altKey, selectedText); 203 | }, 5); 204 | } 205 | 206 | version() { 207 | return controller.version(); 208 | } 209 | } 210 | 211 | //Replace alert with a custom bootstrap styled one. 212 | global.alert = function (msg, type, selfCloseSeconds) { 213 | var types = ['success', 'info', 'warning', 'danger'], 214 | hasValidType = type && types.includes(type.toLowerCase()), 215 | iconHtml = ''; 231 | $('#divAlertMessage').html(msg); 232 | $('#divAlert').modal('show') 233 | .removeClass(types.join(' ')) 234 | .addClass(type) 235 | .find('.modal-title').html(iconHtml); 236 | if (selfCloseSeconds) { 237 | global.setTimeout(function () { 238 | $('#divAlert').modal('hide'); 239 | }, selfCloseSeconds * 1000); 240 | } 241 | } 242 | 243 | $(function () { 244 | var mv = global.markdownViewer = new MarkdownViewer(global); 245 | 246 | $('.btnOpenMarkdown').on('click', () => mv.openFile()); 247 | $('#btnSaveAsHtml').on('click', () => mv.saveAsHtml()); 248 | $('#btnSaveAsMarkdown').on('click', () => mv.saveAsMarkdown()); 249 | $('#btnSaveAsPDF').on('click', () => mv.printToPdf()); 250 | $('#btnShowDevTools').on('click', () => mv.showDevTools()); 251 | $('#btnAbout').on('click', () => mv.showAbout()); 252 | $('#btnFind').on('click', () => mv.find()); 253 | $('body').on('keyup', function (e) { mv.doKeyUp(e); }); 254 | }); -------------------------------------------------------------------------------- /MarkdownViewer/Resources/scripts/shAutoloader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(2(){1 h=5;h.I=2(){2 n(c,a){4(1 d=0;d|<|≥|>=|≤|<=|\*|\+|-|\/|÷|\^)/g, 48 | css: 'color2' }, 49 | 50 | { regex: /\b(?:and|as|div|mod|not|or|return(?!\s&)(ing)?|equals|(is(n't| not)? )?equal( to)?|does(n't| not) equal|(is(n't| not)? )?(greater|less) than( or equal( to)?)?|(comes|does(n't| not) come) (after|before)|is(n't| not)?( in)? (back|front) of|is(n't| not)? behind|is(n't| not)?( (in|contained by))?|does(n't| not) contain|contain(s)?|(start|begin|end)(s)? with|((but|end) )?(consider|ignor)ing|prop(erty)?|(a )?ref(erence)?( to)?|repeat (until|while|with)|((end|exit) )?repeat|((else|end) )?if|else|(end )?(script|tell|try)|(on )?error|(put )?into|(of )?(it|me)|its|my|with (timeout( of)?|transaction)|end (timeout|transaction))\b/g, 51 | css: 'keyword' }, 52 | 53 | { regex: /\b\d+(st|nd|rd|th)\b/g, // ordinals 54 | css: 'keyword' }, 55 | 56 | { regex: /\b(?:about|above|against|around|at|below|beneath|beside|between|by|(apart|aside) from|(instead|out) of|into|on(to)?|over|since|thr(ough|u)|under)\b/g, 57 | css: 'color3' }, 58 | 59 | { regex: /\b(?:adding folder items to|after receiving|choose( ((remote )?application|color|folder|from list|URL))?|clipboard info|set the clipboard to|(the )?clipboard|entire contents|display(ing| (alert|dialog|mode))?|document( (edited|file|nib name))?|file( (name|type))?|(info )?for|giving up after|(name )?extension|quoted form|return(ed)?|second(?! item)(s)?|list (disks|folder)|text item(s| delimiters)?|(Unicode )?text|(disk )?item(s)?|((current|list) )?view|((container|key) )?window|with (data|icon( (caution|note|stop))?|parameter(s)?|prompt|properties|seed|title)|case|diacriticals|hyphens|numeric strings|punctuation|white space|folder creation|application(s( folder)?| (processes|scripts position|support))?|((desktop )?(pictures )?|(documents|downloads|favorites|home|keychain|library|movies|music|public|scripts|sites|system|users|utilities|workflows) )folder|desktop|Folder Action scripts|font(s| panel)?|help|internet plugins|modem scripts|(system )?preferences|printer descriptions|scripting (additions|components)|shared (documents|libraries)|startup (disk|items)|temporary items|trash|on server|in AppleTalk zone|((as|long|short) )?user name|user (ID|locale)|(with )?password|in (bundle( with identifier)?|directory)|(close|open for) access|read|write( permission)?|(g|s)et eof|using( delimiters)?|starting at|default (answer|button|color|country code|entr(y|ies)|identifiers|items|name|location|script editor)|hidden( answer)?|open(ed| (location|untitled))?|error (handling|reporting)|(do( shell)?|load|run|store) script|administrator privileges|altering line endings|get volume settings|(alert|boot|input|mount|output|set) volume|output muted|(fax|random )?number|round(ing)?|up|down|toward zero|to nearest|as taught in school|system (attribute|info)|((AppleScript( Studio)?|system) )?version|(home )?directory|(IPv4|primary Ethernet) address|CPU (type|speed)|physical memory|time (stamp|to GMT)|replacing|ASCII (character|number)|localized string|from table|offset|summarize|beep|delay|say|(empty|multiple) selections allowed|(of|preferred) type|invisibles|showing( package contents)?|editable URL|(File|FTP|News|Media|Web) [Ss]ervers|Telnet hosts|Directory services|Remote applications|waiting until completion|saving( (in|to))?|path (for|to( (((current|frontmost) )?application|resource))?)|POSIX (file|path)|(background|RGB) color|(OK|cancel) button name|cancel button|button(s)?|cubic ((centi)?met(re|er)s|yards|feet|inches)|square ((kilo)?met(re|er)s|miles|yards|feet)|(centi|kilo)?met(re|er)s|miles|yards|feet|inches|lit(re|er)s|gallons|quarts|(kilo)?grams|ounces|pounds|degrees (Celsius|Fahrenheit|Kelvin)|print( (dialog|settings))?|clos(e(able)?|ing)|(de)?miniaturized|miniaturizable|zoom(ed|able)|attribute run|action (method|property|title)|phone|email|((start|end)ing|home) page|((birth|creation|current|custom|modification) )?date|((((phonetic )?(first|last|middle))|computer|host|maiden|related) |nick)?name|aim|icq|jabber|msn|yahoo|address(es)?|save addressbook|should enable action|city|country( code)?|formatte(r|d address)|(palette )?label|state|street|zip|AIM [Hh]andle(s)?|my card|select(ion| all)?|unsaved|(alpha )?value|entr(y|ies)|group|(ICQ|Jabber|MSN) handle|person|people|company|department|icon image|job title|note|organization|suffix|vcard|url|copies|collating|pages (across|down)|request print time|target( printer)?|((GUI Scripting|Script menu) )?enabled|show Computer scripts|(de)?activated|awake from nib|became (key|main)|call method|of (class|object)|center|clicked toolbar item|closed|for document|exposed|(can )?hide|idle|keyboard (down|up)|event( (number|type))?|launch(ed)?|load (image|movie|nib|sound)|owner|log|mouse (down|dragged|entered|exited|moved|up)|move|column|localization|resource|script|register|drag (info|types)|resigned (active|key|main)|resiz(e(d)?|able)|right mouse (down|dragged|up)|scroll wheel|(at )?index|should (close|open( untitled)?|quit( after last window closed)?|zoom)|((proposed|screen) )?bounds|show(n)?|behind|in front of|size (mode|to fit)|update(d| toolbar item)?|was (hidden|miniaturized)|will (become active|close|finish launching|hide|miniaturize|move|open|quit|(resign )?active|((maximum|minimum|proposed) )?size|show|zoom)|bundle|data source|movie|pasteboard|sound|tool(bar| tip)|(color|open|save) panel|coordinate system|frontmost|main( (bundle|menu|window))?|((services|(excluded from )?windows) )?menu|((executable|frameworks|resource|scripts|shared (frameworks|support)) )?path|(selected item )?identifier|data|content(s| view)?|character(s)?|click count|(command|control|option|shift) key down|context|delta (x|y|z)|key( code)?|location|pressure|unmodified characters|types|(first )?responder|playing|(allowed|selectable) identifiers|allows customization|(auto saves )?configuration|visible|image( name)?|menu form representation|tag|user(-| )defaults|associated file name|(auto|needs) display|current field editor|floating|has (resize indicator|shadow)|hides when deactivated|level|minimized (image|title)|opaque|position|release when closed|sheet|title(d)?)\b/g, 60 | css: 'color3' }, 61 | 62 | { regex: new RegExp(this.getKeywords(specials), 'gm'), css: 'color3' }, 63 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, 64 | { regex: new RegExp(this.getKeywords(ordinals), 'gm'), css: 'keyword' } 65 | ]; 66 | }; 67 | 68 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 69 | Brush.aliases = ['applescript']; 70 | 71 | SyntaxHighlighter.brushes.AppleScript = Brush; 72 | 73 | // CommonJS 74 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 75 | })(); 76 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushBash.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'if fi then elif else for do done until while break continue case function return in eq ne ge le'; 25 | var commands = 'alias apropos awk basename bash bc bg builtin bzip2 cal cat cd cfdisk chgrp chmod chown chroot' + 26 | 'cksum clear cmp comm command cp cron crontab csplit cut date dc dd ddrescue declare df ' + 27 | 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' + 28 | 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' + 29 | 'free fsck ftp gawk getopts grep groups gzip hash head history hostname id ifconfig ' + 30 | 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' + 31 | 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' + 32 | 'mv netstat nice nl nohup nslookup open op passwd paste pathchk ping popd pr printcap ' + 33 | 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' + 34 | 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' + 35 | 'sleep sort source split ssh strace su sudo sum symlink sync tail tar tee test time ' + 36 | 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' + 37 | 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' + 38 | 'vi watch wc whereis which who whoami Wget xargs yes' 39 | ; 40 | 41 | this.regexList = [ 42 | { regex: /^#!.*$/gm, css: 'preprocessor bold' }, 43 | { regex: /\/[\w-\/]+/gm, css: 'plain' }, 44 | { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments 45 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings 46 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings 47 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords 48 | { regex: new RegExp(this.getKeywords(commands), 'gm'), css: 'functions' } // commands 49 | ]; 50 | } 51 | 52 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 53 | Brush.aliases = ['bash', 'shell']; 54 | 55 | SyntaxHighlighter.brushes.Bash = Brush; 56 | 57 | // CommonJS 58 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 59 | })(); 60 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushCSharp.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'abstract as base bool break byte case catch char checked class const ' + 25 | 'continue decimal default delegate do double else enum event explicit ' + 26 | 'extern false finally fixed float for foreach get goto if implicit in int ' + 27 | 'interface internal is lock long namespace new null object operator out ' + 28 | 'override params private protected public readonly ref return sbyte sealed set ' + 29 | 'short sizeof stackalloc static string struct switch this throw true try ' + 30 | 'typeof uint ulong unchecked unsafe ushort using virtual void while'; 31 | 32 | function fixComments(match, regexInfo) 33 | { 34 | var css = (match[0].indexOf("///") == 0) 35 | ? 'color1' 36 | : 'comments' 37 | ; 38 | 39 | return [new SyntaxHighlighter.Match(match[0], match.index, css)]; 40 | } 41 | 42 | this.regexList = [ 43 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, func : fixComments }, // one line comments 44 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 45 | { regex: /@"(?:[^"]|"")*"/g, css: 'string' }, // @-quoted strings 46 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 47 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 48 | { regex: /^\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion 49 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // c# keyword 50 | { regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g, css: 'keyword' }, // contextual keyword: 'partial' 51 | { regex: /\byield(?=\s+(?:return|break)\b)/g, css: 'keyword' } // contextual keyword: 'yield' 52 | ]; 53 | 54 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 55 | }; 56 | 57 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 58 | Brush.aliases = ['c#', 'c-sharp', 'csharp']; 59 | 60 | SyntaxHighlighter.brushes.CSharp = Brush; 61 | 62 | // CommonJS 63 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 64 | })(); 65 | 66 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushColdFusion.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Jen 25 | // http://www.jensbits.com/2009/05/14/coldfusion-brush-for-syntaxhighlighter-plus 26 | 27 | var funcs = 'Abs ACos AddSOAPRequestHeader AddSOAPResponseHeader AjaxLink AjaxOnLoad ArrayAppend ArrayAvg ArrayClear ArrayDeleteAt ' + 28 | 'ArrayInsertAt ArrayIsDefined ArrayIsEmpty ArrayLen ArrayMax ArrayMin ArraySet ArraySort ArraySum ArraySwap ArrayToList ' + 29 | 'Asc ASin Atn BinaryDecode BinaryEncode BitAnd BitMaskClear BitMaskRead BitMaskSet BitNot BitOr BitSHLN BitSHRN BitXor ' + 30 | 'Ceiling CharsetDecode CharsetEncode Chr CJustify Compare CompareNoCase Cos CreateDate CreateDateTime CreateObject ' + 31 | 'CreateODBCDate CreateODBCDateTime CreateODBCTime CreateTime CreateTimeSpan CreateUUID DateAdd DateCompare DateConvert ' + 32 | 'DateDiff DateFormat DatePart Day DayOfWeek DayOfWeekAsString DayOfYear DaysInMonth DaysInYear DE DecimalFormat DecrementValue ' + 33 | 'Decrypt DecryptBinary DeleteClientVariable DeserializeJSON DirectoryExists DollarFormat DotNetToCFType Duplicate Encrypt ' + 34 | 'EncryptBinary Evaluate Exp ExpandPath FileClose FileCopy FileDelete FileExists FileIsEOF FileMove FileOpen FileRead ' + 35 | 'FileReadBinary FileReadLine FileSetAccessMode FileSetAttribute FileSetLastModified FileWrite Find FindNoCase FindOneOf ' + 36 | 'FirstDayOfMonth Fix FormatBaseN GenerateSecretKey GetAuthUser GetBaseTagData GetBaseTagList GetBaseTemplatePath ' + 37 | 'GetClientVariablesList GetComponentMetaData GetContextRoot GetCurrentTemplatePath GetDirectoryFromPath GetEncoding ' + 38 | 'GetException GetFileFromPath GetFileInfo GetFunctionList GetGatewayHelper GetHttpRequestData GetHttpTimeString ' + 39 | 'GetK2ServerDocCount GetK2ServerDocCountLimit GetLocale GetLocaleDisplayName GetLocalHostIP GetMetaData GetMetricData ' + 40 | 'GetPageContext GetPrinterInfo GetProfileSections GetProfileString GetReadableImageFormats GetSOAPRequest GetSOAPRequestHeader ' + 41 | 'GetSOAPResponse GetSOAPResponseHeader GetTempDirectory GetTempFile GetTemplatePath GetTickCount GetTimeZoneInfo GetToken ' + 42 | 'GetUserRoles GetWriteableImageFormats Hash Hour HTMLCodeFormat HTMLEditFormat IIf ImageAddBorder ImageBlur ImageClearRect ' + 43 | 'ImageCopy ImageCrop ImageDrawArc ImageDrawBeveledRect ImageDrawCubicCurve ImageDrawLine ImageDrawLines ImageDrawOval ' + 44 | 'ImageDrawPoint ImageDrawQuadraticCurve ImageDrawRect ImageDrawRoundRect ImageDrawText ImageFlip ImageGetBlob ImageGetBufferedImage ' + 45 | 'ImageGetEXIFTag ImageGetHeight ImageGetIPTCTag ImageGetWidth ImageGrayscale ImageInfo ImageNegative ImageNew ImageOverlay ImagePaste ' + 46 | 'ImageRead ImageReadBase64 ImageResize ImageRotate ImageRotateDrawingAxis ImageScaleToFit ImageSetAntialiasing ImageSetBackgroundColor ' + 47 | 'ImageSetDrawingColor ImageSetDrawingStroke ImageSetDrawingTransparency ImageSharpen ImageShear ImageShearDrawingAxis ImageTranslate ' + 48 | 'ImageTranslateDrawingAxis ImageWrite ImageWriteBase64 ImageXORDrawingMode IncrementValue InputBaseN Insert Int IsArray IsBinary ' + 49 | 'IsBoolean IsCustomFunction IsDate IsDDX IsDebugMode IsDefined IsImage IsImageFile IsInstanceOf IsJSON IsLeapYear IsLocalHost ' + 50 | 'IsNumeric IsNumericDate IsObject IsPDFFile IsPDFObject IsQuery IsSimpleValue IsSOAPRequest IsStruct IsUserInAnyRole IsUserInRole ' + 51 | 'IsUserLoggedIn IsValid IsWDDX IsXML IsXmlAttribute IsXmlDoc IsXmlElem IsXmlNode IsXmlRoot JavaCast JSStringFormat LCase Left Len ' + 52 | 'ListAppend ListChangeDelims ListContains ListContainsNoCase ListDeleteAt ListFind ListFindNoCase ListFirst ListGetAt ListInsertAt ' + 53 | 'ListLast ListLen ListPrepend ListQualify ListRest ListSetAt ListSort ListToArray ListValueCount ListValueCountNoCase LJustify Log ' + 54 | 'Log10 LSCurrencyFormat LSDateFormat LSEuroCurrencyFormat LSIsCurrency LSIsDate LSIsNumeric LSNumberFormat LSParseCurrency LSParseDateTime ' + 55 | 'LSParseEuroCurrency LSParseNumber LSTimeFormat LTrim Max Mid Min Minute Month MonthAsString Now NumberFormat ParagraphFormat ParseDateTime ' + 56 | 'Pi PrecisionEvaluate PreserveSingleQuotes Quarter QueryAddColumn QueryAddRow QueryConvertForGrid QueryNew QuerySetCell QuotedValueList Rand ' + 57 | 'Randomize RandRange REFind REFindNoCase ReleaseComObject REMatch REMatchNoCase RemoveChars RepeatString Replace ReplaceList ReplaceNoCase ' + 58 | 'REReplace REReplaceNoCase Reverse Right RJustify Round RTrim Second SendGatewayMessage SerializeJSON SetEncoding SetLocale SetProfileString ' + 59 | 'SetVariable Sgn Sin Sleep SpanExcluding SpanIncluding Sqr StripCR StructAppend StructClear StructCopy StructCount StructDelete StructFind ' + 60 | 'StructFindKey StructFindValue StructGet StructInsert StructIsEmpty StructKeyArray StructKeyExists StructKeyList StructKeyList StructNew ' + 61 | 'StructSort StructUpdate Tan TimeFormat ToBase64 ToBinary ToScript ToString Trim UCase URLDecode URLEncodedFormat URLSessionFormat Val ' + 62 | 'ValueList VerifyClient Week Wrap Wrap WriteOutput XmlChildPos XmlElemNew XmlFormat XmlGetNodeType XmlNew XmlParse XmlSearch XmlTransform ' + 63 | 'XmlValidate Year YesNoFormat'; 64 | 65 | var keywords = 'cfabort cfajaximport cfajaxproxy cfapplet cfapplication cfargument cfassociate cfbreak cfcache cfcalendar ' + 66 | 'cfcase cfcatch cfchart cfchartdata cfchartseries cfcol cfcollection cfcomponent cfcontent cfcookie cfdbinfo ' + 67 | 'cfdefaultcase cfdirectory cfdiv cfdocument cfdocumentitem cfdocumentsection cfdump cfelse cfelseif cferror ' + 68 | 'cfexchangecalendar cfexchangeconnection cfexchangecontact cfexchangefilter cfexchangemail cfexchangetask ' + 69 | 'cfexecute cfexit cffeed cffile cfflush cfform cfformgroup cfformitem cfftp cffunction cfgrid cfgridcolumn ' + 70 | 'cfgridrow cfgridupdate cfheader cfhtmlhead cfhttp cfhttpparam cfif cfimage cfimport cfinclude cfindex ' + 71 | 'cfinput cfinsert cfinterface cfinvoke cfinvokeargument cflayout cflayoutarea cfldap cflocation cflock cflog ' + 72 | 'cflogin cfloginuser cflogout cfloop cfmail cfmailparam cfmailpart cfmenu cfmenuitem cfmodule cfNTauthenticate ' + 73 | 'cfobject cfobjectcache cfoutput cfparam cfpdf cfpdfform cfpdfformparam cfpdfparam cfpdfsubform cfpod cfpop ' + 74 | 'cfpresentation cfpresentationslide cfpresenter cfprint cfprocessingdirective cfprocparam cfprocresult ' + 75 | 'cfproperty cfquery cfqueryparam cfregistry cfreport cfreportparam cfrethrow cfreturn cfsavecontent cfschedule ' + 76 | 'cfscript cfsearch cfselect cfset cfsetting cfsilent cfslider cfsprydataset cfstoredproc cfswitch cftable ' + 77 | 'cftextarea cfthread cfthrow cftimer cftooltip cftrace cftransaction cftree cftreeitem cftry cfupdate cfwddx ' + 78 | 'cfwindow cfxml cfzip cfzipparam'; 79 | 80 | var operators = 'all and any between cross in join like not null or outer some'; 81 | 82 | this.regexList = [ 83 | { regex: new RegExp('--(.*)$', 'gm'), css: 'comments' }, // one line and multiline comments 84 | { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // single quoted strings 85 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings 86 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings 87 | { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // functions 88 | { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such 89 | { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword 90 | ]; 91 | } 92 | 93 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 94 | Brush.aliases = ['coldfusion','cf']; 95 | 96 | SyntaxHighlighter.brushes.ColdFusion = Brush; 97 | 98 | // CommonJS 99 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 100 | })(); 101 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushCpp.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Copyright 2006 Shin, YoungJin 25 | 26 | var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' + 27 | 'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' + 28 | 'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' + 29 | 'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' + 30 | 'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' + 31 | 'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' + 32 | 'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' + 33 | 'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' + 34 | 'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' + 35 | 'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' + 36 | 'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' + 37 | 'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' + 38 | 'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' + 39 | 'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' + 40 | 'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' + 41 | 'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' + 42 | 'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' + 43 | 'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' + 44 | 'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' + 45 | '__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' + 46 | 'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' + 47 | 'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' + 48 | 'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' + 49 | 'va_list wchar_t wctrans_t wctype_t wint_t signed'; 50 | 51 | var keywords = 'break case catch class const __finally __exception __try ' + 52 | 'const_cast continue private public protected __declspec ' + 53 | 'default delete deprecated dllexport dllimport do dynamic_cast ' + 54 | 'else enum explicit extern if for friend goto inline ' + 55 | 'mutable naked namespace new noinline noreturn nothrow ' + 56 | 'register reinterpret_cast return selectany ' + 57 | 'sizeof static static_cast struct switch template this ' + 58 | 'thread throw true false try typedef typeid typename union ' + 59 | 'using uuid virtual void volatile whcar_t while'; 60 | 61 | var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' + 62 | 'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' + 63 | 'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' + 64 | 'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' + 65 | 'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' + 66 | 'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' + 67 | 'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' + 68 | 'fwrite getc getchar gets perror printf putc putchar puts remove ' + 69 | 'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' + 70 | 'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' + 71 | 'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' + 72 | 'mbtowc qsort rand realloc srand strtod strtol strtoul system ' + 73 | 'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' + 74 | 'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' + 75 | 'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' + 76 | 'clock ctime difftime gmtime localtime mktime strftime time'; 77 | 78 | this.regexList = [ 79 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 80 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 81 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 82 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 83 | { regex: /^ *#.*/gm, css: 'preprocessor' }, 84 | { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' }, 85 | { regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' }, 86 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' } 87 | ]; 88 | }; 89 | 90 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 91 | Brush.aliases = ['cpp', 'c', 'h']; 92 | 93 | SyntaxHighlighter.brushes.Cpp = Brush; 94 | 95 | // CommonJS 96 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 97 | })(); 98 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushCss.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | function getKeywordsCSS(str) 25 | { 26 | return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b'; 27 | }; 28 | 29 | function getValuesCSS(str) 30 | { 31 | return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b'; 32 | }; 33 | 34 | var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' + 35 | 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' + 36 | 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' + 37 | 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' + 38 | 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' + 39 | 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' + 40 | 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' + 41 | 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' + 42 | 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' + 43 | 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' + 44 | 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' + 45 | 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' + 46 | 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' + 47 | 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index'; 48 | 49 | var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+ 50 | 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+ 51 | 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+ 52 | 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+ 53 | 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+ 54 | 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+ 55 | 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+ 56 | 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+ 57 | 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+ 58 | 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+ 59 | 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+ 60 | 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+ 61 | 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+ 62 | 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow'; 63 | 64 | var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif'; 65 | 66 | this.regexList = [ 67 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 68 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings 69 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings 70 | { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors 71 | { regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g, css: 'value' }, // sizes 72 | { regex: /!important/g, css: 'color3' }, // !important 73 | { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords 74 | { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values 75 | { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts 76 | ]; 77 | 78 | this.forHtmlScript({ 79 | left: /(<|<)\s*style.*?(>|>)/gi, 80 | right: /(<|<)\/\s*style\s*(>|>)/gi 81 | }); 82 | }; 83 | 84 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 85 | Brush.aliases = ['css']; 86 | 87 | SyntaxHighlighter.brushes.CSS = Brush; 88 | 89 | // CommonJS 90 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 91 | })(); 92 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushDelphi.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' + 25 | 'case char class comp const constructor currency destructor div do double ' + 26 | 'downto else end except exports extended false file finalization finally ' + 27 | 'for function goto if implementation in inherited int64 initialization ' + 28 | 'integer interface is label library longint longword mod nil not object ' + 29 | 'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' + 30 | 'pint64 pointer private procedure program property pshortstring pstring ' + 31 | 'pvariant pwidechar pwidestring protected public published raise real real48 ' + 32 | 'record repeat set shl shortint shortstring shr single smallint string then ' + 33 | 'threadvar to true try type unit until uses val var varirnt while widechar ' + 34 | 'widestring with word write writeln xor'; 35 | 36 | this.regexList = [ 37 | { regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *) 38 | { regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { } 39 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line 40 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 41 | { regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags 42 | { regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345 43 | { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3 44 | { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword 45 | ]; 46 | }; 47 | 48 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 49 | Brush.aliases = ['delphi', 'pascal', 'pas']; 50 | 51 | SyntaxHighlighter.brushes.Delphi = Brush; 52 | 53 | // CommonJS 54 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 55 | })(); 56 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushDiff.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | this.regexList = [ 25 | { regex: /^\+\+\+.*$/gm, css: 'color2' }, 26 | { regex: /^\-\-\-.*$/gm, css: 'color2' }, 27 | { regex: /^\s.*$/gm, css: 'color1' }, 28 | { regex: /^@@.*@@$/gm, css: 'variable' }, 29 | { regex: /^\+[^\+]{1}.*$/gm, css: 'string' }, 30 | { regex: /^\-[^\-]{1}.*$/gm, css: 'comments' } 31 | ]; 32 | }; 33 | 34 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 35 | Brush.aliases = ['diff', 'patch']; 36 | 37 | SyntaxHighlighter.brushes.Diff = Brush; 38 | 39 | // CommonJS 40 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 41 | })(); 42 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushErlang.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Jean-Lou Dupont 25 | // http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html 26 | 27 | // According to: http://erlang.org/doc/reference_manual/introduction.html#1.5 28 | var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+ 29 | 'case catch cond div end fun if let not of or orelse '+ 30 | 'query receive rem try when xor'+ 31 | // additional 32 | ' module export import define'; 33 | 34 | this.regexList = [ 35 | { regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' }, 36 | { regex: new RegExp("\\%.+", 'gm'), css: 'comments' }, 37 | { regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' }, 38 | { regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' }, 39 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, 40 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, 41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } 42 | ]; 43 | }; 44 | 45 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 46 | Brush.aliases = ['erl', 'erlang']; 47 | 48 | SyntaxHighlighter.brushes.Erland = Brush; 49 | 50 | // CommonJS 51 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 52 | })(); 53 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushGroovy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Andres Almiray 25 | // http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter 26 | 27 | var keywords = 'as assert break case catch class continue def default do else extends finally ' + 28 | 'if in implements import instanceof interface new package property return switch ' + 29 | 'throw throws try while public protected private static'; 30 | var types = 'void boolean byte char short int long float double'; 31 | var constants = 'null'; 32 | var methods = 'allProperties count get size '+ 33 | 'collect each eachProperty eachPropertyName eachWithIndex find findAll ' + 34 | 'findIndexOf grep inject max min reverseEach sort ' + 35 | 'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' + 36 | 'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' + 37 | 'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' + 38 | 'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' + 39 | 'transformChar transformLine withOutputStream withPrintWriter withStream ' + 40 | 'withStreams withWriter withWriterAppend write writeLine '+ 41 | 'dump inspect invokeMethod print println step times upto use waitForOrKill '+ 42 | 'getText'; 43 | 44 | this.regexList = [ 45 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 46 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 47 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 48 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 49 | { regex: /""".*"""/g, css: 'string' }, // GStrings 50 | { regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers 51 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword 52 | { regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type 53 | { regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants 54 | { regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods 55 | ]; 56 | 57 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 58 | } 59 | 60 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 61 | Brush.aliases = ['groovy']; 62 | 63 | SyntaxHighlighter.brushes.Groovy = Brush; 64 | 65 | // CommonJS 66 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 67 | })(); 68 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushJScript.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'break case catch continue ' + 25 | 'default delete do else false ' + 26 | 'for function if in instanceof ' + 27 | 'new null return super switch ' + 28 | 'this throw true try typeof var while with' 29 | ; 30 | 31 | var r = SyntaxHighlighter.regexLib; 32 | 33 | this.regexList = [ 34 | { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings 35 | { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings 36 | { regex: r.singleLineCComments, css: 'comments' }, // one line comments 37 | { regex: r.multiLineCComments, css: 'comments' }, // multiline comments 38 | { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion 39 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords 40 | ]; 41 | 42 | this.forHtmlScript(r.scriptScriptTags); 43 | }; 44 | 45 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 46 | Brush.aliases = ['js', 'jscript', 'javascript', 'json']; 47 | 48 | SyntaxHighlighter.brushes.JScript = Brush; 49 | 50 | // CommonJS 51 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 52 | })(); 53 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushJava.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'abstract assert boolean break byte case catch char class const ' + 25 | 'continue default do double else enum extends ' + 26 | 'false final finally float for goto if implements import ' + 27 | 'instanceof int interface long native new null ' + 28 | 'package private protected public return ' + 29 | 'short static strictfp super switch synchronized this throw throws true ' + 30 | 'transient try void volatile while'; 31 | 32 | this.regexList = [ 33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 34 | { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments 35 | { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments 36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 38 | { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers 39 | { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno 40 | { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword 41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword 42 | ]; 43 | 44 | this.forHtmlScript({ 45 | left : /(<|<)%[@!=]?/g, 46 | right : /%(>|>)/g 47 | }); 48 | }; 49 | 50 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 51 | Brush.aliases = ['java']; 52 | 53 | SyntaxHighlighter.brushes.Java = Brush; 54 | 55 | // CommonJS 56 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 57 | })(); 58 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushJavaFX.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Patrick Webster 25 | // http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html 26 | var datatypes = 'Boolean Byte Character Double Duration ' 27 | + 'Float Integer Long Number Short String Void' 28 | ; 29 | 30 | var keywords = 'abstract after and as assert at before bind bound break catch class ' 31 | + 'continue def delete else exclusive extends false finally first for from ' 32 | + 'function if import in indexof init insert instanceof into inverse last ' 33 | + 'lazy mixin mod nativearray new not null on or override package postinit ' 34 | + 'protected public public-init public-read replace return reverse sizeof ' 35 | + 'step super then this throw true try tween typeof var where while with ' 36 | + 'attribute let private readonly static trigger' 37 | ; 38 | 39 | this.regexList = [ 40 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, 41 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, 42 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, 43 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, 44 | { regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers 45 | { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes 46 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } 47 | ]; 48 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 49 | }; 50 | 51 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 52 | Brush.aliases = ['jfx', 'javafx']; 53 | 54 | SyntaxHighlighter.brushes.JavaFX = Brush; 55 | 56 | // CommonJS 57 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 58 | })(); 59 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushPerl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by David Simmons-Duffin and Marty Kube 25 | 26 | var funcs = 27 | 'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' + 28 | 'chroot close closedir connect cos crypt defined delete each endgrent ' + 29 | 'endhostent endnetent endprotoent endpwent endservent eof exec exists ' + 30 | 'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' + 31 | 'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' + 32 | 'getnetbyname getnetent getpeername getpgrp getppid getpriority ' + 33 | 'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' + 34 | 'getservbyname getservbyport getservent getsockname getsockopt glob ' + 35 | 'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' + 36 | 'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' + 37 | 'oct open opendir ord pack pipe pop pos print printf prototype push ' + 38 | 'quotemeta rand read readdir readline readlink readpipe recv rename ' + 39 | 'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' + 40 | 'semget semop send setgrent sethostent setnetent setpgrp setpriority ' + 41 | 'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' + 42 | 'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' + 43 | 'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' + 44 | 'system syswrite tell telldir time times tr truncate uc ucfirst umask ' + 45 | 'undef unlink unpack unshift utime values vec wait waitpid warn write'; 46 | 47 | var keywords = 48 | 'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' + 49 | 'for foreach goto if import last local my next no our package redo ref ' + 50 | 'require return sub tie tied unless untie until use wantarray while'; 51 | 52 | this.regexList = [ 53 | { regex: new RegExp('#[^!].*$', 'gm'), css: 'comments' }, 54 | { regex: new RegExp('^\\s*#!.*$', 'gm'), css: 'preprocessor' }, // shebang 55 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, 56 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, 57 | { regex: new RegExp('(\\$|@|%)\\w+', 'g'), css: 'variable' }, 58 | { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, 59 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } 60 | ]; 61 | 62 | this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); 63 | } 64 | 65 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 66 | Brush.aliases = ['perl', 'Perl', 'pl']; 67 | 68 | SyntaxHighlighter.brushes.Perl = Brush; 69 | 70 | // CommonJS 71 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 72 | })(); 73 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushPhp.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var funcs = 'abs acos acosh addcslashes addslashes ' + 25 | 'array_change_key_case array_chunk array_combine array_count_values array_diff '+ 26 | 'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+ 27 | 'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+ 28 | 'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+ 29 | 'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+ 30 | 'array_push array_rand array_reduce array_reverse array_search array_shift '+ 31 | 'array_slice array_splice array_sum array_udiff array_udiff_assoc '+ 32 | 'array_udiff_uassoc array_uintersect array_uintersect_assoc '+ 33 | 'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+ 34 | 'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+ 35 | 'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+ 36 | 'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+ 37 | 'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+ 38 | 'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+ 39 | 'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+ 40 | 'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+ 41 | 'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+ 42 | 'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+ 43 | 'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+ 44 | 'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+ 45 | 'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+ 46 | 'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+ 47 | 'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+ 48 | 'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+ 49 | 'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+ 50 | 'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+ 51 | 'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+ 52 | 'parse_ini_file parse_str parse_url passthru pathinfo print readlink realpath rewind rewinddir rmdir '+ 53 | 'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+ 54 | 'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+ 55 | 'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+ 56 | 'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+ 57 | 'strtoupper strtr strval substr substr_compare'; 58 | 59 | var keywords = 'abstract and array as break case catch cfunction class clone const continue declare default die do ' + 60 | 'else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach ' + 61 | 'function include include_once global goto if implements interface instanceof namespace new ' + 62 | 'old_function or private protected public return require require_once static switch ' + 63 | 'throw try use var while xor '; 64 | 65 | var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__'; 66 | 67 | this.regexList = [ 68 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 69 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 70 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings 71 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings 72 | { regex: /\$\w+/g, css: 'variable' }, // variables 73 | { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions 74 | { regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants 75 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword 76 | ]; 77 | 78 | this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); 79 | }; 80 | 81 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 82 | Brush.aliases = ['php']; 83 | 84 | SyntaxHighlighter.brushes.Php = Brush; 85 | 86 | // CommonJS 87 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 88 | })(); 89 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushPlain.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | }; 25 | 26 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 27 | Brush.aliases = ['text', 'plain', 'txt']; 28 | 29 | SyntaxHighlighter.brushes.Plain = Brush; 30 | 31 | // CommonJS 32 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 33 | })(); 34 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushPowerShell.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributes by B.v.Zanten, Getronics 25 | // http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro 26 | 27 | var keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' + 28 | 'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' + 29 | 'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' + 30 | 'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' + 31 | 'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' + 32 | 'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' + 33 | 'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' + 34 | 'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' + 35 | 'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' + 36 | 'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' + 37 | 'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' + 38 | 'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' + 39 | 'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' + 40 | 'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' + 41 | 'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' + 42 | 'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' + 43 | 'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' + 44 | 'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' + 45 | 'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' + 46 | 'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' + 47 | 'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning'; 48 | var alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' + 49 | 'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' + 50 | 'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' + 51 | 'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' + 52 | 'spps spsv sv tee cat cd cp h history kill lp ls ' + 53 | 'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' + 54 | 'erase rd ren type % \\?'; 55 | 56 | this.regexList = [ 57 | { regex: /#.*$/gm, css: 'comments' }, // one line comments 58 | { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // variables $Computer1 59 | { regex: /\-[a-zA-Z]+\b/g, css: 'keyword' }, // Operators -not -and -eq 60 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 61 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 62 | { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' }, 63 | { regex: new RegExp(this.getKeywords(alias), 'gmi'), css: 'keyword' } 64 | ]; 65 | }; 66 | 67 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 68 | Brush.aliases = ['powershell', 'ps']; 69 | 70 | SyntaxHighlighter.brushes.PowerShell = Brush; 71 | 72 | // CommonJS 73 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 74 | })(); 75 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushPython.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Gheorghe Milas and Ahmad Sherif 25 | 26 | var keywords = 'and assert break class continue def del elif else ' + 27 | 'except exec finally for from global if import in is ' + 28 | 'lambda not or pass print raise return try yield while'; 29 | 30 | var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' + 31 | 'chr classmethod cmp coerce compile complex delattr dict dir ' + 32 | 'divmod enumerate eval execfile file filter float format frozenset ' + 33 | 'getattr globals hasattr hash help hex id input int intern ' + 34 | 'isinstance issubclass iter len list locals long map max min next ' + 35 | 'object oct open ord pow print property range raw_input reduce ' + 36 | 'reload repr reversed round set setattr slice sorted staticmethod ' + 37 | 'str sum super tuple type type unichr unicode vars xrange zip'; 38 | 39 | var special = 'None True False self cls class_'; 40 | 41 | this.regexList = [ 42 | { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, 43 | { regex: /^\s*@\w+/gm, css: 'decorator' }, 44 | { regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' }, 45 | { regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' }, 46 | { regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' }, 47 | { regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' }, 48 | { regex: /\b\d+\.?\w*/g, css: 'value' }, 49 | { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, 50 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, 51 | { regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' } 52 | ]; 53 | 54 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 55 | }; 56 | 57 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 58 | Brush.aliases = ['py', 'python']; 59 | 60 | SyntaxHighlighter.brushes.Python = Brush; 61 | 62 | // CommonJS 63 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 64 | })(); 65 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushRuby.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Erik Peterson. 25 | 26 | var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' + 27 | 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' + 28 | 'self super then throw true undef unless until when while yield'; 29 | 30 | var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' + 31 | 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' + 32 | 'ThreadGroup Thread Time TrueClass'; 33 | 34 | this.regexList = [ 35 | { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, // one line comments 36 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings 37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings 38 | { regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants 39 | { regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols 40 | { regex: /(\$|@@|@)\w+/g, css: 'variable bold' }, // $global, @instance, and @@class variables 41 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords 42 | { regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins 43 | ]; 44 | 45 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 46 | }; 47 | 48 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 49 | Brush.aliases = ['ruby', 'rails', 'ror', 'rb']; 50 | 51 | SyntaxHighlighter.brushes.Ruby = Brush; 52 | 53 | // CommonJS 54 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 55 | })(); 56 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushSass.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | function getKeywordsCSS(str) 25 | { 26 | return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b'; 27 | }; 28 | 29 | function getValuesCSS(str) 30 | { 31 | return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b'; 32 | }; 33 | 34 | var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' + 35 | 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' + 36 | 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' + 37 | 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' + 38 | 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' + 39 | 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' + 40 | 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' + 41 | 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' + 42 | 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' + 43 | 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' + 44 | 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' + 45 | 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' + 46 | 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' + 47 | 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index'; 48 | 49 | var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+ 50 | 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+ 51 | 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero digits disc dotted double '+ 52 | 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+ 53 | 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+ 54 | 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+ 55 | 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+ 56 | 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+ 57 | 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+ 58 | 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+ 59 | 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+ 60 | 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+ 61 | 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+ 62 | 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow'; 63 | 64 | var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif'; 65 | 66 | var statements = '!important !default'; 67 | var preprocessor = '@import @extend @debug @warn @if @for @while @mixin @include'; 68 | 69 | var r = SyntaxHighlighter.regexLib; 70 | 71 | this.regexList = [ 72 | { regex: r.multiLineCComments, css: 'comments' }, // multiline comments 73 | { regex: r.singleLineCComments, css: 'comments' }, // singleline comments 74 | { regex: r.doubleQuotedString, css: 'string' }, // double quoted strings 75 | { regex: r.singleQuotedString, css: 'string' }, // single quoted strings 76 | { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors 77 | { regex: /\b(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)\b/g, css: 'value' }, // sizes 78 | { regex: /\$\w+/g, css: 'variable' }, // variables 79 | { regex: new RegExp(this.getKeywords(statements), 'g'), css: 'color3' }, // statements 80 | { regex: new RegExp(this.getKeywords(preprocessor), 'g'), css: 'preprocessor' }, // preprocessor 81 | { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords 82 | { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values 83 | { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts 84 | ]; 85 | }; 86 | 87 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 88 | Brush.aliases = ['sass', 'scss']; 89 | 90 | SyntaxHighlighter.brushes.Sass = Brush; 91 | 92 | // CommonJS 93 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 94 | })(); 95 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushScala.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | // Contributed by Yegor Jbanov and David Bernard. 25 | 26 | var keywords = 'val sealed case def true trait implicit forSome import match object null finally super ' + 27 | 'override try lazy for var catch throw type extends class while with new final yield abstract ' + 28 | 'else do if return protected private this package false'; 29 | 30 | var keyops = '[_:=><%#@]+'; 31 | 32 | this.regexList = [ 33 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments 34 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments 35 | { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // multi-line strings 36 | { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double-quoted string 37 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings 38 | { regex: /0x[a-f0-9]+|\d+(\.\d+)?/gi, css: 'value' }, // numbers 39 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords 40 | { regex: new RegExp(keyops, 'gm'), css: 'keyword' } // scala keyword 41 | ]; 42 | } 43 | 44 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 45 | Brush.aliases = ['scala']; 46 | 47 | SyntaxHighlighter.brushes.Scala = Brush; 48 | 49 | // CommonJS 50 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 51 | })(); 52 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushSql.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var funcs = 'abs avg case cast coalesce convert count current_timestamp ' + 25 | 'current_user day isnull left lower month nullif replace right ' + 26 | 'session_user space substring sum system_user upper user year'; 27 | 28 | var keywords = 'absolute action add after alter as asc at authorization begin bigint ' + 29 | 'binary bit by cascade char character check checkpoint close collate ' + 30 | 'column commit committed connect connection constraint contains continue ' + 31 | 'create cube current current_date current_time cursor database date ' + 32 | 'deallocate dec decimal declare default delete desc distinct double drop ' + 33 | 'dynamic else end end-exec escape except exec execute false fetch first ' + 34 | 'float for force foreign forward free from full function global goto grant ' + 35 | 'group grouping having hour ignore index inner insensitive insert instead ' + 36 | 'int integer intersect into is isolation key last level load local max min ' + 37 | 'minute modify move name national nchar next no numeric of off on only ' + 38 | 'open option order out output partial password precision prepare primary ' + 39 | 'prior privileges procedure public read real references relative repeatable ' + 40 | 'restrict return returns revoke rollback rollup rows rule schema scroll ' + 41 | 'second section select sequence serializable set size smallint static ' + 42 | 'statistics table temp temporary then time timestamp to top transaction ' + 43 | 'translation trigger true truncate uncommitted union unique update values ' + 44 | 'varchar varying view when where with work'; 45 | 46 | var operators = 'all and any between cross in join like not null or outer some'; 47 | 48 | this.regexList = [ 49 | { regex: /--(.*)$/gm, css: 'comments' }, // one line and multiline comments 50 | { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings 51 | { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString, css: 'string' }, // single quoted strings 52 | { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'color2' }, // functions 53 | { regex: new RegExp(this.getKeywords(operators), 'gmi'), css: 'color1' }, // operators and such 54 | { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword 55 | ]; 56 | }; 57 | 58 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 59 | Brush.aliases = ['sql']; 60 | 61 | SyntaxHighlighter.brushes.Sql = Brush; 62 | 63 | // CommonJS 64 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 65 | })(); 66 | 67 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushVb.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto ' + 25 | 'Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate ' + 26 | 'CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType ' + 27 | 'Date Decimal Declare Default Delegate Dim DirectCast Do Double Each ' + 28 | 'Else ElseIf End Enum Erase Error Event Exit False Finally For Friend ' + 29 | 'Function Get GetType GoSub GoTo Handles If Implements Imports In ' + 30 | 'Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module ' + 31 | 'MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing ' + 32 | 'NotInheritable NotOverridable Object On Option Optional Or OrElse ' + 33 | 'Overloads Overridable Overrides ParamArray Preserve Private Property ' + 34 | 'Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume ' + 35 | 'Return Select Set Shadows Shared Short Single Static Step Stop String ' + 36 | 'Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until ' + 37 | 'Variant When While With WithEvents WriteOnly Xor'; 38 | 39 | this.regexList = [ 40 | { regex: /'.*$/gm, css: 'comments' }, // one line comments 41 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings 42 | { regex: /^\s*#.*$/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion 43 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // vb keyword 44 | ]; 45 | 46 | this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); 47 | }; 48 | 49 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 50 | Brush.aliases = ['vb', 'vbnet']; 51 | 52 | SyntaxHighlighter.brushes.Vb = Brush; 53 | 54 | // CommonJS 55 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 56 | })(); 57 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/shBrushes/shBrushXml.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | function process(match, regexInfo) 25 | { 26 | var constructor = SyntaxHighlighter.Match, 27 | code = match[0], 28 | tag = new XRegExp('(<|<)[\\s\\/\\?]*(?[:\\w-\\.]+)', 'xg').exec(code), 29 | result = [] 30 | ; 31 | 32 | if (match.attributes != null) 33 | { 34 | var attributes, 35 | regex = new XRegExp('(? [\\w:\\-\\.]+)' + 36 | '\\s*=\\s*' + 37 | '(? ".*?"|\'.*?\'|\\w+)', 38 | 'xg'); 39 | 40 | while ((attributes = regex.exec(code)) != null) 41 | { 42 | result.push(new constructor(attributes.name, match.index + attributes.index, 'color1')); 43 | result.push(new constructor(attributes.value, match.index + attributes.index + attributes[0].indexOf(attributes.value), 'string')); 44 | } 45 | } 46 | 47 | if (tag != null) 48 | result.push( 49 | new constructor(tag.name, match.index + tag[0].indexOf(tag.name), 'keyword') 50 | ); 51 | 52 | return result; 53 | } 54 | 55 | this.regexList = [ 56 | { regex: new XRegExp('(\\<|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](\\>|>)', 'gm'), css: 'color2' }, // 57 | { regex: SyntaxHighlighter.regexLib.xmlComments, css: 'comments' }, // 58 | { regex: new XRegExp('(<|<)[\\s\\/\\?]*(\\w+)(?.*?)[\\s\\/\\?]*(>|>)', 'sg'), func: process } 59 | ]; 60 | }; 61 | 62 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 63 | Brush.aliases = ['xml', 'xhtml', 'xslt', 'html', 'htm', 'asp', 'aspx']; 64 | 65 | SyntaxHighlighter.brushes.Xml = Brush; 66 | 67 | // CommonJS 68 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 69 | })(); 70 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/styles/app.css: -------------------------------------------------------------------------------- 1 | @media print { 2 | body { padding: 0; margin: 0; } 3 | .noprint { display: none; } 4 | } 5 | 6 | @media screen { 7 | body { padding-top: 100px; } 8 | } 9 | 10 | @media(min-width: 768px) { 11 | .navbar-nav > li > a { padding-top: 16px; padding-bottom: 15px; } 12 | } 13 | 14 | 15 | body::-webkit-scrollbar, div::-webkit-scrollbar { -webkit-appearance: none; } 16 | body::-webkit-scrollbar:vertical { width: 25px; } 17 | body::-webkit-scrollbar:horizontal { height: 25px; } 18 | body::-webkit-scrollbar-button, div::-webkit-scrollbar-button { display: none; } 19 | body::-webkit-scrollbar-track { background: #222; } 20 | body::-webkit-scrollbar-thumb { min-height: 2rem; background: #999; background-clip: padding-box; border: 5px solid #222; border-radius: 10px; } 21 | body::-webkit-scrollbar-thumb:active { background-color: #aaa; border-width: 4px; } 22 | 23 | div::-webkit-scrollbar:vertical { width: 18px; } 24 | div::-webkit-scrollbar:horizontal { height: 18px; } 25 | div::-webkit-scrollbar-track { background: #fbfbfb !important; } 26 | div::-webkit-scrollbar-thumb { min-height: 2rem; background: #f0f0f0; background-clip: padding-box; border: 3px solid #fff; border-radius: 10px; } 27 | div::-webkit-scrollbar-thumb:active { background-color: #ddd; border-width: 2px; } 28 | 29 | 30 | a { cursor: pointer; } 31 | 32 | nav.navbar { min-width: 780px; } 33 | #ulNavTabs { margin-top: 5px; } 34 | .nav-tabs, .nav-tabs > li > a { border: 0; } 35 | 36 | .active, .active:hover { cursor: default; color: #000 !important; background: linear-gradient(#222, #ccc, #fff) !important; } 37 | #imgIcon { position: fixed; top: 120px; right: 20px; opacity: 0.1; z-index: 1000; } 38 | #h4MdPath { font-weight: bold; color: #aebcff; margin-top: 20px; margin-left: 20px; } 39 | #divAlert { position: absolute; top: 40%; width: auto; box-shadow: 10px 10px 10px #888; display: none; } 40 | #divAlertMessage { font-size: 1.3em; } 41 | 42 | .modal-header i { font-size: 35px; } 43 | .info .modal-footer, .info .modal-header { background-color: #000; color: #44b; } 44 | .success .modal-footer, .success .modal-header { background-color: #ded; color: #060; } 45 | .warning .modal-footer, .warning .modal-header { background-color: #fb8; color: #800; } 46 | .danger .modal-footer, .danger .modal-header { background-color: #fcc; color: #f00; } 47 | 48 | 49 | /*Hide SyntaxHighlighter help links*/ 50 | .syntaxhighlighter { overflow: visible !important; } 51 | .toolbar { visibility: hidden !important; } 52 | 53 | /*The SimpleMDE editor in side-by-side mode puts itself into fullscreen - 54 | which gets it's head hidden under the nav bar*/ 55 | .editor-toolbar.fullscreen { top: 70px; } 56 | .CodeMirror-fullscreen, .editor-preview-side { top: 120px; } 57 | 58 | /*Hide the full screen button*/ 59 | .fa-arrows-alt { display: none !important; } 60 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/styles/shCore.css: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | .syntaxhighlighter a, 18 | .syntaxhighlighter div, 19 | .syntaxhighlighter code, 20 | .syntaxhighlighter table, 21 | .syntaxhighlighter table td, 22 | .syntaxhighlighter table tr, 23 | .syntaxhighlighter table tbody, 24 | .syntaxhighlighter table thead, 25 | .syntaxhighlighter table caption, 26 | .syntaxhighlighter textarea { 27 | -moz-border-radius: 0 0 0 0 !important; 28 | -webkit-border-radius: 0 0 0 0 !important; 29 | background: none !important; 30 | border: 0 !important; 31 | bottom: auto !important; 32 | float: none !important; 33 | height: auto !important; 34 | left: auto !important; 35 | line-height: 1.1em !important; 36 | margin: 0 !important; 37 | outline: 0 !important; 38 | overflow: visible !important; 39 | padding: 0 !important; 40 | position: static !important; 41 | right: auto !important; 42 | text-align: left !important; 43 | top: auto !important; 44 | vertical-align: baseline !important; 45 | width: auto !important; 46 | box-sizing: content-box !important; 47 | font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; 48 | font-weight: normal !important; 49 | font-style: normal !important; 50 | font-size: 1em !important; 51 | min-height: inherit !important; 52 | min-height: auto !important; 53 | } 54 | 55 | .syntaxhighlighter { 56 | width: 100% !important; 57 | margin: 1em 0 1em 0 !important; 58 | position: relative !important; 59 | overflow: auto !important; 60 | font-size: 1em !important; 61 | } 62 | .syntaxhighlighter.source { 63 | overflow: hidden !important; 64 | } 65 | .syntaxhighlighter .bold { 66 | font-weight: bold !important; 67 | } 68 | .syntaxhighlighter .italic { 69 | font-style: italic !important; 70 | } 71 | .syntaxhighlighter .line { 72 | white-space: pre !important; 73 | } 74 | .syntaxhighlighter table { 75 | width: 100% !important; 76 | } 77 | .syntaxhighlighter table caption { 78 | text-align: left !important; 79 | padding: .5em 0 0.5em 1em !important; 80 | } 81 | .syntaxhighlighter table td.code { 82 | width: 100% !important; 83 | } 84 | .syntaxhighlighter table td.code .container { 85 | position: relative !important; 86 | } 87 | .syntaxhighlighter table td.code .container textarea { 88 | box-sizing: border-box !important; 89 | position: absolute !important; 90 | left: 0 !important; 91 | top: 0 !important; 92 | width: 100% !important; 93 | height: 100% !important; 94 | border: none !important; 95 | background: white !important; 96 | padding-left: 1em !important; 97 | overflow: hidden !important; 98 | white-space: pre !important; 99 | } 100 | .syntaxhighlighter table td.gutter .line { 101 | text-align: right !important; 102 | padding: 0 0.5em 0 1em !important; 103 | } 104 | .syntaxhighlighter table td.code .line { 105 | padding: 0 1em !important; 106 | } 107 | .syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { 108 | padding-left: 0em !important; 109 | } 110 | .syntaxhighlighter.show { 111 | display: block !important; 112 | } 113 | .syntaxhighlighter.collapsed table { 114 | display: none !important; 115 | } 116 | .syntaxhighlighter.collapsed .toolbar { 117 | padding: 0.1em 0.8em 0em 0.8em !important; 118 | font-size: 1em !important; 119 | position: static !important; 120 | width: auto !important; 121 | height: auto !important; 122 | } 123 | .syntaxhighlighter.collapsed .toolbar span { 124 | display: inline !important; 125 | margin-right: 1em !important; 126 | } 127 | .syntaxhighlighter.collapsed .toolbar span a { 128 | padding: 0 !important; 129 | display: none !important; 130 | } 131 | .syntaxhighlighter.collapsed .toolbar span a.expandSource { 132 | display: inline !important; 133 | } 134 | .syntaxhighlighter .toolbar { 135 | position: absolute !important; 136 | right: 1px !important; 137 | top: 1px !important; 138 | width: 11px !important; 139 | height: 11px !important; 140 | font-size: 10px !important; 141 | z-index: 10 !important; 142 | } 143 | .syntaxhighlighter .toolbar span.title { 144 | display: inline !important; 145 | } 146 | .syntaxhighlighter .toolbar a { 147 | display: block !important; 148 | text-align: center !important; 149 | text-decoration: none !important; 150 | padding-top: 1px !important; 151 | } 152 | .syntaxhighlighter .toolbar a.expandSource { 153 | display: none !important; 154 | } 155 | .syntaxhighlighter.ie { 156 | font-size: .9em !important; 157 | padding: 1px 0 1px 0 !important; 158 | } 159 | .syntaxhighlighter.ie .toolbar { 160 | line-height: 8px !important; 161 | } 162 | .syntaxhighlighter.ie .toolbar a { 163 | padding-top: 0px !important; 164 | } 165 | .syntaxhighlighter.printing .line.alt1 .content, 166 | .syntaxhighlighter.printing .line.alt2 .content, 167 | .syntaxhighlighter.printing .line.highlighted .number, 168 | .syntaxhighlighter.printing .line.highlighted.alt1 .content, 169 | .syntaxhighlighter.printing .line.highlighted.alt2 .content { 170 | background: none !important; 171 | } 172 | .syntaxhighlighter.printing .line .number { 173 | color: #bbbbbb !important; 174 | } 175 | .syntaxhighlighter.printing .line .content { 176 | color: black !important; 177 | } 178 | .syntaxhighlighter.printing .toolbar { 179 | display: none !important; 180 | } 181 | .syntaxhighlighter.printing a { 182 | text-decoration: none !important; 183 | } 184 | .syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { 185 | color: black !important; 186 | } 187 | .syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { 188 | color: #008200 !important; 189 | } 190 | .syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { 191 | color: blue !important; 192 | } 193 | .syntaxhighlighter.printing .keyword { 194 | color: #006699 !important; 195 | font-weight: bold !important; 196 | } 197 | .syntaxhighlighter.printing .preprocessor { 198 | color: gray !important; 199 | } 200 | .syntaxhighlighter.printing .variable { 201 | color: #aa7700 !important; 202 | } 203 | .syntaxhighlighter.printing .value { 204 | color: #009900 !important; 205 | } 206 | .syntaxhighlighter.printing .functions { 207 | color: #ff1493 !important; 208 | } 209 | .syntaxhighlighter.printing .constants { 210 | color: #0066cc !important; 211 | } 212 | .syntaxhighlighter.printing .script { 213 | font-weight: bold !important; 214 | } 215 | .syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { 216 | color: gray !important; 217 | } 218 | .syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { 219 | color: #ff1493 !important; 220 | } 221 | .syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { 222 | color: red !important; 223 | } 224 | .syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { 225 | color: black !important; 226 | } 227 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/styles/shCoreDefault.css: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | .syntaxhighlighter a, 18 | .syntaxhighlighter div, 19 | .syntaxhighlighter code, 20 | .syntaxhighlighter table, 21 | .syntaxhighlighter table td, 22 | .syntaxhighlighter table tr, 23 | .syntaxhighlighter table tbody, 24 | .syntaxhighlighter table thead, 25 | .syntaxhighlighter table caption, 26 | .syntaxhighlighter textarea { 27 | -moz-border-radius: 0 0 0 0 !important; 28 | -webkit-border-radius: 0 0 0 0 !important; 29 | background: none !important; 30 | border: 0 !important; 31 | bottom: auto !important; 32 | float: none !important; 33 | height: auto !important; 34 | left: auto !important; 35 | line-height: 1.1em !important; 36 | margin: 0 !important; 37 | outline: 0 !important; 38 | overflow: visible !important; 39 | padding: 0 !important; 40 | position: static !important; 41 | right: auto !important; 42 | text-align: left !important; 43 | top: auto !important; 44 | vertical-align: baseline !important; 45 | width: auto !important; 46 | box-sizing: content-box !important; 47 | font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important; 48 | font-weight: normal !important; 49 | font-style: normal !important; 50 | font-size: 1em !important; 51 | min-height: inherit !important; 52 | min-height: auto !important; 53 | } 54 | 55 | .syntaxhighlighter { 56 | width: 100% !important; 57 | margin: 1em 0 1em 0 !important; 58 | position: relative !important; 59 | overflow: auto !important; 60 | font-size: 1em !important; 61 | } 62 | .syntaxhighlighter.source { 63 | overflow: hidden !important; 64 | } 65 | .syntaxhighlighter .bold { 66 | font-weight: bold !important; 67 | } 68 | .syntaxhighlighter .italic { 69 | font-style: italic !important; 70 | } 71 | .syntaxhighlighter .line { 72 | white-space: pre !important; 73 | } 74 | .syntaxhighlighter table { 75 | width: 100% !important; 76 | } 77 | .syntaxhighlighter table caption { 78 | text-align: left !important; 79 | padding: .5em 0 0.5em 1em !important; 80 | } 81 | .syntaxhighlighter table td.code { 82 | width: 100% !important; 83 | } 84 | .syntaxhighlighter table td.code .container { 85 | position: relative !important; 86 | } 87 | .syntaxhighlighter table td.code .container textarea { 88 | box-sizing: border-box !important; 89 | position: absolute !important; 90 | left: 0 !important; 91 | top: 0 !important; 92 | width: 100% !important; 93 | height: 100% !important; 94 | border: none !important; 95 | background: white !important; 96 | padding-left: 1em !important; 97 | overflow: hidden !important; 98 | white-space: pre !important; 99 | } 100 | .syntaxhighlighter table td.gutter .line { 101 | text-align: right !important; 102 | padding: 0 0.5em 0 1em !important; 103 | } 104 | .syntaxhighlighter table td.code .line { 105 | padding: 0 1em !important; 106 | } 107 | .syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line { 108 | padding-left: 0em !important; 109 | } 110 | .syntaxhighlighter.show { 111 | display: block !important; 112 | } 113 | .syntaxhighlighter.collapsed table { 114 | display: none !important; 115 | } 116 | .syntaxhighlighter.collapsed .toolbar { 117 | padding: 0.1em 0.8em 0em 0.8em !important; 118 | font-size: 1em !important; 119 | position: static !important; 120 | width: auto !important; 121 | height: auto !important; 122 | } 123 | .syntaxhighlighter.collapsed .toolbar span { 124 | display: inline !important; 125 | margin-right: 1em !important; 126 | } 127 | .syntaxhighlighter.collapsed .toolbar span a { 128 | padding: 0 !important; 129 | display: none !important; 130 | } 131 | .syntaxhighlighter.collapsed .toolbar span a.expandSource { 132 | display: inline !important; 133 | } 134 | .syntaxhighlighter .toolbar { 135 | position: absolute !important; 136 | right: 1px !important; 137 | top: 1px !important; 138 | width: 11px !important; 139 | height: 11px !important; 140 | font-size: 10px !important; 141 | z-index: 10 !important; 142 | } 143 | .syntaxhighlighter .toolbar span.title { 144 | display: inline !important; 145 | } 146 | .syntaxhighlighter .toolbar a { 147 | display: block !important; 148 | text-align: center !important; 149 | text-decoration: none !important; 150 | padding-top: 1px !important; 151 | } 152 | .syntaxhighlighter .toolbar a.expandSource { 153 | display: none !important; 154 | } 155 | .syntaxhighlighter.ie { 156 | font-size: .9em !important; 157 | padding: 1px 0 1px 0 !important; 158 | } 159 | .syntaxhighlighter.ie .toolbar { 160 | line-height: 8px !important; 161 | } 162 | .syntaxhighlighter.ie .toolbar a { 163 | padding-top: 0px !important; 164 | } 165 | .syntaxhighlighter.printing .line.alt1 .content, 166 | .syntaxhighlighter.printing .line.alt2 .content, 167 | .syntaxhighlighter.printing .line.highlighted .number, 168 | .syntaxhighlighter.printing .line.highlighted.alt1 .content, 169 | .syntaxhighlighter.printing .line.highlighted.alt2 .content { 170 | background: none !important; 171 | } 172 | .syntaxhighlighter.printing .line .number { 173 | color: #bbbbbb !important; 174 | } 175 | .syntaxhighlighter.printing .line .content { 176 | color: black !important; 177 | } 178 | .syntaxhighlighter.printing .toolbar { 179 | display: none !important; 180 | } 181 | .syntaxhighlighter.printing a { 182 | text-decoration: none !important; 183 | } 184 | .syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a { 185 | color: black !important; 186 | } 187 | .syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a { 188 | color: #008200 !important; 189 | } 190 | .syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a { 191 | color: blue !important; 192 | } 193 | .syntaxhighlighter.printing .keyword { 194 | color: #006699 !important; 195 | font-weight: bold !important; 196 | } 197 | .syntaxhighlighter.printing .preprocessor { 198 | color: gray !important; 199 | } 200 | .syntaxhighlighter.printing .variable { 201 | color: #aa7700 !important; 202 | } 203 | .syntaxhighlighter.printing .value { 204 | color: #009900 !important; 205 | } 206 | .syntaxhighlighter.printing .functions { 207 | color: #ff1493 !important; 208 | } 209 | .syntaxhighlighter.printing .constants { 210 | color: #0066cc !important; 211 | } 212 | .syntaxhighlighter.printing .script { 213 | font-weight: bold !important; 214 | } 215 | .syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a { 216 | color: gray !important; 217 | } 218 | .syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a { 219 | color: #ff1493 !important; 220 | } 221 | .syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a { 222 | color: red !important; 223 | } 224 | .syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a { 225 | color: black !important; 226 | } 227 | 228 | .syntaxhighlighter { 229 | background-color: white !important; 230 | } 231 | .syntaxhighlighter .line.alt1 { 232 | background-color: white !important; 233 | } 234 | .syntaxhighlighter .line.alt2 { 235 | background-color: white !important; 236 | } 237 | .syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { 238 | background-color: #e0e0e0 !important; 239 | } 240 | .syntaxhighlighter .line.highlighted.number { 241 | color: black !important; 242 | } 243 | .syntaxhighlighter table caption { 244 | color: black !important; 245 | } 246 | .syntaxhighlighter .gutter { 247 | color: #afafaf !important; 248 | } 249 | .syntaxhighlighter .gutter .line { 250 | border-right: 3px solid #6ce26c !important; 251 | } 252 | .syntaxhighlighter .gutter .line.highlighted { 253 | background-color: #6ce26c !important; 254 | color: white !important; 255 | } 256 | .syntaxhighlighter.printing .line .content { 257 | border: none !important; 258 | } 259 | .syntaxhighlighter.collapsed { 260 | overflow: visible !important; 261 | } 262 | .syntaxhighlighter.collapsed .toolbar { 263 | color: blue !important; 264 | background: white !important; 265 | border: 1px solid #6ce26c !important; 266 | } 267 | .syntaxhighlighter.collapsed .toolbar a { 268 | color: blue !important; 269 | } 270 | .syntaxhighlighter.collapsed .toolbar a:hover { 271 | color: red !important; 272 | } 273 | .syntaxhighlighter .toolbar { 274 | color: white !important; 275 | background: #6ce26c !important; 276 | border: none !important; 277 | } 278 | .syntaxhighlighter .toolbar a { 279 | color: white !important; 280 | } 281 | .syntaxhighlighter .toolbar a:hover { 282 | color: black !important; 283 | } 284 | .syntaxhighlighter .plain, .syntaxhighlighter .plain a { 285 | color: black !important; 286 | } 287 | .syntaxhighlighter .comments, .syntaxhighlighter .comments a { 288 | color: #008200 !important; 289 | } 290 | .syntaxhighlighter .string, .syntaxhighlighter .string a { 291 | color: blue !important; 292 | } 293 | .syntaxhighlighter .keyword { 294 | color: #006699 !important; 295 | } 296 | .syntaxhighlighter .preprocessor { 297 | color: gray !important; 298 | } 299 | .syntaxhighlighter .variable { 300 | color: #aa7700 !important; 301 | } 302 | .syntaxhighlighter .value { 303 | color: #009900 !important; 304 | } 305 | .syntaxhighlighter .functions { 306 | color: #ff1493 !important; 307 | } 308 | .syntaxhighlighter .constants { 309 | color: #0066cc !important; 310 | } 311 | .syntaxhighlighter .script { 312 | font-weight: bold !important; 313 | color: #006699 !important; 314 | background-color: none !important; 315 | } 316 | .syntaxhighlighter .color1, .syntaxhighlighter .color1 a { 317 | color: gray !important; 318 | } 319 | .syntaxhighlighter .color2, .syntaxhighlighter .color2 a { 320 | color: #ff1493 !important; 321 | } 322 | .syntaxhighlighter .color3, .syntaxhighlighter .color3 a { 323 | color: red !important; 324 | } 325 | 326 | .syntaxhighlighter .keyword { 327 | font-weight: bold !important; 328 | } 329 | -------------------------------------------------------------------------------- /MarkdownViewer/Resources/styles/simplemde.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * simplemde v1.11.2 3 | * Copyright Next Step Webs, Inc. 4 | * @link https://github.com/NextStepWebs/simplemde-markdown-editor 5 | * @license MIT 6 | */ 7 | .CodeMirror{color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:none;font-variant-ligatures:none}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.CodeMirror{height:auto;min-height:300px;border:1px solid #ddd;border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:10px;font:inherit;z-index:1}.CodeMirror-scroll{min-height:300px}.CodeMirror-fullscreen{background:#fff;position:fixed!important;top:50px;left:0;right:0;bottom:0;height:auto;z-index:9}.CodeMirror-sided{width:50%!important}.editor-toolbar{position:relative;opacity:.6;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;padding:0 10px;border-top:1px solid #bbb;border-left:1px solid #bbb;border-right:1px solid #bbb;border-top-left-radius:4px;border-top-right-radius:4px}.editor-toolbar:after,.editor-toolbar:before{display:block;content:' ';height:1px}.editor-toolbar:before{margin-bottom:8px}.editor-toolbar:after{margin-top:8px}.editor-toolbar:hover,.editor-wrapper input.title:focus,.editor-wrapper input.title:hover{opacity:.8}.editor-toolbar.fullscreen{width:100%;height:50px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;padding-top:10px;padding-bottom:10px;box-sizing:border-box;background:#fff;border:0;position:fixed;top:0;left:0;opacity:1;z-index:9}.editor-toolbar.fullscreen::before{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,1)),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-o-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:linear-gradient(to right,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);position:fixed;top:0;left:0;margin:0;padding:0}.editor-toolbar.fullscreen::after{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,0)),color-stop(100%,rgba(255,255,255,1)));background:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-o-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:linear-gradient(to right,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);position:fixed;top:0;right:0;margin:0;padding:0}.editor-toolbar a{display:inline-block;text-align:center;text-decoration:none!important;color:#2c3e50!important;width:30px;height:30px;margin:0;border:1px solid transparent;border-radius:3px;cursor:pointer}.editor-toolbar a.active,.editor-toolbar a:hover{background:#fcfcfc;border-color:#95a5a6}.editor-toolbar a:before{line-height:30px}.editor-toolbar i.separator{display:inline-block;width:0;border-left:1px solid #d9d9d9;border-right:1px solid #fff;color:transparent;text-indent:-10px;margin:0 6px}.editor-toolbar a.fa-header-x:after{font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:65%;vertical-align:text-bottom;position:relative;top:2px}.editor-toolbar a.fa-header-1:after{content:"1"}.editor-toolbar a.fa-header-2:after{content:"2"}.editor-toolbar a.fa-header-3:after{content:"3"}.editor-toolbar a.fa-header-bigger:after{content:"▲"}.editor-toolbar a.fa-header-smaller:after{content:"▼"}.editor-toolbar.disabled-for-preview a:not(.no-disable){pointer-events:none;background:#fff;border-color:transparent;text-shadow:inherit}@media only screen and (max-width:700px){.editor-toolbar a.no-mobile{display:none}}.editor-statusbar{padding:8px 10px;font-size:12px;color:#959694;text-align:right}.editor-statusbar span{display:inline-block;min-width:4em;margin-left:1em}.editor-preview,.editor-preview-side{padding:10px;background:#fafafa;overflow:auto;display:none;box-sizing:border-box}.editor-statusbar .lines:before{content:'lines: '}.editor-statusbar .words:before{content:'words: '}.editor-statusbar .characters:before{content:'characters: '}.editor-preview{position:absolute;width:100%;height:100%;top:0;left:0;z-index:7}.editor-preview-side{position:fixed;bottom:0;width:50%;top:50px;right:0;z-index:9;border:1px solid #ddd}.editor-preview-active,.editor-preview-active-side{display:block}.editor-preview-side>p,.editor-preview>p{margin-top:0}.editor-preview pre,.editor-preview-side pre{background:#eee;margin-bottom:10px}.editor-preview table td,.editor-preview table th,.editor-preview-side table td,.editor-preview-side table th{border:1px solid #ddd;padding:5px}.CodeMirror .CodeMirror-code .cm-tag{color:#63a35c}.CodeMirror .CodeMirror-code .cm-attribute{color:#795da3}.CodeMirror .CodeMirror-code .cm-string{color:#183691}.CodeMirror .CodeMirror-selected{background:#d9d9d9}.CodeMirror .CodeMirror-code .cm-header-1{font-size:200%;line-height:200%}.CodeMirror .CodeMirror-code .cm-header-2{font-size:160%;line-height:160%}.CodeMirror .CodeMirror-code .cm-header-3{font-size:125%;line-height:125%}.CodeMirror .CodeMirror-code .cm-header-4{font-size:110%;line-height:110%}.CodeMirror .CodeMirror-code .cm-comment{background:rgba(0,0,0,.05);border-radius:2px}.CodeMirror .CodeMirror-code .cm-link{color:#7f8c8d}.CodeMirror .CodeMirror-code .cm-url{color:#aab2b3}.CodeMirror .CodeMirror-code .cm-strikethrough{text-decoration:line-through}.CodeMirror .CodeMirror-placeholder{opacity:.5}.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word){background:rgba(255,0,0,.15)} -------------------------------------------------------------------------------- /MarkdownViewer/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | true 28 | 29 | 30 | 31 | 32 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /MarkdownViewer/frmMain.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MarkdownViewer 2 | { 3 | partial class frmMain 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain)); 32 | this.pnlFind = new System.Windows.Forms.Panel(); 33 | this.btnNextSearch = new System.Windows.Forms.Button(); 34 | this.button1 = new System.Windows.Forms.Button(); 35 | this.txtFind = new System.Windows.Forms.TextBox(); 36 | this.pnlFind.SuspendLayout(); 37 | this.SuspendLayout(); 38 | // 39 | // pnlFind 40 | // 41 | this.pnlFind.BackColor = System.Drawing.Color.WhiteSmoke; 42 | this.pnlFind.Controls.Add(this.btnNextSearch); 43 | this.pnlFind.Controls.Add(this.button1); 44 | this.pnlFind.Controls.Add(this.txtFind); 45 | this.pnlFind.Location = new System.Drawing.Point(902, 57); 46 | this.pnlFind.Name = "pnlFind"; 47 | this.pnlFind.Size = new System.Drawing.Size(302, 38); 48 | this.pnlFind.TabIndex = 0; 49 | this.pnlFind.Visible = false; 50 | // 51 | // btnNextSearch 52 | // 53 | this.btnNextSearch.FlatAppearance.BorderSize = 0; 54 | this.btnNextSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 55 | this.btnNextSearch.Image = global::MarkdownViewer.Properties.Resources.fa_arrow_circle_right; 56 | this.btnNextSearch.Location = new System.Drawing.Point(269, 6); 57 | this.btnNextSearch.Name = "btnNextSearch"; 58 | this.btnNextSearch.Size = new System.Drawing.Size(28, 24); 59 | this.btnNextSearch.TabIndex = 2; 60 | this.btnNextSearch.UseVisualStyleBackColor = true; 61 | this.btnNextSearch.Click += new System.EventHandler(this.btnNextSearch_Click); 62 | // 63 | // button1 64 | // 65 | this.button1.FlatAppearance.BorderSize = 0; 66 | this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; 67 | this.button1.Image = global::MarkdownViewer.Properties.Resources.fa_search; 68 | this.button1.Location = new System.Drawing.Point(3, 6); 69 | this.button1.Name = "button1"; 70 | this.button1.Size = new System.Drawing.Size(28, 24); 71 | this.button1.TabIndex = 1; 72 | this.button1.UseVisualStyleBackColor = true; 73 | // 74 | // txtFind 75 | // 76 | this.txtFind.AcceptsReturn = true; 77 | this.txtFind.AcceptsTab = true; 78 | this.txtFind.BackColor = System.Drawing.Color.White; 79 | this.txtFind.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 80 | this.txtFind.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 81 | this.txtFind.ForeColor = System.Drawing.Color.Gray; 82 | this.txtFind.Location = new System.Drawing.Point(31, 7); 83 | this.txtFind.Multiline = true; 84 | this.txtFind.Name = "txtFind"; 85 | this.txtFind.Size = new System.Drawing.Size(232, 22); 86 | this.txtFind.TabIndex = 0; 87 | this.txtFind.TextChanged += new System.EventHandler(this.txtFind_TextChanged); 88 | this.txtFind.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtFind_KeyUp); 89 | // 90 | // frmMain 91 | // 92 | this.AllowDrop = true; 93 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); 94 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 95 | this.ClientSize = new System.Drawing.Size(1204, 730); 96 | this.Controls.Add(this.pnlFind); 97 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 98 | this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); 99 | this.MinimumSize = new System.Drawing.Size(1061, 47); 100 | this.Name = "frmMain"; 101 | this.Text = "Markdown Viewer"; 102 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmMain_FormClosing); 103 | this.pnlFind.ResumeLayout(false); 104 | this.pnlFind.PerformLayout(); 105 | this.ResumeLayout(false); 106 | 107 | } 108 | 109 | #endregion 110 | 111 | private System.Windows.Forms.Panel pnlFind; 112 | private System.Windows.Forms.Button button1; 113 | private System.Windows.Forms.TextBox txtFind; 114 | private System.Windows.Forms.Button btnNextSearch; 115 | } 116 | } -------------------------------------------------------------------------------- /MarkdownViewer/frmMain.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using CefSharp; 4 | using CefSharp.WinForms; 5 | using System.Linq; 6 | 7 | namespace MarkdownViewer 8 | { 9 | public partial class frmMain : Form 10 | { 11 | #region private variables 12 | private readonly ChromiumWebBrowser _browser; 13 | private readonly PageController _pageController = new PageController(); 14 | private readonly string _baseUrl = "file://" + Program.ResourcesDirectory + "\\"; 15 | private readonly Keys[] _keysWeHandle = new Keys[] { Keys.Escape, Keys.F3, Keys.F, Keys.S }; 16 | #endregion 17 | 18 | #region constructors 19 | internal frmMain() 20 | { 21 | InitializeComponent(); 22 | this._browser = new ChromiumWebBrowser("about:blank") 23 | { 24 | Dock = DockStyle.Fill, 25 | RequestHandler = new RequestHandler(), 26 | MenuHandler = new MenuHandler() 27 | }; 28 | this._browser.RegisterJsObject("controller", this._pageController); 29 | this.Controls.Add(this._browser); 30 | this._browser.LoadHtml(Program.GetHtmlTemplate(), this._baseUrl); 31 | this._browser.LoadingStateChanged += _browser_LoadingStateChanged; 32 | } 33 | #endregion 34 | 35 | #region event handlers 36 | private void frmMain_FormClosing(object sender, FormClosingEventArgs e) 37 | { 38 | if (!this._pageController.CheckForChanges()) 39 | { 40 | e.Cancel = true; 41 | } 42 | } 43 | 44 | private void txtFind_KeyUp(object sender, KeyEventArgs e) 45 | { 46 | if (e.KeyCode == Keys.Tab || e.KeyCode == Keys.Enter && !string.IsNullOrEmpty(this.txtFind.Text)) 47 | { 48 | this.NextMatch(); 49 | e.SuppressKeyPress = true; 50 | return; 51 | } 52 | //Filter out all key strokes we don't need to handle. 53 | else if ((!_keysWeHandle.Contains(e.KeyCode)) || (e.KeyCode == Keys.F && !e.Control)) 54 | { 55 | return; 56 | } 57 | else 58 | { 59 | //try to get currently selected text in the browser window 60 | string searchText = null; 61 | var response = this.EvaluateScriptAsync(@"(function(){ return window.getSelection().toString(); })();"); 62 | if (response.Success) 63 | { 64 | searchText = Convert.ToString(response.Result); 65 | } 66 | 67 | this.DoKeyUp(e.KeyCode, e.Control, e.Shift, e.Alt, searchText); 68 | } 69 | } 70 | 71 | private void _browser_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e) 72 | { 73 | if (!e.IsLoading) 74 | { 75 | //After the browser has finished loading, we want it to have focus to be able to catch keyboard events. 76 | this.FocusOnBrowser(); 77 | } 78 | } 79 | 80 | private void txtFind_TextChanged(object sender, EventArgs e) 81 | { 82 | if (this._browser != null) 83 | { 84 | this._browser.Invoke(new Action(() => 85 | { 86 | this.StopFinding(false); 87 | this._browser.Find(0, this.txtFind.Text, true, false, false); 88 | })); 89 | } 90 | } 91 | 92 | private void btnNextSearch_Click(object sender, EventArgs e) 93 | { 94 | this.NextMatch(); 95 | } 96 | #endregion 97 | 98 | #region private functions 99 | private void FocusOnBrowser() 100 | { 101 | if (this._browser != null) 102 | this._browser.Invoke(new Action(() => this._browser.Focus())); 103 | } 104 | 105 | private void CloseFindingPanel() 106 | { 107 | if (this._browser != null) 108 | { 109 | this.StopFinding(true); 110 | } 111 | this.pnlFind.Visible = false; 112 | this.FocusOnBrowser(); 113 | } 114 | 115 | private void StopFinding(bool clearSelection) 116 | { 117 | this._browser.Invoke(new Action(() => this._browser.StopFinding(clearSelection))); 118 | } 119 | 120 | private void NextMatch() 121 | { 122 | if (!this.pnlFind.Visible) 123 | { 124 | this.ToggleFind(); 125 | } 126 | this._browser.Invoke(new Action(() => 127 | { 128 | this._browser.Find(0, this.txtFind.Text, true, false, true); 129 | })); 130 | } 131 | #endregion 132 | 133 | #region public/internal functions 134 | internal void RunJavscript(string script) 135 | { 136 | if (this._browser != null) 137 | { 138 | if (this._browser.InvokeRequired) 139 | { 140 | this._browser.Invoke(new Action(() => 141 | this._browser.GetMainFrame().ExecuteJavaScriptAsync(script))); 142 | } 143 | else 144 | { 145 | this._browser.GetMainFrame().ExecuteJavaScriptAsync(script); 146 | } 147 | } 148 | } 149 | 150 | internal JavascriptResponse EvaluateScriptAsync(string script) 151 | { 152 | JavascriptResponse response = null; 153 | if (this._browser != null) 154 | { 155 | if (this._browser.InvokeRequired) 156 | { 157 | this._browser.Invoke(new Action(() => 158 | response = this._browser.GetMainFrame().EvaluateScriptAsync(script).Result)); 159 | } 160 | else 161 | { 162 | response = this._browser.GetMainFrame().EvaluateScriptAsync(script).Result; 163 | } 164 | } 165 | return response; 166 | } 167 | 168 | internal void ToggleFind() 169 | { 170 | if (this._browser != null) 171 | { 172 | if (this.pnlFind.Visible) 173 | { 174 | this.CloseFindingPanel(); 175 | } 176 | else 177 | { 178 | this.pnlFind.Visible = true; 179 | this.pnlFind.Focus(); 180 | this.txtFind.Focus(); 181 | 182 | if (!string.IsNullOrEmpty(this.txtFind.Text)) 183 | { 184 | this._browser.Invoke(new Action(() => 185 | this._browser.Find(0, this.txtFind.Text, true, false, false))); 186 | this.txtFind.SelectAll(); 187 | } 188 | } 189 | } 190 | } 191 | 192 | internal void ShowDevTools() 193 | { 194 | if (this._browser != null) 195 | { 196 | this._browser.ShowDevTools(); 197 | } 198 | } 199 | 200 | internal void PrintToPdf(string path) 201 | { 202 | var settings = new PdfPrintSettings() 203 | { 204 | BackgroundsEnabled = true, 205 | HeaderFooterEnabled = true 206 | }; 207 | var doIt = new Action(() => 208 | { 209 | this._browser.PrintToPdfAsync(path, settings); 210 | }); 211 | 212 | if (this._browser != null) 213 | { 214 | if (this._browser.InvokeRequired) 215 | { 216 | this._browser.Invoke(doIt); 217 | } 218 | else 219 | { 220 | doIt(); 221 | } 222 | } 223 | } 224 | 225 | internal void DoKeyUp(Keys keyCode, bool control, bool shift, bool alt, string selectedText) 226 | { 227 | //We only handle a few keys 228 | if ((!_keysWeHandle.Contains(keyCode))) 229 | { 230 | return; 231 | } 232 | switch (keyCode) 233 | { 234 | case Keys.F3: 235 | this.btnNextSearch.PerformClick(); 236 | break; 237 | case Keys.Escape: 238 | this.CloseFindingPanel(); 239 | break; 240 | case Keys.F: 241 | if (control) 242 | { 243 | if (!string.IsNullOrEmpty(selectedText)) 244 | { 245 | this.txtFind.Text = selectedText; 246 | } 247 | 248 | if (this.pnlFind.Visible) 249 | { 250 | this.txtFind.Focus(); 251 | } 252 | else 253 | { 254 | this.ToggleFind(); 255 | } 256 | } 257 | break; 258 | case Keys.S: 259 | if (control && this._pageController.CheckForChanges()) 260 | { 261 | if (this._pageController.SaveMarkdown() || this._pageController.SaveAsMarkdown()) 262 | { 263 | this.RunJavscript("alert('Your changes have been successfully saved.', 'success', 2);"); 264 | } 265 | } 266 | break; 267 | } 268 | } 269 | #endregion 270 | } 271 | } 272 | -------------------------------------------------------------------------------- /MarkdownViewer/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cbsom/MarkdownViewer/e03d53e1bc82243a8d3affa37a2ca94b38710682/MarkdownViewer/logo.ico -------------------------------------------------------------------------------- /MarkdownViewer/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2016/Dec/20/161221880-5-markdownviewer-logo_avatar.png) 2 | # Markdown Viewer 3 | 4 | **A clean, quick and simple Markdown viewer for Windows.** 5 | 6 | Preview and Edit local Markdown files. 7 | 8 | The client is a very simple Windows Forms container for a [CEFSharp](https://github.com/cefsharp/CefSharp) browser component which is based on the [Chromium Embedded Framework](https://bitbucket.org/chromiumembedded/cef). 9 | 10 | To format the Markdown for display, it is converted to HTML with [MarkdownSharp](https://code.google.com/archive/p/markdownsharp/), customized to properly format github style code blocks. 11 | 12 | The HTML is styled with [Bootstrap](http://getbootstrap.com/), and the code blocks are syntax highlighted with [SyntaxHighlighter](http://alexgorbatchev.com/SyntaxHighlighter/). 13 | 14 | Markdown file editing is done using the wonderful [SimpleMDE](https://simplemde.com/). 15 | 16 | ### Customize Application 17 | 18 | The application is actually a web site and it allows full customization of the GUI - including the option to change the entire page. 19 | 20 | To customize the GUI you can either: 21 | 22 | 1. Edit the /Resources/HTML_TEMPLATE.html file. The styles are contained in /Resources/styles/app.css and the code is in /Resources/scripts/app.js 23 | 24 | 2. Create a new template. To configure the application to use your new template, open the MarkdownViewer.exe.config file and edit the configuration/userSettings/MarkdownViewer.Properties.Settings/setting element to point to your template. 25 | 26 | #### The Client Side Javascript 27 | 28 | We have that wonderfuly rare situation where we know exactly which browser the user will be using as we have the browser embedding in the application. 29 | 30 | The Chromium Embedded Framework fully supports ECMAScript 2015 (ES6). No need for Babel. 31 | 32 | --------------------------------------------------------------------------------