diff --git a/AWSTools.Powershell/AWSTools.Powershell.nuspec b/AWSTools.Powershell/AWSTools.Powershell.nuspec deleted file mode 100644 index 7566c29..0000000 --- a/AWSTools.Powershell/AWSTools.Powershell.nuspec +++ /dev/null @@ -1,24 +0,0 @@ - - - - AWSTools.Powershell - AWS Tools for Windows PowerShell - 1.1.1120.20130916 - Amazon Web Services - Ethan Brown - The AWS Tools for Windows PowerShell lets developers and administrators manage their AWS services from the Windows PowerShell scripting environment. Now you can manage your AWS resources with the same Windows PowerShell tools you use to manage your Windows environment. - The AWS Tools for Windows PowerShell lets developers and administrators manage their AWS services from the Windows PowerShell scripting environment. Now you can manage your AWS resources with the same Windows PowerShell tools you use to manage your Windows environment. - http://aws.amazon.com/powershell/ - AWS Amazon cloud - http://aws.amazon.com/apache2.0/ - false - http://media.amazonwebservices.com/aws_singlebox_01.png - - - - - - - - - diff --git a/AWSTools.Powershell/tools/chocolateyInstall.ps1 b/AWSTools.Powershell/tools/chocolateyInstall.ps1 deleted file mode 100644 index e7f7391..0000000 --- a/AWSTools.Powershell/tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,16 +0,0 @@ -$package = 'AWSTools.Powershell' - -try { - $params = @{ - packageName = $package; - fileType = 'msi'; - silentArgs = '/quiet'; - url = 'http://sdk-for-net.amazonwebservices.com/latest/AWSToolsAndSDKForNet.msi'; - } - - Install-ChocolateyPackage @params - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/AdobeAIR/AdobeAIR.jpg b/AdobeAIR/AdobeAIR.jpg deleted file mode 100644 index 41c880a..0000000 Binary files a/AdobeAIR/AdobeAIR.jpg and /dev/null differ diff --git a/AdobeAIR/AdobeAIR.nuspec b/AdobeAIR/AdobeAIR.nuspec deleted file mode 100644 index 1919d60..0000000 --- a/AdobeAIR/AdobeAIR.nuspec +++ /dev/null @@ -1,24 +0,0 @@ - - - - AdobeAIR - Adobe AIR Runtime - 3.9.0.1380 - Adobe - Ethan J Brown - Adobe AIR runtime is necessary for AIR based applications. - Adobe AIR is a cross-platform runtime that enables you to use your existing Flash/ActionScript or HTML/JavaScript development skills and tools to build and deploy applications, games, and videos outside the browser and on mobile devices. - - Note that AIR auto-updates itself after an initial install. - - http://get.adobe.com/air/ - web browser AIR - http://www.adobe.com/products/eulas - false - https://github.com/Iristyle/ChocolateyPackages/raw/master/AdobeAIR/AdobeAIR.jpg - - - - - - diff --git a/AdobeAIR/tools/chocolateyInstall.ps1 b/AdobeAIR/tools/chocolateyInstall.ps1 deleted file mode 100644 index 8d01c45..0000000 --- a/AdobeAIR/tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -$package = 'AdobeAIR' -$version = '3.9' - -try { - - $params = @{ - PackageName = $package; - FileType = 'exe'; - SilentArgs = '-silent -eulaAccepted'; - Url = "http://airdownload.adobe.com/air/win/download/$version/AdobeAIRInstaller.exe" - } - - Install-ChocolateyPackage @params - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/AdobeAIR/tools/chocolateyUninstall.ps1 b/AdobeAIR/tools/chocolateyUninstall.ps1 deleted file mode 100644 index 513551c..0000000 --- a/AdobeAIR/tools/chocolateyUninstall.ps1 +++ /dev/null @@ -1,22 +0,0 @@ -$package = 'AdobeAIR' - -try { - - # http://forums.adobe.com/message/4677900 - $airInstall = 'Adobe AIR\Versions\1.0' - $airPath = $Env:CommonProgramFiles, ${Env:CommonProgramFiles(x86)} | - % { Join-Path $_ $airInstall } | - ? { Test-Path $_ } | - Select -First 1 - $airSetup = Join-Path $airPath 'setup.msi' - - # http://stackoverflow.com/questions/450027/uninstalling-an-msi-file-from-the-command-line-without-using-msiexec - msiexec.exe /x "`"$airSetup`"" /qb-! REBOOT=ReallySuppress - # alternate -> wmic product where name='Adobe AIR' call uninstall - - Remove-Item $airInstall -Recurse -ErrorAction SilentlyContinue - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/AndroidStudio/AndroidStudio.nuspec b/AndroidStudio/AndroidStudio.nuspec deleted file mode 100644 index 9799acf..0000000 --- a/AndroidStudio/AndroidStudio.nuspec +++ /dev/null @@ -1,33 +0,0 @@ - - - - AndroidStudio - Android Studio - 0.3.2.132893413 - Google - Ethan J Brown - Android Studio is a new Android development environment based on IntelliJ IDEA. - Android Studio is a new Android development environment based on IntelliJ IDEA. Similar to Eclipse with the ADT Plugin, Android Studio provides integrated Android developer tools for development and debugging. On top of the capabilities you expect from IntelliJ, Android Studio offers: - -* Gradle-based build support. -* Android-specific refactoring and quick fixes. -* Lint tools to catch performance, usability, version compatibility and other problems. -* ProGuard and app-signing capabilities. -* Template-based wizards to create common Android designs and components. -* A rich layout editor that allows you to drag-and-drop UI components, preview layouts on multiple screen configurations, and much more. - -Caution: Android Studio is currently available as an early access preview. Several features are either incomplete or not yet implemented and you may encounter bugs. If you are not comfortable using an unfinished product, you may want to instead download (or continue to use) the ADT Bundle (Eclipse with the ADT Plugin). - - http://blogs.jetbrains.com/idea/2013/05/intellij-idea-and-android-studio-faq/ - - http://developer.android.com/sdk/installing/studio.html - google android jetbrains IntelliJ IDEA - http://opensource.org/licenses/BSD-3-Clause - false - https://github.com/Iristyle/ChocolateyPackages/raw/master/AndroidStudio/androidstudio_logo.png - - - - - - diff --git a/AndroidStudio/androidstudio_logo.png b/AndroidStudio/androidstudio_logo.png deleted file mode 100644 index ff6277c..0000000 Binary files a/AndroidStudio/androidstudio_logo.png and /dev/null differ diff --git a/AndroidStudio/tools/chocolateyInstall.ps1 b/AndroidStudio/tools/chocolateyInstall.ps1 deleted file mode 100644 index 945fcae..0000000 --- a/AndroidStudio/tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,38 +0,0 @@ -$package = 'AndroidStudio' -$majorVersion = '0.3.2' -$buildVersion = 132.893413 - -try { - - $build = Join-Path $Env:LOCALAPPDATA 'Android\android-studio\build.txt' - - if ((Test-Path $build) -and ((Get-Content $build) -match '.*?(\d+\.\d+)')) - { - $installedVersion = [decimal]$Matches[1] - if ($installedVersion -lt $buildVersion) - { - Write-Host "Uninstalling existing version $installedVersion" - . .\chocolateyUninstall.ps1 - } - else - { - Write-Host "$package $installedVersion already installed!" - exit - } - } - - $params = @{ - PackageName = $package; - FileType = 'exe'; - #uses NSIS installer - http://nsis.sourceforge.net/Docs/Chapter3.html - SilentArgs = '/S'; - Url = "https://dl.google.com/android/studio/install/$majorVersion/android-studio-bundle-$buildVersion-windows.exe"; - } - - Install-ChocolateyPackage @params - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/AndroidStudio/tools/chocolateyUninstall.ps1 b/AndroidStudio/tools/chocolateyUninstall.ps1 deleted file mode 100644 index 5108b5c..0000000 --- a/AndroidStudio/tools/chocolateyUninstall.ps1 +++ /dev/null @@ -1,22 +0,0 @@ -$package = 'AndroidStudio' - -try -{ - $uninstall = Join-Path $Env:LOCALAPPDATA 'Android\android-studio\uninstall.exe' - - #uses NSIS installer - http://nsis.sourceforge.net/Docs/Chapter3.html - $uninstallParams = @{ - PackageName = $package; - FileType = 'exe'; - SilentArgs = '/S'; - File = $uninstall; - } - - Uninstall-ChocolateyPackage @uninstallParams - Write-ChocolateySuccess $package -} -catch -{ - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/Brackets.Theseus/Brackets.Theseus.nuspec b/Brackets.Theseus/Brackets.Theseus.nuspec deleted file mode 100644 index 0a56022..0000000 --- a/Brackets.Theseus/Brackets.Theseus.nuspec +++ /dev/null @@ -1,34 +0,0 @@ - - - - Brackets.Theseus - Theseus JavaScript debugger for Brackets - 0.2.8 - Adobe - Ethan J Brown - A pretty darn cool JavaScript debugger for Brackets. - Theseus is a new type of JavaScript debugger for Node.js, Chrome, and both simultaneously. It is an extension for the Brackets code editor. - -* Real-time code coverage: Theseus shows the number of times that every function has been called next to its definition. Functions that have never been called are also given a gray background. You can watch the code light up as you interact with the web page. - -* Retroactive inspection: Click a call count to see the values of parameters, return values, and any exceptions that have been thrown from that function. It's like adding console.log without having to save and reload. - -* Asynchronous call tree: If you click multiple call counts, all invocations of those functions are shown in a tree. When callback functions are called, they show up in the tree under the function that created them, regardless of whether they were called immediately or many ticks later. - -http://brackets.io/ - - https://github.com/adobe-research/theseus - editor web adobe javascript html css debugger nodejs - http://opensource.org/licenses/MIT - false - https://github.com/Iristyle/ChocolateyPackages/raw/master/Brackets/brackets_logo.png - - - - - - - - - - diff --git a/Brackets.Theseus/tools/chocolateyInstall.ps1 b/Brackets.Theseus/tools/chocolateyInstall.ps1 deleted file mode 100644 index c655d5d..0000000 --- a/Brackets.Theseus/tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,20 +0,0 @@ -$package = 'Brackets.Theseus' - -try { - - npm install -g node-theseus@0.0.7 - - $params = @{ - PackageName = $package; - FileType = 'zip'; - Url = 'https://s3.amazonaws.com/theseus-downloads/theseus-0.2.8.zip'; - UnzipLocation = Join-Path $Env:APPDATA 'Brackets\extensions\user'; - } - - Install-ChocolateyZipPackage @params - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/Brackets.Theseus/tools/chocolateyUninstall.ps1 b/Brackets.Theseus/tools/chocolateyUninstall.ps1 deleted file mode 100644 index def7b0b..0000000 --- a/Brackets.Theseus/tools/chocolateyUninstall.ps1 +++ /dev/null @@ -1,13 +0,0 @@ -$package = 'Brackets.Theseus' - -try { - $installPath = Join-Path $Env:APPDATA 'Brackets\extensions\user\brackets-theseus' - Remove-Item $installPath -Recurse -ErrorAction SilentlyContinue - - npm uninstall -g node-theseus@0.0.7 - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/Brackets/Brackets.nuspec b/Brackets/Brackets.nuspec deleted file mode 100644 index accea93..0000000 --- a/Brackets/Brackets.nuspec +++ /dev/null @@ -1,34 +0,0 @@ - - - - Brackets - Brackets Code Editor - 0.35 - Adobe - Ethan J Brown - Brackets open-source code editor built with the web for the web. - Brackets is an open-source editor for web design and development built on top of web technologies such as HTML, CSS and JavaScript. The project was created and is maintained by Adobe, and is released under an MIT License. - -FOR THE WEB, BY THE WEB -Brackets is built using HTML, CSS and JavaScript. If you can code in Brackets, you can code on Brackets. - -OPEN DEVELOPMENT WORKS -Brackets, is a fully open-source, community-driven project. Want to influence its direction? Join the developer list and start contributing. - -TOOLS SHOULDN'T GET IN YOUR WAY -Rather than clutter your workspace with floating panels, toolbars and icons, Brackets focuses on providing “Quick Edit” in-line views that provide context-sensitive access to your content, without taking you away from your code. - -WORKS WITH YOUR BROWSER -The browser is your design view. Brackets hooks up directly to the browser, allowing you to design and develop in the same environment that you deploy. - - http://brackets.io/ - editor web adobe javascript html css - https://github.com/adobe/brackets/blob/master/LICENSE - false - https://upload.wikimedia.org/wikipedia/commons/4/4c/Brackets_Icon.svg - - - - - - diff --git a/Brackets/brackets_logo.png b/Brackets/brackets_logo.png deleted file mode 100644 index 0d2d55f..0000000 Binary files a/Brackets/brackets_logo.png and /dev/null differ diff --git a/Brackets/tools/chocolateyInstall.ps1 b/Brackets/tools/chocolateyInstall.ps1 deleted file mode 100644 index dbda663..0000000 --- a/Brackets/tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -$package = 'Brackets' -$build = '35' - -try { - $params = @{ - PackageName = $package; - FileType = 'msi'; - SilentArgs = '/q'; - Url = "http://download.brackets.io/file.cfm?platform=WIN&build=$build"; - } - - Install-ChocolateyPackage @params - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/Brackets/tools/chocolateyUninstall.ps1 b/Brackets/tools/chocolateyUninstall.ps1 deleted file mode 100644 index 201f31f..0000000 --- a/Brackets/tools/chocolateyUninstall.ps1 +++ /dev/null @@ -1,13 +0,0 @@ -$package = 'Brackets' - -try { - - # http://stackoverflow.com/questions/450027/uninstalling-an-msi-file-from-the-command-line-without-using-msiexec - $msiArgs = "/X{CA6586CA-1C03-488B-B791-2A4533C1B1C6} /qb-! REBOOT=ReallySuppress" - Start-ChocolateyProcessAsAdmin "$msiArgs" 'msiexec' - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/CasperJS/CasperJs.nuspec b/CasperJS/CasperJs.nuspec deleted file mode 100644 index eb19dab..0000000 --- a/CasperJS/CasperJs.nuspec +++ /dev/null @@ -1,34 +0,0 @@ - - - - CasperJS - CasperJS - 1.1-beta1 - Nicolas Perriault - Ethan J. Brown - CasperJS is a navigation scripting & testing utility for PhantomJS and SlimerJS written in Javascript - CasperJS is an open source navigation scripting & testing utility written in Javascript for the PhantomJS WebKit headless browser and SlimerJS (Gecko). It eases the process of defining a full navigation scenario and provides useful high-level functions, methods & syntactic sugar for doing common tasks such as: - -* defining & ordering browsing navigation steps -* filling & submitting forms -* clicking & following links -* capturing screenshots of a page (or part of it) -* testing remote DOM -* logging events -* downloading resources, including binary ones -* writing functional test suites, saving results as JUnit XML -* scraping Web contents - https://github.com/n1k0/casperjs/releases/tag/1.1-beta1 - http://casperjs.org/ - casperjs javascript browser test webkit phantomjs slimerjs - http://en.wikipedia.org/wiki/MIT_License - false - https://github.com/Iristyle/ChocolateyPackages/raw/master/CasperJS/casperjs_logo.jpg - - - - - - - - diff --git a/CasperJS/casperjs_logo.jpg b/CasperJS/casperjs_logo.jpg deleted file mode 100644 index df8dd6f..0000000 Binary files a/CasperJS/casperjs_logo.jpg and /dev/null differ diff --git a/CasperJS/tools/chocolateyInstall.ps1 b/CasperJS/tools/chocolateyInstall.ps1 deleted file mode 100644 index be03aa2..0000000 --- a/CasperJS/tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,41 +0,0 @@ -$package = 'CasperJS' -$version = '1.1-beta1' - -try { - $params = @{ - PackageName = $package; - FileType = 'zip'; - Url = "https://github.com/n1k0/casperjs/zipball/$version"; - UnzipLocation = Join-Path $Env:TEMP "$package\$version"; - } - - if (!(Test-Path($params.UnzipLocation))) - { - New-Item $params.UnzipLocation -Type Directory | Out-Null - } - - # unzip to a temporary location - Install-ChocolateyZipPackage @params - - # then move the sha1 named package over to tools\CasperJS - $binRoot = Join-Path $Env:SystemDrive $Env:Chocolatey_Bin_Root - $moveTo = if (Test-Path $binRoot) { $binRoot } ` - else { Join-Path $Env:SystemDrive 'tools' } - $moveTo = Join-Path $moveTo $package - - if (Test-Path $moveTo) { Remove-Item $moveTo -Recurse -ErrorAction SilentlyContinue } - - Get-ChildItem $params.UnzipLocation | - Select -First 1 | - Move-Item -Destination $moveTo - - $batchLocation = Get-ChildItem $moveTo -Filter 'casperjs.bat' -Recurse | - Select -ExpandProperty 'DirectoryName' -First 1 - - Install-ChocolateyPath $batchLocation - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/CasperJS/tools/chocolateyUninstall.ps1 b/CasperJS/tools/chocolateyUninstall.ps1 deleted file mode 100644 index 69766e1..0000000 --- a/CasperJS/tools/chocolateyUninstall.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -$package = 'CasperJS' - -try { - $installPath = Join-Path $Env:SystemDrive $Env:Chocolatey_Bin_Root - if (!(Test-Path $installPath)) - { - $installPath = Join-Path $Env:SystemDrive 'tools' - } - $installPath = Join-Path $installPath 'casperjs' - - if (Test-Path $installPath) - { - Remove-Item $installPath -Recurse -Force - } - - $binLocation = $installPath -replace '\\', '\\' - - $userPaths = [Environment]::GetEnvironmentVariable('Path', 'User') -split ';' | - ? { ($_ -notmatch $binLocation) -and (![String]::IsNullOrEmpty($_)) } | - Select-Object -Unique - - [Environment]::SetEnvironmentVariable('Path', ($userPaths -join ';'), 'User') - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/ConEmu/ConEmu.nuspec b/ConEmu/ConEmu.nuspec deleted file mode 100644 index c7ce159..0000000 --- a/ConEmu/ConEmu.nuspec +++ /dev/null @@ -1,44 +0,0 @@ - - - - ConEmu - 13.12.25.0 - Maximus5 - Xavier Decoster, Ethan J. Brown - http://opensource.org/licenses/BSD-3-Clause - http://code.google.com/p/conemu-maximus5/ - http://code.google.com/p/conemu-maximus5/logo?cct=1340271535 - false - ConEmu-Maximus5 is a Windows console emulator with tabs, which presents multiple consoles and simple GUI applications as one customizable GUI window with various features. - ConEmu starts a console program in a hidden console window, and provides an alternative customizable GUI window with various features: - - * smooth and friendly window resizing; - * tabs for editors, viewers, panels and consoles; - * run simple GUI apps in tabs; - * Windows 7 Jump Lists and Progress on Taskbar buttons; - * easily run old DOS applications (games) in Windows 7 or 64-bit OS; - * thumbnails and tiles in Far Manager; - * normal, maximized and full screen graphical window modes; - * window font anti-aliasing: standard, ClearType, disabled; - * window fonts: family, height, width, bold, italic, etc.; - * using normal/bold/italic fonts for different parts of the console simultaneously; - * Chinese verions of Windows supported; - * using 24-bit colors in Far Manager 3.x; - * ANSI X3.64 and Xterm 256 colors; - * cursor: standard console (horizontal) or GUI (vertical); - * optional per-application settings (e.g. palette); - * vertical console buffer scrolling using the keyboard (BufferHeight mode); - * show full output (1K+ lines) of last command in Far Manager's editor/viewer; - * customizable Far Manager right click behaviour (long click opens context menu); - * drag and drop (explorer style) of files and folders in Far Manager; - * limited support of BDF fonts; - * user friendly text and block selection; - * transparency and desktop mode; - * customizable starting tabs; - * configurable and clickable status bar; - * and more, and more... take a look at the Settings dialog, What's New page and Settings.reg - https://code.google.com/p/conemu-maximus5/wiki/Whats_New - Copyright (c) 2013, Maximus5 - graphical console emulator tabs FAR farmanager powershell cmd bash - - diff --git a/ConEmu/tools/chocolateyInstall.ps1 b/ConEmu/tools/chocolateyInstall.ps1 deleted file mode 100644 index b0f447c..0000000 --- a/ConEmu/tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,29 +0,0 @@ -$package = 'ConEmu' -$version = '131225' - -try { - - $isSytem32Bit = (($Env:PROCESSOR_ARCHITECTURE -eq 'x86') -and ` - ($Env:PROCESSOR_ARCHITEW6432 -eq $null)) - - $os = if ($isSytem32Bit) { "x86" } else { "x64" } - - # If having problems with untrusted cetrificates on HTTPS, use - # solution: http://stackoverflow.com/a/561242/1579985 - $params = @{ - PackageName = $package; - FileType = 'exe'; - SilentArgs = "/p:$os /passive"; - # MSI installer, but packed inside wrapper to select x86 or x64 - # version. Therefore, treat it as EXE type. - Url = "https://conemu-maximus5.googlecode.com/files/ConEmuSetup.$version.exe"; - ValidExitCodes = @(0); - } - - Install-ChocolateyPackage @params - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/ConEmu/tools/chocolateyUninstall.ps1 b/ConEmu/tools/chocolateyUninstall.ps1 deleted file mode 100644 index 0489005..0000000 --- a/ConEmu/tools/chocolateyUninstall.ps1 +++ /dev/null @@ -1,27 +0,0 @@ -$package = 'ConEmu' - -try { - - # $productGuid = Get-ChildItem HKLM:\SOFTWARE\Classes\Installer\Products | - # Get-ItemProperty -Name 'ProductName' | - # ? { $_.ProductName -match 'ConEmu' } | - # Select -ExpandProperty PSChildName -First 1 - - $installerRoot = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer' - $productsRoot = "$installerRoot\UserData\S-1-5-18\Products" - - # x64, x86 - '1616F7E78FA09834EAA6E0617006EEC7', '8ADD8A72FEF29D044884864D191B15B0' | - % { "$productsRoot\$_\InstallProperties" } | - ? { Test-Path $_ } | - % { - $pkg = (Get-ItemProperty $_).LocalPackage - - msiexec.exe /x $pkg /qb-! - } - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/CouchPotato/CouchPotato-logo.png b/CouchPotato/CouchPotato-logo.png deleted file mode 100644 index d3e6d9f..0000000 Binary files a/CouchPotato/CouchPotato-logo.png and /dev/null differ diff --git a/CouchPotato/CouchPotato.nuspec b/CouchPotato/CouchPotato.nuspec deleted file mode 100644 index f9739a8..0000000 --- a/CouchPotato/CouchPotato.nuspec +++ /dev/null @@ -1,45 +0,0 @@ - - - - CouchPotato - CouchPotato automatic NZB downloader - 2012.11.04.1 - RuudBurger - Ethan Brown - CouchPotato (CP) is an automatic NZB and torrent downloader. You can keep a "movies I want"-list and it will search for NZBs/torrents of these movies every X hours. Once a movie is found, it will send it to SABnzbd or download the torrent to a specified directory. - CouchPotato is an automatic NZB and torrent downloader. -You can keep a "want to watch"-list and it will search for NZBs/torrents of these items every X hours. Once a correct release is found, matching the correct quality, it will send it to SABnzbd or download the .nzb or .torrent to a specified directory. - - This package performs a number of normally quite painful / tedious tasks - - Installs SABnzbd+ (compiled version) - - Installs Python - - Installs PyWin32 - - Git clones the CouchPotato source to site-packages - - Configures Git within CouchPotato to auto-update - - Configures for XBMC metadata - - Configures XMBC notifications - to port 9090 as SABnzbd+ uses 8080 - - Configures CouchPotato to send NZBs to SABnzbd+ using API key - - Configures CouchPotato to run as a Windows service - - Configured alternate sabToCouchPotato.py SABnzbd+ post-processing scripts - - https://couchpota.to/ - CouchPotato Python Usenet NZB torrent - https://github.com/RuudBurger/CouchPotatoServer/blob/master/license.txt - false - https://github.com/Iristyle/ChocolateyPackages/raw/master/CouchPotato/CouchPotato-logo.png - - - - - - - - - - - - - - - - diff --git a/CouchPotato/tools/autoProcessMovie.cfg.sample b/CouchPotato/tools/autoProcessMovie.cfg.sample deleted file mode 100644 index 563f216..0000000 --- a/CouchPotato/tools/autoProcessMovie.cfg.sample +++ /dev/null @@ -1,22 +0,0 @@ -[CouchPotato] -host = localhost -port = 5050 -username = -password = -ssl = 0 -web_root = -apikey = xxxxxxxx -delay = 60 -method = renamer - -[Comments] -host = (ip address for CouchPotato Server. Use "localhost" if SABnzbd and CPS on same system) -port = (port for CouchPotato Server) -username = (username if set for CouchPotato Server) -password = (password if set for CouchPotato Server) -ssl = 0 (set to 1 if you want to use ssl. -untested. Default is 0) -web_root = (set URL base if needed.) -apikey = (apikey for CouchPotato Server... Required) -delay = (set delay in seconds before sending api call. Minimum 60) -method = "renamer" or "manage". renamer is the default. Read the help file. - diff --git a/CouchPotato/tools/autoProcessMovie.py b/CouchPotato/tools/autoProcessMovie.py deleted file mode 100644 index 6ba652c..0000000 --- a/CouchPotato/tools/autoProcessMovie.py +++ /dev/null @@ -1,143 +0,0 @@ -import sys -import urllib -import os.path -import ConfigParser -import time -import json -from pprint import pprint - -class AuthURLOpener(urllib.FancyURLopener): - def __init__(self, user, pw): - self.username = user - self.password = pw - self.numTries = 0 - urllib.FancyURLopener.__init__(self) - - def prompt_user_passwd(self, host, realm): - if self.numTries == 0: - self.numTries = 1 - return (self.username, self.password) - else: - return ('', '') - - def openit(self, url): - self.numTries = 0 - return urllib.FancyURLopener.open(self, url) - - -def process(dirName, nzbName=None, status=0): - - config = ConfigParser.ConfigParser() - configFilename = os.path.join(os.path.dirname(sys.argv[0]), "autoProcessMovie.cfg") - print "autoProcessMovie v 2.2" - print "Loading config from", configFilename - - if not os.path.isfile(configFilename): - print "ERROR: You need an autoProcessMovie.cfg file - did you rename and edit the .sample?" - sys.exit(-1) - - config.read(configFilename) - - host = config.get("CouchPotato", "host") - port = config.get("CouchPotato", "port") - username = config.get("CouchPotato", "username") - password = config.get("CouchPotato", "password") - apikey = config.get("CouchPotato", "apikey") - delay = float(config.get("CouchPotato", "delay")) - method = config.get("CouchPotato", "method") - - try: - ssl = int(config.get("CouchPotato", "ssl")) - except (ConfigParser.NoOptionError, ValueError): - ssl = 0 - - try: - web_root = config.get("CouchPotato", "web_root") - except ConfigParser.NoOptionError: - web_root = "" - - myOpener = AuthURLOpener(username, password) - - nzbName1 = str(nzbName) - - if ssl: - protocol = "https://" - else: - protocol = "http://" - if status == 0: - if method == "manage": - command = "manage.update" - else: - command = "renamer.scan" - - url = protocol + host + ":" + port + web_root + "/api/" + apikey + "/" + command - - print "waiting for", str(delay), "seconds to allow CPS to process newly extracted files" - - time.sleep(delay) - - print "Opening URL:", url - - try: - urlObj = myOpener.openit(url) - except IOError, e: - print "Unable to open URL: ", str(e) - sys.exit(1) - - result = urlObj.readlines() - for line in result: - print line - - print command, "started on CouchPotatoServer for", nzbName1 - - else: - print "download of", nzbName1, "has failed." - print "trying to re-cue the next highest ranked release" - a=nzbName1.find('.cp')+4 - b=nzbName1.find('.nzb')-1 - imdbid=nzbName1[a:b] - #print imdbid - - url = protocol + host + ":" + port + web_root + "/api/" + apikey + "/movie.list" - - print "Opening URL:", url - - try: - urlObj = myOpener.openit(url) - except IOError, e: - print "Unable to open URL: ", str(e) - sys.exit(1) - - n=0 - result = json.load(urlObj) - movieid = [item["id"] for item in result["movies"]] - library = [item["library"] for item in result["movies"]] - identifier = [item["identifier"] for item in library] - for index in range(len(movieid)): - if identifier[index] == imdbid: - movid = str(movieid[index]) - print "found movie id", movid, "in database for release", nzbName1 - n = n + 1 - break - - if n == 0: - print "cound not find a movie in the database for release", nzbName1 - print "please manually ignore this release and refresh the wanted movie" - print "exiting postprocessing script" - sys.exit(1) - - url = protocol + host + ":" + port + web_root + "/api/" + apikey + "/searcher.try_next/?id=" + movid - - print "Opening URL:", url - - try: - urlObj = myOpener.openit(url) - except IOError, e: - print "Unable to open URL: ", str(e) - sys.exit(1) - - result = urlObj.readlines() - for line in result: - print line - - print "movie", movid, "set to try the next best release on CouchPotatoServer" diff --git a/CouchPotato/tools/autoProcessTV.cfg.sample b/CouchPotato/tools/autoProcessTV.cfg.sample deleted file mode 100644 index 15dc900..0000000 --- a/CouchPotato/tools/autoProcessTV.cfg.sample +++ /dev/null @@ -1,7 +0,0 @@ -[SickBeard] -host=localhost -port=8081 -username= -password= -web_root= -ssl=0 \ No newline at end of file diff --git a/CouchPotato/tools/autoProcessTV.py b/CouchPotato/tools/autoProcessTV.py deleted file mode 100644 index b42ffd5..0000000 --- a/CouchPotato/tools/autoProcessTV.py +++ /dev/null @@ -1,108 +0,0 @@ -# Author: Nic Wolfe -# URL: http://code.google.com/p/sickbeard/ -# -# This file is part of Sick Beard. -# -# Sick Beard is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Sick Beard is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Sick Beard. If not, see . - - -import sys -import urllib -import os.path -import ConfigParser - -class AuthURLOpener(urllib.FancyURLopener): - def __init__(self, user, pw): - self.username = user - self.password = pw - self.numTries = 0 - urllib.FancyURLopener.__init__(self) - - def prompt_user_passwd(self, host, realm): - if self.numTries == 0: - self.numTries = 1 - return (self.username, self.password) - else: - return ('', '') - - def openit(self, url): - self.numTries = 0 - return urllib.FancyURLopener.open(self, url) - - -def processEpisode(dirName, nzbName=None, status=0): - - if status > 0: - print "the download failed. nothing to process" - sys.exit() - - config = ConfigParser.ConfigParser() - configFilename = os.path.join(os.path.dirname(sys.argv[0]), "autoProcessTV.cfg") - print "Loading config from", configFilename - - if not os.path.isfile(configFilename): - print "ERROR: You need an autoProcessTV.cfg file - did you rename and edit the .sample?" - sys.exit(-1) - - try: - fp = open(configFilename, "r") - config.readfp(fp) - fp.close() - except IOError, e: - print "Could not read configuration file: ", str(e) - sys.exit(1) - - host = config.get("SickBeard", "host") - port = config.get("SickBeard", "port") - username = config.get("SickBeard", "username") - password = config.get("SickBeard", "password") - try: - ssl = int(config.get("SickBeard", "ssl")) - except (ConfigParser.NoOptionError, ValueError): - ssl = 0 - - try: - web_root = config.get("SickBeard", "web_root") - except ConfigParser.NoOptionError: - web_root = "" - - params = {} - - params['quiet'] = 1 - - params['dir'] = dirName - if nzbName != None: - params['nzbName'] = nzbName - - myOpener = AuthURLOpener(username, password) - - if ssl: - protocol = "https://" - else: - protocol = "http://" - - url = protocol + host + ":" + port + web_root + "/home/postprocess/processEpisode?" + urllib.urlencode(params) - - print "Opening URL:", url - - try: - urlObj = myOpener.openit(url) - except IOError, e: - print "Unable to open URL: ", str(e) - sys.exit(1) - - result = urlObj.readlines() - for line in result: - print line - diff --git a/CouchPotato/tools/chocolateyInstall.ps1 b/CouchPotato/tools/chocolateyInstall.ps1 deleted file mode 100644 index 6ad998f..0000000 --- a/CouchPotato/tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,349 +0,0 @@ -$package = 'CouchPotato' - -try { - - function Get-CurrentDirectory - { - $thisName = $MyInvocation.MyCommand.Name - [IO.Path]::GetDirectoryName((Get-Content function:$thisName).File) - } - - . (Join-Path (Get-CurrentDirectory) 'Get-IniContent.ps1') - . (Join-Path (Get-CurrentDirectory) 'Out-IniFile.ps1') - . (Join-Path (Get-CurrentDirectory) 'WaitForSuccess.ps1') - - #simulate the unix command for finding things in path - #http://stackoverflow.com/questions/63805/equivalent-of-nix-which-command-in-powershell - function Which([string]$cmd) - { - Get-Command -ErrorAction "SilentlyContinue" $cmd | - Select -ExpandProperty Definition - } - - $couchPotatoRunning = { - $service = Get-Service 'CouchPotato' -ErrorAction SilentlyContinue - return ($service -and ($service.Status -eq 'Running')) - } - $couchPotatoServing = { - $pingUrl = 'http://localhost:5050/docs/' - try - { - (New-Object Net.WebClient).DownloadString($pingUrl) - return $true - } - catch {} - - return $false - } - - # Use PYTHONHOME if it exists, or fallback to 'Where' to search PATH - if ($Env:PYTHONHOME) { $localPython = Join-Path $Env:PYTHONHOME 'python.exe' } - - if (!$Env:PYTHONHOME -or !(Test-Path $localPython)) - { $localPython = Which python.exe } - - if (!(Test-Path $localPython)) - { - Write-ChocolateyFailure 'CouchPotato requires a Python runtime to install' - return - } - - $pythonRoot = Split-Path $localPython - - # as we're running a service as SYSTEM, Machine needs python in PATH - # TODO: Bug in Install-ChocolateyPath won't add to MACHINE if already in USER - $setMachinePathScript = @" - `$vars = [Environment]::GetEnvironmentVariable('PATH', 'Machine') -split ';'; - if (!(`$vars -contains '$pythonRoot')) { `$vars += '$pythonRoot' }; - [Environment]::SetEnvironmentVariable('PATH', (`$vars -join ';'), 'Machine'); - [Environment]::SetEnvironmentVariable('PYTHONHOME', '$pythonRoot', 'Machine'); -"@ - - Start-ChocolateyProcessAsAdmin $setMachinePathScript - - $sitePackages = (Join-Path (Join-Path $pythonRoot 'Lib') 'site-packages') - if (!(Test-Path $sitePackages)) - { - Write-ChocolateyFailure 'Could not find Python site-packages directory' - return - } - - # grab the latest sources if not present - Push-Location $sitePackages - $git = Which git - $couchPotatoPath = (Join-Path $sitePackages 'CouchPotatoServer') - $couchPotatoEmpty = $true - if (Test-Path $couchPotatoPath) - { - $files = Get-ChildItem $couchPotatoPath -Recurse -ErrorAction SilentlyContinue - $couchPotatoEmpty = ($files.Count -eq 0) - } - if (!$couchPotatoEmpty) - { - Write-ChocolateySuccess 'CouchPotato already installed!' - return - } - else - { - Write-Host 'Cloning CouchPotato source from GitHub' - &git clone https://github.com/RuudBurger/CouchPotatoServer.git - } - - # Read SABNzbd+ config file to find scripts directory - $sabDataPath = Join-Path $Env:LOCALAPPDATA 'sabnzbd' - $sabIniPath = Join-Path $sabDataPath 'sabnzbd.ini' - if (Test-Path $sabIniPath) - { - Write-Host "Reading SABnzbd+ config file at $sabIniPath" - $sabConfig = Get-IniContent -Path $sabIniPath - - # 3 options - missing script_dir, script_dir set to "", or configured script_dir - if (!$sabConfig.misc.script_dir -or ` - ($sabConfig.misc.script_dir -eq "`"`"")) - { - $scriptDir = (Join-Path $sabDataPath 'scripts') - Write-Host "Configured SABnzbd+ script_dir to $scriptDir" - $sabConfig.misc.script_dir = $scriptDir - $sabConfig | Out-IniFile -FilePath $sabIniPath -Force -Encoding UTF8 - } - - if (!(Test-Path $sabConfig.misc.script_dir)) - { - New-Item -Path $sabConfig.misc.script_dir -Type Directory | Out-Null - } - - # To use alternate CouchPotato script, requires modified SickBeard bits - # copy and configure autoprocessing scripts in SABNzbd+ scripts directory - Write-Host "Copying CouchPotato post-processing scripts to SABnzbd+" - Get-ChildItem (Get-CurrentDirectory) -Filter '*.py' | - # overwrite SickBeard scripts if they exist - Copy-Item -Destination $sabConfig.misc.script_dir -Force - - if (!$sabconfig.categories.movies) - { - Write-Host "Configuring movies category inside SABnzbd+" - $movies = New-Object Collections.Specialized.OrderedDictionary - $movies.priority = 0; - $movies.pp = 3; # Download + Unpack +Repair +Delete - $movies.name = 'movies'; - $movies.script = 'sabToCouchPotato.py'; - $movies.newzbin = ''; - $movies.dir = 'movies'; - $sabconfig.categories.movies = $movies - } - - if (([string]::IsNullOrEmpty($sabconfig.categories.movies.script)) -or ` - ($sabconfig.categories.movies.script -ieq 'None') -or - ($sabconfig.categories.movies.script -ieq "`"`"")) - { - $sabconfig.categories.movies.script = 'sabToCouchPotato.py' - } - - # allows failed post processing of empty files (out of retention, etc) - $sabConfig.misc.empty_postproc = 1 - - Write-Host 'Configured movies category in SABnzbd+' - $sabConfig | Out-IniFile -FilePath $sabIniPath -Force -Encoding UTF8 - } - - # regardless of sabnzbd+ install status, .PY should be executable - if (($ENV:PATHEXT -split ';') -inotcontains '.PY') - { - Write-Host 'Adding .PY to PATHEXT' - $ENV:PATHEXT += ';.PY' - [Environment]::SetEnvironmentVariable('PATHEXT', $ENV:PATHEXT, 'Machine') - } - - # find resource kit tools and configure CouchPotato as a service - # http://htpcbuild.com/htpc-software/sickbeard/sickbeard-service/ - # http://stackoverflow.com/questions/32404/can-i-run-a-python-script-as-a-service-in-windows-how - $resourceKit = ${Env:ProgramFiles(x86)}, $Env:ProgramFiles | - % { Join-Path (Join-Path $_ 'Windows Resource Kits') 'Tools' } | - ? { Test-Path $_ } | - Select -First 1 - - if ($resourceKit) - { - Write-Host "Found resource kit - registering CouchPotato as a service" - Push-Location $resourceKit - $srvAny = Join-Path $resourceKit 'srvany.exe' - .\instsrv CouchPotato $srvany | Out-Null - - # Set-Service cmdlet doesn't have depend OR delayed start :( - Write-Host "Configuring service delayed auto with Tcpip dependency" - sc.exe config CouchPotato depend= Tcpip - sc.exe config CouchPotato start= delayed-auto - Pop-Location - - New-Item HKLM:\SYSTEM\CurrentControlSet\Services -Name CouchPotato ` - -ErrorAction SilentlyContinue | Out-Null - New-Item HKLM:\SYSTEM\CurrentControlSet\Services\CouchPotato ` - -Name Parameters -ErrorAction SilentlyContinue | Out-Null - $couchPotatoParams = Get-Item HKLM:\SYSTEM\CurrentControlSet\Services\CouchPotato\Parameters - New-ItemProperty -Path $couchPotatoParams.PSPath -PropertyType String ` - -Name 'AppDirectory' -Value $pythonRoot -Force | Out-Null - $pythonW = (Join-Path $pythonRoot 'pythonw.exe') - New-ItemProperty -Path $couchPotatoParams.PSPath -PropertyType String ` - -Name 'Application' -Value $pythonW -Force | Out-Null - $startCouchPotato = (Join-Path $couchPotatoPath 'CouchPotato.py') - New-ItemProperty -Path $couchPotatoParams.PSPath -PropertyType String ` - -Name 'AppParameters' -Value $startCouchPotato -Force | Out-Null - - Start-Service CouchPotato - - $sysProfile = Join-Path 'config' 'systemprofile' - $roamingData = Join-Path $sysProfile 'AppData\Roaming' - - # config files are created on first start-up - $configPath = (Join-Path ([Environment]::GetFolderPath('System')) $roamingData), - # must handle SYSWOW64 on x64 (works inside both 32-bit and 64-bit host procs) - (Join-Path ([Environment]::GetFolderPath('SystemX86')) $roamingData) | - Select -Unique | - ? { Test-Path $_ } | - % { Join-Path $_ 'CouchPotato\settings.conf' } | - Select -First 1 - Write-Host "Expecting configuration file at $configPath" - - # to start hacking settings.conf the service needs to be up, settings.conf needs - # to exist, and CouchPotato must respond to requests (settings.conf is complete) - $waitOnConfig = { - if (!(&$couchPotatoRunning)) { return $false } - if (!(Test-Path $configPath)) { return $false } - return &$couchPotatoServing - } - - if (WaitForSuccess $waitOnConfig 20 'CouchPotato to start and create config') - { - Write-Host 'CouchPotato started and configuration files created' - # an alternative to modifying conf directly is to use the API - # /api/KEY/settings - $couchPotatoConfig = Get-IniContent -Path $configPath - $couchPotatoApiKey = $couchPotatoConfig.core.api_key - - Write-Host 'Configuring Windows Firewall for the CouchPotato port' - # configure windows firewall - netsh advfirewall firewall delete rule name="CouchPotato" - # program="$pythonW" - $port = $couchPotatoConfig.core.port - netsh advfirewall firewall add rule name="CouchPotato" dir=in protocol=tcp localport=$port action=allow - - $couchPotatoConfig.core.launch_browser = 'False' - - # make sure autoupdate is turned on with a correct path to Git - $couchPotatoConfig.updater.notification = 'True' - $couchPotatoConfig.updater.enabled = 'True' - $couchPotatoConfig.updater.git_command = "`"$($git -replace '\\', '\\')`"" - $couchPotatoConfig.updater.automatic = 'True' - - $couchPotatoConfig.manage.cleanup = 'True' - # TODO: once we can sniff out the XBMC directory, we can auto-config this - # $couchPotatoConfig.manage.enabled = 'False' - # $couchPotatoConfig.manage.library = '' - - $movieDownloads = Join-Path (Join-Path $sabDataPath 'Downloads\complete') ` - $sabConfig.categories.movies.dir - $from = $movieDownloads -replace '\\', '\\' - if ($from -match '\s+') { $from = "`"$from`"" } - - # Write-Host "Using SABNzbd+ movies download directory, but the to must be configured" - $couchPotatoConfig.renamer.from = $from - $couchPotatoConfig.renamer.enabled = 'True' - $couchPotatoConfig.renamer.cleanup = 'True' - $couchPotatoConfig.renamer.folder_name = ' []' - $couchPotatoConfig.renamer.move_leftover = 1 - # because we're using alternate post-processing script, don't auto-run this - # on a schedule - $couchPotatoConfig.renamer.run_every = 0 - - # configure for XBMC with default user / pass of xbmc / xbmc - $couchPotatoConfig.xbmc.enabled = 1 - $couchPotatoConfig.xbmc.meta_enabled = 'True' - $couchPotatoConfig.xbmc.meta_thumbnail = 'True' - $couchPotatoConfig.xbmc.meta_fanart = 'True' - $couchPotatoConfig.xbmc.meta_nfo = 'True' - $couchPotatoConfig.xbmc.host = 'localhost:9090' - $couchPotatoConfig.xbmc.username = 'xbmc' - $couchPotatoConfig.xbmc.password = 'xbmc' - - # configure CouchPotato to use SABNzbd - $couchPotatoConfig.sabnzbd.enabled = 1 - $couchPotatoConfig.sabnzbd.api_key = $sabConfig.misc.api_key - $couchPotatoConfig.sabnzbd.category = 'movies' - $couchPotatoConfig.sabnzbd.host = "localhost:$($sabConfig.misc.port)" - - $couchPotatoConfig | - Out-IniFile -File $configPath -Force -Encoding ASCII | - Out-Null - - $restartUrl = "http://localhost:$port/api/$couchPotatoApiKey/app.restart/" - try - { - Write-Host "Restarting CouchPotato using API to accept config" - (New-Object Net.WebClient).DownloadString($restartUrl) - } - catch - { - Write-Host "Error using API - restarting service manually" - Restart-Service CouchPotato - } - } - - # Using alternative CouchPotato renamer script like SickBeard - # https://couchpota.to/forum/showthread.php?tid=343 - # files at http://www.freefilehosting.net/autoprocessmediabuilds-win - # The main benefits to this script are: - # 1 less CPU usage (due to SABnzbd polling an regular disk scanning etc) - # 2 less hard disk scanning - # 3 ability to get hard disk to spin down when not downloading - # 4 the renamer is fired (on demand) - # 5 if you are using SABnzbd renaming this script will add to the manage list without using the renamer. - - $autoConfig = Join-Path $sabConfig.misc.script_dir 'autoProcessMovie.cfg' - if (!(Test-Path $autoConfig)) - { - # order shouldn't matter, but don't trust Python ;0 - $couchPotatoAuto = New-Object Collections.Specialized.OrderedDictionary - $couchPotatoAuto.host = $couchPotatoConfig.core.host -replace '0\.0\.0\.0', - 'localhost' - $couchPotatoAuto.port = $couchPotatoConfig.core.port - $couchPotatoAuto.username = $couchPotatoConfig.core.username - $couchPotatoAuto.password = $couchPotatoConfig.core.password - $couchPotatoAuto.ssl = 0 - $couchPotatoAuto.web_root = $couchPotatoConfig.core.url_base - $couchPotatoAuto.apikey = $couchPotatoConfig.core.api_key - $couchPotatoAuto.delay = 60 # must be minimum of 60 seconds - $couchPotatoAuto.method = 'renamer' #or 'manage' - - @{ 'CouchPotato' = $couchPotatoAuto } | - Out-IniFile -FilePath $autoConfig -Encoding ASCII -Force - - Write-Host @" -CouchPotato SABNzbd+ post-processing scripts configured - If CouchPotato is reconfigured with a username or password or another - host or different API key then those same changes must be made to $configPath -"@ - } - - $url = ("http://localhost:$($sabConfig.misc.port)/api?mode=restart" + - "&apikey=$($sabConfig.misc.api_key)") - Write-Host "Restarting SABnzbd+ to accept configuration changes at $url" - (New-Object Net.WebClient).DownloadString($url) - - #wait up to 5 seconds for service to fire up - if (WaitForSuccess $couchPotatoServing 5 'CouchPotato to start') - { - #launch local default browser for additional config - $configUrl = "http://localhost:$($couchPotatoConfig.core.port)" - [Diagnostics.Process]::Start($configUrl) | Out-Null - } - - Write-Host "For use in other apps, CouchPotato API key: $couchPotatoApiKey" - - Pop-Location - } - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/CouchPotato/tools/chocolateyUninstall.ps1 b/CouchPotato/tools/chocolateyUninstall.ps1 deleted file mode 100644 index d03c273..0000000 --- a/CouchPotato/tools/chocolateyUninstall.ps1 +++ /dev/null @@ -1,134 +0,0 @@ -$package = 'CouchPotato' - -try -{ - function Get-CurrentDirectory - { - $thisName = $MyInvocation.MyCommand.Name - [IO.Path]::GetDirectoryName((Get-Content function:$thisName).File) - } - - # load INI parser - . (Join-Path (Get-CurrentDirectory) 'Get-IniContent.ps1') - . (Join-Path (Get-CurrentDirectory) 'Out-IniFile.ps1') - - #simulate the unix command for finding things in path - #http://stackoverflow.com/questions/63805/equivalent-of-nix-which-command-in-powershell - function Which([string]$cmd) - { - Get-Command -ErrorAction "SilentlyContinue" $cmd | - Select -ExpandProperty Definition - } - - Write-Host 'Deleting CouchPotato Windows Firewall config' - netsh advfirewall firewall delete rule name="CouchPotato" - - # check registry for path to CouchPotato - $servicePath = 'HKLM:\SYSTEM\CurrentControlSet\Services\CouchPotato\Parameters' - $installDir = Get-ItemProperty $servicePath -ErrorAction SilentlyContinue | - Select -ExpandProperty AppParameters - - if ($installDir) - { - $couchPotatoDir = Split-Path $installDir - $sitePackages = Split-Path $couchPotatoDir - Write-Host "Found CouchPotato service configuration directory of $couchPotatoDir" - } - # not found - do some guesswork - else - { - # Use PYTHONHOME if it exists, or fallback to 'Where' to search PATH - if ($Env:PYTHONHOME) { $localPython = Join-Path $Env:PYTHONHOME 'python.exe' } - - if (!$Env:PYTHONHOME -or !(Test-Path $localPython)) - { $localPython = Which python.exe } - - if (!(Test-Path $localPython)) - { - Write-Warning 'Could not find CouchPotato or Python!' - } - else - { - $pythonRoot = Split-Path $localPython - $sitePackages = (Join-Path (Join-Path $pythonRoot 'Lib') 'site-packages') - $couchPotatoDir = Join-Path $sitePackages 'CouchPotatoServer' - Write-Host "CouchPotato service configuration not found - assuming $couchPotatoDir" - } - } - - # delete the service and reg keys - if (Get-Service CouchPotato -ErrorAction SilentlyContinue) - { - Write-Host 'Deleting CouchPotato service' - Stop-Service CouchPotato - sc.exe delete CouchPotato - } - - # we found CouchPotato on disk, so delete all the files - if (Test-Path $couchPotatoDir) - { - Write-Host "Removing all files in $couchPotatoDir" - Remove-Item $couchPotatoDir -Recurse -Force -ErrorAction SilentlyContinue - if (Test-Path $couchPotatoDir) - { - Write-Warning "$couchPotatoDir must be deleted manually" - } - } - - $sysProfile = Join-Path 'config' 'systemprofile' - $couchPotatoData = Join-Path (Join-Path 'AppData' 'Roaming') 'CouchPotato' - $couchPotatoData = Join-Path $sysProfile $couchPotatoData - - # config files are created on first start-up - $configPath = (Join-Path ([Environment]::GetFolderPath('System')) $couchPotatoData), - # must handle SYSWOW64 on x64 (works inside both 32-bit and 64-bit host procs) - (Join-Path ([Environment]::GetFolderPath('SystemX86')) $couchPotatoData) | - Select -Unique | - % { - if (Test-Path $_) - { - Write-Warning "$_ data directory must be deleted manually" - } - } - - # Read SABNzbd+ config file to delete CouchPotato scripts if configured - $sabDataPath = Join-Path $Env:LOCALAPPDATA 'sabnzbd' - $sabIniPath = Join-Path $sabDataPath 'sabnzbd.ini' - if (Test-Path $sabIniPath) - { - Write-Host "Reading SABnzbd+ config file at $sabIniPath" - $sabConfig = Get-IniContent $sabIniPath - - $scriptsDir = $sabConfig.misc.script_dir - # found a legit scripts dir, so delete CouchPotato files - if ($scriptsDir -and ($scriptsDir -ne "`"`"") -and (Test-Path $scriptsDir)) - { - Write-Warning "SABnzbd+ post-processing scripts at $scriptsDir must be deleted manually" - } - - $movies = $sabconfig.categories.movies - if ($movies -and ($movies.script -eq 'sabToCouchPotato.py')) - { - Write-Host 'Removed sabToCouchPotato.py script from movies category inside SABnzbd+' - $movies.script = 'None' - $sabConfig | Out-IniFile -FilePath $sabIniPath -Force -Encoding UTF8 - } - - Write-Host 'Restarting SABnzbd+ to accept configuration changes' - $url = ("http://localhost:$($sabConfig.misc.port)/api?mode=restart" + - "&apikey=$($sabConfig.misc.api_key)") - try - { - (New-Object Net.WebClient).DownloadString($url) - } - catch - { - Write-Host "SABNzbd+ not responding to restart request" - } - } - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/CouchPotato/tools/sabToCouchPotato.history.txt b/CouchPotato/tools/sabToCouchPotato.history.txt deleted file mode 100644 index 2805bea..0000000 --- a/CouchPotato/tools/sabToCouchPotato.history.txt +++ /dev/null @@ -1,149 +0,0 @@ -Rename the file autoProcessMovie.cfg.sample to autoProcessMovie.cfg - -Fill in the appropriate fields as they apply to your installation. - -[Notes_On_Delay] - delay must be a minimum of 60 seconds for the renamer.scan to run successfully. CouchPotato - performs a test to ensure files/folder are not newer than 1 minute to prevent renaming of - files that are still extracting. - -[Notes_On_Method_renamer] - method "renamer" is the default which will cause CouchPotato to move and rename downloaded files - as specified in the CouchPotato renamer settings. - This will also add the movie to the manage list and initiate any configured notifications. - In this case SABnzbd (or your download client) must extract the files to the "from" folder - as specified in your CouchPotato renamer settings. Renamer must be enabled but you should - increase the "run every" option in CouchPotato renamer settings (advanced settings) to only - run daily (1440) or weekly (10080) or automatic scan can be disabled by setting run every =0. - -[Notes_On_Method_manage] - method "manage" will make CouchPotato update the list of managed movies if manager - is enabled but renamer is not enabled. - In this case SABnzbd (or your download client) must extract the files directly - to your final movies folder (as configured in CouchPotato manage settings) and Manage must - be enabled. - -If you have added .py to your PATHEXT (in windows) or you have given sabToCouchPotato.py executable -permissions, or you are using the compiled executables you can manually call this process outside of -sabnzbd for testing your configuration or in case a postprocessing event failed. -To do this, execute sabToCouchPotato.py -e.g. via ssl issue the following command: #./sabToCouchPotato.py -when in the directory where sabToCouchPotato.py is located. - - - -Change_LOG / History - - -V2.2 05/10/2012 - -Re-wrote the failed downlaod handling to just search for the imdb ttXXXX identifier (as received from the nzb name) -Now issues only two api calls. movie.list and searcher.try_next - -Should be more robust with regards changes to CPS and also utilises less resources (i.e. less api call and and less processing). - - -V2.1 04/10/2012 - -detected a change in the movie release info format. Fixed the script to work with new format. - - -V2.0 04/10/2012 - -Fixed an issue with the failed download handling in that the status id for "snatched" can be different on each installation. now performs a status.list via api to verify the status. - -Also including a version print (currently 2.0... yeah original I know) so you know if you are current. - -removed the multiple versions. The former _recue version will perform the standard renamer only if "postprocess only verified downloads" (default) is enabled in SABnzbd. Also, the "unix" version works fine in Windows, only the "dos" version gave issue in Linux. In other words, this one version should work for all systems. -For historical reasons, the former download stats apply to the old versions: -sabToCouchPotato-dos - downloaded 143 times -sabToCouchPotato-unix - downloaded 205 times -sabToCouchPotato_recue - downloaded 105 times - -Also updated the Windows Build to include the same changes. I have removed the link to the linux build as this didn't work on all systems and it really shouldn't be necessary. Let me know if you need this updated. - - -V1.9 18/09/2012 - -compiled (build) versions of sabToSickBeard and sabToCouchPotato added for both Linux and Windows. links at top of post. - - -V1.9 16/09/2012 - -Added a compiled .exe version for windows. Should prevent the "python not recognised" issue and allow this to be used in conjunction with the windows build on systems that do not have python installed. - -This is the full (_recue version) if sabnzbd is set to post ptocess only verified jobs, this will not recue and will function as a standard renamer. - - -V1.9 27/08/2012 - -Following the latest CPS update on the master branch, this script is not really needed as CPS actually polls the SABnzbd api and does the same as this script (internally). - -However, if you have any issues with CPS constantly downloading the same movies, or filling the log with polling SABnzbd for completed movies, or otherwise prefer to use this method, then you can still use this script and make the following changes in CPS: -Settings, renamer, run every (advanced) = set to 1440 (or some longer interval) -Settings, renamer, next On_failed = off -Settings, downloaders, SABnzbd, Delete failed = off. - -V1.9 06/08/2012 - -Also added the integer handling of status in the sabToSickBeard.py script to prevent SickBeard trying to postprocess a failed TV download. Only impacts the _recue version - - -V1.8 05/08/2012 - -Modified the _recue version as SABnzbd 0.7.3 now appears to pass the "status" variable as a string not an integer!!! (or i had it wrong on first attempt :~) -This causes the old script to identify completed downloads as failed and recues the next download! - -The fix here should work with any conceivable subsequent updates in that I now make the sys.argv[7] an integer before passing it. if the variable already is an integer, this shouldn't cause any issues. - -status = int(sys.argv[7]) -autoProcessMovie.process(sys.argv[1], sys.argv[2], status) - - -V1.7 02/08/2012 - -Added a new version sabToCouchPotato_recue -This works the same as the other versions, but includes support for recuing failed downloads. -This is new, and only tested once (with success ) at my end. - -To get this to run you will need to uncheck the "post-process only verified jobs" option in SABnzbd. Also, to avoid issues with SickBeard postprocessing, I have included a modified postprocessing for SickBeard that just checks for failed status and then exits (the SickBeard Team are currently working on failed download handling and I will hopefully make this script work with that in the future) - -This re-cue works as follows: -Performs an api call to CPS to get a list of all wanted movies (with all data including the releases and status etc) -It finds the nzbname (from SABnzbd) in the json list returned from the api call (movie.list) and identifies the movie id and release id. -It performs an api call to make the release as "ignore" and then performs another api call to refresh the movie. -If another (next best) release that meets your criteria is already available it will send that to SABnzbd, otherwise it will wait until a new release becomes availabe. - -I have left the old versions here for now for those who don't want to try this. Also, if you don't uncheck the "post-process only verified jobs" in SABnzbd this code will perform the same as the previous versions. - -The next issue to tackle (if this works) is automating the deletion of failed download files in SABnzbd.... but I figured this was a start. - - -V1.6 22/07/2012 - -no functionality change, but providing scripts in both unix and dos format to prevent exit(127) errors. -if you are using windows, use the dos format. if you are using linux, use the unix format and unzip the files in linux. - - -V1.5 17/07/2012 - -add back the web_root parameter to set the URL base. - - -V1.4 17/07/2012 - -Have uploaded the latest version. -changes -Removed support for a movie.downlaoded api call that was only used in a seperate branch and is not expected to be merged. -Modified the passthrough to allow a manual call to this script (i.e. does not need to be called from SABnzbd). -Have added a helpfile that explains the setup options in a bit more detail. -Modified the .cfg.sample file to use 60 as a default delay and now specify that 60 should be your minimum to ensure the renamer.scan finds newly extracted movies. - - -V1.3 and earlier were not fully tracked, as the script itself (not files) was posted on the QNAP forums. - - - - - - diff --git a/CouchPotato/tools/sabToCouchPotato.py b/CouchPotato/tools/sabToCouchPotato.py deleted file mode 100644 index 4fdbfe6..0000000 --- a/CouchPotato/tools/sabToCouchPotato.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python - -import sys -import autoProcessMovie - -if len(sys.argv) < 8: - print "Not enough arguments received from SABnzbd." - print "Running autoProcessMovie as a manual run" - autoProcessMovie.process('Manual Run', 'Manual Run', 0) -else: - status = int(sys.argv[7]) - autoProcessMovie.process(sys.argv[1], sys.argv[2], status) - - -# SABnzbd argv: -# 1 The final directory of the job (full path) -# 2 The original name of the NZB file -# 3 Clean version of the job name (no path info and ".nzb" removed) -# 4 Indexer's report number (if supported) -# 5 User-defined category -# 6 Group that the NZB was posted in e.g. alt.binaries.x -# 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2 - - diff --git a/CouchPotato/tools/sabToSickBeard.py b/CouchPotato/tools/sabToSickBeard.py deleted file mode 100644 index 6baf999..0000000 --- a/CouchPotato/tools/sabToSickBeard.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python - -# Author: Nic Wolfe -# URL: http://code.google.com/p/sickbeard/ -# -# This file is part of Sick Beard. -# -# Sick Beard is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Sick Beard is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Sick Beard. If not, see . - - -import sys -import autoProcessTV - -if len(sys.argv) < 8: - print "Not enough arguments received from SABnzbd." - sys.exit() -else: - status = int(sys.argv[7]) - autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], status) - - -# SABnzbd argv: -# 1 The final directory of the job (full path) -# 2 The original name of the NZB file -# 3 Clean version of the job name (no path info and ".nzb" removed) -# 4 Indexer's report number (if supported) -# 5 User-defined category -# 6 Group that the NZB was posted in e.g. alt.binaries.x -# 7 Status of post processing. 0 = OK, 1=failed verification, 2=failed unpack, 3=1+2 - diff --git a/DartEditor/DartEditor.nuspec b/DartEditor/DartEditor.nuspec deleted file mode 100644 index 6faac5c..0000000 --- a/DartEditor/DartEditor.nuspec +++ /dev/null @@ -1,36 +0,0 @@ - - - - DartEditor - Dart Editor - 0.24898 - Google - Ethan J Brown - Dart Editor is an open-source tool for editing, debugging, and running Dart applications. - Dart Editor is an open-source tool for editing, debugging, and running Dart applications. - -Dart is a new web programming language with libraries, a virtual machine, and tools. Dart helps developers build structured modern web apps. Dart compiles to JavaScript to run across the entire modern web. - -* The Dart language is familiar and easy to learn. It's class based and object oriented, without being dogmatic. -* The Pub package manager makes getting and sharing libraries easy. -* Core libraries provide all the basics, including support for asynchronous programming with Futures. -* Performance is good and getting better. Dart apps are fastest in the Dart VM, but they can be speedy even after compilation to JavaScript. -* Web UI lets you use future web APIs today, with support for proposed standards such as web components, MDV, and shadow DOM. -* All modern browsers (both desktop and mobile) can run Dart web apps, thanks to our Dart-to-JavaScript compiler. - -https://code.google.com/p/dart/ - - http://www.dartlang.org/tools/editor - google dart browser javascript - http://opensource.org/licenses/BSD-3-Clause - false - https://github.com/Iristyle/ChocolateyPackages/raw/master/DartEditor/dart_logo.jpg - - - - - - - - - diff --git a/DartEditor/dart_logo.jpg b/DartEditor/dart_logo.jpg deleted file mode 100644 index f6ca3c9..0000000 Binary files a/DartEditor/dart_logo.jpg and /dev/null differ diff --git a/DartEditor/tools/chocolateyInstall.ps1 b/DartEditor/tools/chocolateyInstall.ps1 deleted file mode 100644 index b2def57..0000000 --- a/DartEditor/tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,36 +0,0 @@ -$package = 'DartEditor' - -try { - $params = @{ - PackageName = $package; - FileType = 'zip'; - Url = 'https://storage.googleapis.com/dart-editor-archive-integration/latest/darteditor-win32-32.zip'; - Url64bit = 'https://storage.googleapis.com/dart-editor-archive-integration/latest/darteditor-win32-64.zip'; - UnzipLocation = Join-Path $Env:SystemDrive 'tools'; - } - - $binRoot = Join-Path $Env:SystemDrive $Env:Chocolatey_Bin_Root - if (Test-Path $binRoot) - { - $params.UnzipLocation = $binRoot - } - - if (!(Test-Path($params.UnzipLocation))) - { - New-Item $params.UnzipLocation -Type Directory | Out-Null - } - - Install-ChocolateyZipPackage @params - - $dartPath = Join-Path $params.UnzipLocation 'dart' - Get-ChildItem $dartPath -Filter *.exe -Recurse | - ? { $_.Name -match 'dart' } | - % { - Generate-BinFile ($_.Name -replace '\.exe', '') $_.FullName - } - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/DartEditor/tools/chocolateyUninstall.ps1 b/DartEditor/tools/chocolateyUninstall.ps1 deleted file mode 100644 index c78e503..0000000 --- a/DartEditor/tools/chocolateyUninstall.ps1 +++ /dev/null @@ -1,28 +0,0 @@ -$package = 'DartEditor' - -try { - $location = Join-Path $Env:SystemDrive $Env:Chocolatey_Bin_Root - if (!(Test-Path $location)) - { - $location = Join-Path $Env:SystemDrive 'tools' - } - $location = Join-Path $location 'dart' - - if (Test-Path $location) - { - Remove-Item $location -Recurse -Force - } - - Push-Location $Env:ChocolateyInstall\bin - $batch = 'DartEditor.bat' - if (Test-Path $batch) - { - Remove-Item $batch - } - Pop-Location - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/Elixir/Elixir.nuspec b/Elixir/Elixir.nuspec index d29945d..c4665ab 100644 --- a/Elixir/Elixir.nuspec +++ b/Elixir/Elixir.nuspec @@ -3,9 +3,9 @@ Elixir Elixir - 0.12.0 + 0.13.2.20140728 Jose Valim - Ethan J Brown + Onorio Catenacci Elixir is a functional meta-programming aware language built on top of the Erlang VM. Elixir is a functional meta-programming aware language built on top of the Erlang VM. It is a dynamic language with flexible syntax with macros support that leverages Erlang's abilities to build concurrent, distributed, fault-tolerant applications with hot code upgrades. @@ -20,9 +20,7 @@ Finally, Elixir and Erlang share the same bytecode and data types. This means yo https://secure.gravatar.com/avatar/4c5c2c297ed9f4664cfbe7733a011fb2?s=400&d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png - - - + diff --git a/Elixir/tools/chocolateyInstall.ps1 b/Elixir/tools/chocolateyInstall.ps1 index aed6877..0250f8e 100644 --- a/Elixir/tools/chocolateyInstall.ps1 +++ b/Elixir/tools/chocolateyInstall.ps1 @@ -1,11 +1,11 @@ $package = 'Elixir' -$version = '0.12.0' +$version = '0.13.2' try { $params = @{ PackageName = $package; FileType = 'zip'; - Url = "https://github.com/elixir-lang/elixir/releases/download/v$version/v$version.zip"; + Url = "https://github.com/elixir-lang/elixir/releases/download/v$version/Precompiled.zip"; UnzipLocation = Join-Path $Env:SystemDrive 'tools'; } @@ -26,7 +26,6 @@ try { $elixirBin = Join-Path $params.UnzipLocation 'bin' - Install-ChocolateyPath $elixirBin Write-Host @' Please restart your current shell session to access Elixir commands: diff --git a/Erlang/erlang-logo.png b/Erlang/erlang-logo.png new file mode 100644 index 0000000..56291aa Binary files /dev/null and b/Erlang/erlang-logo.png differ diff --git a/Erlang/erlang.nuspec b/Erlang/erlang.nuspec new file mode 100644 index 0000000..8248e14 --- /dev/null +++ b/Erlang/erlang.nuspec @@ -0,0 +1,21 @@ + + + + erlang + Erlang + 17.1.0 + Joe Armstrong,Robert Virding,Mike Williams + Onorio Catenacci + Erlang/OTP - for building concurrent, distributed, and fault tolerant systems + Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability. Some of its uses are in telecoms, banking, e-commerce, computer telephony and instant messaging. Erlang's runtime system has built-in support for concurrency, distribution and fault tolerance. +OTP is set of Erlang libraries and design principles providing middle-ware to develop these systems. It includes its own distributed database, applications to interface towards other languages, debugging and release handling tools. + + http://www.erlang.org/ + erlang languages admin + erlang.org + http://www.erlang.org/EPLICENSE + false + https://github.com/smerchek/nugetpackages/raw/master/Erlang/erlang-logo.png + + + \ No newline at end of file diff --git a/Erlang/tools/chocolateyInstall.ps1 b/Erlang/tools/chocolateyInstall.ps1 new file mode 100644 index 0000000..42a1c77 --- /dev/null +++ b/Erlang/tools/chocolateyInstall.ps1 @@ -0,0 +1,8 @@ +try { + Install-ChocolateyPackage 'erlang' 'EXE' '/S' 'http://www.erlang.org/download/otp_win32_17.1.exe' 'http://www.erlang.org/download/otp_win64_17.1.exe' -validExitCodes @(0) + + Write-ChocolateySuccess 'Erlang' +} catch { + Write-ChocolateyFailure 'Erlang' $($_.Exception.Message) + throw +} diff --git a/Erlang/tools/chocolateyUninstall.ps1 b/Erlang/tools/chocolateyUninstall.ps1 new file mode 100644 index 0000000..e07e79a --- /dev/null +++ b/Erlang/tools/chocolateyUninstall.ps1 @@ -0,0 +1,9 @@ + +try { + + start-process -wait "C:\Program Files\erl6.0\uninstall.exe" + + Write-ChocolateySuccess 'Erlang' +} catch { + Write-ChocolateySuccess 'Erlang' +} diff --git a/EthanBrown.ChromeCanaryDevExtensions/EthanBrown.ChromeCanaryDevExtensions.nuspec b/EthanBrown.ChromeCanaryDevExtensions/EthanBrown.ChromeCanaryDevExtensions.nuspec deleted file mode 100644 index 62e51d1..0000000 --- a/EthanBrown.ChromeCanaryDevExtensions/EthanBrown.ChromeCanaryDevExtensions.nuspec +++ /dev/null @@ -1,101 +0,0 @@ - - - - EthanBrown.ChromeCanaryDevExtensions - Chrome Canary - Web Development Extensions - 0.0.2 - Various - Ethan Brown - Chrome Canary extensions for web development. - Includes a number of very useful extensions for web application - development within Chrome. - - WARNING: This is not a "silent" installer. - - Chrome no longer provides any ability to automatically install extensions - due to abuse, so the existing preferences file is examined, to determine - what is currently installed. - - For plugins that are not installed, Chrome is launched with each extension - in a new browser tab, where the user must press the 'Add To Chrome' button. - - Included - =========================================================================== - - - Batarang for AngularJS development - https://chrome.google.com/webstore/detail/ighdmehidhipcmcojjgiloacoafjmpfk - - - Clear Cache - https://chrome.google.com/webstore/detail/cppjkneekbjaeellbfkmgnhonkkjfpdn - - - DevTools AutoSave - https://chrome.google.com/webstore/detail/mlejngncgiocofkcbnnpaieapabmanfl - - - PageSpeed Insights - https://developers.google.com/speed/docs/insights/using_chrome - - - YSlow - https://chrome.google.com/webstore/detail/yslow/ninejjcohidippngpapiilnmkgllmakh - - - Simple REST Client - https://chrome.google.com/webstore/detail/simple-rest-client/fhjcajmcbmldlhcimfajhfbgofnpcjmb - - Postman is the preferred client, but requires login, which is - often undesireable with a test browser - https://chrome.google.com/webstore/detail/fdmmgilgnpjigdojojpjoooidkmcomcm - - - Speed Tracer - https://chrome.google.com/webstore/detail/ognampngfcbddbfemdapefohjiobgbdl - - - CoffeeConsole - https://chrome.google.com/webstore/detail/coffeeconsole/ladbkfdlnaibelfidknofapbbdlhadfp - - CoffeeScript IDE is preferred, but requires login - https://chrome.google.com/webstore/detail/coffeescript-ide/hikjpmfebkagiijbdinakadphhjffaik - - - JS Runtime Inspector - https://chrome.google.com/webstore/detail/js-runtime-inspector/iilpjebedgohcmlffhnkhbjhabkdhfmn/related - - - PrettyPrint - https://chrome.google.com/webstore/detail/prettyprint/nipdlgebaanapcphbcidpmmmkcecpkhg/reviews - - Previously Included - =========================================================================== - - - LiveReload - https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei - Grunt-contrib-livereload plugin now handles this - - - Tincr - https://chrome.google.com/webstore/detail/tincr/lfjbhpnjiajjgnjganiaggebdhhpnbih - Hasn't been updated recently, and Chrome workspaces might supercede this - - Under evaluation - =========================================================================== - - - Grunt DevTools - https://chrome.google.com/webstore/detail/grunt-devtools/fbiodiodggnlakggeeckkjccjhhjndnb - - - CSS Shack - https://chrome.google.com/webstore/detail/css-shack/geiccgjkigajaicecnhdokggninehdlp/details - - - JetBrains IDE support - https://chrome.google.com/webstore/detail/jetbrains-ide-support/hmhgeddbohgjknpmjagkdomcpobmllji - - http://github.com/Iristyle/ChocolateyPackages/ - Google Chrome Canary Extension Development Web - - false - https://github.com/Iristyle/ChocolateyPackages/raw/master/GoogleChrome.Canary/GoogleChrome.Canary.png - - - - - - - - - - diff --git a/EthanBrown.ChromeCanaryDevExtensions/tools/chocolateyInstall.ps1 b/EthanBrown.ChromeCanaryDevExtensions/tools/chocolateyInstall.ps1 deleted file mode 100644 index b6febdf..0000000 --- a/EthanBrown.ChromeCanaryDevExtensions/tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,42 +0,0 @@ -$package = 'EthanBrown.ChromeCanaryDevExtensions' - -try { - - function Get-CurrentDirectory - { - $thisName = $MyInvocation.MyCommand.Name - [IO.Path]::GetDirectoryName((Get-Content function:$thisName).File) - } - - . (Join-Path (Get-CurrentDirectory) 'ChromeHelpers.ps1') - - $toInstall = @{ - "ighdmehidhipcmcojjgiloacoafjmpfk" = "Batarang"; - "cppjkneekbjaeellbfkmgnhonkkjfpdn" = "Clear Cache"; - "mlejngncgiocofkcbnnpaieapabmanfl" = "DevTools AutoSave"; - "gplegfbjlmmehdoakndmohflojccocli" = "PageSpeed Insights"; - "fhjcajmcbmldlhcimfajhfbgofnpcjmb" = "Simple REST Client"; - "ognampngfcbddbfemdapefohjiobgbdl" = "Speed Tracer"; - "ladbkfdlnaibelfidknofapbbdlhadfp" = "CoffeeConsole"; - "ninejjcohidippngpapiilnmkgllmakh" = "YSlow"; - "iilpjebedgohcmlffhnkhbjhabkdhfmn" = "JS Runtime Inspector"; - "nipdlgebaanapcphbcidpmmmkcecpkhg" = "PrettyPrint"; - # has messed up install requirements - # "hikjpmfebkagiijbdinakadphhjffaik" = "CoffeeScript IDE"; - # "fdmmgilgnpjigdojojpjoooidkmcomcm" = "PostMan"; - # handled by Grunt - # "jnihajbhpnppcggbcgedagnkighmdlei" = "LiveReload"; - # deprecated for now - # "fbiodiodggnlakggeeckkjccjhhjndnb" = "Grunt DevTools"; - # "lfjbhpnjiajjgnjganiaggebdhhpnbih" = "Tincr" - # "geiccgjkigajaicecnhdokggninehdlp" = "CSS Shack"; - # "hmhgeddbohgjknpmjagkdomcpobmllji" = "JetBrains IDE Support"; - } - - Install-ChromeExtensions $toInstall -Canary - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/EthanBrown.ChromeCanaryDevExtensions/tools/chocolateyUninstall.ps1 b/EthanBrown.ChromeCanaryDevExtensions/tools/chocolateyUninstall.ps1 deleted file mode 100644 index 2651833..0000000 --- a/EthanBrown.ChromeCanaryDevExtensions/tools/chocolateyUninstall.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -$package = 'EthanBrown.ChromeCanaryDevExtensions' - -try { - - function Get-CurrentDirectory - { - $thisName = $MyInvocation.MyCommand.Name - [IO.Path]::GetDirectoryName((Get-Content function:$thisName).File) - } - - . (Join-Path (Get-CurrentDirectory) 'ChromeHelpers.ps1') - - Write-Host "Launching Chrome Canary extensions page to remove extensions" - - $chromePath = Get-ChromePath -Canary - $chromeExe = Join-Path $chromePath 'Application\chrome.exe' - $chromeParams = @('--new-window', 'chrome://extensions/') - &$chromeExe @chromeParams - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/EthanBrown.ChromeDevExtensions/EthanBrown.ChromeDevExtensions.nuspec b/EthanBrown.ChromeDevExtensions/EthanBrown.ChromeDevExtensions.nuspec deleted file mode 100644 index 7c87a3d..0000000 --- a/EthanBrown.ChromeDevExtensions/EthanBrown.ChromeDevExtensions.nuspec +++ /dev/null @@ -1,102 +0,0 @@ - - - - EthanBrown.ChromeDevExtensions - Chrome - Web Development Extensions - 0.0.2 - Various - Ethan Brown - Chrome extensions for web development. - Includes a number of very useful extensions for web application - development within Chrome. - - WARNING: This is not a "silent" installer. Assumes installation of the - dev version of Chrome, and not stable or beta. - - Chrome no longer provides any ability to automatically install extensions - due to abuse, so the existing preferences file is examined, to determine - what is currently installed. - - For plugins that are not installed, Chrome is launched with each extension - in a new browser tab, where the user must press the 'Add To Chrome' button. - - Included - =========================================================================== - - - Batarang for AngularJS development - https://chrome.google.com/webstore/detail/ighdmehidhipcmcojjgiloacoafjmpfk - - - Clear Cache - https://chrome.google.com/webstore/detail/cppjkneekbjaeellbfkmgnhonkkjfpdn - - - DevTools AutoSave - https://chrome.google.com/webstore/detail/mlejngncgiocofkcbnnpaieapabmanfl - - - PageSpeed Insights - https://developers.google.com/speed/docs/insights/using_chrome - - - YSlow - https://chrome.google.com/webstore/detail/yslow/ninejjcohidippngpapiilnmkgllmakh - - - Simple REST Client - https://chrome.google.com/webstore/detail/simple-rest-client/fhjcajmcbmldlhcimfajhfbgofnpcjmb - - Postman is the preferred client, but requires login, which is - often undesireable with a test browser - https://chrome.google.com/webstore/detail/fdmmgilgnpjigdojojpjoooidkmcomcm - - - Speed Tracer - https://chrome.google.com/webstore/detail/ognampngfcbddbfemdapefohjiobgbdl - - - CoffeeConsole - https://chrome.google.com/webstore/detail/coffeeconsole/ladbkfdlnaibelfidknofapbbdlhadfp - - CoffeeScript IDE is preferred, but requires login - https://chrome.google.com/webstore/detail/coffeescript-ide/hikjpmfebkagiijbdinakadphhjffaik - - - JS Runtime Inspector - https://chrome.google.com/webstore/detail/js-runtime-inspector/iilpjebedgohcmlffhnkhbjhabkdhfmn/related - - - PrettyPrint - https://chrome.google.com/webstore/detail/prettyprint/nipdlgebaanapcphbcidpmmmkcecpkhg/reviews - - Previously Included - =========================================================================== - - - LiveReload - https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei - Grunt-contrib-livereload plugin now handles this - - - Tincr - https://chrome.google.com/webstore/detail/tincr/lfjbhpnjiajjgnjganiaggebdhhpnbih - Hasn't been updated recently, and Chrome workspaces might supercede this - - Under evaluation - =========================================================================== - - - Grunt DevTools - https://chrome.google.com/webstore/detail/grunt-devtools/fbiodiodggnlakggeeckkjccjhhjndnb - - - CSS Shack - https://chrome.google.com/webstore/detail/css-shack/geiccgjkigajaicecnhdokggninehdlp/details - - - JetBrains IDE support - https://chrome.google.com/webstore/detail/jetbrains-ide-support/hmhgeddbohgjknpmjagkdomcpobmllji - - http://github.com/Iristyle/ChocolateyPackages/ - Google Chrome Extension Development Web - - false - https://github.com/Iristyle/ChocolateyPackages/raw/master/GoogleChrome.Dev/GoogleChrome.png - - - - - - - - - - diff --git a/EthanBrown.ChromeDevExtensions/tools/chocolateyInstall.ps1 b/EthanBrown.ChromeDevExtensions/tools/chocolateyInstall.ps1 deleted file mode 100644 index 99ac78e..0000000 --- a/EthanBrown.ChromeDevExtensions/tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,42 +0,0 @@ -$package = 'EthanBrown.ChromeDevExtensions' - -try { - - function Get-CurrentDirectory - { - $thisName = $MyInvocation.MyCommand.Name - [IO.Path]::GetDirectoryName((Get-Content function:$thisName).File) - } - - . (Join-Path (Get-CurrentDirectory) 'ChromeHelpers.ps1') - - $toInstall = @{ - "ighdmehidhipcmcojjgiloacoafjmpfk" = "Batarang"; - "cppjkneekbjaeellbfkmgnhonkkjfpdn" = "Clear Cache"; - "mlejngncgiocofkcbnnpaieapabmanfl" = "DevTools AutoSave"; - "gplegfbjlmmehdoakndmohflojccocli" = "PageSpeed Insights"; - "fhjcajmcbmldlhcimfajhfbgofnpcjmb" = "Simple REST Client"; - "ognampngfcbddbfemdapefohjiobgbdl" = "Speed Tracer"; - "ladbkfdlnaibelfidknofapbbdlhadfp" = "CoffeeConsole"; - "ninejjcohidippngpapiilnmkgllmakh" = "YSlow"; - "iilpjebedgohcmlffhnkhbjhabkdhfmn" = "JS Runtime Inspector"; - "nipdlgebaanapcphbcidpmmmkcecpkhg" = "PrettyPrint"; - # has messed up install requirements - # "hikjpmfebkagiijbdinakadphhjffaik" = "CoffeeScript IDE"; - # "fdmmgilgnpjigdojojpjoooidkmcomcm" = "PostMan"; - # handled by Grunt - # "jnihajbhpnppcggbcgedagnkighmdlei" = "LiveReload"; - # deprecated for now - # "fbiodiodggnlakggeeckkjccjhhjndnb" = "Grunt DevTools"; - # "lfjbhpnjiajjgnjganiaggebdhhpnbih" = "Tincr" - # "geiccgjkigajaicecnhdokggninehdlp" = "CSS Shack"; - # "hmhgeddbohgjknpmjagkdomcpobmllji" = "JetBrains IDE Support"; - } - - Install-ChromeExtensions $toInstall - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/EthanBrown.ChromeDevExtensions/tools/chocolateyUninstall.ps1 b/EthanBrown.ChromeDevExtensions/tools/chocolateyUninstall.ps1 deleted file mode 100644 index 1b8b2c5..0000000 --- a/EthanBrown.ChromeDevExtensions/tools/chocolateyUninstall.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -$package = 'EthanBrown.ChromeDevExtensions' - -try { - - function Get-CurrentDirectory - { - $thisName = $MyInvocation.MyCommand.Name - [IO.Path]::GetDirectoryName((Get-Content function:$thisName).File) - } - - . (Join-Path (Get-CurrentDirectory) 'ChromeHelpers.ps1') - - Write-Host "Launching Chrome extensions page to remove extensions" - - $chromePath = Get-ChromePath - $chromeExe = Join-Path $chromePath 'Application\chrome.exe' - $chromeParams = @('--new-window', 'chrome://extensions/') - &$chromeExe @chromeParams - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/EthanBrown.ConEmuConfig/EthanBrown.ConEmuConfig.nuspec b/EthanBrown.ConEmuConfig/EthanBrown.ConEmuConfig.nuspec deleted file mode 100644 index 02b4149..0000000 --- a/EthanBrown.ConEmuConfig/EthanBrown.ConEmuConfig.nuspec +++ /dev/null @@ -1,62 +0,0 @@ - - - - EthanBrown.ConEmuConfig - EthanBrown.ConEmuConfig - 0.0.5 - Ethan Brown - Ethan Brown - ConEmu configured with Base16 color scheme and sane defaults. - ConEmu is a beast to configure with reasonable defaults. - -It is hands down the best terminal Windows has to offer, but its configuration -abilities are overwhelming. It also has a rather peculiar set of defaults, that -can make keyboard usage quite odd. - -This pkg removes the pain. - -Includes: - - Use of SourceCodePro terminal font - - One admin PowerShell tab, one non-admin PowerShell tab, one Git Bash tab - - Uses Chris Kempson's base16 color scheme for hackers - https://github.com/chriskempson/base16 - - Uses long console output buffer height to ensure capturing all terminal output - from long running scripts - - Smaller window chrome to save on screen real estate - - Auto-updates enabled - - Support for Ruby ANSI escape sequences through ConEmuHk - - Block cursor - - A simplified status bar - - Sane key bindings that are consistent with other applications, for instance - - Windows + # are not hijacked, and Alt-1 through Alt-0 can switch tabs - - Ctrl-Tab cycles all tabs and current tab is always previewd - - Ctrl-W / Ctrl-F4 closes a tab - - Alt-Space shows ConEmu System menu - - Ctrl-T / Ctrl-N / Ctrl-Shift-N to create new tabs (mimicking Chrome) - - Ctrl-Shift-P to show tab context menu (mimicking Sublime) - - F11 full screen - - Ctrl-V pastes entire clipboard without prompting - - Full mouse and keyboard selection support - - Dim window on inactive - -I'm sure there are a couple of other minor tweaks that were dialed in as well. - - http://github.com/Iristyle/ChocolateyPackages/ - conemu powershell git - - https://raw.github.com/Iristyle/ChocolateyPackages/master/LICENSE.md - false - https://github.com/Iristyle/ChocolateyPackages/raw/master/EthanBrown.ConEmuConfig/conemu_logo.png - - - - - - - - - - - - - diff --git a/EthanBrown.ConEmuConfig/conemu_logo.png b/EthanBrown.ConEmuConfig/conemu_logo.png deleted file mode 100644 index 1e1f7e4..0000000 Binary files a/EthanBrown.ConEmuConfig/conemu_logo.png and /dev/null differ diff --git a/EthanBrown.ConEmuConfig/tools/ConEmu.reg b/EthanBrown.ConEmuConfig/tools/ConEmu.reg deleted file mode 100644 index 5397549..0000000 --- a/EthanBrown.ConEmuConfig/tools/ConEmu.reg +++ /dev/null @@ -1,549 +0,0 @@ -Windows Registry Editor Version 5.00 - -[HKEY_CURRENT_USER\Software\ConEmu] -"ConEmuStartShortcut64Installed"=dword:00000001 -"UninstallShortcutInstalled"=dword:00000001 -"ConEmuDesktopShortcut64Installed"=dword:00000001 -"ConEmuDesktopShortcutFolder"=dword:00000001 - -[HKEY_CURRENT_USER\Software\ConEmu\.Vanilla] -"ColorTable00"=dword:00362b00 -"ColorTable01"=dword:009e864e -"ColorTable02"=dword:004c947d -"ColorTable03"=dword:008a9650 -"ColorTable04"=dword:004241ac -"ColorTable05"=dword:007d5488 -"ColorTable06"=dword:004584d2 -"ColorTable07"=dword:00a1a193 -"ColorTable08"=dword:00d5e8ee -"ColorTable09"=dword:00b59f6a -"ColorTable10"=dword:0059a990 -"ColorTable11"=dword:00aab575 -"ColorTable12"=dword:005f5ec2 -"ColorTable13"=dword:009f75aa -"ColorTable14"=dword:0075bff4 -"ColorTable15"=dword:00f5f5f5 -"ColorTable16"=dword:00362b00 -"ColorTable17"=dword:00423607 -"ColorTable18"=dword:00756e58 -"ColorTable19"=dword:00837b65 -"ColorTable20"=dword:002f32dc -"ColorTable21"=dword:00c4716c -"ColorTable22"=dword:00164bcb -"ColorTable23"=dword:00d5e8ee -"ColorTable24"=dword:00a1a193 -"ColorTable25"=dword:00d28b26 -"ColorTable26"=dword:00009985 -"ColorTable27"=dword:0098a12a -"ColorTable28"=dword:00969483 -"ColorTable29"=dword:008236d3 -"ColorTable30"=dword:000089b5 -"ColorTable31"=dword:00e3f6fd -"ExtendColors"=hex:00 -"ExtendColorIdx"=hex:0e -"OverrideExtendFonts"=hex:01 -"ExtendFonts"=hex:00 -"ExtendFontNormalIdx"=hex:01 -"ExtendFontBoldIdx"=hex:0c -"ExtendFontItalicIdx"=hex:0d -"OverrideCursor"=hex:01 -"CursorType"=hex:01 -"CursorColor"=hex:00 -"CursorBlink"=hex:01 -"CursorBlockInactive"=hex:01 -"TrueColorerSupport"=hex:01 -"FadeInactive"=hex:01 -"FadeInactiveLow"=hex:00 -"FadeInactiveHigh"=hex:d0 -"ConVisible"=hex:00 -"ConInMode"=dword:ffffffff -"UseInjects"=hex:01 -"CmdLine"="" -"Multi"=hex:01 -"Multi.Modifier"=dword:0000005b -"Multi.NewConsole"=dword:00001154 -"Multi.Next"=dword:80808000 -"Multi.Recreate"=dword:00105bc0 -"Multi.Close"=dword:00001173 -"Multi.CmdKey"=dword:80808000 -"Multi.NewConfirm"=hex:01 -"Multi.Buffer"=hex:41 -"Multi.UseArrows"=hex:00 -"Multi.UseNumbers"=hex:00 -"Multi.UseWinTab"=hex:00 -"Multi.AutoCreate"=hex:00 -"Multi.LeaveOnClose"=hex:00 -"Multi.Iterate"=hex:01 -"MinimizeRestore"=dword:001011c0 -"KeyboardHooks"=hex:01 -"FontName"="Source Code Pro Semibold" -"FontName2"="Source Code Pro Semibold" -"FontAutoSize"=hex:00 -"FontSize"=dword:00000012 -"FontSizeX"=dword:00000000 -"FontSizeX2"=dword:00000000 -"FontSizeX3"=dword:00000000 -"FontCharSet"=hex:00 -"Anti-aliasing"=dword:00000004 -"FontBold"=hex:00 -"FontItalic"=hex:00 -"Monospace"=hex:01 -"BackGround Image show"=hex:00 -"BackGround Image"="c:\\back.bmp" -"bgImageDarker"=hex:ff -"bgImageColors"=dword:ffffffff -"bgOperation"=hex:00 -"bgPluginAllowed"=hex:01 -"AlphaValue"=hex:ff -"UserScreenTransparent"=hex:00 -"WindowMode"=dword:0000051f -"HideCaption"=hex:00 -"HideCaptionAlways"=hex:01 -"HideCaptionAlwaysFrame"=hex:00 -"HideCaptionAlwaysDelay"=dword:000007d0 -"HideCaptionAlwaysDisappear"=dword:000007d0 -"DownShowHiddenMessage"=hex:00 -"ConsoleFontName"="Lucida Console" -"ConsoleFontWidth"=dword:00000003 -"ConsoleFontHeight"=dword:00000005 -"DefaultBufferHeight"=dword:00001388 -"AutoBufferHeight"=hex:01 -"CmdOutputCP"=dword:00000000 -"ConsoleTextSelection"=hex:01 -"CTS.SelectBlock"=hex:01 -"CTS.VkBlock"=hex:a4 -"CTS.VkBlockStart"=dword:00000000 -"CTS.SelectText"=hex:01 -"CTS.VkText"=hex:00 -"CTS.VkTextStart"=dword:00000000 -"CTS.ActMode"=hex:02 -"CTS.VkAct"=hex:00 -"CTS.RBtnAction"=hex:03 -"CTS.MBtnAction"=hex:00 -"CTS.ColorIndex"=hex:e0 -"FarGotoEditor"=hex:01 -"FarGotoEditorVk"=hex:a2 -"FixFarBorders"=hex:01 -"FixFarBordersRanges"="2013-25C4;" -"ExtendUCharMap"=hex:01 -"EnhanceGraphics"=hex:01 -"EnhanceButtons"=hex:00 -"PartBrush75"=hex:c8 -"PartBrush50"=hex:96 -"PartBrush25"=hex:5a -"PartBrushBlack"=hex:20 -"RightClick opens context menu"=hex:02 -"RightClickMacro2"="" -"AltEnter"=hex:00 -"AltSpace"=hex:00 -"SendAltTab"=hex:00 -"SendAltEsc"=hex:00 -"SendAltPrintScrn"=hex:00 -"SendPrintScrn"=hex:00 -"SendCtrlEsc"=hex:00 -"SendAltF9"=hex:00 -"Min2Tray"=hex:00 -"AlwaysShowTrayIcon"=hex:00 -"SafeFarClose"=hex:01 -"SafeFarCloseMacro"="" -"FARuseASCIIsort"=hex:00 -"ShellNoZoneCheck"=hex:00 -"FixAltOnAltTab"=hex:00 -"DisableMouse"=hex:00 -"RSelectionFix"=hex:01 -"MouseSkipActivation"=hex:01 -"MouseSkipMoving"=hex:01 -"FarHourglass"=hex:01 -"FarHourglassDelay"=dword:000001f4 -"Dnd"=hex:01 -"DndLKey"=hex:00 -"DndRKey"=hex:a2 -"DndDrop"=hex:01 -"DefCopy"=hex:01 -"DragOverlay"=hex:01 -"DragShowIcons"=hex:01 -"DebugSteps"=hex:01 -"DragPanel"=hex:02 -"DragPanelBothEdges"=hex:00 -"KeyBarRClick"=hex:01 -"Tabs"=hex:01 -"TabSelf"=hex:01 -"TabLazy"=hex:00 -"TabRecent"=hex:00 -"TabsOnTaskBar"=hex:00 -"TabCloseMacro"="" -"TabFontFace"="Consolas" -"TabFontCharSet"=dword:00000000 -"TabFontHeight"=dword:0000000e -"SaveAllEditors"="" -"TabFrame"=hex:01 -"TabMargins"=hex:00,00,00,00,19,00,00,00,00,00,00,00,00,00,00,00 -"ToolbarAddSpace"=dword:00000000 -"TabConsole"="%s" -"TabEditor"="<%c.%i>{%s}" -"TabEditorModified"="<%c.%i>[%s] *" -"TabViewer"="<%c.%i>[%s]" -"TabLenMax"=dword:00000014 -"AdminTitleSuffix"=" (Admin)" -"AdminShowShield"=hex:01 -"HideInactiveConsoleTabs"=hex:00 -"ShowFarWindows"=hex:01 -"TryToCenter"=hex:00 -"ShowScrollbar"=hex:02 -"IconID"=dword:00000001 -"ConWnd Width"=dword:00000069 -"ConWnd Height"=dword:0000003d -"16bit Height"=dword:00000000 -"ConWnd X"=dword:000007e7 -"ConWnd Y"=dword:00000028 -"Cascaded"=hex:01 -"AutoSaveSizePos"=hex:00 -"MainTimerElapse"=dword:0000000a -"MainTimerInactiveElapse"=dword:000003e8 -"AffinityMask"=dword:00000000 -"SkipFocusEvents"=hex:00 -"MonitorConsoleLang"=hex:03 -"DesktopMode"=hex:00 -"AlwaysOnTop"=hex:00 -"SleepInBackground"=hex:00 -"DisableFarFlashing"=hex:00 -"DisableAllFlashing"=hex:00 -"PanView.BackColor"=dword:30ffffff -"PanView.PFrame"=dword:00000001 -"PanView.PFrameColor"=dword:28808080 -"PanView.SFrame"=dword:00000001 -"PanView.SFrameColor"=dword:07c0c0c0 -"PanView.Thumbs.ImgSize"=dword:00000060 -"PanView.Thumbs.SpaceX1"=dword:00000001 -"PanView.Thumbs.SpaceY1"=dword:00000001 -"PanView.Thumbs.SpaceX2"=dword:00000005 -"PanView.Thumbs.SpaceY2"=dword:00000014 -"PanView.Thumbs.LabelSpacing"=dword:00000002 -"PanView.Thumbs.LabelPadding"=dword:00000000 -"PanView.Thumbs.FontName"="Tahoma" -"PanView.Thumbs.FontHeight"=dword:0000000e -"PanView.Tiles.ImgSize"=dword:00000030 -"PanView.Tiles.SpaceX1"=dword:00000004 -"PanView.Tiles.SpaceY1"=dword:00000004 -"PanView.Tiles.SpaceX2"=dword:000000ac -"PanView.Tiles.SpaceY2"=dword:00000004 -"PanView.Tiles.LabelSpacing"=dword:00000004 -"PanView.Tiles.LabelPadding"=dword:00000001 -"PanView.Tiles.FontName"="Tahoma" -"PanView.Tiles.FontHeight"=dword:0000000e -"PanView.LoadPreviews"=hex:03 -"PanView.LoadFolders"=hex:01 -"PanView.LoadTimeout"=dword:0000000f -"PanView.MaxZoom"=dword:00000258 -"PanView.UsePicView2"=hex:01 -"PanView.RestoreOnStartup"=hex:00 -"Update.VerLocation"="" -"Update.CheckOnStartup"=hex:01 -"Update.CheckHourly"=hex:00 -"Update.ConfirmDownload"=hex:00 -"Update.UseBuilds"=hex:02 -"Update.UseProxy"=hex:00 -"Update.Proxy"="" -"Update.ProxyUser"="" -"Update.ProxyPassword"="" -"Update.DownloadSetup"=hex:00 -"Update.ExeCmdLine"="" -"Update.ArcCmdLine"="" -"Update.DownloadPath"="%TEMP%\\ConEmu" -"Update.LeavePackages"=hex:00 -"Update.PostUpdateCmd"="echo Last successful update>ConEmuUpdate.info && date /t>>ConEmuUpdate.info && time /t>>ConEmuUpdate.info" -"TextColorIdx"=hex:10 -"BackColorIdx"=hex:10 -"PopTextColorIdx"=hex:10 -"PopBackColorIdx"=hex:10 -"CursorTypeActive"=dword:000232c2 -"CursorTypeInactive"=dword:00823283 -"ClipboardDetectLineEnd"=hex:01 -"ClipboardBashMargin"=hex:00 -"ClipboardTrimTrailing"=hex:02 -"ClipboardEOL"=hex:00 -"ClipboardArrowStart"=hex:01 -"ClipboardAllLines"=hex:01 -"ClipboardFirstLine"=hex:01 -"ClipboardClickPromptPosition"=hex:02 -"ClipboardDeleteLeftWord"=hex:02 -"SetDefaultTerminal"=hex:00 -"SetDefaultTerminalStartup"=hex:00 -"DefaultTerminalNoInjects"=hex:00 -"DefaultTerminalConfirm"=hex:01 -"DefaultTerminalApps"="explorer.exe" -"ProcessAnsi"=hex:01 -"UseClink"=hex:01 -"StartType"=hex:02 -"StartTasksFile"="" -"StartTasksName"="{Development}" -"StartFarFolders"=hex:00 -"StartFarEditors"=hex:00 -"StoreTaskbarkTasks"=hex:01 -"StoreTaskbarCommands"=hex:00 -"SingleInstance"=hex:01 -"Multi.ShowButtons"=hex:01 -"Multi.NumberInCaption"=hex:00 -"Multi.CloseConfirm"=hex:00 -"Multi.CloseEditViewConfirm"=hex:00 -"Multi.HideOnClose"=hex:01 -"Multi.MinByEsc"=hex:02 -"MapShiftEscToEsc"=hex:01 -"Multi.SplitWidth"=hex:04 -"Multi.SplitHeight"=hex:04 -"AlphaValueSeparate"=hex:00 -"AlphaValueInactive"=hex:ff -"ColorKeyTransparent"=hex:00 -"ColorKeyValue"=dword:00010101 -"UseCurrentSizePos"=hex:01 -"QuakeStyle"=hex:00 -"QuakeAnimation"=dword:0000012c -"HideChildCaption"=hex:01 -"FocusInChildWindows"=hex:01 -"ComSpec.Type"=hex:00 -"ComSpec.Bits"=hex:00 -"ComSpec.UpdateEnv"=hex:00 -"ComSpec.EnvAddPath"=hex:01 -"ComSpec.UncPaths"=hex:00 -"ComSpec.Path"="" -"CTS.AutoCopy"=hex:01 -"CTS.EndOnTyping"=hex:00 -"CTS.EndOnKeyPress"=hex:00 -"CTS.Freeze"=hex:00 -"ClipboardConfirmEnter"=hex:00 -"ClipboardConfirmLonger"=dword:00000000 -"FarGotoEditorOpt"=hex:01 -"FarGotoEditorPath"="far.exe /e%1:%2 \"%3\"" -"DropUseMenu"=hex:02 -"StatusBar.Show"=hex:01 -"StatusBar.Flags"=dword:00000000 -"StatusFontFace"="Source Code Pro Black" -"StatusFontCharSet"=dword:00000000 -"StatusFontHeight"=dword:00000010 -"StatusBar.Color.Back"=dword:00a1a193 -"StatusBar.Color.Light"=dword:00303030 -"StatusBar.Color.Dark"=dword:00b0b0a4 -"StatusBar.Hide.VCon"=hex:00 -"StatusBar.Hide.CapsL"=hex:00 -"StatusBar.Hide.NumL"=hex:00 -"StatusBar.Hide.ScrL"=hex:00 -"StatusBar.Hide.Lang"=hex:01 -"StatusBar.Hide.WPos"=hex:01 -"StatusBar.Hide.WSize"=hex:01 -"StatusBar.Hide.WClient"=hex:01 -"StatusBar.Hide.WWork"=hex:01 -"StatusBar.Hide.Style"=hex:01 -"StatusBar.Hide.StyleEx"=hex:01 -"StatusBar.Hide.hFore"=hex:01 -"StatusBar.Hide.hFocus"=hex:01 -"StatusBar.Hide.ABuf"=hex:00 -"StatusBar.Hide.CPos"=hex:01 -"StatusBar.Hide.CSize"=hex:01 -"StatusBar.Hide.BSize"=hex:00 -"StatusBar.Hide.CurX"=hex:00 -"StatusBar.Hide.CurY"=hex:01 -"StatusBar.Hide.CurS"=hex:01 -"StatusBar.Hide.CurI"=hex:01 -"StatusBar.Hide.ConEmuPID"=hex:01 -"StatusBar.Hide.ConEmuHWND"=hex:01 -"StatusBar.Hide.ConEmuView"=hex:01 -"StatusBar.Hide.Srv"=hex:00 -"StatusBar.Hide.SrvHWND"=hex:01 -"StatusBar.Hide.Transparency"=hex:01 -"StatusBar.Hide.New"=hex:00 -"StatusBar.Hide.Sync"=hex:00 -"StatusBar.Hide.Proc"=hex:00 -"StatusBar.Hide.Title"=hex:01 -"StatusBar.Hide.Resize"=hex:00 -"TabsLocation"=hex:00 -"TabDblClick"=dword:00000001 -"TaskBarOverlay"=hex:01 -"TabSkipWords"="Administrator:|Администратор:" -"TabPanels"="<%c> %s" -"CenterConsolePad"=dword:00000000 -"ScrollBarAppearDelay"=dword:00000064 -"ScrollBarDisappearDelay"=dword:000003e8 -"SnapToDesktopEdges"=hex:00 -"MinimizeOnLoseFocus"=hex:00 -"FindText"="full_name" -"FindMatchCase"=hex:00 -"FindMatchWholeWords"=hex:00 -"FindTransparent"=hex:01 -"Multi.ArrowsModifier"=dword:0000005b -"KeyMacroVersion"=hex:02 -"MinimizeRestore2"=dword:00000000 -"GlobalRestore"=dword:00000000 -"ForcedFullScreen"=dword:0000107a -"SwitchGuiFocus"=dword:00000000 -"SetFocusGui"=dword:00000000 -"SetFocusChild"=dword:00000000 -"ChildSystemMenu"=dword:00000000 -"Multi.NewConsoleShift"=dword:0000114e -"Multi.NewConsolePopup"=dword:80808000 -"Multi.NewWindow"=dword:0010114e -"Multi.NewSplitV"=dword:0010114f -"Multi.NewSplitH"=dword:00101145 -"Multi.NewAttach"=dword:80808000 -"Multi.NextShift"=dword:80808000 -"Multi.AltCon"=dword:00101141 -"Multi.Scroll"=dword:80808000 -"CloseTabKey"=dword:00001157 -"CloseGroupKey"=dword:00000000 -"TerminateProcessKey"=dword:80808000 -"DuplicateRootKey"=dword:00000000 -"CloseConEmuKey"=dword:00001273 -"Multi.Rename"=dword:00005d52 -"Multi.MoveLeft"=dword:00101121 -"Multi.MoveRight"=dword:00101122 -"Multi.ShowTabsList"=dword:00000000 -"Multi.ShowTabsList2"=dword:00005d7b -"ClipboardVkAllLines"=dword:00001156 -"ClipboardVkFirstLine"=dword:80808000 -"DeleteWordToLeft"=dword:00001108 -"FindTextKey"=dword:00001146 -"ScreenshotKey"=dword:80808000 -"ScreenshotFullKey"=dword:80808000 -"ShowStatusBarKey"=dword:00005d53 -"ShowTabBarKey"=dword:00005d54 -"ShowCaptionKey"=dword:00005d43 -"AlwaysOnTopKey"=dword:00000000 -"Key.TabMenu"=dword:00101150 -"Key.TabMenu2"=dword:00001002 -"Key.TabPane1"=dword:00005d09 -"Key.TabPane2"=dword:00105d09 -"Key.Maximize"=dword:80808000 -"Key.FullScreen"=dword:8080807a -"Key.SysMenu"=dword:00001220 -"Key.SysMenu2"=dword:00001102 -"Key.BufUp"=dword:00001126 -"Key.BufDn"=dword:00001128 -"Key.BufPgUp"=dword:00001121 -"Key.BufPgDn"=dword:00001122 -"Key.PicViewSlide"=dword:80808013 -"Key.PicViewSlower"=dword:808080bd -"Key.PicViewFaster"=dword:808080bb -"FontLargerKey"=dword:000011d0 -"FontSmallerKey"=dword:000011d1 -"PasteFileKey"=dword:00101146 -"PastePathKey"=dword:00101144 -"PasteCygwinKey"=dword:00005d2d -"Key.JumpPrevMonitor"=dword:00105b25 -"Key.JumpNextMonitor"=dword:00105b27 -"KeyMacro01"=dword:00001231 -"KeyMacro01.Text"="Tab(7, 1)" -"KeyMacro02"=dword:00001232 -"KeyMacro02.Text"="Tab(7, 2)" -"KeyMacro03"=dword:00001233 -"KeyMacro03.Text"="Tab(7, 3)" -"KeyMacro04"=dword:00001234 -"KeyMacro04.Text"="Tab(7, 4)" -"KeyMacro05"=dword:00001235 -"KeyMacro05.Text"="Tab(7, 5)" -"KeyMacro06"=dword:00001236 -"KeyMacro06.Text"="Tab(7, 6)" -"KeyMacro07"=dword:00001237 -"KeyMacro07.Text"="Tab(7, 7)" -"KeyMacro08"=dword:00001238 -"KeyMacro08.Text"="Tab(7, 8)" -"KeyMacro09"=dword:00001239 -"KeyMacro09.Text"="Tab(7, 9)" -"KeyMacro10"=dword:00000000 -"KeyMacro10.Text"="" -"KeyMacro11"=dword:00000000 -"KeyMacro11.Text"="" -"KeyMacro12"=dword:00000000 -"KeyMacro12.Text"="" -"KeyMacro13"=dword:00000000 -"KeyMacro13.Text"="" -"KeyMacro14"=dword:00000000 -"KeyMacro14.Text"="" -"KeyMacro15"=dword:00000000 -"KeyMacro15.Text"="" -"KeyMacro16"=dword:00000000 -"KeyMacro16.Text"="" -"KeyMacro17"=dword:00000000 -"KeyMacro17.Text"="" -"KeyMacro18"=dword:00000000 -"KeyMacro18.Text"="" -"KeyMacro19"=dword:00000000 -"KeyMacro19.Text"="" -"KeyMacro20"=dword:00000000 -"KeyMacro20.Text"="" -"KeyMacro21"=dword:00000000 -"KeyMacro21.Text"="" -"KeyMacro22"=dword:00000000 -"KeyMacro22.Text"="" -"KeyMacro23"=dword:00000000 -"KeyMacro23.Text"="" -"KeyMacro24"=dword:00000000 -"KeyMacro24.Text"="" -"KeyMacro25"=dword:00000000 -"KeyMacro25.Text"="" -"KeyMacro26"=dword:00000000 -"KeyMacro26.Text"="" -"KeyMacro27"=dword:00000000 -"KeyMacro27.Text"="" -"KeyMacro28"=dword:00000000 -"KeyMacro28.Text"="" -"KeyMacro29"=dword:00000000 -"KeyMacro29.Text"="" -"KeyMacro30"=dword:00000000 -"KeyMacro30.Text"="" -"KeyMacro31"=dword:00000000 -"KeyMacro31.Text"="" -"KeyMacro32"=dword:00000000 -"KeyMacro32.Text"="" -"CTS.VkPrompt"=hex:a0 -"WndDragKey"=dword:00121101 -"ComSpec.EnvAddExePath"=hex:01 -"CmdLineHistory"=hex(7):00,00 -"ShowHelpTooltips"=hex:01 -"IntegralSize"=hex:00 -"CTS.VkCopyAll"=dword:00000000 -"Key.TileToLeft"=dword:00005b25 -"Key.TileToRIght"=dword:00005b27 - -[HKEY_CURRENT_USER\Software\ConEmu\.Vanilla\Apps] -"Count"=dword:00000000 - -[HKEY_CURRENT_USER\Software\ConEmu\.Vanilla\Colors] -"Count"=dword:00000000 - -[HKEY_CURRENT_USER\Software\ConEmu\.Vanilla\Tasks] -"Count"=dword:00000004 - -[HKEY_CURRENT_USER\Software\ConEmu\.Vanilla\Tasks\Task1] -"Name"="{Development}" -"GuiArgs"="/single /Dir %userprofile%" -"Active"=dword:00000001 -"Count"=dword:00000003 -"Cmd1"=">*\"%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" \"-cur_console:a:t:PS\"" -"Cmd2"="\"%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -cur_console:t:PS" -"Cmd3"="%systemroot%\\SysWOW64\\cmd.exe /c \"\"%ProgramFiles(x86)%\\Git\\bin\\sh.exe\" --login -i\" \"-cur_console:t:Git Bash\"" -"Cmd4"="powershell " -"Cmd5"="* %SystemRoot%\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe" - -[HKEY_CURRENT_USER\Software\ConEmu\.Vanilla\Tasks\Task2] -"Name"="{Powershell Admin}" -"GuiArgs"="/single /Dir %userprofile%" -"Cmd1"="*\"%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -cur_console:a:t:PS" -"Active"=dword:00000000 -"Count"=dword:00000001 - -[HKEY_CURRENT_USER\Software\ConEmu\.Vanilla\Tasks\Task3] -"Name"="{Powershell Non-Admin}" -"GuiArgs"="/single /Dir %userprofile%" -"Cmd1"="\"%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe\" -cur_console:t:PS" -"Active"=dword:00000000 -"Count"=dword:00000001 - -[HKEY_CURRENT_USER\Software\ConEmu\.Vanilla\Tasks\Task4] -"Name"="{Git Bash}" -"GuiArgs"="/single /Dir %userprofile% /icon \"%ProgramFiles(x86)%\\Git\\etc\\git.ico\"" -"Cmd1"="%systemroot%\\SysWOW64\\cmd.exe /c \"\"%ProgramFiles(x86)%\\Git\\bin\\sh.exe\" --login -i\" \"-cur_console:t:Git Bash\" " -"Active"=dword:00000000 -"Count"=dword:00000001 - -[HKEY_CURRENT_USER\Software\ConEmu\shell] -"CmdLineHistory"=hex(7):00,00 - diff --git a/EthanBrown.ConEmuConfig/tools/ConEmu.xml b/EthanBrown.ConEmuConfig/tools/ConEmu.xml deleted file mode 100644 index 1afaf79..0000000 --- a/EthanBrown.ConEmuConfig/tools/ConEmu.xml +++ /dev/null @@ -1,527 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/EthanBrown.ConEmuConfig/tools/chocolateyInstall.ps1 b/EthanBrown.ConEmuConfig/tools/chocolateyInstall.ps1 deleted file mode 100644 index 9635f4c..0000000 --- a/EthanBrown.ConEmuConfig/tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -$package = 'EthanBrown.ConEmuConfig' - -try { - - function Get-CurrentDirectory - { - $thisName = $MyInvocation.MyCommand.Name - [IO.Path]::GetDirectoryName((Get-Content function:$thisName).File) - } - - Push-Location (Get-CurrentDirectory) - reg import .\ConEmu.reg - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package $($_.Exception.Message) - throw -} diff --git a/EthanBrown.ConEmuConfig/tools/export.bat b/EthanBrown.ConEmuConfig/tools/export.bat deleted file mode 100644 index b4963c3..0000000 --- a/EthanBrown.ConEmuConfig/tools/export.bat +++ /dev/null @@ -1 +0,0 @@ -reg export HKCU\Software\ConEmu ConEmu.reg diff --git a/EthanBrown.DevTools.Web/Content/content.txt b/EthanBrown.DevTools.Web/Content/content.txt deleted file mode 100644 index 6101509..0000000 --- a/EthanBrown.DevTools.Web/Content/content.txt +++ /dev/null @@ -1 +0,0 @@ -This file is used to work around Nuget peculiarities - http://danlimerick.wordpress.com/2011/10/01/getting-around-nugets-external-package-dependency-problem/ diff --git a/EthanBrown.DevTools.Web/EthanBrown.DevTools.Web.nuspec b/EthanBrown.DevTools.Web/EthanBrown.DevTools.Web.nuspec deleted file mode 100644 index 19f6fcd..0000000 --- a/EthanBrown.DevTools.Web/EthanBrown.DevTools.Web.nuspec +++ /dev/null @@ -1,69 +0,0 @@ - - - - EthanBrown.DevTools.Web - EthanBrown.DevTools.Web - 0.3.1 - Ethan Brown - Ethan Brown - Batteries included web development tool stack for Windows. - Batteries included web development tool stack for Windows. Includes Git, Node.js, Ruby, Chrome Canary, PhantomJS, Sublime Text 2 and a number of web-specific Sublime packages amongst a host of other tools. - http://github.com/Iristyle/ChocolateyPackages/ - nodejs conemu git powershell font sublimetext2 - - https://raw.github.com/Iristyle/ChocolateyPackages/master/LICENSE.md - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - For Ruby: Bundler, Capistrano, Twig - For Node: coffee-script coffeelint bower grunt-cli http-server jshint codo recess csslint - - Configures a number of Git settings, such as Notepad++ for - commit editor, DiffMerge as diff / merge tool, and core.autocrlf - to true. - - Additionally includes a number of very useful Git aliases. - - - - - - - diff --git a/EthanBrown.DevTools.Web/Tools/chocolateyInstall.ps1 b/EthanBrown.DevTools.Web/Tools/chocolateyInstall.ps1 deleted file mode 100644 index ae73a7b..0000000 --- a/EthanBrown.DevTools.Web/Tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,60 +0,0 @@ -$package = 'EthanBrown.DevTools.Web' - -try { - - # simulate the unix command for finding things in path - # http://stackoverflow.com/questions/63805/equivalent-of-nix-which-command-in-powershell - function Which([string]$cmd) - { - Get-Command -ErrorAction "SilentlyContinue" $cmd | - Select -ExpandProperty Definition - } - - # "External packages cannot depend on packages that target projects." - # http://nuget.codeplex.com/workitem/595 - - # install required NPM packages - $packages = @( - 'coffee-script@1.6.2', - 'coffeelint@0.5.4', - 'bower@0.9.2', - 'grunt-cli@0.1.8', - 'http-server@0.5.3', - 'jshint@2.0.1', - 'codo@1.7.0', - 'recess@1.1.6', - 'csslint@0.9.10' - ) - - $npmDefault = Join-Path $Env:ProgramFiles 'nodejs\npm.cmd' - $npm = (Which npm), - $npmDefault | - ? { Test-Path $_ } | - Select -First 1 - - if ($npm) - { - &$npm install -g $packages - } - else - { - $msg = @" -Could not find NodeJS NPM to install global packages: -Please install these packages in a command prompt that has access to npm.cmd - -npm install -g $packages -"@ - Write-Warning $msg - } - - # install required gems - gem update --system - gem install bundler --version '=1.3.5' - gem install capistrano --version '=2.14.2' - gem install twig --version '=1.2' - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package $($_.Exception.Message) - throw -} diff --git a/EthanBrown.GitAliases/EthanBrown.GitAliases.nuspec b/EthanBrown.GitAliases/EthanBrown.GitAliases.nuspec deleted file mode 100644 index 397c5b2..0000000 --- a/EthanBrown.GitAliases/EthanBrown.GitAliases.nuspec +++ /dev/null @@ -1,50 +0,0 @@ - - - - EthanBrown.GitAliases - Git - Aliases - 0.0.5 - Various - Ethan Brown - Git aliases - My standard Git aliases - - aliases = config --get-regexp alias - amend = commit --amend - bl = blame -w -M -C - bra = branch -rav - branches = branch -rav - changed = status -sb - f = !git ls-files | grep -i - filelog = log -u - hist = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) [%an]%Creset' --abbrev-commit --date=relative - last = log -p --max-count=1 --word-diff - lastref = rev-parse --short HEAD - lasttag = describe --tags --abbrev=0 - pick = add -p - remotes = remote -v show - stage = add - standup = log --since yesterday --oneline --author {ME} - stats = diff --stat - sync = ! git fetch upstream -v && git fetch origin -v && git checkout master && git merge upstream/master - undo = reset head~ - unstage = reset HEAD - wdiff = diff --word-diff - who = shortlog -s -e -- - - http://github.com/Iristyle/ChocolateyPackages/ - Git - - false - https://github.com/ferventcoder/chocolateyautomaticpackages/raw/master/git/git.png - - - - - - - - - diff --git a/EthanBrown.GitAliases/tools/chocolateyInstall.ps1 b/EthanBrown.GitAliases/tools/chocolateyInstall.ps1 deleted file mode 100644 index a5a1b17..0000000 --- a/EthanBrown.GitAliases/tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,44 +0,0 @@ -$package = 'EthanBrown.GitAliases' - -try { - # partially inspired by - # https://git.wiki.kernel.org/index.php/Aliases - # https://gist.github.com/oli/1637874 - # https://gist.github.com/bradwilson/4215933 - - git config --global alias.aliases 'config --get-regexp alias' - git config --global alias.amend 'commit --amend' - git config --global alias.bl 'blame -w -M -C' - git config --global alias.bra 'branch -rav' - git config --global alias.branches 'branch -rav' - git config --global alias.changed 'status -sb' - git config --global alias.f '!git ls-files | grep -i' - git config --global alias.filelog 'log -u' - git config --global alias.hist "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) [%an]%Creset' --abbrev-commit --date=relative" - git config --global alias.last 'log -p --max-count=1 --word-diff' - git config --global alias.lastref 'rev-parse --short HEAD' - git config --global alias.lasttag 'describe --tags --abbrev=0' - git config --global alias.pick 'add -p' - git config --global alias.remotes 'remote -v show' - git config --global alias.stage 'add' - $userName = git config --global --get user.name - if ($userName) - { - git config --global alias.standup "log --since yesterday --oneline --author $userName" - } - else - { - Write-Warning "Set git global username with git config --global user.name 'foo' to use standup" - } - git config --global alias.stats 'diff --stat' - git config --global alias.sync '! git fetch upstream -v && git fetch origin -v && git checkout master && git merge upstream/master' - git config --global alias.undo 'reset head~' - git config --global alias.unstage 'reset HEAD' - git config --global alias.wdiff 'diff --word-diff' - git config --global alias.who 'shortlog -s -e --' - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/EthanBrown.GitAliases/tools/chocolateyUninstall.ps1 b/EthanBrown.GitAliases/tools/chocolateyUninstall.ps1 deleted file mode 100644 index da4a2f7..0000000 --- a/EthanBrown.GitAliases/tools/chocolateyUninstall.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -$package = 'EthanBrown.GitAliases' - -try { - Write-Host "Manually edit $ENV:USERPROFILE\.gitconfig to revert package changes" - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/EthanBrown.GitConfiguration/EthanBrown.GitConfiguration.nuspec b/EthanBrown.GitConfiguration/EthanBrown.GitConfiguration.nuspec deleted file mode 100644 index f407b3f..0000000 --- a/EthanBrown.GitConfiguration/EthanBrown.GitConfiguration.nuspec +++ /dev/null @@ -1,40 +0,0 @@ - - - - EthanBrown.GitConfiguration - Git - Development Configuration - 0.0.4 - Various - Ethan Brown - Git configuration for Windows. - Very simple set of standard Git config on Windows - - core.autocrlf true - core.safecrlf false - rebase.autosquash true - help.format html - push.default simple - core.editor Notepad++ - - diff.tool DiffMerge - diff.guitool DiffMerge - merge.tool DiffMerge - - http://github.com/Iristyle/ChocolateyPackages/ - Git - - false - https://github.com/ferventcoder/chocolateyautomaticpackages/raw/master/git/git.png - - - - - - - - - - - diff --git a/EthanBrown.GitConfiguration/tools/chocolateyInstall.ps1 b/EthanBrown.GitConfiguration/tools/chocolateyInstall.ps1 deleted file mode 100644 index 0178014..0000000 --- a/EthanBrown.GitConfiguration/tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,51 +0,0 @@ -$package = 'EthanBrown.GitConfiguration' - -try { - # Set up git diff/merge tool - git config --global mergetool.DiffMerge.cmd '\"C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe\" --merge --result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\" --title1=\"Mine\" --title2=\"Merging to: $MERGED\" --title3=\"Theirs\"' - git config --global mergetool.DiffMerge.trustExitCode true - git config --global difftool.DiffMerge.cmd '\"C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe\" \"$LOCAL\" \"$REMOTE\" --title1=\"Previous Version ($LOCAL)\" --title2=\"Current Version ($REMOTE)\"' - - $defaultMerge = git config --get merge.tool - if (!$defaultMerge -or ($defaultMerge -match 'kdiff')) - { - git config --global merge.tool DiffMerge - } - git config --global mergetool.keepBackup false - git config --global mergetool.prompt false - - $defaultDiff = git config --get diff.tool - if (!$defaultDiff -or ($defaultDiff -match 'kdiff')) - { - git config --global diff.tool DiffMerge - } - $defaultDiff = git config --get diff.guitool - if (!$defaultDiff -or ($defaultDiff -match 'kdiff')) - { - git config --global diff.guitool DiffMerge - } - git config --global difftool.prompt false - - $defaultPush = git config --get push.default - if (!$defaultPush) - { - git config --global push.default simple - } - - git config --global core.autocrlf true - git config --global core.safecrlf false - $defaultEditor = git config --get core.editor - if (!$defaultEditor) - { - git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugins" - } - - git config --global pack.packSizeLimit 2g - git config --global help.format html - git config --global rebase.autosquash true - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/EthanBrown.GitConfiguration/tools/chocolateyUninstall.ps1 b/EthanBrown.GitConfiguration/tools/chocolateyUninstall.ps1 deleted file mode 100644 index cf34564..0000000 --- a/EthanBrown.GitConfiguration/tools/chocolateyUninstall.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -$package = 'EthanBrown.GitConfiguration' - -try { - Write-Host "Manually edit $ENV:USERPROFILE\.gitconfig to revert package changes" - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/EthanBrown.GitExtensionsConfiguration/EthanBrown.GitExtensionsConfiguration.nuspec b/EthanBrown.GitExtensionsConfiguration/EthanBrown.GitExtensionsConfiguration.nuspec deleted file mode 100644 index 314ed30..0000000 --- a/EthanBrown.GitExtensionsConfiguration/EthanBrown.GitExtensionsConfiguration.nuspec +++ /dev/null @@ -1,37 +0,0 @@ - - - - EthanBrown.GitExtensionsConfiguration - GitExtensions - Configuration - 0.0.1 - Various - Ethan Brown - GitExtensions configuration for Windows. - Very simple set of standard GitExtensions configuration options - - - SourceCodePro for diff font - - Max 50 characters for first line of commit - - Max 72 characters on subsequent lines - - 2nd line of commit must be empty - - Show repository status in browse dialog (number of changes in toolbar) - - Show current working dir changes in revision graph - - Use FileSystemWatcher to check if index is changed - - Show stash count on status bar in browse window - - http://github.com/Iristyle/ChocolateyPackages/ - Git font - - false - https://raw.github.com/ferventcoder/chocolateyautomaticpackages/master/gitextensions/gitextensions.png - - - - - - - - - - diff --git a/EthanBrown.GitExtensionsConfiguration/tools/chocolateyInstall.ps1 b/EthanBrown.GitExtensionsConfiguration/tools/chocolateyInstall.ps1 deleted file mode 100644 index b1ac011..0000000 --- a/EthanBrown.GitExtensionsConfiguration/tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,26 +0,0 @@ -$package = 'EthanBrown.GitExtensionsConfiguration' - -try { - - $root = 'HKCU:\Software\GitExtensions\GitExtensions' - - @( - @{Name = 'difffont'; Value = 'Source Code Pro Semibold;9.75'; Type='String'} - @{Name = 'showstashcount'; Value = 'True'; Type = 'String'}, - @{Name = 'CommitValidationMaxCntCharsFirstLine'; Value = 50; Type = 'DWORD'}, - @{Name = 'CommitValidationMaxCntCharsPerLine'; Value = 72; Type = 'DWORD'}, - @{Name = 'CommitValidationSecondLineMustBeEmpty'; Value = 'True'; Type = 'String'}, - @{Name = 'CommitTemplates'; Value = '512:AAEAAAD/////AQAAAAAAAAAMAgAAAD1HaXRVSSwgVmVyc2lvbj0yLjQzLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1udWxsBwEAAAAAAQAAAAUAAAAEGEdpdFVJLkNvbW1pdFRlbXBsYXRlSXRlbQIAAAAJAwAAAAkEAAAACQUAAAAJBgAAAAkHAAAABQMAAAAYR2l0VUkuQ29tbWl0VGVtcGxhdGVJdGVtAgAAAAROYW1lBFRleHQBAQIAAAAGCAAAABdTdGFuZGFyZCBHaXQgQ29tbWl0IExvZwYJAAAAAAEEAAAAAwAAAAkJAAAACQkAAAABBQAAAAMAAAAJCQAAAAkJAAAAAQYAAAADAAAACQkAAAAJCQAAAAEHAAAAAwAAAAkJAAAACQkAAAALAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA='; Type = 'String'}, - @{Name = 'revisiongraphshowworkingdirchanges'; Value = 'True'; Type = 'String'}, - @{Name = 'showgitstatusinbrowsetoolbar'; Value = 'True'; Type = 'String'}, - @{Name = 'usefastchecks'; Value = 'True'; Type = 'String'} - ) | - % { - Set-ItemProperty -Path $root -name $_.Name -Type $_.Type -Value $_.Value - } - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/EthanBrown.GitExtensionsConfiguration/tools/chocolateyUninstall.ps1 b/EthanBrown.GitExtensionsConfiguration/tools/chocolateyUninstall.ps1 deleted file mode 100644 index e24af06..0000000 --- a/EthanBrown.GitExtensionsConfiguration/tools/chocolateyUninstall.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -$package = 'EthanBrown.GitExtensionsConfiguration' - -try { - Write-Host "Configure settings from the Git Extensions menu (Settings -> Settings) manually" - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/EthanBrown.SublimeText2.EditorPackages/EthanBrown.SublimeText2.EditorPackages.nuspec b/EthanBrown.SublimeText2.EditorPackages/EthanBrown.SublimeText2.EditorPackages.nuspec deleted file mode 100644 index 15e1828..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/EthanBrown.SublimeText2.EditorPackages.nuspec +++ /dev/null @@ -1,106 +0,0 @@ - - - - EthanBrown.SublimeText2.EditorPackages - Sublime Text 2 - Editor Enhancing Packages - 0.2.2 - Various - Ethan Brown - A number of packages helpful for increased editor productivity. - Includes a number of very useful packages for Sublime Text 2. - - Included - =========================================================================== - - - Abacus - https://github.com/khiltd/Abacus - - - Block Cursor Everywhere - https://github.com/ingshtrom/BlockCursorEverywhere - - - Bracketeer - https://github.com/colinta/SublimeBracketeer - - - BracketHighlighter - https://github.com/facelessuser/BracketHighlighter - - - Clipboard Manager - https://github.com/colinta/SublimeClipboardManager - - - EasyMotion - https://github.com/tednaleid/sublime-EasyMotion - - - ExportHtml - https://github.com/facelessuser/ExportHtml - - - FileDiffs - https://github.com/colinta/SublimeFileDiffs - - - LiveReload - https://github.com/dz0ny/LiveReload-sublimetext2 - - - Markdown Preview - https://github.com/revolunet/sublimetext-markdown-preview - - - Missing Palette Commands - https://github.com/fjl/Sublime-Missing-Palette-Commands - - - Related Files - https://github.com/fabiokr/sublime-related-files - - - SmartMarkdown - https://github.com/demon386/SmartMarkdown - - - Solarized Color Scheme - https://github.com/SublimeColors/Solarized - - - StringEncode - https://github.com/colinta/SublimeStringEncode - - - SublimeTODO - https://github.com/robcowie/SublimeTODO - - - TrailingSpaces - https://github.com/SublimeText/TrailingSpaces - - Customized Key Bindings - =========================================================================== - https://github.com/Iristyle/SublimeKeyMap.Editor - - Additional Package Preferences - =========================================================================== - BracketHighlighter - Coloring compatibility with Solarized - Markdown Preview - Uses github parser - Related Files - Settings for AngularJS projects - - Additional User Preferences - =========================================================================== - Rules for - - drawing whitespace - - ensuring 2 tab indent - - rulers at 50, 72, 80 and 120 - - use spaces everywhere - - trim whitespace on save - - 14 point Source Code Pro font - - line highlight - - http://github.com/Iristyle/ChocolateyPackages/ - SublimeText package editor - - false - https://raw.github.com/Iristyle/ChocolateyPackages/master/SublimeText2.app/Sublime_Text.png - * Use a local package cache to prevent first-time package restore / load errors - - - - - - - - - - - - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/EasyMotion.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/EasyMotion.sublime-settings deleted file mode 100644 index d9f2cbc..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/EasyMotion.sublime-settings +++ /dev/null @@ -1,4 +0,0 @@ -{ - // searches are case sensitive by default - "case_sensitive" : false -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/MarkdownPreview.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/MarkdownPreview.sublime-settings deleted file mode 100644 index a63b107..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/MarkdownPreview.sublime-settings +++ /dev/null @@ -1,10 +0,0 @@ -{ - /* - Sets the default parser for converting markdown to html. - Warning for github API : if you have a ST2 linux build, Python is not built with SSL o it may not work - - default - Use the builtin python-markdown2 parser - github - User github API to convert markdown, so you can use GitHub flavored Markdown, see http://github.github.com/github-flavored-markdown/ - */ - "parser": "github" -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/Package Control.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/Package Control.sublime-settings deleted file mode 100644 index e785b4a..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/Package Control.sublime-settings +++ /dev/null @@ -1,30 +0,0 @@ -{ - "installed_packages": - [ - "Abacus", - "Block Cursor Everywhere", - "Bracketeer", - "BracketHighlighter", - "Clipboard Manager", - "EasyMotion", - "ExportHtml", - "FileDiffs", - "LiveReload", - "Markdown Preview", - "Missing Palette Commands", - "Related Files", - "SmartMarkdown", - "Solarized Color Scheme", - "StringEncode", - "SublimeTODO", - "TrailingSpaces", - "ZZZ.EthanBrown.SublimeKeyMap.Editor" - ], - "package_name_map": { - "SublimeKeyMap.Editor": "ZZZ.EthanBrown.SublimeKeyMap.Editor" - }, - "repositories": - [ - "https://github.com/Iristyle/SublimeKeyMap.Editor" - ] -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/.gitignore b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/.gitignore deleted file mode 100644 index e43b0f9..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.DS_Store diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Abacus.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Abacus.py deleted file mode 100644 index 25442d6..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Abacus.py +++ /dev/null @@ -1,213 +0,0 @@ -import sublime, sublime_plugin, re, sys -from string import Template - -class AbacusCommand(sublime_plugin.TextCommand): - """ - Main entry point. Find candidates for alignment, - calculate appropriate column widths, and then - perform a series of replacements. - """ - def run(self, edit): - candidates = [] - separators = sublime.load_settings("Abacus.sublime-settings").get("com.khiltd.abacus.separators") - syntax_specific = self.view.settings().get("com.khiltd.abacus.separators", []) - indentor = Template("$indentation$left_col") - lg_aligner = Template("$left_col$separator") - rg_aligner = Template("$left_col$gutter$separator_padding$separator") - - #Run through the separators accumulating alignment candidates - #starting with the longest ones i.e. '==' before '='. - longest_first = self.sort_separators(syntax_specific + [sep for sep in separators if sep["token"] not in [t["token"] for t in syntax_specific]]) - - #Favor those that lean right so assignments with slice notation in them - #get handled sanely - for separator in [righty for righty in longest_first if righty["gravity"] == "right"]: - self.find_candidates_for_separator(separator, candidates) - - for separator in [lefty for lefty in longest_first if lefty["gravity"] == "left"]: - self.find_candidates_for_separator(separator, candidates) - - #After accumulation is done, figure out what the minimum required - #indentation and column width is going to have to be to make every - #candidate happy. - max_indent, max_left_col_width = self.calc_left_col_width(candidates) - - #Perform actual alignments based on gravitational affinity of separators - for candidate in candidates: - indent = 0 - if not candidate["preserve_indent"]: - indent = max_indent - else: - indent = candidate["adjusted_indent"] - - sep_width = len(candidate["separator"]) - right_col = candidate["right_col"].strip() - left_col = indentor.substitute( indentation = " " * indent, - left_col = candidate["left_col"] ) - #Marry the separator to the proper column - if candidate["gravity"] == "left": - #Separator sits flush left - left_col = lg_aligner.substitute(left_col = left_col, - separator = candidate["separator"] ) - elif candidate["gravity"] == "right": - gutter_width = max_left_col_width + max_indent - len(left_col) - len(candidate["separator"]) - #Push the separator ONE separator's width over the tab boundary - left_col = rg_aligner.substitute( left_col = left_col, - gutter = " " * gutter_width, - separator_padding = " " * sep_width, - separator = candidate["separator"] ) - #Most sane people will want a space between the operator and the value. - right_col = " %s" % right_col - #Snap the left side together - left_col = left_col.ljust(max_indent + max_left_col_width) - candidate["replacement"] = "%s%s\n" % (left_col, right_col) - - #Replace each line in its entirety - full_line = self.region_from_line_number(candidate["line"]) - #sys.stdout.write(candidate["replacement"]) - self.view.replace(edit, full_line, candidate["replacement"]) - - #Scroll and muck with the selection - if candidates: - self.view.sel().clear() - for region in [self.region_from_line_number(changed["line"]) for changed in candidates]: - start_of_right_col = region.begin() + max_indent + max_left_col_width - insertion_point = sublime.Region(start_of_right_col, start_of_right_col) - self.view.sel().add(insertion_point) - #self.view.show_at_center(insertion_point) - else: - sublime.status_message('Abacus - no alignment token found on selected line(s)') - - def sort_separators(self, separators): - return sorted(separators, key=lambda sep: -len(sep["token"])) - - def find_candidates_for_separator(self, separator, candidates): - """ - Given a particular separator, loop through every - line in the current selection looking for it and - add unique matches to a list. - """ - debug = sublime.load_settings("Abacus.sublime-settings").get("com.khiltd.abacus.debug") - token = separator["token"] - selection = self.view.sel() - new_candidates = [] - for region in selection: - for line in self.view.lines(region): - line_no = self.view.rowcol(line.begin())[0] - - #Never match a line more than once - if len([match for match in candidates if match["line"] == line_no]): - continue - - #Collapse any string literals that might - #also contain our separator token so that - #we can reliably find the location of the - #real McCoy. - line_content = self.view.substr(line) - collapsed = line_content - - for match in re.finditer(r"(\"[^\"]*(?' - #And remember that quoted strings were collapsed - #up above! - token_pos = None - safe_token = re.escape(token) - token_matcher = re.compile(r"(?= self.tab_width / 2: - initial_indent = self.snap_to_next_boundary(initial_indent, self.tab_width) - else: - initial_indent -= initial_indent % self.tab_width - candidate = { "line": line_no, - "original": line_content, - "separator": sep, - "gravity": separator["gravity"], - "adjusted_indent": initial_indent, - "preserve_indent": separator.get("preserve_indentation", False), - "left_col": left_col.lstrip(), - "right_col": right_col.rstrip() } - new_candidates.append(candidate) - #Poke more stuff in the accumulator - candidates.extend(new_candidates) - - def calc_left_col_width(self, candidates): - """ - Given a list of lines we've already matched against - one or more separators, loop through them all to - normalize their indentation and determine the minimum - possible column width that will accomodate them all - when aligned to a tab stop boundary. - """ - max_width = 0 - max_indent = 0 - max_sep_width = 0 - - for candidate in candidates: - max_indent = max([candidate["adjusted_indent"], max_indent]) - max_sep_width = max([len(candidate["separator"]), max_sep_width]) - max_width = max([len(candidate["left_col"].rstrip()), max_width]) - - max_width += max_sep_width - - #Bump up to the next multiple of tab_width - max_width = self.snap_to_next_boundary(max_width, self.tab_width) - - return max_indent, max_width - - @property - def tab_width(self): - """ - Exceptionally inefficient - """ - return int(self.view.settings().get('tab_size', 4)) - - def detab(self, input): - """ - Goodbye tabs! - """ - return input.expandtabs(self.tab_width) - - def region_from_line_number(self, line_number): - """ - Given a zero-based line number, return a region - encompassing it (including the newline). - """ - return self.view.full_line(self.view.text_point(line_number, 0)) - - def snap_to_next_boundary(self, value, interval): - """ - Alignment voodoo - """ - return value + (interval - value % interval) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Abacus.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Abacus.sublime-settings deleted file mode 100644 index 9c4843a..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Abacus.sublime-settings +++ /dev/null @@ -1,56 +0,0 @@ -{ - "com.khiltd.abacus.debug": true, - "com.khiltd.abacus.separators": - [ - { - "token": ":", - "gravity": "left", - "preserve_indentation": true - }, - { - "token": "=", - "gravity": "right", - "preserve_indentation": true - }, - { - "token": "+=", - "gravity": "right", - "preserve_indentation": true - }, - { - "token": "-=", - "gravity": "right", - "preserve_indentation": true - }, - { - "token": "*=", - "gravity": "right", - "preserve_indentation": true - }, - { - "token": "/=", - "gravity": "right", - "preserve_indentation": true - }, - { - "token": "?=", - "gravity": "right", - "preserve_indentation": true - }, - { - "token": "||=", - "gravity": "right", - "preserve_indentation": true - }, - { - "token": "%=", - "gravity": "right", - "preserve_indentation": true - }, - { - "token": "==", - "gravity": "right", - "preserve_indentation": true - } - ] -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/CSS.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/CSS.sublime-settings deleted file mode 100644 index dbb14e7..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/CSS.sublime-settings +++ /dev/null @@ -1,10 +0,0 @@ -{ - "com.khiltd.abacus.separators": - [ - { - "token": ":", - "gravity": "left", - "preserve_indentation": false - } - ] -} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Default (Linux).sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Default (Linux).sublime-keymap deleted file mode 100644 index 34bd3cb..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Default (Linux).sublime-keymap +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "keys": ["ctrl+alt+]"], "command": "abacus" - } -] - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Default (OSX).sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Default (OSX).sublime-keymap deleted file mode 100644 index 5a36030..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Default (OSX).sublime-keymap +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "keys": ["super+ctrl+alt+]"], "command": "abacus" - } -] - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Default (Windows).sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Default (Windows).sublime-keymap deleted file mode 100644 index 34bd3cb..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Default (Windows).sublime-keymap +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "keys": ["ctrl+alt+]"], "command": "abacus" - } -] - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Default.sublime-commands b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Default.sublime-commands deleted file mode 100644 index 2737802..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Default.sublime-commands +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "caption": "Abacus: align selection", - "command": "abacus" - } -] \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Main.sublime-menu b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Main.sublime-menu deleted file mode 100644 index 98f7058..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Main.sublime-menu +++ /dev/null @@ -1,97 +0,0 @@ -[ - { - "id": "selection", - "children": - [ - { "id": "abacus" }, - { - "command": "abacus", - "caption": "Abacus Align" - } - ] - }, - { - "caption": "Preferences", - "mnemonic": "n", - "id": "preferences", - "children": - [ - { - "caption": "Package Settings", - "mnemonic": "P", - "id": "package-settings", - "children": - [ - { - "caption": "Abacus", - "children": - [ - { - "command": "open_file", - "args": { "file": "${packages}/Abacus/Abacus.sublime-settings" }, - "caption": "Settings - Default" - }, - { - "command": "open_file", - "args": { "file": "${packages}/User/Abacus.sublime-settings" }, - "caption": "Settings - User" - }, - { - "command": "open_file_settings", - "caption": "Settings - Syntax Specific - User" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/Abacus/Default (Windows).sublime-keymap", - "platform": "Windows" - }, - "caption": "Key Bindings – Default" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/Abacus/Default (OSX).sublime-keymap", - "platform": "OSX" - }, - "caption": "Key Bindings – Default" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/Abacus/Default (Linux).sublime-keymap", - "platform": "Linux" - }, - "caption": "Key Bindings – Default" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/User/Default (Windows).sublime-keymap", - "platform": "Windows" - }, - "caption": "Key Bindings – User" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/User/Default (OSX).sublime-keymap", - "platform": "OSX" - }, - "caption": "Key Bindings – User" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/User/Default (Linux).sublime-keymap", - "platform": "Linux" - }, - "caption": "Key Bindings – User" - } - ] - } - ] - } - ] - } -] \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/PHP.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/PHP.sublime-settings deleted file mode 100644 index 60f1a00..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/PHP.sublime-settings +++ /dev/null @@ -1,10 +0,0 @@ -{ - "com.khiltd.abacus.separators": - [ - { - "token": "=>", - "gravity": "right", - "preserve_indentation": true - } - ] -} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Perl.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Perl.sublime-settings deleted file mode 100644 index 60f1a00..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Perl.sublime-settings +++ /dev/null @@ -1,10 +0,0 @@ -{ - "com.khiltd.abacus.separators": - [ - { - "token": "=>", - "gravity": "right", - "preserve_indentation": true - } - ] -} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/README.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/README.md deleted file mode 100644 index a1f9bfc..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/README.md +++ /dev/null @@ -1,59 +0,0 @@ -Abacus Alignment Plugin for Sublime Text 2 -================ - -![This work?](http://dl.dropbox.com/u/5514249/Abacus.gif) - -I'm pretty anal about aligning things in my code, but the alignment plugins I tried were more-or-less one-trick-ponies, and I didn't like any of their tricks, so I made my own. - -My one anal pony trick involves allowing you to slide the operator like an abacus bead, toward either the left or the right hand side, by giving each possible token a `gravity` property like so: - -``` json -{ - "com.khiltd.abacus.separators": - [ - { - "token": ":", - "gravity": "left", - "preserve_indentation": true - }, - { - "token": "=", - "gravity": "right", - "preserve_indentation": true - } - ] -} -``` - -Abacus focuses on aligning assignments in as language-agnostic a manner as possible and strives to address most of the open issues in that other, more popular plugin (it won't even jack up your Backbone routes!). It is, however, an *alignment* tool and *not* a full-blown beautifier. It works best when there's one assignment per line; if you like shoving dozens of CSS or JSON declarations on a single line then you are an enemy of readability and this plugin will make every effort to hinder and harm your creature on Earth as far as it is able. - -`preserve_indentation` is a tip that you might be working in a language where whitespace is significant, thereby suggesting that Abacus should make no effort to normalize indentation across lines. It's not foolproof, especially if you set your tab width really, really low, but it tries harder than Cory Doctorow ever has. OK, you're right... It would be impossible for anyone to try harder than that. - -Usage -============ - -Make a selection, then `command + option + control + ]`. - -Think the plugin's crazy? Add the following to your config: - -``` -"com.khiltd.abacus.debug": true -``` - -and Abacus will dump its thoughts out to Sublime Text's console like so: - -``` - margin:0; - ^ - padding:0; - ^ - border-style:none; - ^ -``` - -Caveats -============ - -I've used nothing but Macs since 1984 and do absolutely **no** testing in Windows or Ububian's window manager of the minute. If something's broken in some OS I don't own, you'll need to have a suggestion as to how it can be fixed as I'm unlikely to have any idea what you're talking about. - -I don't care if you like real tabs or Windows line endings and don't bother with handling them. Seriously, what year is this? diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Ruby.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Ruby.sublime-settings deleted file mode 100644 index 60f1a00..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/Ruby.sublime-settings +++ /dev/null @@ -1,10 +0,0 @@ -{ - "com.khiltd.abacus.separators": - [ - { - "token": "=>", - "gravity": "right", - "preserve_indentation": true - } - ] -} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/package-metadata.json deleted file mode 100644 index b921063..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Abacus/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://github.com/khiltd/Abacus", "version": "2013.07.23.05.22.38", "description": "An Alignment Plugin for Sublime Text 2 that actually works `\u2318\u2325^ ]`"} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Block Cursor Everywhere/.gitignore b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Block Cursor Everywhere/.gitignore deleted file mode 100644 index 47748ac..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Block Cursor Everywhere/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.pyc -*.cache -*.sublime-project -.DS_store -.c9revisions \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Block Cursor Everywhere/README.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Block Cursor Everywhere/README.md deleted file mode 100644 index 5352b0e..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Block Cursor Everywhere/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# BlockCursorEverywhere # - -I apologize, but this is no longer updated. I don't even use it anymore because of API limitations. I recommend looking at the original repo by netpro2k. - - -![Screenshot](http://f.cl.ly/items/42131K2X1h0j0P2m1O2B/Screen%20Shot%202011-12-02%20at%202.36.54%20AM.png) - -It can become very difficult to keep track of your cursor location. This is solved by having a "block" cursor, which is very easy to spot no matter where it is on screen. Unfortunately, Sublime Text 2 does not (yet) support this feature natively. This Plugin mimics this functionality by highlighting the area behind the cursor whenever it moves (similar to how you might highlight syntax errors, or color a comment). - -## Installation ## - -### With Package Control ### - -If you have the [Package Control][package_control] installed, you can install BlockCursorEverywhere from inside Sublime Text itself. Open the Command Palette and select "Package Control: Install Package", then search for BlockCursorEverywhere and you’re done! - -### Without Package Control ### - -Go to your Sublime Text 2 Packages directory: - - Windows: %USERPROFILE%\AppData\Roaming\Sublime Text 2\Packages\ - Mac: ~/Library/Application Support/Sublime Text 2/Packages/ - -and clone the repository there - - git clone git://github.com/ingshtrom/BlockCursorEverywhere - - -## Configuration ## - -These are the settings that I prefer. You can change the style of the block cursor by adding a section to your theme file like so: - -```xml - - name - Block Cursor - scope - block_cursor - settings - - foreground - #000000 - background - #FF1111 - - -``` - ---------- - -[sublime]: http://www.sublimetext.com/2 -[package_control]: http://wbond.net/sublime_packages/package_control diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Block Cursor Everywhere/SublimeBlockCursor.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Block Cursor Everywhere/SublimeBlockCursor.py deleted file mode 100644 index 9d088e9..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Block Cursor Everywhere/SublimeBlockCursor.py +++ /dev/null @@ -1,39 +0,0 @@ -import sublime -import sublime_plugin - - -class BlockCursorEverywhere(sublime_plugin.EventListener): - def view_is_widget(self, view): - settings = view.settings() - return bool(settings.get('is_widget')) - - def show_block_cursor(self, view): - validRegions = [] - for s in view.sel(): - if s.a != s.b: - continue - validRegions.append(sublime.Region(s.a, s.a + 1)) - if validRegions.__len__: - view.add_regions('BlockCursorListener', validRegions, 'block_cursor') - else: - view.erase_regions('BlockCursorListener') - - def on_selection_modified(self, view): - no_vintage = view.settings().get('ignored_packages') is None or "Vintage" in view.settings().get('ignored_packages') - if view.settings().get('is_widget') or not(no_vintage or view.settings().get('command_mode')): - view.erase_regions('BlockCursorListener') - return - self.show_block_cursor(view) - - def on_deactivated(self, view): - view.erase_regions('BlockCursorListener') - view.settings().clear_on_change('command_mode') - self.current_view = None - - def on_activated(self, view): - self.on_selection_modified(view) - view.settings().add_on_change('command_mode', self.on_command_mode_change) - self.current_view = view - - def on_command_mode_change(self): - self.on_selection_modified(self.current_view) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Block Cursor Everywhere/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Block Cursor Everywhere/package-metadata.json deleted file mode 100644 index e9c311f..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Block Cursor Everywhere/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://github.com/ingshtrom/BlockCursorEverywhere", "version": "2013.08.02.15.49.34", "description": "Sublime Text 2 plugin to mimic a block cursor in Vintage command mode."} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/.gitignore b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/.gitignore deleted file mode 100644 index 043d1e9..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.pyc - -.DS_Store diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/CHANGELOG.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/CHANGELOG.md deleted file mode 100644 index 94f2f51..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/CHANGELOG.md +++ /dev/null @@ -1,68 +0,0 @@ -# Version 1.9.0 -- Add experimental CFML support (defaulted off) -- Add auto-detection of self-closing tags (defaulted on) - -# Version 1.8.0 -- Add new commands: "Show Bracket String Escape Mode" and "Toggle Bracket String Escape Mode". Default is "regex" - -# Version 1.7.2 -- Feed general bracket type to bracket plugins -- Adjust bracket select plugin to better handle HTML tags - -# Version 1.7.1 -- Reorganize some settings -- Limit auto-highlight selections by configurable threshold setting - -# Version 1.7.0 -- Hide parent quote highlighting when child quotes are highlighted -- Allow the searching for brackets in non-quoted code scoped as strings (like regex) -- Add setting "highlight_string_brackets_only" which allows never highlighting quotes but leaves internal string bracket highlighting on -- deprecate "enable_forward_slash_regex_strings" in favor of "find_brackets_in any_strings" - -# Version 1.6.2 -- Fix adjacent_only with multi_select - -# Version 1.6.1 -- Suppress string highlighting when adjacent_only is set, but allow internal string brackets to still get highlighted with adjacent_only settings if match_string_brackets is true - -# Version 1.6.0 -- Add setting to match only when cursor is between brackets - -# Version 1.5.3 -- Allow turning off gutter icons for multi-select via settings -- Fix multi-select detection -- Default the internal settings if setting is not found - -# Version 1.5.2 -- Use tiny icons when line height is less than 16 -- Use no icon if icon cannot be found -- Optimize png icons - -# Version 1.5.1 -- Ignore selection/edit events inside the main routine - -# Version 1.5.0 -- More responsive highlighting (thanks tito); delay setting no longer needed -- Organize bracket plugins -- Included more configurable custom gutter icons - -# Version 1.4.1 -- Make adjusment to regex modifier code to correctly count back modifiers in perl - -# Version 1.4.0 -- Account for perl regex, substitutions, and translations surrounded by "/" for string bracket matching -- Account for regex modifiers when matching regex surrounded by "/" in javascript and perl - -# Version 1.3.0 -- Fixed escaped brackets in string handling. Also a bit more efficient. - -# Version 1.2.0 -- Fix angle bracket avoidance when finding brackets inside strings, and make it cleaner - -# Version 1.1.0 -- Add python raw string support for quote highlighting -- Add highlighting of brackets in strings; will work in all strings, but mainly meant for regex. True by default -- Add support for targetting regex strings like in javascript that are scoped as strings, but are not quoted, but use '/'s. True by default - -# Version 1.0.0 -- All previous work and releases diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/Default.sublime-commands b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/Default.sublime-commands deleted file mode 100644 index b9bdfc7..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/Default.sublime-commands +++ /dev/null @@ -1,152 +0,0 @@ -[ - // Toggle Global Enable - { - "caption": "BracketHighlighter: Toggle Global Enable", - "command": "bh_toggle_enable" - }, - // Search to end of file for bracket - { - "caption": "BracketHighlighter: Match Brackets (ignore threshold)", - "command": "bh_key", - "args": {"lines" : true} - }, - // Remove brackets - { - "caption": "BracketHighlighter: Remove Brackets", - "command": "bh_remove_brackets" - }, - // Go to left bracket - { - "caption": "BracketHighlighter: Jump to Left Bracket", - "command": "bh_key", - "args": - { - "lines" : true, - "plugin": - { - "type": ["__all__"], - "command": "bh_modules.bracketselect", - "args": {"select": "left"} - } - } - }, - // Go to right bracket - { - "caption": "BracketHighlighter: Jump to Right Bracket", - "command": "bh_key", - "args": - { - "lines" : true, - "plugin": - { - "type": ["__all__"], - "command": "bh_modules.bracketselect", - "args": {"select": "right"} - } - } - }, - // Select text between brackets - { - "caption": "BracketHighlighter: Select Bracket Content", - "command": "bh_key", - "args": - { - "lines" : true, - "plugin": - { - "type": ["__all__"], - "command": "bh_modules.bracketselect" - } - } - }, - // Fold contents between brackets - { - "caption": "BracketHighlighter: Fold Bracket Content", - "command": "bh_key", - "args": - { - "plugin": { - "type": ["__all__"], - "command" : "bh_modules.foldbracket" - } - } - }, - { "caption": "-" }, - // Toggle between string and regex escape mode for string brackets - { - "caption": "BracketHighlighter: Toggle String Bracket Escape Mode", - "command": "bh_toggle_string_escape_mode" - }, - // Toggle high visibility mode - { - "caption": "BracketHighlighter: Toggle High Visibility Mode", - "command": "bh_toggle_high_visibility" - }, - { "caption": "-" }, - // Select tag name of HTML/XML tag (both opening name and closing) - { - "caption": "BracketHighlighter: Select Tag Name (closing and opening)", - "command": "bh_key", - "args": - { - "plugin": - { - "type": ["cfml", "html", "angle"], - "command": "bh_modules.tagnameselect" - } - } - }, - // Select the attribute to the right of the cursor (will wrap inside the tag) - { - "caption": "BracketHighlighter: Select Next Attribute (right)", - "command": "bh_key", - "args": - { - "plugin": - { - "type": ["cfml", "html", "angle"], - "command": "bh_modules.tagattrselect", - "args": {"direction": "right"} - } - } - }, - // Select the attribute to the left of the cursor (will wrap inside the tag) - { - "caption": "BracketHighlighter: Select Next Attribute (left)", - "command": "bh_key", - "args": - { - "plugin": - { - "type": ["cfml", "html", "angle"], - "command": "bh_modules.tagattrselect", - "args": {"direction": "left"} - } - } - }, - // Convert single quote string to double quoted string and vice versa - // Will handle escaping or unescaping quotes within the string - { - "caption": "BracketHighlighter: Swap Quotes", - "command": "bh_key", - "args": - { - "lines" : true, - "plugin": - { - "type": ["single_quote", "double_quote", "py_single_quote", "py_double_quote"], - "command": "bh_modules.swapquotes" - } - } - }, - // Swap Brackets - { - "caption": "BracketHighlighter: Swap Brackets", - "command": "swap_brackets" - }, - // Surround selection with brackets from quick panel - { - "caption": "BracketHighlighter: Wrap Selections with Brackets", - "command": "wrap_brackets" - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/Default.sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/Default.sublime-keymap deleted file mode 100644 index 5421945..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/Default.sublime-keymap +++ /dev/null @@ -1,16 +0,0 @@ -[ - // Navigate tabstops in wrapped selection - { - "keys": ["tab"], - "command": "bh_next_wrap_sel", - "context": - [ - { - "operand": true, - "operator": "equal", - "match_all": true, - "key": "bh_wrapping" - } - ] - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/Example.sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/Example.sublime-keymap deleted file mode 100644 index ef99e15..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/Example.sublime-keymap +++ /dev/null @@ -1,153 +0,0 @@ -[ - // Toggle Global Enable - { - "keys": ["ctrl+alt+super+e"], - "command": "bh_toggle_enable" - }, - // Search to end of file for bracket - { - "keys": ["ctrl+alt+super+b"], - "command": "bh_key", - "args": - { - "lines" : true - } - }, - // Go to left bracket - { - "keys": ["ctrl+alt+super+up"], - "command": "bh_key", - "args": - { - "lines" : true, - "plugin": - { - "type": ["__all__"], - "command": "bh_modules.bracketselect", - "args": {"select": "left"} - } - } - }, - // Go to right bracket - { - "keys": ["ctrl+alt+super+down"], - "command": "bh_key", - "args": - { - "lines" : true, - "plugin": - { - "type": ["__all__"], - "command": "bh_modules.bracketselect", - "args": {"select": "right"} - } - } - }, - // Remove brackets - { - "keys": ["ctrl+alt+super+r"], - "command": "bh_remove_brackets" - }, - // Toggle string escape mode for sub bracket search in strings - { - "keys": ["ctrl+alt+super+x"], - "command": "bh_toggle_string_escape_mode" - }, - // Select text between brackets - { - "keys": ["ctrl+alt+super+s"], - "command": "bh_key", - "args": - { - "lines" : true, - "plugin": - { - "type": ["__all__"], - "command": "bh_modules.bracketselect" - } - } - }, - // Select tag name of HTML/XML tag (both opening name and closing) - { - "keys": ["ctrl+alt+super+t"], - "command": "bh_key", - "args": - { - "plugin": - { - "type": ["cfml", "html", "angle"], - "command": "bh_modules.tagnameselect" - } - } - }, - // Select the attribute to the right of the cursor (will wrap inside the tag) - { - "keys": ["ctrl+alt+super+right"], - "command": "bh_key", - "args": - { - "plugin": - { - "type": ["cfml", "html", "angle"], - "command": "bh_modules.tagattrselect", - "args": {"direction": "right"} - } - } - }, - // Select the attribute to the left of the cursor (will wrap inside the tag) - { - "keys": ["ctrl+alt+super+left"], - "command": "bh_key", - "args": - { - "plugin": - { - "type": ["cfml", "html", "angle"], - "command": "bh_modules.tagattrselect", - "args": {"direction": "left"} - } - } - }, - // Convert single quote string to double quoted string and vice versa - // Will handle escaping or unescaping quotes within the string - { - "keys": ["ctrl+alt+super+q"], - "command": "bh_key", - "args": - { - "lines" : true, - "plugin": - { - "type": ["single_quote", "double_quote", "py_single_quote", "py_double_quote"], - "command": "bh_modules.swapquotes" - } - } - }, - // Fold contents between brackets - { - "keys": ["ctrl+alt+super+["], - "command": "bh_key", - "args": - { - "plugin": { - "type": ["__all__"], - "command" : "bh_modules.foldbracket" - } - } - }, - // Swap brackets with another type - { - "keys": ["ctrl+alt+super+e"], - "command": "swap_brackets" - }, - // Surround selection with brackets from quick panel - { - "keys": ["ctrl+alt+super+w"], - "command": "wrap_brackets" - }, - // Toggle high visibility mode - { - "keys": ["ctrl+alt+super+v"], - "command": "bh_toggle_high_visibility" - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/Main.sublime-menu b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/Main.sublime-menu deleted file mode 100644 index 1c2a3b8..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/Main.sublime-menu +++ /dev/null @@ -1,260 +0,0 @@ -[ - { - "id": "tools", - "caption": "Tools", - "children": - [ - { - "id": "packages", - "caption": "Packages", - "children": - [ - { - "id": "brackethighlighter", - "caption": "BracketHighlighter", - "children": - [ - // Toggle Global Enable - { - "caption": "BracketHighlighter: Toggle Global Enable", - "command": "bh_toggle_enable" - }, - { "caption": "-" }, - // Search to end of file for bracket - { - "caption": "Match Brackets (ignore threshold)", - "command": "bh_key", - "args": {"lines" : true} - }, - // Remove brackets - { - "caption": "Remove Brackets", - "command": "bh_remove_brackets" - }, - // Go to left bracket - { - "caption": "Jump to Left Bracket", - "command": "bh_key", - "args": - { - "lines" : true, - "plugin": - { - "type": ["__all__"], - "command": "bh_modules.bracketselect", - "args": {"select": "left"} - } - } - }, - // Go to right bracket - { - "caption": "Jump to Right Bracket", - "command": "bh_key", - "args": - { - "lines" : true, - "plugin": - { - "type": ["__all__"], - "command": "bh_modules.bracketselect", - "args": {"select": "right"} - } - } - }, - // Select text between brackets - { - "caption": "Select Bracket Content", - "command": "bh_key", - "args": - { - "lines" : true, - "plugin": - { - "type": ["__all__"], - "command": "bh_modules.bracketselect" - } - } - }, - // Fold contents between brackets - { - "caption": "Fold Bracket Content", - "command": "bh_key", - "args": - { - "plugin": { - "type": ["__all__"], - "command" : "bh_modules.foldbracket" - } - } - }, - { "caption": "-" }, - // Toggle between string and regex escape mode for string brackets - { - "caption": "Toggle String Bracket Escape Mode", - "command": "bh_toggle_string_escape_mode" - }, - // Toggle high visibility mode - { - "caption": "Toggle High Visibility Mode", - "command": "bh_toggle_high_visibility" - }, - { "caption": "-" }, - // Select tag name of HTML/XML tag (both opening name and closing) - { - "caption": "Select Tag Name (closing and opening)", - "command": "bh_key", - "args": - { - "plugin": - { - "type": ["cfml", "html", "angle"], - "command": "bh_modules.tagnameselect" - } - } - }, - // Select the attribute to the right of the cursor (will wrap inside the tag) - { - "caption": "Select Next Attribute (right)", - "command": "bh_key", - "args": - { - "plugin": - { - "type": ["cfml", "html", "angle"], - "command": "bh_modules.tagattrselect", - "args": {"direction": "right"} - } - } - }, - // Select the attribute to the left of the cursor (will wrap inside the tag) - { - "caption": "Select Next Attribute (left)", - "command": "bh_key", - "args": - { - "plugin": - { - "type": ["cfml", "html", "angle"], - "command": "bh_modules.tagattrselect", - "args": {"direction": "left"} - } - } - }, - { "caption": "-" }, - // Convert single quote string to double quoted string and vice versa - // Will handle escaping or unescaping quotes within the string - { - "caption": "Swap Quotes", - "command": "bh_key", - "args": - { - "lines" : true, - "plugin": - { - "type": ["single_quote", "double_quote", "py_single_quote", "py_double_quote"], - "command": "bh_modules.swapquotes" - } - } - }, - // Swap brackets - { - "caption": "Swap Brackets", - "command": "swap_brackets" - }, - // Surround selection with brackets from quick panel - { - "caption": "Wrap Selections with Brackets", - "command": "wrap_brackets" - } - ] - } - ] - } - ] - }, - { - "caption": "Preferences", - "mnemonic": "n", - "id": "preferences", - "children": - [ - { - "caption": "Package Settings", - "mnemonic": "P", - "id": "package-settings", - "children": - [ - { - "caption": "Bracket Highlighter", - "children": - [ - { - "command": "open_file", - "args": {"file": "${packages}/BracketHighlighter/bh_core.sublime-settings"}, - "caption": "Bracket Settings – Default" - }, - { - "command": "open_file", - "args": {"file": "${packages}/User/bh_core.sublime-settings"}, - "caption": "Bracket Settings – User" - }, - { "caption": "-" }, - { - "command": "open_file", - "args": {"file": "${packages}/BracketHighlighter/bh_wrapping.sublime-settings"}, - "caption": "Wrap Settings – Default" - }, - { - "command": "open_file", - "args": {"file": "${packages}/User/bh_wrapping.sublime-settings"}, - "caption": "Wrap Settings – User" - }, - { "caption": "-" }, - { - "command": "open_file", - "args": {"file": "${packages}/BracketHighlighter/bh_swapping.sublime-settings"}, - "caption": "Swap Settings – Default" - }, - { - "command": "open_file", - "args": {"file": "${packages}/User/bh_swapping.sublime-settings"}, - "caption": "Swap Settings – User" - }, - { "caption": "-" }, - { - "command": "open_file", - "args": {"file": "${packages}/BracketHighlighter/Example.sublime-keymap"}, - "caption": "Example Key Bindings" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/User/Default (Windows).sublime-keymap", - "platform": "Windows" - }, - "caption": "Key Bindings – User" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/User/Default (OSX).sublime-keymap", - "platform": "OSX" - }, - "caption": "Key Bindings – User" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/User/Default (Linux).sublime-keymap", - "platform": "Linux" - }, - "caption": "Key Bindings – User" - }, - { "caption": "-" } - ] - } - ] - } - ] - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_core.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_core.py deleted file mode 100644 index 1c1e32e..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_core.py +++ /dev/null @@ -1,1415 +0,0 @@ -from os.path import basename, exists, join, normpath -import sublime -import sublime_plugin -from time import time, sleep -import thread -import ure -from bh_plugin import BracketPlugin, BracketRegion, ImportModule -from collections import namedtuple -import traceback - -BH_MATCH_TYPE_NONE = 0 -BH_MATCH_TYPE_SELECTION = 1 -BH_MATCH_TYPE_EDIT = 2 -DEFAULT_STYLES = { - "default": { - "icon": "dot", - "color": "brackethighlighter.default", - "style": "underline" - }, - "unmatched": { - "icon": "question", - "color": "brackethighlighter.unmatched", - "style": "outline" - } -} -HV_RSVD_VALUES = ["__default__", "__bracket__"] - -HIGH_VISIBILITY = False - -GLOBAL_ENABLE = True - - -def bh_logging(msg): - print("BracketHighlighter: %s" % msg) - - -def bh_debug(msg): - if sublime.load_settings("bh_core.sublime-settings").get('debug_enable', False): - bh_logging(msg) - - -def underline(regions): - """ - Convert sublime regions into underline regions - """ - - r = [] - for region in regions: - start = region.begin() - end = region.end() - while start < end: - r.append(sublime.Region(start)) - start += 1 - return r - - -def load_modules(obj, loaded): - """ - Load bracket plugin modules - """ - - plib = obj.get("plugin_library") - if plib is None: - return - - try: - module = ImportModule.import_module(plib, loaded) - obj["compare"] = getattr(module, "compare", None) - obj["post_match"] = getattr(module, "post_match", None) - loaded.add(plib) - except: - bh_logging("Could not load module %s\n%s" % (plib, str(traceback.format_exc()))) - raise - - -def select_bracket_style(option): - """ - Configure style of region based on option - """ - - style = sublime.HIDE_ON_MINIMAP - if option == "outline": - style |= sublime.DRAW_OUTLINED - elif option == "none": - style |= sublime.HIDDEN - elif option == "underline": - style |= sublime.DRAW_EMPTY_AS_OVERWRITE - return style - - -def select_bracket_icons(option, icon_path): - """ - Configure custom gutter icons if they can be located. - """ - - icon = "" - small_icon = "" - open_icon = "" - small_open_icon = "" - close_icon = "" - small_close_icon = "" - # Icon exist? - if not option == "none" and not option == "": - if exists(normpath(join(sublime.packages_path(), icon_path, option + ".png"))): - icon = "../%s/%s" % (icon_path, option) - if exists(normpath(join(sublime.packages_path(), icon_path, option + "_small.png"))): - small_icon = "../%s/%s" % (icon_path, option + "_small") - if exists(normpath(join(sublime.packages_path(), icon_path, option + "_open.png"))): - open_icon = "../%s/%s" % (icon_path, option + "_open") - else: - open_icon = icon - if exists(normpath(join(sublime.packages_path(), icon_path, option + "_open_small.png"))): - small_open_icon = "../%s/%s" % (icon_path, option + "_open_small") - else: - small_open_icon = small_icon - if exists(normpath(join(sublime.packages_path(), icon_path, option + "_close.png"))): - close_icon = "../%s/%s" % (icon_path, option + "_close") - else: - close_icon = icon - if exists(normpath(join(sublime.packages_path(), icon_path, option + "_close_small.png"))): - small_close_icon = "../%s/%s" % (icon_path, option + "_close_small") - else: - small_close_icon = small_icon - - return icon, small_icon, open_icon, small_open_icon, close_icon, small_close_icon - - -def exclude_bracket(enabled, filter_type, language_list, language): - """ - Exclude or include brackets based on filter lists. - """ - - exclude = True - if enabled: - # Black list languages - if filter_type == 'blacklist': - exclude = False - if language != None: - for item in language_list: - if language == item.lower(): - exclude = True - break - #White list languages - elif filter_type == 'whitelist': - if language != None: - for item in language_list: - if language == item.lower(): - exclude = False - break - return exclude - - -class BhEventMgr(object): - """ - Object to manage when bracket events should be launched. - """ - - @classmethod - def load(cls): - """ - Initialize variables for determining - when to initiate a bracket matching event. - """ - - cls.wait_time = 0.12 - cls.time = time() - cls.modified = False - cls.type = BH_MATCH_TYPE_SELECTION - cls.ignore_all = False - -BhEventMgr.load() - - -class BhThreadMgr(object): - """ - Object to help track when a new thread needs to be started. - """ - - restart = False - - -class BhEntry(object): - """ - Generic object for bracket regions. - """ - - def move(self, begin, end): - """ - Create a new object with the points moved to the specified locations. - """ - - return self._replace(begin=begin, end=end) - - def size(self): - """ - Size of bracket selection. - """ - - return abs(self.begin - self.end) - - def toregion(self): - """ - Convert to sublime Region. - """ - - return sublime.Region(self.begin, self.end) - - -class BracketEntry(namedtuple('BracketEntry', ['begin', 'end', 'type'], verbose=False), BhEntry): - """ - Bracket object. - """ - - pass - - -class ScopeEntry(namedtuple('ScopeEntry', ['begin', 'end', 'scope', 'type'], verbose=False), BhEntry): - """ - Scope bracket object. - """ - - pass - - -class BracketSearchSide(object): - """ - Userful structure to specify bracket matching direction. - """ - - left = 0 - right = 1 - - -class BracektSearchType(object): - """ - Userful structure to specify bracket matching direction. - """ - - opening = 0 - closing = 1 - - -class BracketSearch(object): - """ - Object that performs regex search on the view's buffer and finds brackets. - """ - - def __init__(self, bfr, window, center, pattern, scope_check, scope): - """ - Prepare the search object - """ - - self.center = center - self.pattern = pattern - self.bfr = bfr - self.scope = scope - self.scope_check = scope_check - self.prev_match = [None, None] - self.return_prev = [False, False] - self.done = [False, False] - self.start = [None, None] - self.left = [[], []] - self.right = [[], []] - self.findall(window) - - def reset_end_state(self): - """ - Reset the the current search flags etc. - This is usually done before searching the other direction. - """ - - self.start = [None, None] - self.done = [False, False] - self.prev_match = [None, None] - self.return_prev = [False, False] - - def remember(self, match_type): - """ - Remember the current match. - Don't get the next bracket on the next - request, but return the current one again. - """ - - self.return_prev[match_type] = True - self.done[match_type] = False - - def findall(self, window): - """ - Find all of the brackets and sort them - to "left of the cursor" and "right of the cursor" - """ - - for m in self.pattern.finditer(self.bfr, window[0], window[1]): - g = m.lastindex - try: - start = m.start(g) - end = m.end(g) - except: - continue - - match_type = int(not bool(g % 2)) - bracket_id = (g / 2) - match_type - - if not self.scope_check(start, bracket_id, self.scope): - if (end <= self.center if match_type else start < self.center): - self.left[match_type].append(BracketEntry(start, end, bracket_id)) - elif (end > self.center if match_type else start >= self.center): - self.right[match_type].append(BracketEntry(start, end, bracket_id)) - - def get_open(self, bracket_code): - """ - Get opening bracket. Accepts a bracket code that - determines which side of the cursor the next match is returned from. - """ - - for b in self._get_bracket(bracket_code, BracektSearchType.opening): - yield b - - def get_close(self, bracket_code): - """ - Get closing bracket. Accepts a bracket code that - determines which side of the cursor the next match is returned from. - """ - - for b in self._get_bracket(bracket_code, BracektSearchType.closing): - yield b - - def is_done(self, match_type): - """ - Retrieve done flag. - """ - - return self.done[match_type] - - def _get_bracket(self, bracket_code, match_type): - """ - Get the next bracket. Accepts bracket code that determines - which side of the cursor the next match is returned from and - the match type which determines whether a opening or closing - bracket is desired. - """ - - if self.done[match_type]: - return - if self.return_prev[match_type]: - self.return_prev[match_type] = False - yield self.prev_match[match_type] - if bracket_code == BracketSearchSide.left: - if self.start[match_type] is None: - self.start[match_type] = len(self.left[match_type]) - for x in reversed(range(0, self.start[match_type])): - b = self.left[match_type][x] - self.prev_match[match_type] = b - self.start[match_type] -= 1 - yield b - else: - if self.start[match_type] is None: - self.start[match_type] = 0 - for x in range(self.start[match_type], len(self.right[match_type])): - b = self.right[match_type][x] - self.prev_match[match_type] = b - self.start[match_type] += 1 - yield b - - self.done[match_type] = True - - -class BracketDefinition(object): - """ - Normal bracket definition. - """ - - def __init__(self, bracket): - """ - Setup the bracket object by reading the passed in dictionary. - """ - - self.name = bracket["name"] - self.style = bracket.get("style", "default") - self.compare = bracket.get("compare") - sub_search = bracket.get("find_in_sub_search", "false") - self.find_in_sub_search_only = sub_search == "only" - self.find_in_sub_search = sub_search == "true" or self.find_in_sub_search_only - self.post_match = bracket.get("post_match") - self.scope_exclude_exceptions = bracket.get("scope_exclude_exceptions", []) - self.scope_exclude = bracket.get("scope_exclude", []) - self.ignore_string_escape = bracket.get("ignore_string_escape", False) - - -class ScopeDefinition(object): - """ - Scope bracket definition. - """ - - def __init__(self, bracket): - """ - Setup the bracket object by reading the passed in dictionary. - """ - - self.style = bracket.get("style", "default") - self.open = ure.compile("\\A" + bracket.get("open", "."), ure.MULTILINE | ure.IGNORECASE) - self.close = ure.compile(bracket.get("close", ".") + "\\Z", ure.MULTILINE | ure.IGNORECASE) - self.name = bracket["name"] - sub_search = bracket.get("sub_bracket_search", "false") - self.sub_search_only = sub_search == "only" - self.sub_search = self.sub_search_only == True or sub_search == "true" - self.compare = bracket.get("compare") - self.post_match = bracket.get("post_match") - self.scopes = bracket["scopes"] - - -class StyleDefinition(object): - """ - Styling definition. - """ - - def __init__(self, name, style, default_highlight, icon_path): - """ - Setup the style object by reading the - passed in dictionary. And other parameters. - """ - - self.name = name - self.selections = [] - self.open_selections = [] - self.close_selections = [] - self.center_selections = [] - self.color = style.get("color", default_highlight["color"]) - self.style = select_bracket_style(style.get("style", default_highlight["style"])) - self.underline = self.style & sublime.DRAW_EMPTY_AS_OVERWRITE - ( - self.icon, self.small_icon, self.open_icon, - self.small_open_icon, self.close_icon, self.small_close_icon - ) = select_bracket_icons(style.get("icon", default_highlight["icon"]), icon_path) - self.no_icon = "" - - -class BhToggleStringEscapeModeCommand(sublime_plugin.TextCommand): - """ - Toggle between regex escape and - string escape for brackets in strings. - """ - - def run(self, edit): - default_mode = sublime.load_settings("bh_core.sublime-settings").get('bracket_string_escape_mode', 'string') - if self.view.settings().get('bracket_string_escape_mode', default_mode) == "regex": - self.view.settings().set('bracket_string_escape_mode', "string") - sublime.status_message("Bracket String Escape Mode: string") - else: - self.view.settings().set('bracket_string_escape_mode', "regex") - sublime.status_message("Bracket String Escape Mode: regex") - - -class BhShowStringEscapeModeCommand(sublime_plugin.TextCommand): - """ - Shoe current string escape mode for sub brackets in strings. - """ - - def run(self, edit): - default_mode = sublime.load_settings("BracketHighlighter.sublime-settings").get('bracket_string_escape_mode', 'string') - sublime.status_message("Bracket String Escape Mode: %s" % self.view.settings().get('bracket_string_escape_mode', default_mode)) - - -class BhToggleHighVisibilityCommand(sublime_plugin.ApplicationCommand): - """ - Toggle a high visibility mode that - highlights the entire bracket extent. - """ - - def run(self): - global HIGH_VISIBILITY - HIGH_VISIBILITY = not HIGH_VISIBILITY - - -class BhToggleEnableCommand(sublime_plugin.ApplicationCommand): - """ - Toggle global enable for BracketHighlighter. - """ - - def run(self): - global GLOBAL_ENABLE - GLOBAL_ENABLE = not GLOBAL_ENABLE - - -class BhKeyCommand(sublime_plugin.WindowCommand): - """ - Command to process shortcuts, menu calls, and command palette calls. - This is how BhCore is called with different options. - """ - - def run(self, threshold=True, lines=False, adjacent=False, ignore={}, plugin={}): - # Override events - BhEventMgr.ignore_all = True - BhEventMgr.modified = False - self.bh = BhCore( - threshold, - lines, - adjacent, - ignore, - plugin, - True - ) - self.view = self.window.active_view() - sublime.set_timeout(self.execute, 100) - - def execute(self): - bh_debug("Key Event") - self.bh.match(self.view) - BhEventMgr.ignore_all = False - BhEventMgr.time = time() - - -class BhCore(object): - """ - Bracket matching class. - """ - plugin_reload = False - - def __init__(self, override_thresh=False, count_lines=False, adj_only=None, ignore={}, plugin={}, keycommand=False): - """ - Load settings and setup reload events if settings changes. - """ - - self.settings = sublime.load_settings("bh_core.sublime-settings") - self.keycommand = keycommand - if not keycommand: - self.settings.clear_on_change('reload') - self.settings.add_on_change('reload', self.setup) - self.setup(override_thresh, count_lines, adj_only, ignore, plugin) - - def setup(self, override_thresh=False, count_lines=False, adj_only=None, ignore={}, plugin={}): - """ - Initialize class settings from settings file and inputs. - """ - - # Init view params - self.last_id_view = None - self.last_id_sel = None - self.view_tracker = (None, None) - self.ignore_threshold = override_thresh or bool(self.settings.get("ignore_threshold", False)) - self.adj_only = adj_only if adj_only is not None else bool(self.settings.get("match_only_adjacent", False)) - self.auto_selection_threshold = int(self.settings.get("auto_selection_threshold", 10)) - self.no_multi_select_icons = bool(self.settings.get("no_multi_select_icons", False)) - self.count_lines = count_lines - self.default_string_escape_mode = str(self.settings.get('bracket_string_escape_mode', "string")) - self.show_unmatched = bool(self.settings.get("show_unmatched", True)) - - # Init bracket objects - self.bracket_types = self.settings.get("brackets", []) - self.scope_types = self.settings.get("scope_brackets", []) - - # Init selection params - self.use_selection_threshold = True - self.selection_threshold = int(self.settings.get("search_threshold", 5000)) - self.new_select = False - self.loaded_modules = set([]) - - # High Visibility options - self.hv_style = select_bracket_style(self.settings.get("high_visibility_style", "outline")) - self.hv_underline = self.hv_style & sublime.DRAW_EMPTY_AS_OVERWRITE - self.hv_color = self.settings.get("high_visibility_color", HV_RSVD_VALUES[1]) - - # Init plugin - self.plugin = None - self.transform = set([]) - if 'command' in plugin: - self.plugin = BracketPlugin(plugin, self.loaded_modules) - self.new_select = True - if 'type' in plugin: - for t in plugin["type"]: - self.transform.add(t) - - def init_bracket_regions(self): - """ - Load up styled regions for brackets to use. - """ - - self.bracket_regions = {} - styles = self.settings.get("bracket_styles", DEFAULT_STYLES) - icon_path = self.settings.get("icon_path", "Theme - Default").replace('\\', '/').strip('/') - # Make sure default and unmatched styles in styles - for key, value in DEFAULT_STYLES.items(): - if key not in styles: - styles[key] = value - continue - for k, v in value.items(): - if k not in styles[key]: - styles[key][k] = v - # Initialize styles - default_settings = styles["default"] - for k, v in styles.items(): - self.bracket_regions[k] = StyleDefinition(k, v, default_settings, icon_path) - - def is_valid_definition(self, params, language): - """ - Ensure bracket definition should be and can be loaded. - """ - - return ( - not exclude_bracket( - params.get("enabled", True), - params.get("language_filter", "blacklist"), - params.get("language_list", []), - language - ) and - params["open"] is not None and params["close"] is not None - ) - - def init_brackets(self, language): - """ - Initialize bracket match definition objects from settings file. - """ - - self.find_regex = [] - self.sub_find_regex = [] - self.index_open = {} - self.index_close = {} - self.brackets = [] - self.scopes = [] - self.view_tracker = (language, self.view.id()) - self.enabled = False - self.sels = [] - self.multi_select = False - scopes = {} - loaded_modules = self.loaded_modules.copy() - - for params in self.bracket_types: - if self.is_valid_definition(params, language): - try: - load_modules(params, loaded_modules) - entry = BracketDefinition(params) - self.brackets.append(entry) - if not entry.find_in_sub_search_only: - self.find_regex.append(params["open"]) - self.find_regex.append(params["close"]) - else: - self.find_regex.append(r"([^\s\S])") - self.find_regex.append(r"([^\s\S])") - - if entry.find_in_sub_search: - self.sub_find_regex.append(params["open"]) - self.sub_find_regex.append(params["close"]) - else: - self.sub_find_regex.append(r"([^\s\S])") - self.sub_find_regex.append(r"([^\s\S])") - except Exception, e: - bh_logging(e) - - scope_count = 0 - for params in self.scope_types: - if self.is_valid_definition(params, language): - try: - load_modules(params, loaded_modules) - entry = ScopeDefinition(params) - for x in entry.scopes: - if x not in scopes: - scopes[x] = scope_count - scope_count += 1 - self.scopes.append({"name": x, "brackets": [entry]}) - else: - self.scopes[scopes[x]]["brackets"].append(entry) - except Exception, e: - bh_logging(e) - - if len(self.brackets): - bh_debug( - "Search patterns:\n" + - "(?:%s)\n" % '|'.join(self.find_regex) + - "(?:%s)" % '|'.join(self.sub_find_regex) - ) - self.sub_pattern = ure.compile("(?:%s)" % '|'.join(self.sub_find_regex), ure.MULTILINE | ure.IGNORECASE) - self.pattern = ure.compile("(?:%s)" % '|'.join(self.find_regex), ure.MULTILINE | ure.IGNORECASE) - self.enabled = True - - def init_match(self): - """ - Initialize matching for the current view's syntax. - """ - - self.chars = 0 - self.lines = 0 - syntax = self.view.settings().get('syntax') - language = basename(syntax).replace('.tmLanguage', '').lower() if syntax != None else "plain text" - - if language != self.view_tracker[0] or self.view.id() != self.view_tracker[1]: - self.init_bracket_regions() - self.init_brackets(language) - else: - for r in self.bracket_regions.values(): - r.selections = [] - r.open_selections = [] - r.close_selections = [] - r.center_selections = [] - - def unique(self): - """ - Check if the current selection(s) is different from the last. - """ - - id_view = self.view.id() - id_sel = "".join([str(sel.a) for sel in self.view.sel()]) - is_unique = False - if id_view != self.last_id_view or id_sel != self.last_id_sel: - self.last_id_view = id_view - self.last_id_sel = id_sel - is_unique = True - return is_unique - - def store_sel(self, regions): - """ - Store the current selection selection to be set at the end. - """ - - if self.new_select: - for region in regions: - self.sels.append(region) - - def change_sel(self): - """ - Change the view's selections. - """ - - if self.new_select and len(self.sels) > 0: - if self.multi_select == False: - self.view.show(self.sels[0]) - self.view.sel().clear() - map(lambda x: self.view.sel().add(x), self.sels) - - def hv_highlight_color(self, b_value): - """ - High visibility highlight decesions. - """ - - color = self.hv_color - if self.hv_color == HV_RSVD_VALUES[0]: - color = self.bracket_regions["default"].color - elif self.hv_color == HV_RSVD_VALUES[1]: - color = b_value - return color - - def highlight_regions(self, name, icon_type, selections, bracket, regions): - """ - Apply the highlightes for the highlight region. - """ - - if len(selections): - self.view.add_regions( - name, - getattr(bracket, selections), - self.hv_highlight_color(bracket.color) if HIGH_VISIBILITY else bracket.color, - getattr(bracket, icon_type), - self.hv_style if HIGH_VISIBILITY else bracket.style - ) - regions.append(name) - - def highlight(self, view): - """ - Highlight all bracket regions. - """ - - for region_key in self.view.settings().get("bh_regions", []): - self.view.erase_regions(region_key) - - regions = [] - icon_type = "no_icon" - open_icon_type = "no_icon" - close_icon_type = "no_icon" - if not self.no_multi_select_icons or not self.multi_select: - icon_type = "small_icon" if self.view.line_height() < 16 else "icon" - open_icon_type = "small_open_icon" if self.view.line_height() < 16 else "open_icon" - close_icon_type = "small_close_icon" if self.view.line_height() < 16 else "close_icon" - for name, r in self.bracket_regions.items(): - self.highlight_regions("bh_" + name, icon_type, "selections", r, regions) - self.highlight_regions("bh_" + name + "_center", "no_icon", "center_selections", r, regions) - self.highlight_regions("bh_" + name + "_open", open_icon_type, "open_selections", r, regions) - self.highlight_regions("bh_" + name + "_close", close_icon_type, "close_selections", r, regions) - # Track which regions were set in the view so that they can be cleaned up later. - self.view.settings().set("bh_regions", regions) - - def get_search_bfr(self, sel): - """ - Read in the view's buffer for scanning for brackets etc. - """ - - # Determine how much of the buffer to search - view_min = 0 - view_max = self.view.size() - if not self.ignore_threshold: - left_delta = sel.a - view_min - right_delta = view_max - sel.a - limit = self.selection_threshold / 2 - rpad = limit - left_delta if left_delta < limit else 0 - lpad = limit - right_delta if right_delta < limit else 0 - llimit = limit + lpad - rlimit = limit + rpad - self.search_window = ( - sel.a - llimit if left_delta >= llimit else view_min, - sel.a + rlimit if right_delta >= rlimit else view_max - ) - else: - self.search_window = (0, view_max) - - # Search Buffer - return self.view.substr(sublime.Region(0, view_max)) - - def match(self, view, force_match=True): - """ - Preform matching brackets surround the selection(s) - """ - - if view == None: - return - - view.settings().set("BracketHighlighterBusy", True) - - if not GLOBAL_ENABLE: - for region_key in view.settings().get("bh_regions", []): - view.erase_regions(region_key) - view.settings().set("BracketHighlighterBusy", False) - return - - if self.keycommand: - BhCore.plugin_reload = True - - if not self.keycommand and BhCore.plugin_reload: - self.setup() - BhCore.plugin_reload = False - - # Setup views - self.view = view - self.last_view = view - num_sels = len(view.sel()) - self.multi_select = (num_sels > 1) - - if self.unique() or force_match: - # Initialize - self.init_match() - - # Nothing to search for - if not self.enabled: - view.settings().set("BracketHighlighterBusy", False) - return - - # Abort if selections are beyond the threshold - if self.use_selection_threshold and num_sels >= self.selection_threshold: - self.highlight(view) - view.settings().set("BracketHighlighterBusy", False) - return - - multi_select_count = 0 - # Process selections. - for sel in view.sel(): - bfr = self.get_search_bfr(sel) - if not self.ignore_threshold and multi_select_count >= self.auto_selection_threshold: - self.store_sel([sel]) - multi_select_count += 1 - continue - if not self.find_scopes(bfr, sel): - self.sub_search_mode = False - self.find_matches(bfr, sel) - multi_select_count += 1 - - # Highlight, focus, and display lines etc. - self.change_sel() - self.highlight(view) - if self.count_lines: - sublime.status_message('In Block: Lines ' + str(self.lines) + ', Chars ' + str(self.chars)) - view.settings().set("BracketHighlighterBusy", False) - - def save_incomplete_regions(self, left, right, regions): - """ - Store single incomplete brackets for highlighting. - """ - - found = left if left is not None else right - bracket = self.bracket_regions["unmatched"] - if bracket.underline: - bracket.selections += underline((found.toregion(),)) - else: - bracket.selections += [found.toregion()] - self.store_sel(regions) - - def save_regions(self, left, right, regions): - """ - Saved matched regions. Perform any special considerations for region formatting. - """ - - bracket = self.bracket_regions.get(self.bracket_style, self.bracket_regions["default"]) - lines = abs(self.view.rowcol(right.begin)[0] - self.view.rowcol(left.end)[0] + 1) - if self.count_lines: - self.chars += abs(right.begin - left.end) - self.lines += lines - if HIGH_VISIBILITY: - if lines <= 1: - if self.hv_underline: - bracket.selections += underline((sublime.Region(left.begin, right.end),)) - else: - bracket.selections += [sublime.Region(left.begin, right.end)] - else: - bracket.open_selections += [sublime.Region(left.begin)] - if self.hv_underline: - bracket.center_selections += underline((sublime.Region(left.begin + 1, right.end - 1),)) - else: - bracket.center_selections += [sublime.Region(left.begin, right.end)] - bracket.close_selections += [sublime.Region(right.begin)] - elif bracket.underline: - if lines <= 1: - bracket.selections += underline((left.toregion(), right.toregion())) - else: - bracket.open_selections += [sublime.Region(left.begin)] - bracket.close_selections += [sublime.Region(right.begin)] - if left.size(): - bracket.center_selections += underline((sublime.Region(left.begin + 1, left.end),)) - if right.size(): - bracket.center_selections += underline((sublime.Region(right.begin + 1, right.end),)) - else: - if lines <= 1: - bracket.selections += [left.toregion(), right.toregion()] - else: - bracket.open_selections += [left.toregion()] - bracket.close_selections += [right.toregion()] - self.store_sel(regions) - - def sub_search(self, sel, search_window, bfr, scope=None): - """ - Search a scope bracket match for bracekts within. - """ - - bracket = None - left, right = self.match_brackets(bfr, search_window, sel, scope) - - regions = [sublime.Region(sel.a, sel.b)] - - if left is not None and right is not None: - bracket = self.brackets[left.type] - left, right, regions, nobracket = self.run_plugin(bracket.name, left, right, regions) - if nobracket: - return True - - # Matched brackets - if left is not None and right is not None and bracket is not None: - self.save_regions(left, right, regions) - return True - return False - - def find_scopes(self, bfr, sel): - """ - Find brackets by scope definition. - """ - - # Search buffer - left, right, bracket, sub_matched = self.match_scope_brackets(bfr, sel) - if sub_matched: - return True - regions = [sublime.Region(sel.a, sel.b)] - - if left is not None and right is not None: - left, right, regions, _ = self.run_plugin(bracket.name, left, right, regions) - if left is None and right is None: - self.store_sel(regions) - return True - - if left is not None and right is not None: - self.save_regions(left, right, regions) - return True - elif (left is not None or right is not None) and self.show_invalid: - self.save_incomplete_regions(left, right, regions) - return True - return False - - def find_matches(self, bfr, sel): - """ - Find bracket matches - """ - - bracket = None - left, right = self.match_brackets(bfr, self.search_window, sel) - - regions = [sublime.Region(sel.a, sel.b)] - - if left is not None and right is not None: - bracket = self.brackets[left.type] - left, right, regions, _ = self.run_plugin(bracket.name, left, right, regions) - - # Matched brackets - if left is not None and right is not None and bracket is not None: - self.save_regions(left, right, regions) - - # Unmatched brackets - elif (left is not None or right is not None) and self.show_unmatched: - self.save_incomplete_regions(left, right, regions) - - else: - self.store_sel(regions) - - def escaped(self, pt, ignore_string_escape, scope): - """ - Check if sub bracket in string scope is escaped. - """ - - if not ignore_string_escape: - return False - if scope and scope.startswith("string"): - return self.string_escaped(pt) - return False - - def string_escaped(self, pt): - """ - Check if bracket is follows escaping characters. - Account for if in string or regex string scope. - """ - - escaped = False - start = pt - 1 - first = False - if self.view.settings().get("bracket_string_escape_mode", self.default_string_escape_mode) == "string": - first = True - while self.view.substr(start) == "\\": - if first: - first = False - else: - escaped = False if escaped else True - start -= 1 - return escaped - - def is_illegal_scope(self, pt, bracket_id, scope=None): - """ - Check if scope at pt X should be ignored. - """ - - bracket = self.brackets[bracket_id] - if self.sub_search_mode and not bracket.find_in_sub_search: - return True - illegal_scope = False - # Scope sent in, so we must be scanning whatever this scope is - if scope != None: - if self.escaped(pt, bracket.ignore_string_escape, scope): - illegal_scope = True - return illegal_scope - # for exception in bracket.scope_exclude_exceptions: - elif len(bracket.scope_exclude_exceptions) and self.view.match_selector(pt, ", ".join(bracket.scope_exclude_exceptions)): - pass - elif len(bracket.scope_exclude) and self.view.match_selector(pt, ", ".join(bracket.scope_exclude)): - illegal_scope = True - return illegal_scope - - def compare(self, first, second, bfr, scope_bracket=False): - """ - Compare brackets. This function allows bracket plugins to add aditional logic. - """ - - if scope_bracket: - match = first is not None and second is not None - else: - match = first.type == second.type - if match: - bracket = self.scopes[first.scope]["brackets"][first.type] if scope_bracket else self.brackets[first.type] - try: - if bracket.compare is not None and match: - match = bracket.compare( - bracket.name, - BracketRegion(first.begin, first.end), - BracketRegion(second.begin, second.end), - bfr - ) - except: - bh_logging("Plugin Compare Error:\n%s" % str(traceback.format_exc())) - return match - - def post_match(self, left, right, center, bfr, scope_bracket=False): - """ - Peform special logic after a match has been made. - This function allows bracket plugins to add aditional logic. - """ - - if left is not None: - if scope_bracket: - bracket = self.scopes[left.scope]["brackets"][left.type] - bracket_scope = left.scope - else: - bracket = self.brackets[left.type] - bracket_type = left.type - elif right is not None: - if scope_bracket: - bracket = self.scopes[right.scope]["brackets"][right.type] - bracket_scope = right.scope - else: - bracket = self.brackets[right.type] - bracket_type = right.type - else: - return left, right - - self.bracket_style = bracket.style - - if bracket.post_match is not None: - try: - lbracket, rbracket, self.bracket_style = bracket.post_match( - self.view, - bracket.name, - bracket.style, - BracketRegion(left.begin, left.end) if left is not None else None, - BracketRegion(right.begin, right.end) if right is not None else None, - center, - bfr, - self.search_window - ) - - if scope_bracket: - left = ScopeEntry(lbracket.begin, lbracket.end, bracket_scope, bracket_type) if lbracket is not None else None - right = ScopeEntry(rbracket.begin, rbracket.end, bracket_scope, bracket_type) if rbracket is not None else None - else: - left = BracketEntry(lbracket.begin, lbracket.end, bracket_type) if lbracket is not None else None - right = BracketEntry(rbracket.begin, rbracket.end, bracket_type) if rbracket is not None else None - except: - bh_logging("Plugin Post Match Error:\n%s" % str(traceback.format_exc())) - return left, right - - def run_plugin(self, name, left, right, regions): - """ - Run a bracket plugin. - """ - - lbracket = BracketRegion(left.begin, left.end) - rbracket = BracketRegion(right.begin, right.end) - nobracket = False - - if ( - ("__all__" in self.transform or name in self.transform) and - self.plugin != None and - self.plugin.is_enabled() - ): - lbracket, rbracket, regions, nobracket = self.plugin.run_command(self.view, name, lbracket, rbracket, regions) - left = left.move(lbracket.begin, lbracket.end) if lbracket is not None else None - right = right.move(rbracket.begin, rbracket.end) if rbracket is not None else None - return left, right, regions, nobracket - - def match_scope_brackets(self, bfr, sel): - """ - See if scope should be searched, and then check - endcaps to determine if valid scope bracket. - """ - - center = sel.a - left = None - right = None - scope_count = 0 - before_center = center - 1 - bracket_count = 0 - partial_find = None - max_size = self.view.size() - 1 - selected_scope = None - bracket = None - - # Cannot be inside a bracket pair if cursor is at zero - if center == 0: - return left, right, selected_scope, False - - # Identify if the cursor is in a scope with bracket definitions - for s in self.scopes: - scope = s["name"] - extent = None - exceed_limit = False - if self.view.match_selector(center, scope) and self.view.match_selector(before_center, scope): - extent = self.view.extract_scope(center) - while not exceed_limit and extent.begin() != 0: - if self.view.match_selector(extent.begin() - 1, scope): - extent = extent.cover(self.view.extract_scope(extent.begin() - 1)) - if extent.begin() < self.search_window[0] or extent.end() > self.search_window[1]: - extent = None - exceed_limit = True - else: - break - while not exceed_limit and extent.end() != max_size: - if self.view.match_selector(extent.end(), scope): - extent = extent.cover(self.view.extract_scope(extent.end())) - if extent.begin() < self.search_window[0] or extent.end() > self.search_window[1]: - extent = None - exceed_limit = True - else: - break - - if extent is None: - scope_count += 1 - continue - - # Search the bracket patterns of this scope - # to determine if this scope matches the rules. - bracket_count = 0 - scope_bfr = bfr[extent.begin():extent.end()] - for b in s["brackets"]: - m = b.open.search(scope_bfr) - if m and m.group(1): - left = ScopeEntry(extent.begin() + m.start(1), extent.begin() + m.end(1), scope_count, bracket_count) - m = b.close.search(scope_bfr) - if m and m.group(1): - right = ScopeEntry(extent.begin() + m.start(1), extent.begin() + m.end(1), scope_count, bracket_count) - if not self.compare(left, right, bfr, scope_bracket=True): - left, right = None, None - # Track partial matches. If a full match isn't found, - # return the first partial match at the end. - if partial_find is None and bool(left) != bool(right): - partial_find = (left, right) - left = None - right = None - if left and right: - break - bracket_count += 1 - if left and right: - break - scope_count += 1 - - # Full match not found. Return partial match (if any). - if (left is None or right is None) and partial_find is not None: - left, right = partial_find[0], partial_find[1] - - # Make sure cursor in highlighted sub group - if (left and center <= left.begin) or (right and center >= right.end): - left, right = None, None - - if left is not None: - selected_scope = self.scopes[left.scope]["name"] - elif right is not None: - selected_scope = self.scopes[right.scope]["name"] - - if left is not None and right is not None: - bracket = self.scopes[left.scope]["brackets"][left.type] - if bracket.sub_search: - self.sub_search_mode = True - if self.sub_search(sel, (left.begin, right.end), bfr, scope): - return left, right, self.brackets[left.type], True - elif bracket.sub_search_only: - left, right, bracket = None, None, None - - if self.adj_only: - left, right = self.adjacent_check(left, right, center) - - left, right = self.post_match(left, right, center, bfr, scope_bracket=True) - return left, right, bracket, False - - def match_brackets(self, bfr, window, sel, scope=None): - """ - Regex bracket matching. - """ - - center = sel.a - left = None - right = None - stack = [] - pattern = self.pattern if not self.sub_search_mode else self.sub_pattern - bsearch = BracketSearch(bfr, window, center, pattern, self.is_illegal_scope, scope) - for o in bsearch.get_open(BracketSearchSide.left): - if len(stack) and bsearch.is_done(BracektSearchType.closing): - if self.compare(o, stack[-1], bfr): - stack.pop() - continue - for c in bsearch.get_close(BracketSearchSide.left): - if o.end <= c.begin: - stack.append(c) - continue - elif len(stack): - bsearch.remember(BracektSearchType.closing) - break - - if len(stack): - b = stack.pop() - if self.compare(o, b, bfr): - continue - else: - left = o - break - - bsearch.reset_end_state() - stack = [] - - # Grab each closest closing right side bracket and attempt to match it. - # If the closing bracket cannot be matched, select it. - for c in bsearch.get_close(BracketSearchSide.right): - if len(stack) and bsearch.is_done(BracektSearchType.opening): - if self.compare(stack[-1], c, bfr): - stack.pop() - continue - for o in bsearch.get_open(BracketSearchSide.right): - if o.end <= c.begin: - stack.append(o) - continue - else: - bsearch.remember(BracektSearchType.opening) - break - - if len(stack): - b = stack.pop() - if self.compare(b, c, bfr): - continue - else: - if left is None or self.compare(left, c, bfr): - right = c - break - - if self.adj_only: - left, right = self.adjacent_check(left, right, center) - - return self.post_match(left, right, center, bfr) - - def adjacent_check(self, left, right, center): - if left and right: - if left.end < center < right.begin: - left, right = None, None - elif (left and left.end < center) or (right and center < right.begin): - left, right = None, None - return left, right - -bh_match = BhCore().match -bh_debug("Match object loaded.") - - -class BhListenerCommand(sublime_plugin.EventListener): - """ - Manage when to kick off bracket matching. - Try and reduce redundant requests by letting the - background thread ensure certain needed match occurs - """ - - def on_load(self, view): - """ - Search brackets on view load. - """ - - if self.ignore_event(view): - return - BhEventMgr.type = BH_MATCH_TYPE_SELECTION - sublime.set_timeout(bh_run, 0) - - def on_modified(self, view): - """ - Update highlighted brackets when the text changes. - """ - - if self.ignore_event(view): - return - BhEventMgr.type = BH_MATCH_TYPE_EDIT - BhEventMgr.modified = True - BhEventMgr.time = time() - - def on_activated(self, view): - """ - Highlight brackets when the view gains focus again. - """ - - if self.ignore_event(view): - return - BhEventMgr.type = BH_MATCH_TYPE_SELECTION - sublime.set_timeout(bh_run, 0) - - def on_selection_modified(self, view): - """ - Highlight brackets when the selections change. - """ - - if self.ignore_event(view): - return - if BhEventMgr.type != BH_MATCH_TYPE_EDIT: - BhEventMgr.type = BH_MATCH_TYPE_SELECTION - now = time() - if now - BhEventMgr.time > BhEventMgr.wait_time: - sublime.set_timeout(bh_run, 0) - else: - BhEventMgr.modified = True - BhEventMgr.time = now - - def ignore_event(self, view): - """ - Ignore request to highlight if the view is a widget, - or if it is too soon to accept an event. - """ - - return (view.settings().get('is_widget') or BhEventMgr.ignore_all) - - -def bh_run(): - """ - Kick off matching of brackets - """ - - BhEventMgr.modified = False - window = sublime.active_window() - view = window.active_view() if window != None else None - BhEventMgr.ignore_all = True - bh_match(view, True if BhEventMgr.type == BH_MATCH_TYPE_EDIT else False) - BhEventMgr.ignore_all = False - BhEventMgr.time = time() - - -def bh_loop(): - """ - Start thread that will ensure highlighting happens after a barage of events - Initial highlight is instant, but subsequent events in close succession will - be ignored and then accounted for with one match by this thread - """ - - while not BhThreadMgr.restart: - if BhEventMgr.modified == True and time() - BhEventMgr.time > BhEventMgr.wait_time: - sublime.set_timeout(bh_run, 0) - sleep(0.5) - - if BhThreadMgr.restart: - BhThreadMgr.restart = False - sublime.set_timeout(lambda: thread.start_new_thread(bh_loop, ()), 0) - -if not 'running_bh_loop' in globals(): - running_bh_loop = True - thread.start_new_thread(bh_loop, ()) - bh_debug("Starting Thread") -else: - bh_debug("Restarting Thread") - BhThreadMgr.restart = True diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_core.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_core.sublime-settings deleted file mode 100644 index 0b59898..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_core.sublime-settings +++ /dev/null @@ -1,402 +0,0 @@ -{ - //Debug logging - "debug_enable": false, - - // Path to find icons at - "icon_path": "BracketHighlighter/icons", - - // When only either the left or right bracket can be found - // this defines if the unmatched bracket should be shown. - "show_unmatched" : true, - - // High visibility style and color for high visibility mode - // (solid|outline|underline) - "high_visibility_style": "outline", - - // (scope|__default__|__bracket__) - "high_visibility_color": "__bracket__", - - // Match brackets only when the cursor is touching the inside of the bracket - "match_only_adjacent": false, - - // Character threshold to search - "search_threshold": 5000, - - // Ignore threshold - "ignore_threshold": false, - - // Set mode for string escapes to ignore (regex|string) - "bracket_string_escape_mode": "string", - - // Set max number of multi-select brackets that will be searched automatically - "auto_selection_threshold" : 10, - - // Disable gutter icons when doing multi-select - "no_multi_select_icons": false, - - // Rules that define the finding and matching of brackets - // that are contained in a common scope. - // Useful for bracket pairs that are the same but - // share a common scope. Brackets are found by - // Finding the extent of the scope and using regex - // to look at the beginning and end to identify bracket. - // Use only if they cannot be targeted with traditional bracket - // rules. - "scope_brackets": [ - // Quotes - { - "name": "py_single_quote", - "open": "u?r?((?:'')?')", - "close": "((?:'')?')", - "style": "single_quote", - "scopes": ["string"], - "language_filter": "whitelist", - "language_list": ["Python"], - "sub_bracket_search": "true", - "enabled": true - }, - { - "name": "py_double_quote", - "open": "u?r?((?:\"\")?\")", - "close": "((?:\"\")?\")", - "style": "double_quote", - "scopes": ["string"], - "language_filter": "whitelist", - "language_list": ["Python"], - "sub_bracket_search": "true", - "enabled": true - }, - { - "name": "single_quote", - "open": "(')", - "close": "(')", - "style": "single_quote", - "scopes": ["string"], - "language_filter": "blacklist", - "language_list": ["Plain text"], - "sub_bracket_search": "true", - "enabled": true - }, - { - "name": "double_quote", - "open": "(\")", - "close": "(\")", - "style": "double_quote", - "scopes": ["string"], - "language_filter": "blacklist", - "language_list": ["Plain text"], - "sub_bracket_search": "true", - "enabled": true - }, - // Regex for different Languages - { - "name": "jsregex", - "open": " *(/)", - "close": "(/)[igm]*", - "style": "regex", - "scopes": ["string"], - "language_filter": "whitelist", - "language_list": ["JavaScript"], - "sub_bracket_search": "true", - "enabled": true - }, - { - "name": "perlregex", - "open": "(?:m|s|tr)(.|\n)", - "close": "(.|\n)(?:[igmos]*)", - "style": "regex", - "scopes": ["string.regexp"], - "language_filter": "whitelist", - "language_list": ["Perl"], - "sub_bracket_search": "true", - "enabled": true - }, - { - "name": "rubyregex", - "open": " *(/)", - "close": "(/)[imxo]*", - "style": "regex", - "scopes": ["string"], - "language_filter": "whitelist", - "language_list": ["Ruby"], - "sub_bracket_search": "true", - "enabled": true - }, - // Markdown - { - "name": "mditalic", - "open": "(\\*|_)", - "close": "(\\*|_)", - "style": "default", - "scopes": ["markup.italic"], - "language_filter": "whitelist", - "language_list": ["Markdown"], - "sub_bracket_search": "true", - "enabled": true - }, - { - "name": "mdbold", - "open": "(\\*\\*|__)", - "close": "(\\*\\*|__)", - "style": "default", - "scopes": ["markup.bold"], - "language_filter": "whitelist", - "language_list": ["Markdown"], - "sub_bracket_search": "true", - "enabled": true - } - ], - - // Rule definitions for finding and matching brackets. - // Brackets are found by using regex and can use scope - // qualifiers exclude certain matches. - // Once all matches are found, the closest pair surrounding - // the cursor are selected. - "brackets": [ - // Basic brackets - { - "name": "curly", - "open": "(\\{)", - "close": "(\\})", - "style": "curly", - "scope_exclude": ["string", "comment"], - "scope_exclude_exceptions": ["string.other.math.block.environment.latex"], - "language_filter": "blacklist", - "language_list": ["Plain text"], - "find_in_sub_search": "true", - "ignore_string_escape": true, - "enabled": true - }, - { - "name": "round", - "open": "(\\()", - "close": "(\\))", - "style": "round", - "scope_exclude_exceptions": ["string.other.math.block.environment.latex"], - "scope_exclude": ["string", "comment"], - "language_filter": "blacklist", - "language_list": ["Plain text"], - "find_in_sub_search": "true", - "ignore_string_escape": true, - "enabled": true - }, - { - "name": "square", - "open": "(\\[)", - "close": "(\\])", - "style": "square", - "scope_exclude": ["string", "comment"], - "scope_exclude_exceptions": ["string.other.math.block.environment.latex"], - "language_filter": "blacklist", - "language_list": ["Plain text"], - "find_in_sub_search": "true", - "ignore_string_escape": true, - "enabled": true - }, - // HTML - { - "name": "html", - "open": "(<)(?=[\\w\\:\\-]+(?:(?:\\s+[\\w\\-:]+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^>\\s]+))?)*)\\s*\\/?>|\\/[\\w\\:\\-]+[^>]*>)", - "close": "(?<=<)(?:[\\w\\:\\-]+(?:(?:\\s+[\\w\\-:]+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^>\\s]+))?)*)\\s*\\/?|\\/[\\w\\:\\-]+[^>]*)(>)", - "style": "tag", - "scope_exclude": ["string", "comment"], - "language_filter": "whitelist", - "language_list": ["HTML", "HTML 5", "XML", "PHP"], - "plugin_library": "bh_modules.tags", - "find_in_sub_search": "only", - "enabled": false - }, - // CFML - { - "name": "cfml", - "open": "(<)(?=[\\w\\:\\-]+(?:(?:\\s+[\\w\\-\\.:]+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^>\\s]+))?)*|(?:(?<=cfif)|(?<=cfelseif))[^>]+)\\s*\\/?>|\\/[\\w\\:\\-]+[^>]*>)", - "close": "(?<=<)(?:[\\w\\:\\-]+(?:(?:\\s+[\\w\\-\\.:]+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^>\\s]+))?)*|(?:(?<=cfif)|(?<=cfelseif))[^>]+)\\s*\\/?|\\/[\\w\\:\\-]+[^>]*)(>)", - "style": "tag", - "scope_exclude": ["string", "comment"], - "language_filter": "whitelist", - "language_list": ["HTML+CFML", "ColdFusion", "ColdFusionCFC"], - "plugin_library": "bh_modules.tags", - "find_in_sub_search": "only", - "enabled": false - }, - // PHP Angle - { - "name": "php_angle", - "open": "(<\\?)(?:php)?", - "close": "(\\?>)", - "style": "angle", - "scope_exclude": ["string", "comment", "keyword.operator"], - "language_filter": "whitelist", - "language_list": ["HTML", "HTML 5", "PHP"], - "enabled": true - }, - // Angle - { - "name": "angle", - "open": "(<)(?!\\?)", - "close": "(?)", - "style": "angle", - "scope_exclude": ["string", "comment", "keyword.operator", "source.ruby.rails.embedded.html", "source.ruby.embedded.html"], - "language_filter": "whitelist", - "language_list": ["HTML", "HTML 5", "XML", "PHP", "HTML (Rails)", "HTML (Jinja Templates)", "HTML (Twig)", "HTML+CFML", "ColdFusion", "ColdFusionCFC"], - "plugin_library": "bh_modules.tags", - "enabled": true - }, - // CSSedit groups - { - "name": "cssedit_groups", - "open": "(/\\* *@group .*\\*/)", - "close": "(/\\* *@end *\\*/)", - "style": "default", - "scope_exclude": [], - "language_filter": "whitelist", - "language_list": ["CSS"], - "enabled": true - }, - // Ruby embedded HTML - { - "name": "ruby_embedded_html", - "open": "((?:(?<=<%)|(?<=^))\\s*\\b(?:if|case|until|unless|while|begin|class|module|def\\b[\\p{Ll}\\p{Lu}]*)|\\bdo)\\b", - "close": "\\b(end)\\b", - "style": "default", - "scope_exclude": ["text.html", "source", "comment", "string"], - "scope_exclude_exceptions": ["source.ruby.rails.embedded.html", "source.ruby.embedded.html"], - "plugin_library": "bh_modules.rubykeywords", - "language_filter": "whitelist", - "language_list": ["HTML", "HTML 5", "PHP", "HTML (Rails)"], - "enabled": true - }, - // Ruby conditional statements - { - "name": "ruby", - "open": "(^\\s*\\b(?:if|case|until|unless|while|begin|class|module|def\\b[\\p{Ll}\\p{Lu}]*)|\\bdo)\\b", - "close": "\\b(end)\\b", - "style": "default", - "scope_exclude": ["string", "comment"], - "plugin_library": "bh_modules.rubykeywords", - "language_filter": "whitelist", - "language_list": ["Ruby", "Ruby on Rails"], - "enabled": true - }, - // C/C++ compile switches - { - "name": "c_compile_switch", - "open": "(\\#(?:if|ifdef|ifndef))\\b", - "close": "(\\#endif)\\b", - "style": "default", - "scope_exclude": ["string", "comment"], - "language_filter": "whitelist", - "language_list": ["C++", "C", "Objective-C"], - "enabled": true - }, - // PHP conditional keywords - { - "name": "php_keywords", - "open": "(?:^\\s*|<\\?(?:php)?\\s*)?\\b(if|foreach|for|while|switch)\\b(?=.*:\\s*(?:\\?>\\s*)?$)", - "close": "(?:^\\s*|<\\?(?:php)?\\s*)?\\b(endif|endfor|endforeach|endwhile|endswitch)\\b(?=\\s*;\\s*(?:\\?>\\s*)?$)", - "style": "default", - "language_filter": "whitelist", - "scope_exclude": ["string", "comment"], - "plugin_library": "bh_modules.phpkeywords", - "language_list": ["HTML", "HTML 5", "XML", "PHP", "HTML+CFML", "ColdFusion", "ColdFusionCFC"], - "enabled": true - }, - // Erlang conditional statements - { - "name": "erlang", - "open": "\\s*(\\b(?:if|case|begin|try|fun(?=\\s*\\()|receive)\\b)", - "close": "\\b(end)\\b", - "style": "default", - "scope_exclude": ["string", "comment"], - "language_filter": "whitelist", - "language_list": ["Erlang", "HTML (Erlang)"], - "enabled": true - } - ], - - // Define region highlight styles - "bracket_styles": { - // "default" and "unmatched" styles are special - // styles. If they are not defined here, - // they will be generated internally with - // internal defaults. - - // "default" style defines attributes that - // will be used for any style that does not - // explicitly define that attribute. So if - // a style does not define a color, it will - // use the color from the "default" style. - "default": { - "icon": "dot", - // BH1's original default color for reference - // "color": "entity.name.class", - "color": "brackethighlighter.default", - "style": "underline" - }, - - // This particular style is used to highlight - // unmatched bracekt pairs. It is a special - // style. - "unmatched": { - "icon": "question", - // "color": "brackethighlighter.unmatched", - "style": "outline" - }, - // User defined region styles - "curly": { - "icon": "curly_bracket" - // "color": "brackethighlighter.curly", - // "style": "underline" - }, - "round": { - "icon": "round_bracket" - // "color": "brackethighlighter.round", - // "style": "underline" - }, - "square": { - "icon": "square_bracket" - // "color": "brackethighlighter.square", - // "style": "underline" - }, - "angle": { - "icon": "angle_bracket" - // "color": "brackethighlighter.angle", - // "style": "underline" - }, - "tag": { - "icon": "tag", - // "color": "brackethighlighter.tag", - "style": "outline" - }, - "single_quote": { - "icon": "single_quote" - // "color": "brackethighlighter.quote", - // "style": "underline" - }, - "double_quote": { - "icon": "double_quote" - // "color": "brackethighlighter.quote", - // "style": "underline" - }, - "regex": { - "icon": "regex" - // "color": "brackethighlighter.quote", - // "style": "underline" - } - }, - - /* Plugin settings */ - - // Style to use for matched tags - "tag_style": "tag", - - // Scopes to exclude from tag searches - "tag_scope_exclude": ["string", "comment"], - - // Determine which style of tag-matching to use in which syntax - "tag_mode": { - "xhtml": ["XML"], - "html": ["HTML", "HTML 5", "PHP", "HTML (Jinja Templates)", "HTML (Rails)", "HTML (Twig)"], - "cfml": ["HTML+CFML", "ColdFusion", "ColdFusionCFC"] - } -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/__init__.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/__init__.py deleted file mode 100644 index 8b13789..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/bracketremove.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/bracketremove.py deleted file mode 100644 index 98a9d96..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/bracketremove.py +++ /dev/null @@ -1,42 +0,0 @@ -import bh_plugin -import re -import sublime - - -class BracketRemove(bh_plugin.BracketPluginCommand): - def decrease_indent_level(self, edit, row_first, row_last): - tab_size = self.view.settings().get("tab_size", 4) - indents = re.compile(r"^(?:\t| {%d}| *)((?:\t| {%d}| )*)([\s\S]*)" % (tab_size, tab_size)) - if not self.single_line: - for x in reversed(range(row_first, row_last + 1)): - line = self.view.full_line(self.view.text_point(x, 0)) - text = self.view.substr(line) - m = indents.match(text) - if m: - self.view.replace(edit, line, m.group(1) + m.group(2)) - - def run(self, edit, name, remove_content=False, remove_indent=False, remove_block=False): - if remove_content: - self.view.replace(edit, sublime.Region(self.left.begin, self.right.end), "") - else: - row_first = self.view.rowcol(self.left.end)[0] + 1 - row_last = self.view.rowcol(self.right.begin)[0] - 1 - self.single_line = not row_first <= row_last - if remove_block and not self.single_line: - self.view.replace(edit, self.view.full_line(self.right.toregion()), "") - else: - self.view.replace(edit, self.right.toregion(), "") - if remove_indent: - self.decrease_indent_level(edit, row_first, row_last) - if remove_block and not self.single_line: - self.view.replace(edit, self.view.full_line(self.left.toregion()), "") - else: - self.view.replace(edit, self.left.toregion(), "") - - self.left = None - self.right = None - self.nobracket = True - - -def plugin(): - return BracketRemove diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/bracketselect.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/bracketselect.py deleted file mode 100644 index af14a64..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/bracketselect.py +++ /dev/null @@ -1,46 +0,0 @@ -import bh_plugin -import sublime - -DEFAULT_TAGS = ["cfml", "html", "angle"] - - -class SelectBracket(bh_plugin.BracketPluginCommand): - def run(self, edit, name, select='', tags=DEFAULT_TAGS): - current_left, current_right = self.selection[0].begin(), self.selection[0].end() - left, right = self.left, self.right - first, last = left.end, right.begin - if select == 'left': - if name in tags and left.size() > 1: - first, last = left.begin + 1, left.begin + 1 - if first == current_left and last == current_right: - first, last = left.begin, left.begin - else: - first, last = left.end, left.end - if first == current_left and last == current_right: - first, last = left.begin, left.begin - elif select == 'right': - if left.end != right.end: - if name in tags and left.size() > 1: - first, last = right.begin + 1, right.begin + 1 - if first == current_left and last == current_right: - first, last = right.end, right.end - else: - first, last = right.begin, right.begin - if first == current_left and last == current_right: - first, last = right.end, right.end - else: - # There is no second bracket, so just select the first - if name in tags and left.size() > 1: - first, last = left.begin + 1, left.begin + 1 - else: - first, last = right.end, right.end - if first == current_left and last == current_right: - first, last = right.end, right.end - elif first == current_left and last == current_right: - first, last = left.begin, right.end - - self.selection = [sublime.Region(first, last)] - - -def plugin(): - return SelectBracket diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/foldbracket.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/foldbracket.py deleted file mode 100644 index adead9b..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/foldbracket.py +++ /dev/null @@ -1,16 +0,0 @@ -import bh_plugin -import sublime - - -class FoldBrackets(bh_plugin.BracketPluginCommand): - def run(self, edit, name): - content = sublime.Region(self.left.end, self.right.begin) - new_content = [content] - if content.size > 0: - if self.view.fold(content) == False: - new_content = self.view.unfold(content) - self.selection = new_content - - -def plugin(): - return FoldBrackets diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/phpkeywords.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/phpkeywords.py deleted file mode 100644 index cf49e3a..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/phpkeywords.py +++ /dev/null @@ -1,2 +0,0 @@ -def compare(name, first, second, bfr): - return "end" + bfr[first.begin:first.end].lower() == bfr[second.begin:second.end].lower() diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/rubykeywords.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/rubykeywords.py deleted file mode 100644 index ff78a21..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/rubykeywords.py +++ /dev/null @@ -1,13 +0,0 @@ -import re - - -def post_match(view, name, style, first, second, center, bfr, threshold): - if first is not None: - # Strip whitespace from the beginning of first bracket - open_bracket = bfr[first.begin:first.end] - print (open_bracket) - if open_bracket != "do": - m = re.match(r"(\s*\b)[\w\W]*", open_bracket) - if m: - first = first.move(first.begin + m.end(1), first.end) - return first, second, style diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/swapbrackets.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/swapbrackets.py deleted file mode 100644 index 3db5400..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/swapbrackets.py +++ /dev/null @@ -1,20 +0,0 @@ -import sublime -from bh_plugin import ImportModule as ImpMod -BracketRemove = ImpMod.import_from("bh_modules.bracketremove", "BracketRemove") - - -class SwapBrackets(BracketRemove): - def run(self, edit, name, remove_content=False, remove_indent=False, remove_block=False): - offset = self.left.toregion().size() - selection = [sublime.Region(self.left.begin, self.right.begin - offset)] - left = self.left.move(self.left.end, self.left.end) - right = self.right.move(self.right.begin, self.right.begin) - super(SwapBrackets, self).run(edit, name) - self.selection = selection - self.left = left - self.right = right - self.nobracket = False - - -def plugin(): - return SwapBrackets diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/swapquotes.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/swapquotes.py deleted file mode 100644 index 42793b7..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/swapquotes.py +++ /dev/null @@ -1,46 +0,0 @@ -import bh_plugin -import sublime - - -class SwapQuotes(bh_plugin.BracketPluginCommand): - def escaped(self, idx): - view = self.view - escaped = False - while idx >= 0 and view.substr(idx) == '\\': - escaped = ~escaped - idx -= 1 - return escaped - - def run(self, edit, name): - view = self.view - quote = view.substr(self.left.begin) - if quote != "'" and quote != '"': - return - new = "'" if (quote == '"') else '"' - old = quote - begin = self.left.end - end = self.right.begin - content_end = self.right.begin - - view.replace(edit, self.left.toregion(), view.substr(self.left.toregion()).replace(old, new)) - view.replace(edit, self.right.toregion(), view.substr(self.right.toregion()).replace(old, new)) - - offset = 0 - while begin < end + offset: - char = view.substr(begin) - if char == old and self.escaped(begin - 1): - view.replace(edit, sublime.Region(begin - 1, begin), '') - offset -= 1 - content_end -= 1 - elif char == new and not self.escaped(begin - 1): - view.insert(edit, begin, "\\") - offset += 1 - content_end += 1 - begin += 1 - - self.right = self.right.move(content_end, end + offset) - self.selection = [sublime.Region(content_end)] - - -def plugin(): - return SwapQuotes diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/tagattrselect.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/tagattrselect.py deleted file mode 100644 index a4319ec..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/tagattrselect.py +++ /dev/null @@ -1,54 +0,0 @@ -import bh_plugin - - -class SelectAttr(bh_plugin.BracketPluginCommand): - def run(self, edit, name, direction='right'): - if self.left.size() <= 1: - return - tag_name = r'[\w\:\-]+' - attr_name = r'''([\w\-\.:]+)(?:\s*=\s*(?:(?:"((?:\.|[^"])*)")|(?:'((?:\.|[^'])*)')|([^>\s]+)))?''' - tname = self.view.find(tag_name, self.left.begin) - current = self.selection[0].b - region = self.view.find(attr_name, tname.b) - selection = self.selection - - if direction == 'left': - last = None - - # Keep track of last attr - if region != None and current <= region.b and region.b < self.left.end: - last = region - - while region != None and region.b < self.left.end: - # Select attribute until you have closest to the left of selection - if current > region.b: - selection = [region] - last = None - # Update last attr - elif last != None: - last = region - region = self.view.find(attr_name, region.b) - # Wrap right - if last != None: - selection = [last] - else: - first = None - # Keep track of first attr - if region != None and region.b < self.left.end: - first = region - - while region != None and region.b < self.left.end: - # Select closest attr to the right of the selection - if current < region.b: - selection = [region] - first = None - break - region = self.view.find(attr_name, region.b) - # Wrap left - if first != None: - selection = [first] - self.selection = selection - - -def plugin(): - return SelectAttr diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/tagnameselect.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/tagnameselect.py deleted file mode 100644 index 77b8fe9..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/tagnameselect.py +++ /dev/null @@ -1,14 +0,0 @@ -import bh_plugin - - -class TagNameSelect(bh_plugin.BracketPluginCommand): - def run(self, edit, name): - if self.left.size() > 1: - tag_name = '[\w\:\-]+' - region1 = self.view.find(tag_name, self.left.begin) - region2 = self.view.find(tag_name, self.right.begin) - self.selection = [region1, region2] - - -def plugin(): - return TagNameSelect diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/tags.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/tags.py deleted file mode 100644 index 47c2972..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_modules/tags.py +++ /dev/null @@ -1,243 +0,0 @@ -import re -from collections import namedtuple -import sublime -from os.path import basename - -FLAGS = re.MULTILINE | re.IGNORECASE -HTML_START = re.compile(r'''<([\w\:\-]+)((?:\s+[\w\-:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))?)*)\s*(\/?)>''', FLAGS) -CFML_START = re.compile(r'''<([\w\:\-]+)((?:\s+[\w\-\.:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))?)*|(?:(?<=cfif)|(?<=cfelseif))[^>]+)\s*(\/?)>''', FLAGS) -START_TAG = { - "html": HTML_START, - "xhtml": HTML_START, - "cfml": CFML_START -} -END_TAG = re.compile(r'<\/([\w\:\-]+)[^>]*>', FLAGS) - -self_closing_tags = set("colgroup dd dt li options p td tfoot th thead tr".split()) -single_tags = set("area base basefont br col frame hr img input isindex link meta param embed".split()) - - -class TagEntry(namedtuple('TagEntry', ['begin', 'end', 'name', 'self_closing', 'single'], verbose=False)): - def move(self, begin, end): - return self._replace(begin=begin, end=end) - - -def compare_languge(language, lang_list): - found = False - for l in lang_list: - if language == l.lower(): - found = True - break - return found - - -def get_tag_mode(view, tag_mode_config): - default_mode = None - syntax = view.settings().get('syntax') - language = basename(syntax).replace('.tmLanguage', '').lower() if syntax != None else "plain text" - for mode in ["html", "xhtml", "cfml"]: - if compare_languge(language, tag_mode_config.get(mode, [])): - return mode - return default_mode - - -def post_match(view, name, style, first, second, center, bfr, threshold): - left, right = first, second - threshold = [0, len(bfr)] if threshold is None else threshold - tag_settings = sublime.load_settings("bh_core.sublime-settings") - tag_mode = get_tag_mode(view, tag_settings.get("tag_mode", {})) - tag_style = tag_settings.get("tag_style", "angle") - bracket_style = style - - if first is not None and tag_mode is not None: - matcher = TagMatch(view, bfr, threshold, first, second, center, tag_mode) - left, right = matcher.match() - if not matcher.no_tag: - bracket_style = tag_style - - return left, right, bracket_style - - -class TagSearch(object): - def __init__(self, view, bfr, window, center, pattern, match_type): - self.start = window[0] - self.end = window[1] - self.center = center - self.pattern = pattern - self.match_type = match_type - self.bfr = bfr - self.prev_match = None - self.return_prev = False - self.done = False - self.view = view - self.scope_exclude = sublime.load_settings("bh_core.sublime-settings").get("tag_scope_exclude") - - def scope_check(self, pt): - illegal_scope = False - for exclude in self.scope_exclude: - illegal_scope |= bool(self.view.score_selector(pt, exclude)) - return illegal_scope - - def reset_end_state(self): - self.done = False - self.prev_match = None - self.return_prev = False - - def remember(self): - self.return_prev = True - self.done = False - - def get_tags(self, bracket_code): - if self.done: - return - if self.return_prev: - self.return_prev = False - yield self.prev_match - for m in self.pattern.finditer(self.bfr, self.start, self.end): - name = m.group(1).lower() - if not self.match_type: - single = bool(m.group(3) != "" or name in single_tags) - self_closing = name in self_closing_tags or name.startswith("cf") - else: - single = False - self_closing = False - start = m.start(0) - end = m.end(0) - if not self.scope_check(start): - self.prev_match = TagEntry(start, end, name, self_closing, single) - self.start = end - yield self.prev_match - self.done = True - - -class TagMatch(object): - def __init__(self, view, bfr, threshold, first, second, center, mode): - self.view = view - self.bfr = bfr - self.mode = mode - tag, tag_type, tag_end = self.get_first_tag(first[0]) - self.left, self.right = None, None - self.window = None - self.no_tag = False - if tag and first[0] < center < tag_end: - if tag.single: - self.left = tag - self.right = tag - else: - if tag_type == "open": - self.left = tag - self.window = (tag_end, len(bfr) if threshold is None else threshold[1]) - else: - self.right = tag - self.window = (0 if threshold is None else threshold[0], first[0]) - else: - self.left = first - self.right = second - self.no_tag = True - - def get_first_tag(self, offset): - tag = None - tag_type = None - self_closing = False - single = False - m = START_TAG[self.mode].match(self.bfr[offset:]) - end = None - if m: - name = m.group(1).lower() - single = bool(m.group(3) != "" or name in single_tags) - if self.mode == "html": - self_closing = name in self_closing_tags - elif self.mode == "cfml": - self_closing = name in self_closing_tags or name.startswith("cf") - start = m.start(0) + offset - end = m.end(0) + offset - tag = TagEntry(start, end, name, self_closing, single) - tag_type = "open" - self.center = end - else: - m = END_TAG.match(self.bfr[offset:]) - if m: - name = m.group(1).lower() - start = m.start(0) + offset - end = m.end(0) + offset - tag = TagEntry(start, end, name, self_closing, single) - tag_type = "close" - self.center = offset - return tag, tag_type, end - - def compare_tags(self, left, right): - return left.name == right.name - - def resolve_self_closing(self, stack, c): - found_tag = None - b = stack[-1] - if self.compare_tags(b, c): - found_tag = b - stack.pop() - else: - while b is not None and b.self_closing: - stack.pop() - if len(stack): - b = stack[-1] - if self.compare_tags(b, c): - found_tag = b - stack.pop() - break - else: - b = None - return found_tag - - def match(self): - stack = [] - - # No tags to search for - if self.no_tag or (self.left and self.right): - return self.left, self.right - - # Init tag matching objects - osearch = TagSearch(self.view, self.bfr, self.window, self.center, START_TAG[self.mode], 0) - csearch = TagSearch(self.view, self.bfr, self.window, self.center, END_TAG, 1) - - # Searching for opening or closing tag to match - match_type = 0 if self.right else 1 - - # Match the tags - for c in csearch.get_tags(match_type): - if len(stack) and osearch.done: - if self.resolve_self_closing(stack, c): - continue - for o in osearch.get_tags(match_type): - if o.end <= c.begin: - if not o.single: - stack.append(o) - continue - else: - osearch.remember() - break - - if len(stack): - if self.resolve_self_closing(stack, c): - continue - elif match_type == 0 and not osearch.done: - continue - if match_type == 1: - if self.left is None or self.compare_tags(self.left, c): - self.right = c - elif self.left.self_closing: - self.right = self.left - break - - if match_type == 0: - # Find the rest of the the unmatched left side open brackets - # approaching the cursor if all closing brackets were matched - # Select the most recent open bracket on the stack. - for o in osearch.get_tags(0): - if not o.single: - stack.append(o) - if len(stack): - self.left = self.resolve_self_closing(stack, self.right) - elif self.right is None and self.left is not None and self.left.self_closing: - # Account for the opening tag that was found being a self closing - self.right = self.left - - return self.left, self.right diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_plugin.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_plugin.py deleted file mode 100644 index 78a600e..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_plugin.py +++ /dev/null @@ -1,142 +0,0 @@ -import sublime -from os.path import normpath, join -import imp -from collections import namedtuple -import sys -import traceback -import warnings - - -class BracketRegion (namedtuple('BracketRegion', ['begin', 'end'], verbose=False)): - """ - Bracket Regions for plugins - """ - - def move(self, begin, end): - """ - Move bracket region to different points - """ - - return self._replace(begin=begin, end=end) - - def size(self): - """ - Get the size of the region - """ - - return abs(self.begin - self.end) - - def toregion(self): - """ - Convert to sublime region - """ - - return sublime.Region(self.begin, self.end) - - -def is_bracket_region(obj): - """ - Check if object is a BracketRegion - """ - - return isinstance(obj, BracketRegion) - - -class ImportModule(object): - @classmethod - def import_module(cls, module_name, loaded=None): - # Pull in built-in and custom plugin directory - if module_name.startswith("bh_modules."): - path_name = join(sublime.packages_path(), "BracketHighlighter", normpath(module_name.replace('.', '/'))) - else: - path_name = join(sublime.packages_path(), normpath(module_name.replace('.', '/'))) - path_name += ".py" - if loaded is not None and module_name in loaded: - module = sys.modules[module_name] - else: - with warnings.catch_warnings(record=True) as w: - # Ignore warnings about plugin folder not being a python package - warnings.simplefilter("always") - module = imp.new_module(module_name) - sys.modules[module_name] = module - source = None - with open(path_name) as f: - source = f.read().replace('\r', '') - cls.__execute_module(source, module_name) - w = filter(lambda i: issubclass(i.category, UserWarning), w) - return module - - @classmethod - def __execute_module(cls, source, module_name): - exec(compile(source, module_name, 'exec'), sys.modules[module_name].__dict__) - - @classmethod - def import_from(cls, module_name, attribute): - return getattr(cls.import_module(module_name), attribute) - - -class BracketPlugin(object): - """ - Class for preparing and running plugins - """ - - def __init__(self, plugin, loaded): - """ - Load plugin module - """ - - self.enabled = False - self.args = plugin['args'] if ("args" in plugin) else {} - self.plugin = None - if 'command' in plugin: - plib = plugin['command'] - try: - module = ImportModule.import_module(plib, loaded) - self.plugin = getattr(module, 'plugin')() - loaded.add(plib) - self.enabled = True - except Exception: - print 'BracketHighlighter: Load Plugin Error: %s\n%s' % (plugin['command'], traceback.format_exc()) - - def is_enabled(self): - """ - Check if plugin is enabled - """ - - return self.enabled - - def run_command(self, view, name, left, right, selection): - """ - Load arguments into plugin and run - """ - - plugin = self.plugin() - setattr(plugin, "left", left) - setattr(plugin, "right", right) - setattr(plugin, "view", view) - setattr(plugin, "selection", selection) - setattr(plugin, "nobracket", False) - edit = view.begin_edit() - self.args["edit"] = edit - self.args["name"] = name - try: - nobracket = False - plugin.run(**self.args) - left, right, selection, nobracket = plugin.left, plugin.right, plugin.selection, plugin.nobracket - except Exception: - print "BracketHighlighter: Plugin Run Error:\n%s" % str(traceback.format_exc()) - view.end_edit(edit) - return left, right, selection, nobracket - - -class BracketPluginCommand(object): - """ - Bracket Plugin base class - """ - - def run(self, bracket, content, selection): - """ - Runs the plugin class - """ - - pass diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_remove.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_remove.py deleted file mode 100644 index ed1da63..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_remove.py +++ /dev/null @@ -1,51 +0,0 @@ -import sublime_plugin -from collections import namedtuple - -MENU = namedtuple("Menu", "simple content block block_indent")( - "Remove Brackets", - "Remove Brackets and Content", - "Remove Brackets: Block", - "Remove Brackets: Indented Block" -) - - -class BhRemoveBracketsCommand(sublime_plugin.WindowCommand): - """ - Command to remove current highlighted brackets and optionally content - """ - - def remove_brackets(self, value): - """ - Perform removal of brackets - """ - - if value != -1: - menu_item = MENU[value] - indent = menu_item == MENU.block_indent - block = menu_item == MENU.block or menu_item == MENU.block_indent - content = menu_item == MENU.content - - self.window.run_command( - "bh_key", - { - "plugin": { - "type": ["__all__"], - "command": "bh_modules.bracketremove", - "args": { - "remove_indent": indent, - "remove_block": block, - "remove_content": content - } - } - } - ) - - def run(self): - """ - Show menu of removal options - """ - - self.window.show_quick_panel( - list(MENU), - self.remove_brackets - ) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_swapping.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_swapping.py deleted file mode 100644 index c28c930..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_swapping.py +++ /dev/null @@ -1,55 +0,0 @@ -import sublime -import sublime_plugin -import bh_wrapping - - -class SwapBrackets(bh_wrapping.WrapBrackets): - def wrap(self, wrap_entry): - if wrap_entry < 0: - return - - self._style = ["inline"] - - self.brackets = self._brackets[wrap_entry] - self.wrap_brackets(0) - - -class SwapBracketsCommand(sublime_plugin.WindowCommand): - def finalize(self, callback): - if self.view is not None: - if not self.view.settings().get("BracketHighlighterBusy", False): - callback() - else: - sublime.set_timeout(lambda: self.finalize(callback), 100) - - def swap_brackets(self, value): - if value < 0: - return - - self.brackets = self.wrap._brackets[value] - - self.window.run_command( - "bh_key", - { - "plugin": { - "type": ["__all__"], - "command": "bh_modules.swapbrackets" - } - } - ) - - self.view = self.window.active_view() - - sublime.set_timeout(lambda: self.finalize(lambda: self.wrap.wrap(value)), 100) - - def run(self): - view = self.window.active_view() - if view is None: - return - self.wrap = SwapBrackets(view, "bh_swapping.sublime-settings", "swapping") - - if len(self.wrap._menu): - self.window.show_quick_panel( - self.wrap._menu, - self.swap_brackets - ) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_swapping.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_swapping.sublime-settings deleted file mode 100644 index 09e583e..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_swapping.sublime-settings +++ /dev/null @@ -1,46 +0,0 @@ -{ - "swapping": [ - { - "enabled": true, "language_list": [], "language_filter": "whitelist", "entries": [ - {"name": "<> Angle", "brackets": ["<", ">${BH_SEL}"]} - ] - }, - { - "enabled": true, "language_list": ["Plain text"], "language_filter": "blacklist", "entries": [ - {"name": "{} Curly", "brackets": ["{", "}${BH_SEL}"]} - ] - }, - { - "enabled": true, "language_list": ["Plain text"], "language_filter": "blacklist", "entries": [ - {"name": "() Round", "brackets": ["(", ")${BH_SEL}"]} - ] - }, - { - "enabled": true, "language_list": ["Plain text"], "language_filter": "blacklist", "entries": [ - {"name": "[] Square", "brackets": ["[", "]${BH_SEL}"]} - ] - }, - { - "enabled": true, "language_list": ["HTML", "HTML 5", "XML", "PHP", "HTML+CFML", "ColdFusion", "ColdFusionCFC"], "language_filter": "whitelist", "entries": [ - {"name": "HTML/XML Tag", "brackets": ["<${BH_SEL:NAME}>", ""]} - ] - }, - { - "enabled": true, "language_list": ["Markdown"], "language_filter": "whitelist", "entries": [ - {"name": "Mardown: Bold", "brackets": ["**", "**${BH_SEL}"]}, - {"name": "Mardown: Italic", "brackets": ["_", "_${BH_SEL}"]} - ] - }, - { - "enabled": true, "language_list": ["C++", "C"], "language_filter": "whitelist", "entries": [ - {"name": "C/C++: #if", "brackets": ["#if ${BH_SEL}", "#endif"]}, - {"name": "C/C++: #if, #else", "brackets": ["#if${BH_SEL}", "#else\n${BH_TAB:/* CODE */}\n#endif"]}, - {"name": "C/C++: #if, #elif", "brackets": ["#if${BH_SEL}", "#elif ${BH_TAB:/* CONDITION */}\n${BH_TAB:/* CODE */}\n#endif"]}, - {"name": "C/C++: #ifdef", "brackets": ["#ifdef${BH_SEL}", "#endif"]}, - {"name": "C/C++: #ifdef, #else", "brackets": ["#ifdef${BH_SEL}", "#else\n${BH_TAB:/* CODE */}\n#endif"]}, - {"name": "C/C++: #ifndef", "brackets": ["#ifndef${BH_SEL}", "#endif"]}, - {"name": "C/C++: #ifndef, #else", "brackets": ["#ifndef${BH_SEL}", "#else\n${BH_TAB:/* CODE */}\n#endif"]} - ] - } - ] -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_wrapping.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_wrapping.py deleted file mode 100644 index fc58251..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_wrapping.py +++ /dev/null @@ -1,368 +0,0 @@ -import sublime -import sublime_plugin -from os.path import basename -import re - - -BH_TABSTOPS = re.compile(r"(\$\{BH_(SEL|TAB)(?:\:([^\}]+))?\})") -TAB_REGION = "bh_plugin_wrapping_tabstop" -SEL_REGION = "bh_plugin_wrapping_select" -OUT_REGION = "bh_plugin_wrapping_outlier" - -VALID_INSERT_STYLES = ( - ("inline", "Inline Insert"), - ("block", "Block Insert"), - ("indent_block", "Indented Block Insert") -) - - -def exclude_entry(enabled, filter_type, language_list, language): - """ - Exclude bracket wrapping entry by filter - """ - - exclude = True - if enabled: - # Black list languages - if filter_type == 'blacklist': - exclude = False - if language != None: - for item in language_list: - if language == item.lower(): - exclude = True - break - #White list languages - elif filter_type == 'whitelist': - if language != None: - for item in language_list: - if language == item.lower(): - exclude = False - break - return exclude - - -class TextInsertion(object): - """ - Wrapper class for inserting text - """ - - def __init__(self, view, edit): - """ - Store view and edit objects - """ - - self.view = view - self.edit = edit - - def insert(self, pt, text): - """ - Peform insertion - """ - - return self.view.insert(self.edit, pt, text) - - -class WrapBrackets(object): - """ - Wrap the current selection(s) with the defined wrapping options - """ - - def __init__(self, view, setting_file, attribute): - self.view = view - self._menu = [] - self._brackets = [] - self._insert = [] - self._style = [] - self.read_wrap_entries(setting_file, attribute) - - def inline(self, edit, sel): - """ - Inline wrap - """ - - ti = TextInsertion(self.view, edit) - - offset1 = ti.insert(sel.begin(), self.brackets[0]) - self.insert_regions.append(sublime.Region(sel.begin(), sel.begin() + offset1)) - offset2 = ti.insert(sel.end() + offset1, self.brackets[1]) - self.insert_regions.append(sublime.Region(sel.end() + offset1, sel.end() + offset1 + offset2)) - - def block(self, edit, sel, indent=False): - """ - Wrap brackets around selection and block off the content - """ - - # Calculate number of lines between brackets - self.calculate_lines(sel) - # Calculate the current indentation of first bracket - self.calculate_indentation(sel) - - ti = TextInsertion(self.view, edit) - - line_offset = 0 - first_end = 0 - second_end = 0 - second_start = sel.end() - - for b in reversed(self.brackets[1].split('\n')): - second_end += ti.insert(sel.end(), "\n" + self.indent_to_col + b) - num_open_lines = self.brackets[0].count('\n') - for b in reversed(self.brackets[0].split('\n')): - if line_offset == num_open_lines: - line = b + "\n" - else: - line = self.indent_to_col + b + "\n" - first_end += ti.insert(sel.begin(), line) - line_offset += 1 - self.insert_regions.append(sublime.Region(sel.begin(), sel.begin() + first_end)) - - if indent: - second_start += self.indent_content(ti, line_offset) - else: - pt = self.view.text_point(self.first_line + line_offset, 0) - second_start += ti.insert(pt, self.indent_to_col) - - self.insert_regions.append(sublime.Region(first_end + second_start, first_end + second_start + second_end)) - - def indent_content(self, ti, line_offset): - """ - Indent the block content - """ - - first = True - offset = 0 - for l in range(line_offset, self.total_lines + line_offset): - pt = self.view.text_point(self.first_line + l, 0) - if first: - offset += ti.insert(pt, self.indent_to_col + "\t") - first = False - else: - offset += ti.insert(pt, "\t") - return offset - - def calculate_lines(self, sel): - """ - Calculate lines between brackets - """ - - self.first_line, self.col_position = self.view.rowcol(sel.begin()) - last_line = self.view.rowcol(sel.end())[0] - self.total_lines = last_line - self.first_line + 1 - - def calculate_indentation(self, sel): - """ - Calculate how much lines should be indented - """ - - tab_size = self.view.settings().get("tab_size", 4) - tab_count = self.view.substr(sublime.Region(sel.begin() - self.col_position, sel.begin())).count('\t') - spaces = self.col_position - tab_count - self.indent_to_col = "\t" * tab_count + "\t" * (spaces / tab_size) + " " * (spaces % tab_size if spaces >= tab_size else spaces) - - def select(self, edit): - """ - Select defined regions after wrapping - """ - - self.view.sel().clear() - map(lambda x: self.view.sel().add(x), self.insert_regions) - - final_sel = [] - initial_sel = [] - for s in self.view.sel(): - string = self.view.substr(s) - matches = [m for m in BH_TABSTOPS.finditer(string)] - multi_offset = 0 - if matches: - for m in matches: - r = sublime.Region(s.begin() + multi_offset + m.start(1), s.begin() + multi_offset + m.end(1)) - if m.group(3): - replace = m.group(3) - self.view.erase(edit, r) - added = self.view.insert(edit, r.begin(), replace) - final_sel.append(sublime.Region(s.begin() + multi_offset + m.start(1), s.begin() + multi_offset + m.start(1) + added)) - multi_offset += added - r.size() - else: - self.view.erase(edit, r) - final_sel.append(sublime.Region(s.begin() + multi_offset + m.start(1))) - multi_offset -= r.size() - if m.group(2) == "SEL": - initial_sel.append(final_sel[-1]) - - if len(initial_sel) != len(final_sel): - self.view.add_regions(TAB_REGION, final_sel, "", "", sublime.HIDDEN) - - # Re-position cursor - self.view.sel().clear() - if len(initial_sel): - map(lambda x: self.view.sel().add(x), initial_sel) - elif len(final_sel): - self.view.sel().add(final_sel[0]) - - def read_wrap_entries(self, setting_file, attribute): - """ - Read wrap entries from the settings file - """ - - settings = sublime.load_settings(setting_file) - syntax = self.view.settings().get('syntax') - language = basename(syntax).replace('.tmLanguage', '').lower() if syntax != None else "plain text" - wrapping = settings.get(attribute, []) - for i in wrapping: - if not exclude_entry(i["enabled"], i["language_filter"], i["language_list"], language): - for j in i.get("entries", []): - try: - menu_entry = j["name"] - bracket_entry = j["brackets"] - insert_style = j.get("insert_style", ["inline"]) - self._menu.append(menu_entry) - self._brackets.append(bracket_entry) - self._insert.append(insert_style) - except Exception: - pass - - def wrap_brackets(self, value): - """ - Wrap selection(s) with defined brackets - """ - - if value < 0: - return - - # Use new edit object since the main run has already exited - # and the old edit is more than likely closed now - edit = self.view.begin_edit() - - # Wrap selections with brackets - style = self._style[value] - self.insert_regions = [] - - for sel in self.view.sel(): - # Determine indentation style - if style == "indent_block": - self.block(edit, sel, True) - elif style == "block": - self.block(edit, sel) - else: - self.inline(edit, sel) - - self.select(edit) - - self.view.end_edit(edit) - - def wrap_style(self, value): - """ - Choose insert style for wrapping. - """ - - if value < 0: - return - - style = [] - - self.brackets = self._brackets[value] - for s in VALID_INSERT_STYLES: - if s[0] in self._insert[value]: - self._style.append(s[0]) - style.append(s[1]) - - if len(style) > 1: - self.view.window().show_quick_panel( - style, - self.wrap_brackets - ) - else: - self.wrap_brackets(0) - - -class WrapBracketsCommand(sublime_plugin.TextCommand, WrapBrackets): - def run(self, edit): - """ - Display the wrapping menu - """ - - self._menu = [] - self._brackets = [] - self._insert = [] - self._style = [] - self.read_wrap_entries("bh_wrapping.sublime-settings", "wrapping") - - if len(self._menu): - self.view.window().show_quick_panel( - self._menu, - self.wrap_style - ) - - -class BhNextWrapSelCommand(sublime_plugin.TextCommand): - """ - Navigate wrapping tab stop regions - """ - - def run(self, edit): - """ - Look for the next wrapping tab stop region - """ - - regions = self.view.get_regions(SEL_REGION) + self.view.get_regions(OUT_REGION) - if len(regions): - self.view.sel().clear() - map(lambda x: self.view.sel().add(x), regions) - - # Clean up unneed sections - self.view.erase_regions(SEL_REGION) - self.view.erase_regions(OUT_REGION) - - -class BhWrapListener(sublime_plugin.EventListener): - """ - Listen for wrapping tab stop tabbing - """ - - def on_query_context(self, view, key, operator, operand, match_all): - """ - Mark the next regions to navigate to. - """ - - accept_query = False - if key == "bh_wrapping": - select = [] - outlier = [] - regions = view.get_regions(TAB_REGION) - tabstop = [] - sels = view.sel() - - if len(regions) == 0: - return False - - for s in sels: - count = 0 - found = False - for r in regions[:]: - if found: - select.append(r) - tabstop.append(r) - del regions[count] - break - if r.begin() <= s.begin() <= r.end(): - del regions[count] - found = True - continue - count += 1 - if not found: - outlier.append(s) - tabstop += regions - - if len(tabstop) == len(select): - if len(tabstop): - tabstop = [] - accept_query = True - elif len(tabstop) != 0: - accept_query = True - - # Mark regions to make the "next" command aware of what to do - view.add_regions(SEL_REGION, select, "", "", sublime.HIDDEN) - view.add_regions(OUT_REGION, outlier, "", "", sublime.HIDDEN) - view.add_regions(TAB_REGION, tabstop, "", "", sublime.HIDDEN) - - return accept_query diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_wrapping.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_wrapping.sublime-settings deleted file mode 100644 index a2899bd..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/bh_wrapping.sublime-settings +++ /dev/null @@ -1,71 +0,0 @@ -{ - "wrapping": [ - { - "enabled": true, "language_list": [], "language_filter": "whitelist", "entries": [ - {"name": "<> Angle", "brackets": ["<", ">${BH_SEL}"]} - ] - }, - { - "enabled": true, "language_list": ["Plain text"], "language_filter": "blacklist", "entries": [ - {"name": "{} Curly", "brackets": ["{", "}${BH_SEL}"]} - ] - }, - { - "enabled": true, "language_list": ["Plain text"], "language_filter": "blacklist", "entries": [ - {"name": "() Round", "brackets": ["(", ")${BH_SEL}"]} - ] - }, - { - "enabled": true, "language_list": ["Plain text"], "language_filter": "blacklist", "entries": [ - {"name": "[] Square", "brackets": ["[", "]${BH_SEL}"]} - ] - }, - { - "enabled": true, "language_list": ["Plain text"], "language_filter": "blacklist", "entries": [ - {"name": "'' Single Quotes", "brackets": ["'", "'${BH_SEL}"], "insert_style": ["inline"]}, - {"name": "\"\" Double Quotes", "brackets": ["\"", "\"${BH_SEL}"], "insert_style": ["inline"]} - ] - }, - { - "enabled": true, "language_list": ["Python"], "language_filter": "whitelist", "entries": [ - {"name": "'''''' Triple Single Quotes", "brackets": ["'''", "'''${BH_SEL}"], "insert_style": ["inline", "block"]}, - {"name": "\"\"\"\"\"\" Triple Double Quotes", "brackets": ["\"\"\"", "\"\"\"${BH_SEL}"], "insert_style": ["inline", "block"]} - ] - }, - { - "enabled": true, "language_list": ["HTML", "HTML 5", "XML", "PHP", "HTML+CFML", "ColdFusion", "ColdFusionCFC"], "language_filter": "whitelist", "entries": [ - {"name": "HTML/XML Tag", "brackets": ["<${BH_SEL:NAME}>", ""], "insert_style": ["inline", "block", "indent_block"]} - ] - }, - { - "enabled": true, "language_list": ["Markdown"], "language_filter": "whitelist", "entries": [ - {"name": "Mardown: Bold", "brackets": ["**", "**${BH_SEL}"]}, - {"name": "Mardown: Italic", "brackets": ["_", "_${BH_SEL}"]} - ] - }, - { - "enabled": true, "language_list": ["C++", "C"], "language_filter": "whitelist", "entries": [ - {"name": "C/C++: #if", "brackets": ["#if ${BH_SEL:/* CONDITION */}", "#endif"], "insert_style": ["block"]}, - {"name": "C/C++: #if, #else", "brackets": ["#if ${BH_SEL:/* CONDITION */}", "#else\n${BH_TAB:/* CODE */}\n#endif"], "insert_style": ["block"]}, - {"name": "C/C++: #if, #elif", "brackets": ["#if ${BH_SEL:/* CONDITION */}", "#elif ${BH_TAB:/* CONDITION */}\n${BH_TAB:/* CODE */}\n#endif"], "insert_style": ["block"]}, - {"name": "C/C++: #ifdef", "brackets": ["#ifdef ${BH_SEL:/* DEFINE */}", "#endif"], "insert_style": ["block"]}, - {"name": "C/C++: #ifdef, #else", "brackets": ["#ifdef ${BH_SEL:/* DEFINE */}", "#else\n${BH_TAB:/* CODE */}\n#endif"], "insert_style": ["block"]}, - {"name": "C/C++: #ifndef", "brackets": ["#ifndef ${BH_SEL:/* DEFINE */}", "#endif"], "insert_style": ["block"]}, - {"name": "C/C++: #ifndef, #else", "brackets": ["#ifndef ${BH_SEL:/* DEFINE */}", "#else\n${BH_TAB:/* CODE */}\n#endif"], "insert_style": ["block"]} - ] - }, - { - "enabled": true, "language_list": ["Ruby"], "language_filter": "whitelist", "entries": [ - {"name": "Ruby: if", "brackets": ["if ${BH_SEL:CONDITION}", "end"], "insert_style": ["indent_block"]}, - {"name": "Ruby: until", "brackets": ["until ${BH_SEL:CONDITION}", "end"], "insert_style": ["indent_block"]}, - {"name": "Ruby: while", "brackets": ["while ${BH_SEL:CONDITION}", "end"], "insert_style": ["indent_block"]}, - {"name": "Ruby: def", "brackets": ["def ${BH_SEL:NAME}", "end"], "insert_style": ["indent_block"]} - ] - }, - { - "enabled": true, "language_list": ["CSS"], "language_filter": "whitelist", "entries": [ - {"name": "CSS: @group", "brackets": ["/* @group ${BH_SEL:NAME} */", "/* @end */"], "insert_style": ["block"]} - ] - } - ] -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket.png deleted file mode 100644 index a6aaef4..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket_close.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket_close.png deleted file mode 100644 index edb8b19..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket_close.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket_close_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket_close_small.png deleted file mode 100644 index ba6c69c..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket_close_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket_open.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket_open.png deleted file mode 100644 index 27a8303..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket_open.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket_open_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket_open_small.png deleted file mode 100644 index e3e6679..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket_open_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket_small.png deleted file mode 100644 index fb5879f..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/angle_bracket_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/bookmark.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/bookmark.png deleted file mode 100644 index 44055a6..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/bookmark.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/bookmark_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/bookmark_small.png deleted file mode 100644 index acf8012..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/bookmark_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/circle.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/circle.png deleted file mode 100644 index f23afb0..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/circle.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/circle_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/circle_small.png deleted file mode 100644 index d32b925..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/circle_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket.png deleted file mode 100644 index dc48ec6..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket_close.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket_close.png deleted file mode 100644 index 0773317..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket_close.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket_close_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket_close_small.png deleted file mode 100644 index 05f13ad..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket_close_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket_open.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket_open.png deleted file mode 100644 index 5297eca..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket_open.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket_open_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket_open_small.png deleted file mode 100644 index 0c3d0b4..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket_open_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket_small.png deleted file mode 100644 index a348972..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/curly_bracket_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/dot.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/dot.png deleted file mode 100644 index 52e5493..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/dot.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/dot_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/dot_small.png deleted file mode 100644 index 8ebbe9a..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/dot_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote.png deleted file mode 100644 index 07a7946..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_close.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_close.png deleted file mode 100644 index 02aca9f..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_close.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_close_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_close_small.png deleted file mode 100644 index ad4656f..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_close_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_offset.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_offset.png deleted file mode 100644 index 628138b..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_offset.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_offset_open.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_offset_open.png deleted file mode 100644 index d4621c1..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_offset_open.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_offset_open_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_offset_open_small.png deleted file mode 100644 index 1139367..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_offset_open_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_offset_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_offset_small.png deleted file mode 100644 index a029339..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_offset_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_open.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_open.png deleted file mode 100644 index 5f63217..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_open.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_open_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_open_small.png deleted file mode 100644 index dfa09ad..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_open_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_small.png deleted file mode 100644 index 4f149fc..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/double_quote_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/question.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/question.png deleted file mode 100644 index 8e5324a..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/question.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/question_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/question_small.png deleted file mode 100644 index 9d4c23d..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/question_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/quote.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/quote.png deleted file mode 100644 index b073dc6..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/quote.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/quote_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/quote_small.png deleted file mode 100644 index e44fbbc..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/quote_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket.png deleted file mode 100644 index 19d79ac..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket_close.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket_close.png deleted file mode 100644 index 772f7b0..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket_close.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket_close_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket_close_small.png deleted file mode 100644 index f174562..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket_close_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket_open.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket_open.png deleted file mode 100644 index 001d511..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket_open.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket_open_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket_open_small.png deleted file mode 100644 index 85c97f7..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket_open_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket_small.png deleted file mode 100644 index 6893093..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/round_bracket_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote.png deleted file mode 100644 index 11d6ffc..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_close.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_close.png deleted file mode 100644 index 066c5d9..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_close.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_close_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_close_small.png deleted file mode 100644 index 65b31fd..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_close_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_offset.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_offset.png deleted file mode 100644 index 3129747..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_offset.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_offset_open.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_offset_open.png deleted file mode 100644 index 7ed5e68..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_offset_open.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_offset_open_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_offset_open_small.png deleted file mode 100644 index 3f5ca1e..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_offset_open_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_offset_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_offset_small.png deleted file mode 100644 index db25ba4..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_offset_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_open.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_open.png deleted file mode 100644 index 7ed5e68..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_open.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_open_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_open_small.png deleted file mode 100644 index 86c8e66..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_open_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_small.png deleted file mode 100644 index dd7d49a..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/single_quote_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket.png deleted file mode 100644 index f3f00b2..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket_close.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket_close.png deleted file mode 100644 index dc5eb2c..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket_close.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket_close_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket_close_small.png deleted file mode 100644 index 5740f81..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket_close_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket_open.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket_open.png deleted file mode 100644 index e773360..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket_open.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket_open_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket_open_small.png deleted file mode 100644 index b30181e..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket_open_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket_small.png deleted file mode 100644 index 3a8002c..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/square_bracket_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/star.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/star.png deleted file mode 100644 index 109b6e8..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/star.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/star_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/star_small.png deleted file mode 100644 index 8e12d3c..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/star_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/tag.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/tag.png deleted file mode 100644 index 822427d..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/tag.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/tag_small.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/tag_small.png deleted file mode 100644 index 2a6a71c..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/icons/tag_small.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/package-metadata.json deleted file mode 100644 index 9ae6e32..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://github.com/facelessuser/BracketHighlighter", "version": "2013.09.15.18.40.20", "description": "Bracket and tag highlighter for Sublime Text 2"} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/readme.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/readme.md deleted file mode 100644 index 079cc93..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/readme.md +++ /dev/null @@ -1,492 +0,0 @@ -# Table of Contents -- [About](#about) - - [Sublime Text 3 Support?](#sublime-text-3-support) - - [Overview](#overview) -- [Feature List](#feature-list) -- [General Use](#general-use) - - [Built-in Supported brackets](#built-in-supported-brackets) - - [Additional Features](#additional-features) - - [Bracket Plugin](#bracket-plugin) - - [Shortcuts](#shortcuts) -- [Customizing BracketHighligher](#costumizing-brackethighlighter) - - [Configuring Brackets](#cnfiguring-brackets) - - [Configuring Highlight Style](#configuring-highlight-style) -- [Bracket Plugin API](#bracket-plugin-api) - - ['Defintion' Plugins](#definition-plugins) - - [Run Instance Plugins](#run-instance-plugins) -- [Credits](#credits) -- [Changelog](#changelog) - -# About -This is a fork of pyparadigm's _SublimeBrackets_ and _SublimeTagmatcher_ (both are no longer available). I forked this to fix some issues I had and to add some features I wanted. I also wanted to improve the efficiency of the matching. This cuts down on the parallel searching that is now streamlined in one search. Since then, I have rewritten the entire code base to bring more flexibility, speed, and features. - - - -## Sublime Text 3 Support? -ST3 support is found here (at the present time): https://github.com/facelessuser/BracketHighlighter/tree/BH2ST3 - -## Overview -Bracket Highlighter matches a variety of brackets such as: ```[]```, ```()```, ```{}```, ```""```, ```''```, ``````, and even custom brackets. - -# Feature List -- Customizable to highlight almost any bracket -- Customizable bracket highlight style -- High visibility bracket highlight mode -- Selectively disable or enable specific matching of tags, brackets, or quotes -- Selectively whitelist or blacklist matching of specific tags, brackets, or quotes based on language -- When bound to a shortcut, allow option to show line count and char count between match in the status bar -- Highlight basic brackets within strings -- Works with multi-select -- Configurable custom gutter icons -- Toggle bracket escape mode for string brackets (regex|string) -- Bracket plugins that can jump between bracket ends, select content, remove brackets and/or content, wrap selectios with brackets, swap brackets, swap quotes (handling quote escaping between the main quotes), fold/unfold conent between brackets, toggle through tag attribute selecection, select both the opening and closing tag name to change both simultaneously. - -# General Use -In general, BracketHighligher (BH) will highlight brackets (or defined bracket like start and end blocks) surrounding the cursor. By default, BH will put opening and closing icons in the gutter of the corresponding line containing open or closising bracket. BH, by default, will underline the closing and opening bracket as well. - -## Built-in Supported brackets -Currently BH supports the following brackets out of the box: - -- round -- square -- curly -- angle -- single and double quotes -- python single and double quotes (unicode and raw) -- python tripple single and double quotes (unicode and raw) -- Javascript regex -- Perl regex -- Ruby regex -- Markdown italic -- Markdown bold -- CSSedit groups -- Ruby conditional statements -- C/C++ compiler switches -- PHP conditional keywords -- Erlang conditional statements -- HTML/ColdFusion/XML tags - -BH also supports highlighting basic sub brackets ```(), [], {}``` within supported regex and strings. - -## Additional Features -BH has a couple of additonal features built-in. - -### Toggle Global Enable (bh_toggle_enable) -This command enables and disables BH globally - -### Toggle String Bracket Escape Mode (bh_toggle_string_escape_mode) -This toggles BH's recognition mode of escaped sub brackets in strings and regex. The modes are string escape mode and regex escape mode. - -### Settings -When changing settings, you should copy the entire ```bh_core.sublime-settings``` to your ```User``` folder before changing. Style and color will be discussed in greater depth in the ```Configuring Highlight Style``` section. - -These are the basic settings you can change: -```javascript - //Debug logging - "debug_enable": false, - - // When only either the left or right bracket can be found - // this defines if the unmatched bracket should be shown. - "show_unmatched" : true, - - // High visibility style and color for high visibility mode - // (solid|outline|underline) - "high_visibility_style": "outline", - // (scope|__default__|__bracket__) - "high_visibility_color": "__bracket__", - - // Match brackets only when the cursor is touching the inside of the bracket - "match_only_adjacent": false, - - // Character threshold to search - "search_threshold": 5000, - - // Set mode for string escapes to ignore (regex|string) - "bracket_string_escape_mode": "string", - - // Set max number of multi-select brackets that will be searched automatically - "auto_selection_threshold" : 10, - - // Disable gutter icons when doing multi-select - "no_multi_select_icons": false, -``` - -### Bracket Plugins -Bh is also extendable via plugins and provides an number of plugins by default. See [Bracket Plugins](#bracket-plugins) to learn more about the included plugins. - -## Bracket Plugin -BH provides a number of built in Bracket Plugins that take advantage of BH's matching to provide additional features. Most plugin features are available via the Tools->Packages->BracketHighlighter menu or the command palette. To see how to configure shortcuts, see the ```Example.sublime-settings``` file. - -### Bracket Select Plugin -This plugin changes the selection inside between the brackets. It can select the content or move the bracket to the opening and closing bracket. Behavior is slightly modified for tags. - -### Bracket Remove Plugin -Removes the surrounding brackets. - -### Fold Bracket Plugin -Folds the content of the current surrounding brackets. - -### Swap Quotes Plugin -Swap the quotes style of surrounding quotes from double to single or vice versa. It also handles escaping and unescaping of sub quotes. - -### Tag Plugin -Plugin used to help highlight tags. - -Additional tag settings found in ```bh_core.sublime-settings```: -```javascript - /* Plugin settings */ - - // Style to use for matched tags - "tag_style": "tag", - - // Scopes to exclude from tag searches - "tag_scope_exclude": ["string", "comment"], - - // Determine which style of tag-matching to use in which syntax - "tag_mode": { - "xhtml": ["XML"], - "html": ["HTML", "HTML 5", "PHP"], - "cfml": ["HTML+CFML", "ColdFusion", "ColdFusionCFC"] - } -``` - -### Tag Attribute Select Plugin -Cycle through selecting tag attributes of tags. - -### Tag Name Select Plugin -Select the opening and closing tag name of current tag. - -### Bracket Wrapping Plugin -Wrap the current selection with supported bracket of your choice. Wrapping definitions are configured in ```bh_wrapping.sublime-settings```. - -### Bracket Swapping Plugin -Swap the current surrounding bracket with supported bracket of your choice. Swapping definitions are configured in ```bh_swapping.sublime-settings```. - -## Shortcuts -By default BH provides no shortcuts to avoid shortcut conflicts, but you can view the included ```Example.sublime-keymaps``` file to get an idea how to set up your own. - -# Customizing BracketHighligher -BH is extremely flexible and be customized and extended to fit a User's needs. The first step is to copy the ```bh_core.sublime-settings``` to your ```User``` folder. - -## Configuring Brackets -BH has been written to allow users to define any brackets they would like to have highlighted. There are two kinds of brackets you can define: ```scope_brackets``` (search file for scope regions and then use regex to test for opening and closing brackets) and ```brackets``` (use regex to find opening and closing brackets). ```bracket``` should usually be the preferred type. ```scope_brackets``` are usually used for brackets whose opening and closing are the same and not distinguishable form one another by regex; scope brackets must be contained in a continuous scope region like string for quotes etc. - -### Configuring Brackets -Brackets are defined under ```brackets``` in ```bh_core.sublime-settings```. - -Angle and Curly bracket will be used as an eample (not all options may be shown in these examples): - -```javascript - { - "name": "angle", - "open": "(<)", - "close": "(>)", - "style": "angle", - "scope_exclude": ["string", "comment", "keyword.operator"], - "language_filter": "whitelist", - "language_list": ["HTML", "HTML 5", "XML", "PHP", "HTML+CFML", "ColdFusion", "ColdFusionCFC"], - "plugin_library": "bh_modules.tags", - "enabled": true - }, - { - "name": "curly", - "open": "(\\{)", - "close": "(\\})", - "style": "curly", - "scope_exclude": ["string", "comment"], - "scope_exclude_exceptions": ["string.other.math.block.environment.latex"], - "language_filter": "blacklist", - "language_list": ["Plain text"], - "find_in_sub_search": "true", - "ignore_string_escape": true, - "enabled": true - }, -``` - -- **name**: the name of the bracket (should be unique) -- **open**: defines the opening bracket (one and only one captureing group must be present) -- **close**: defines the closing bracket (one and only one captureing group must be present) -- **style**: Name of style definition to be used to highlight the brackets. See ```Configuring Bracket Styles``` for more info. -- **scope_exclude**: Scopes where the opening and closing brackets should be ignored. -- **language_filter**: This works in conjunction with ```language_list```. It specifies whether ```language_list``` is a ```blacklist``` or ```whitelist```. -- **language_list**: an array of tmLanguage file names that should be avoided or included for highlighting. Looks to ```language_filter``` to determine if avoidance or inclusion is used. -- **enabled**: disable or enable rule -- **scope_exclude_exceptions (optional)***: used to ignore exluding of sub scopes such as in the curly example above where ```string``` is excluded, but not ```string.other.math.block.environment.latex```. -- **plugin_library (optional)**: defines plugin to use for determining matches (see Bracket Plugin API for more info on matching plugins) -- **find_in_sub_search (optional)**: this rule should be included when doing sub bracket matching in ```scope_brackets``` (like finding round brackets between quotes etc.). The setting must be as string and can be either (true|false|only); only means this bracket is only matched as a sub bracket of a ```scope_bracket```. -- **ignore_string_escape (optional)**: Do not ignore sub brackets found in strings and regex when escaped, but use internal escape logic to determine if the brackets should be ignored based on whether regex or string escape mode is set. - -### Configuring Scope Brackets -Scope Brackets are defined under ```scope_brackets``` in ```bh_core.sublime-settings```. - -Python Single Quote bracket will be used as an eample (not all options are shown in this example): - -```javascript - { - "name": "py_single_quote", - "open": "u?r?((?:'')?')", - "close": "((?:'')?')", - "style": "single_quote", - "scopes": ["string"], - "language_filter": "whitelist", - "language_list": ["Python"], - "sub_bracket_search": "true", - "enabled": true - }, -``` - -- **name**: the name of the bracket (should be unique) -- **open**: defines the opening bracket (one and only one captureing group must be present) -- **close**: defines the closing bracket (one and only one captureing group must be present) -- **style**: Name of style definition to be used to highlight the brackets. See ```Configuring Bracket Styles``` for more info. -- **scopes**: scope that should be searched to find the opening and closing brackets. -- **language_filter**: This works in conjunction with ```language_list```. It specifies whether ```language_list``` is a ```blacklist``` or ```whitelist```. -- **language_list**: an array of tmLanguage file names that should be avoided or included for highlighting. Looks to ```language_filter``` to determine if avoidance or inclusion is used. -- **sub_bracket_search**: should this scope bracket also search for sub brackets (like curly brackets in strings etc.). -- **enabled**: disable or enable rule -- **plugin_library (optional)**: defines plugin to use for determining matches (see Bracket Plugin API for more info on matching plugins) - -## Configuring Highlight Style -Each bracket definition (described in [Configuring Scope Brackets](#configuring-scope-brackets) and [Configuring Brackets](#configuring-brackets)) has a ```style``` setting that you give a style definition to. Style definitions are defined under ```bracket_styles``` in ```bh_core.sublime-settings```. - -There are two special style definitions whose names are reserved: ```default``` and ```unmatched```, but you can configure them. All other custom style definitions follow the same pattern (see ```curly``` below and compare to the special style defintions; format is the same) All custom styles follow this pattern. See description below: - -```javascript - // "default" style defines attributes that - // will be used for any style that does not - // explicitly define that attribute. So if - // a style does not define a color, it will - // use the color from the "default" style. - "default": { - "icon": "dot", - "color": "brackethighlighter.default", - "style": "underline" - }, - - // This particular style is used to highlight - // unmatched bracekt pairs. It is a special - // style. - "unmatched": { - "icon": "question", - // "color": "brackethighlighter.unmatched", - "style": "outline" - }, - // User defined region styles - "curly": { - "icon": "curly_bracket" - // "color": "brackethighlighter.curly", - // "style": "underline" - }, -``` - -- **icon**: icon to show in gutter. Available options are (angle|round|curly|square|tag|star|dot|bookmark|question|quote|double_quote|single_quote|single_quote_offset| -double_quote_offset|none) -- **color**: scope to define color -- **style**: higlight style. Available options are (solid|outline|underline|none) - -As shown in the example above, if an option is omitted, it will use the setting in ```default```. So ```curly```, in this example, defines ```icon```, but will use ```default``` for the ```color``` and ```style```. - -To customize the color for ```curly``` you can create your own custom scope. - -Add this to your color scheme: -```XML - - name - Bracket Curly - scope - brackethighlighter.curly - settings - - foreground - #CC99CC - - -``` - -And then use the scope: -```javascript - "curly": { - "icon": "curly_bracket" - "color": "brackethighlighter.curly", - // "style": "underline" - }, -``` - -# Bracket Plugin API -There are two kinds of plugins that can be written ```definition``` plugins (plugins attached to bracket definitions via the ```plugin_library``` option) or ```run instance``` plugins (plugins that are that are fed in the BracketHighligher via the command parameter ```plugin```). - -Bracket plugins use ```BracketRegions```. ```BracketRegions``` are simple objects containing a begin pt and end pt of a bracket. - -Class: - -- **BracketRegion(begin_pt, end_pt)** - -Attributes of BracketRegion: - -- **begin**: the start pt of the BracketRegion -- **end**: the end pt of the BracketRegion - -Methods of BracketRegion: - -- **size()**: returns size of region -- **move(begin_pt, end_pt)**: returns a new BracketRegion object with the points moved as specified by the parameters -- **toregion**: returns a sublime Region() object - -## 'Defintion' Plugins -These are plugins that are attached to the bracket definition and aid in processing the brackets. These kids of plugins have two methods you can provide ```post_match``` and/or ```compare```. - -### compare -```compare``` is run when comparing the opening bracket with closing brackets. This allows you to provide logic to accept or reject the pairing of an opening bracket with a closing bracket. You should not change the text in the view during this operation. - -The ```compare``` method receives the following paramters: - -- **name**: the name of the bracket definition being evaluated -- **first**: a bracket region for the opening bracket -- **second**: a bracket region for the closing bracket -- **bfr**: the file buffer - -Returns: - -- **Boolean**: indicating whether the the comparison yields a suitable match - -Example (from phphekywords.py): -```python -def compare(name, first, second, bfr): - return "end" + bfr[first.begin:first.end].lower() == bfr[second.begin:second.end].lower() -``` - -### post_match -```post_match``` is run after the brackets have been matched. You can do things like alter the highlighting region and change the bracket_style if needed. You should not change the text in the view during this operation. - -The ```post_match``` method receives the following parameters: - -- **name**: the name of the bracket definition being evaluated -- **style**: the style definition name that is to be used to highlight the region -- **first**: a bracket region for the opening bracket -- **second**: a bracket region for the closing bracket -- **center**: position (pt) of cursor (in retrospect, probably not the most intuitive name; not sure why I named it such) -- **bfr**: the file buffer -- **threshold**: the calculated search window of the buffer that is being searched - -Returns: - -- **BracketRegion**: opening bracket region -- **BracketRegion**: closing bracekt region -- **style**: the name of the style definition to use - -Example (from rubykeywords.py): -```python -import re - - -def post_match(view, name, style, first, second, center, bfr, threshold): - if first is not None: - # Strip whitespace from the beginning of first bracket - open_bracket = bfr[first.begin:first.end] - if open_bracket != "do": - m = re.match(r"^(\s*\b)[\w\W]*", open_bracket) - if m: - first = first.move(first.begin + m.end(1), first.end) - return first, second, style -``` - -Example (snippet from tags.py) -```python -def post_match(view, name, style, first, second, center, bfr, threshold): - left, right = first, second - threshold = [0, len(bfr)] if threshold is None else threshold - tag_settings = sublime.load_settings("bh_core.sublime-settings") - tag_mode = get_tag_mode(view, tag_settings.get("tag_mode", {})) - tag_style = tag_settings.get("tag_style", "angle") - bracket_style = style - - if first is not None and tag_mode is not None: - matcher = TagMatch(view, bfr, threshold, first, second, center, tag_mode) - left, right = matcher.match() - if not matcher.no_tag: - bracket_style = tag_style - - return left, right, bracket_style -``` - -## Run Instance Plugins -```Run instance``` plugins are fed into the command executing a BracketHighlighter match via the ```plugin``` parameter. - -Example of run instance plugin getting called: -```javascript -// Go to left bracket - { - "caption": "BracketHighlighter: Jump to Left Bracket", - "command": "bh_key", - "args": - { - "lines" : true, - "plugin": - { - "type": ["__all__"], - "command": "bh_modules.bracketselect", - "args": {"select": "left"} - } - } - }, -``` - -The ```plugin``` paramter is a dictionary that contains 3 parameters to define what plugin should get run, with what arguments, and on what bracket defintion. - -- **type**: an array containing the bracket definition names that the plugin should be run on. Use ```__all__``` for all bracket definitions. -- **command**: the plugin to run. For internal plugins, they are referenced by ```bh_modules.```. For custom plugins, you should use the folder path releative to ```Packages```. So if I had a plugin called ```myplugin.py``` in my ```User``` folder, I would use ```User.myplugin```. -- **args**: a dictionary contianing the arguments to feed into the plugin. - -You create ```run instance``` plugins by deriving a class from the ```BracketPluginCommand``` class. Then you provide a method called ```plugin``` that returns the class. - -Class: - -- **BracketPluginCommand()** - -Parameters of BracketPluginCommand: - -- **edit**: sublime edit object -- **name**: name of tag definition being evaluated - -Attributes of BracketPluginCommand: - -- **view**: the sublime view containg the bracket (don't change this) -- **left**: a bracket region for the opening bracket (can be changed) -- **right**: a bracket region for the closing bracket (can be changed) -- **selection**: an array containing the selection that triggered the match (can be changed) - -Methods of BracketPluginCommand: - -- **run(edit, name, )**: (edit is a sublime edit object and name is the bracket definition being evaluated) - -Example (from foldbracket.py): -```python -import BracketHighlighter.bh_plugin as bh_plugin -import sublime - - -class FoldBrackets(bh_plugin.BracketPluginCommand): - def run(self, edit, name): - content = sublime.Region(self.left.end, self.right.begin) - new_content = [content] - if content.size() > 0: - if self.view.fold(content) == False: - new_content = self.view.unfold(content) - self.selection = new_content - - -def plugin(): - return FoldBrackets -``` - -# Credits -- pyparadigm: for his original efforts with SublimeBrackets and SublimeTagmatcher which originally BracketHighlighter was built off of and the inspiration behind the current implementation. -- BoundInCode: for his Tag icon - -# Changelog - -#### Version 2.0.0 -- Re-write of BracketHighlighter - -#### Older Versions -- See [Complete Changelog](https://github.com/facelessuser/BracketHighlighter/blob/BH2/CHANGELOG.md) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/ure.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/ure.py deleted file mode 100644 index bcd33ac..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/BracketHighlighter/ure.py +++ /dev/null @@ -1,207 +0,0 @@ -""" -ure - unicode re - -A simple script that wraps the re interface with methods to handle unicode properties. -Patterns will all have re.UNICODE enabled and unicode property formats will be replaced -with the unicode characters in that category. - -Example: -r"\p{Ll}\p{Lu}" - -Licensed under MIT -Copyright (c) 2013 Isaac Muse -""" -import re -import sys -from os.path import dirname -try: - import unicodedata -except: - sys.path.append(dirname(sys.executable)) - import unicodedata - -PY3 = sys.version_info[0] >= 3 -uchr = chr if PY3 else unichr - -DEBUG = re.DEBUG -I = re.I -IGNORECASE = re.IGNORECASE -L = re.L -LOCALE = re.LOCALE -M = re.M -MULTILINE = re.MULTILINE -S = re.S -DOTALL = re.DOTALL -U = re.U -UNICODE = re.UNICODE -X = re.X -VERBOSE = re.VERBOSE -escape = re.escape -purge = re.purge - -_unicode_properties = None -_unicode_key_pattern = None - - -def _build_unicode_property_table(unicode_range): - """ - Build property table for unicode range. - """ - table = {} - p = None - for i in range(*unicode_range): - try: - c = uchr(i) - p = unicodedata.category(c) - except: - continue - if p[0] not in table: - table[p[0]] = {} - if p[1] not in table[p[0]]: - table[p[0]][p[1]] = [] - table[p[0]][p[1]].append(c) - - # Join as one string - for k1, v1 in table.items(): - for k2, v2 in v1.items(): - v1[k2] = ''.join(v2) - - return table - - -def _build_unicode_key_pattern(): - """ - Build regex key pattern - """ - unicode_prop = r"\p\{(%s)\}" - unicode_keys = [] - for k1, v1 in _unicode_properties.items(): - unicode_keys.append("%s(?:%s)" % (k1, "|".join(v1.keys()))) - return re.compile(unicode_prop % "|".join(unicode_keys), re.UNICODE) - - -def _init_unicode(): - """ - Prepare unicode property tables and key pattern - """ - global _unicode_properties - global _unicode_key_pattern - _unicode_properties = _build_unicode_property_table((0x0000, 0x10FFFF)) - _unicode_key_pattern = _build_unicode_key_pattern() - - -def find_char_groups(s): - """ - Find character groups - """ - pos = 0 - groups = [] - escaped = False - found = False - first = None - for c in s: - if c == "\\": - escaped = not escaped - elif escaped: - escaped = False - elif c == "[" and not found: - found = True - first = pos - elif c == "]" and found: - groups.append((first, pos)) - pos += 1 - return groups - - -def get_unicode_category(prop): - """ - Retrieve the unicode category from the table - """ - p1, p2 = (prop[0], prop[1]) if len(prop) > 1 else (prop[0], None) - return ''.join([x for x in _unicode_properties[p1].values()]) if p2 is None else _unicode_properties[p1][p2] - - -def parse_unicode_properties(re_pattern): - """ - Replaces regex property notation with unicode values - """ - char_groups = find_char_groups(re_pattern) - ure_pattern = re_pattern - for p in reversed(list(_unicode_key_pattern.finditer(re_pattern))): - v = get_unicode_category(p.group(1)) - brackets = True - if v is None: - continue - for g in char_groups: - if p.start(0) >= g[0] and p.end(0) <= g[1]: - brackets = False - break - if brackets: - v = "[" + v + "]" - ure_pattern = ure_pattern[:p.start(0) - 1] + v + ure_pattern[p.end(0): len(ure_pattern)] - return ure_pattern - - -def compile(pattern, flags=0): - """ - compile after parsing unicode properties and set flag to unicode - """ - return re.compile(parse_unicode_properties(pattern), flags | re.UNICODE) - - -def search(pattern, string, flags=0): - """ - search after parsing unicode properties and set flag to unicode - """ - re.search(parse_unicode_properties(pattern), string, flags | re.UNICODE) - - -def match(pattern, string, flags=0): - """ - match after parsing unicode properties and set flag to unicode - """ - re.match(parse_unicode_properties(pattern), string, flags | re.UNICODE) - - -def split(pattern, string, maxsplit=0, flags=0): - """ - split after parsing unicode properties and set flag to unicode - """ - re.split(parse_unicode_properties(pattern), string, maxsplit, flags | re.UNICODE) - - -def findall(pattern, string, flags=0): - """ - findall after parsing unicode properties and set flag to unicode - """ - re.findall(parse_unicode_properties(pattern), string, flags | re.UNICODE) - - -def finditer(pattern, string, flags=0): - """ - finditer after parsing unicode properties and set flag to unicode - """ - re.finditer(parse_unicode_properties(pattern), string, flags | re.UNICODE) - - -def sub(pattern, repl, string, count=0, flags=0): - """ - sub after parsing unicode properties and set flag to unicode - """ - re.sub(parse_unicode_properties(pattern), repl, string, count, flags | re.UNICODE) - - -def subn(pattern, repl, string, count=0, flags=0): - """ - subn after parsing unicode properties and set flag to unicode - """ - re.subn(parse_unicode_properties(pattern), repl, string, flags | re.UNICODE) - - -_init_unicode() - - -if __name__ == "__main__": - print("Testing ure's unicode properties replacement") - print(parse_unicode_properties(r"[\p{Ll}\p{Lu}]")) - print(parse_unicode_properties(r"\p{Ll}\p{Lu}")) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/Default.sublime-commands b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/Default.sublime-commands deleted file mode 100644 index ebd4a05..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/Default.sublime-commands +++ /dev/null @@ -1,25 +0,0 @@ -[ - { - "caption": "Bracketeer: Indent Text", - "command": "bracketeer_indent" - }, - { - "caption": "Bracketeer: Select Inside Braces", - "command": "bracketeer_select" - }, - { - "caption": "Bracketeer: Insert curly brackets", - "command": "bracketeer", - "args": { "braces": "{}" } - }, - { - "caption": "Bracketeer: Insert square brackets", - "command": "bracketeer", - "args": { "braces": "[]" } - }, - { - "caption": "Bracketeer: Insert round brackets, aka parentheses", - "command": "bracketeer", - "args": { "braces": "()" } - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/Example.sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/Example.sublime-keymap deleted file mode 100644 index 7d87ac3..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/Example.sublime-keymap +++ /dev/null @@ -1,276 +0,0 @@ -[ - { "keys": ["super+]"], "command": "bracketeer_indent" }, - { "keys": ["ctrl+shift+["], "command": "bracketeer_select" }, - - { "keys": ["ctrl+["], "command": "bracketeer_goto", "args": { "goto": "left" } }, - { "keys": ["ctrl+]"], "command": "bracketeer_goto", "args": { "goto": "right" } }, - { "keys": ["ctrl+alt+["], "command": "bracketeer_goto", "args": { "goto": "both" } }, - { "keys": ["ctrl+alt+]"], "command": "bracketeer_goto", "args": { "goto": "both" } }, - //| - //| BRACKETEER - //| - { "keys": ["{"], "command": "bracketeer", "args": { "braces": "{}", "unindent": true } }, - { "keys": ["}"], "command": "bracketeer", "args": { "braces": "{}", "pressed": "}", "unindent": true } }, - { "keys": ["["], "command": "bracketeer", "args": { "braces": "[]" } }, - { "keys": ["]"], "command": "bracketeer", "args": { "braces": "[]", "pressed": "]" } }, - { "keys": ["("], "command": "bracketeer", "args": { "braces": "()" } }, - { "keys": [")"], "command": "bracketeer", "args": { "braces": "()", "pressed": ")" } }, - - //| reStructured Text - { "keys": ["alt+`"], "command": "bracketeer", "args": { "braces": "````", "pressed": "``" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.restructuredtext" } - ] - }, - { "keys": ["*"], "command": "bracketeer", "args": { "braces": "**", "pressed": "*" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.restructuredtext" } - ] - }, - - //| DJANGO CURLIES - // For django, liquid, jinja. All the grammars *I* have list 'source.smarty' as - // when the cursor is inside "{}"s - { "keys": ["{"], "command": "bracketeer", "args": { "braces": "{ }" }, "context": - [{ "key": "selector", "operator": "equal", "operand": "source.smarty" }] - }, - { "keys": ["{"], "command": "bracketeer", "args": { "braces": "{ }" }, "context": - [{ "key": "selector", "operator": "equal", "operand": "meta.brace.curly" }] - }, - { "keys": ["%"], "command": "bracketeer", "args": { "braces": "% %" }, "context": - [{ "key": "selector", "operator": "equal", "operand": "source.smarty" }] - }, - { "keys": ["%"], "command": "bracketeer", "args": { "braces": "% %" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "meta.brace.curly" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "<$", "match_all": true } - ] - }, - { "keys": ["%"], "command": "insert_snippet", "args": { "contents": " $1 %>$0" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "source.ruby" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "<%$", "match_all": true } - ] - }, - { "keys": [">"], "command": "insert_snippet", "args": { "contents": ">$1<% $0" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "source.ruby" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "%$", "match_all": true } - ] - }, - { "keys": ["="], "command": "insert_snippet", "args": { "contents": "= $1 %>$0" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "source.ruby" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "<%$", "match_all": true } - ] - }, - { "keys": ["-"], "command": "insert_snippet", "args": { "contents": "- $1 %>$0" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "source.ruby" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "<%$", "match_all": true } - ] - }, - { "keys": ["#"], "command": "bracketeer", "args": { "braces": "# #" }, "context": - [{ "key": "selector", "operator": "equal", "operand": "source.smarty" }] - }, - - //| QUOTES - { "keys": ["\""], "command": "bracketeer", "args": { "braces": "\"\"", "pressed": "\"" } }, - { "keys": ["ctrl+'","ctrl+'"], "command": "bracketeer", "args": { "braces": "\"\"\"\n\n\"\"\"" } }, - { "keys": ["'"], "command": "bracketeer", "args": { "braces": "''", "pressed": "'" } }, - { "keys": ["ctrl+'","'"], "command": "bracketeer", "args": { "braces": "'''\n\n'''" } }, - { "keys": ["`"], "command": "bracketeer", "args": { "braces": "``", "pressed": "`" } }, - { "keys": ["ctrl+'","`"], "command": "insert_snippet", "args": { "contents": "```${1:syntax}\n$0\n```" } }, - { "keys": ["«"], "command": "bracketeer", "args": { "braces": "«»" } }, - { "keys": ["»"], "command": "bracketeer", "args": { "braces": "«»", "pressed": "»" } }, - { "keys": ["‹"], "command": "bracketeer", "args": { "braces": "‹›" } }, - { "keys": ["›"], "command": "bracketeer", "args": { "braces": "‹›", "pressed": "›" } }, - { "keys": ["“"], "command": "bracketeer", "args": { "braces": "“”" } }, - { "keys": ["”"], "command": "bracketeer", "args": { "braces": "“”", "pressed": "”" } }, - { "keys": ["‘"], "command": "bracketeer", "args": { "braces": "‘’" } }, - { "keys": ["’"], "command": "bracketeer", "args": { "braces": "‘’", "pressed": "’" } }, - - //| - //| AUTO DELETE MATCHING '', "", [], etc. - //| - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "\"$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^\"" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "'$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^'" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "`$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^`" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "«$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^»" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "‹$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^›" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "“$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^”" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "‘$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^’" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.restructuredtext" }, - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "\\*$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^\\*" } - ] - }, - - //| - //| Bracket and select - //| - { "keys": ["ctrl+alt+[", "backspace"], "command": "bracketeer", "args": { "braces": "", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "d"], "command": "bracketeer", "args": { "braces": ["do", "end"], "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "d"], "command": "bracketeer", "args": { "braces": ["do", "end"], "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "{"], "command": "bracketeer", "args": { "braces": "{}", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "{"], "command": "bracketeer", "args": { "braces": "{}", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", " "], "command": "bracketeer", "args": { "braces": " ", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", " "], "command": "bracketeer", "args": { "braces": " ", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "["], "command": "bracketeer", "args": { "braces": "[]", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "["], "command": "bracketeer", "args": { "braces": "[]", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "("], "command": "bracketeer", "args": { "braces": "()", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "("], "command": "bracketeer", "args": { "braces": "()", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "\""], "command": "bracketeer", "args": { "braces": "\"\"", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "\""], "command": "bracketeer", "args": { "braces": "\"\"", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "ctrl+shift+'"], "command": "bracketeer", "args": { "braces": "\"\"\"\"\"\"", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "ctrl+shift+'"], "command": "bracketeer", "args": { "braces": "\"\"\"\"\"\"", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "'"], "command": "bracketeer", "args": { "braces": "''", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "'"], "command": "bracketeer", "args": { "braces": "''", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "ctrl+'"], "command": "bracketeer", "args": { "braces": "''''''", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "ctrl+'"], "command": "bracketeer", "args": { "braces": "''''''", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "`"], "command": "bracketeer", "args": { "braces": "``", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "`"], "command": "bracketeer", "args": { "braces": "``", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "ctrl+`"], "command": "bracketeer", "args": { "braces": "``````", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "ctrl+`"], "command": "bracketeer", "args": { "braces": "``````", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "«"], "command": "bracketeer", "args": { "braces": "«»", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "«"], "command": "bracketeer", "args": { "braces": "«»", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "‹"], "command": "bracketeer", "args": { "braces": "‹›", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "‹"], "command": "bracketeer", "args": { "braces": "‹›", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "“"], "command": "bracketeer", "args": { "braces": "“”", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "“"], "command": "bracketeer", "args": { "braces": "“”", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "‘"], "command": "bracketeer", "args": { "braces": "‘’", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "‘"], "command": "bracketeer", "args": { "braces": "‘’", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "alt+`"], "command": "bracketeer", "args": { "braces": "````", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "alt+`"], "command": "bracketeer", "args": { "braces": "````", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "*"], "command": "bracketeer", "args": { "braces": "**", "select": true }, "context": - [ - { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, - { "key": "selector", "operator": "equal", "operand": "text.restructuredtext" } - ] - }, - { "keys": ["ctrl+alt+[", "*"], "command": "bracketeer", "args": { "braces": "**", "select": true, "replace": true }, "context": - [ - { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, - { "key": "selector", "operator": "equal", "operand": "text.restructuredtext" } - ] - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/LICENSE b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/LICENSE deleted file mode 100644 index 8da8c54..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2012, Colin T.A. Gray -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those -of the authors and should not be interpreted as representing official policies, -either expressed or implied, of this project. diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/README.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/README.md deleted file mode 100644 index d33469c..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/README.md +++ /dev/null @@ -1,142 +0,0 @@ -Bracketeer plugin for Sublime Text 2 -===================================== - -Some bracket manipulation, selection, and insertion commands. - - -Installation ------------- - -### Sublime Text 2 - -1. Using Package Control, install "Bracketeer" - -Or: - -1. Open the Sublime Text 2 Packages folder - - - OS X: ~/Library/Application Support/Sublime Text 2/Packages/ - - Windows: %APPDATA%/Sublime Text 2/Packages/ - - Linux: ~/.Sublime Text 2/Packages/ - -2. clone this repo -3. Install keymaps for the commands (see Example.sublime-keymap for my preferred keys) - -### Sublime Text 3 - -1. Open the Sublime Text 2 Packages folder -2. clone this repo, but use the `st3` branch - - git clone -b st3 git@github.com:colinta/SublimeBracketeer - -Commands --------- - -`bracketeer`: Surrounds selected text with braces (or quotes - anything, really), and prevents indentation mishaps. - -`bracketeer_indent`: Indents sensibly - allows a clever use of enter, indent, and '{' to surround code in '{}'. See example below. - -`bracketeer_goto`: Goes to the matching bracket - either opener (ctrl+[), closer (ctrl+]), or *both* (ctrl+alt+[). - -`bracketeer_select`: Searches for matching brackets and selects what is inside, or expands the selection to include the brackets. - - -### bracketeer - - -Required args: - -`braces`: Two characters. Default key bindings support: - -* `{}` -* `[]` -* `()` -* `<>` -* `«»` -* `‹›` -* `""` -* `''` -* `“”` -* `‘’` -* `\`\`` - -Select some text and press one of these keys. The default Sublime Text braces will re-indent the text, and it looks really silly. This plugin indents sensibly. Helpful in languages that use curlies, e.g. `C`, `Java`, `PHP`. - -In addition, the "super+]" indent command is modified (using `bracketeer_indent`) so that the first and last lines are not indented. Makes it easy to add curly braces. Select some lines of code, with a blank line above and below. Or, if you like your braces on the same line as the `if|while|do`, put the start of the selection at the end of that line. - -Press `super+]`, then press "{". The block of code will be indented, leaving the code highlighted, then you can surround it in braces. - - 1. if ( a ) - 2. echo NULL; - - # add blank lines - 1. if ( a ) - 2. - 3. echo NULL; - 4. - - # select text - 1. if ( a ) - 2. | - 3. echo NULL; - 4. | - - # press super+] - 1. if ( a ) - 2. | - 3. echo NULL; - 4. | - - # press { - 1. if ( a ) - 2. { - 3. echo NULL; - 4. }| - - -### bracketeer_indent - - -Default key combination is super+] - -If the first line of selected text is empty (and keep in mind this *ignores* whatever text is to the left of the selection, so not necessarily an empty line), that line will not be indented. See example usage above. - - -### bracketeer_select - - -Default key combination is ctrl+shift+[ - -Expands the current region to include text *within* brackets, and if pressed again to include the brackets themselves. - -I will use '|' as the caret or selection start and end points: - - 1. do_something([1, '[', {'brace':'{', 'test'}])| - - # move caret into the 'test' string - 1. do_something([1, '[', {'brace':'{', 'te|st'}]) - - # press ctrl+shift+[ - # the first bracket it finds is the '}', so it will match {}s - # notice it will ignore the '{', which would otherwise look like the matching brace - 1. do_something([1, '[', {|'brace':'{', 'test'|}]) - - # press ctrl+shift+[ - # adds the {} to the selection - 1. do_something([1, '[', |{'brace':'{', 'test'}|]) - - # press ctrl+shift+[ - # selects between the []s. - 1. do_something([|1, '[', {'brace':'{', 'test'}|]) - - # press ctrl+shift+[ - # selects the []s. - 1. do_something(|[1, '[', {'brace':'{', 'test'}]|) - - # press ctrl+shift+[ - # selects the ()s. It would have expanded to select *between* the (), but that is what the selection already *was to start with* - 1. do_something|([1, '[', {'brace':'{', 'test'}])| - - # press ctrl+shift+[ - # does nothing. No more brackets to match! - 1. do_something|([1, '[', {'brace':'{', 'test'}])| diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/bracketeer.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/bracketeer.py deleted file mode 100644 index 372450b..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/bracketeer.py +++ /dev/null @@ -1,393 +0,0 @@ -# coding: utf8 -import sublime -import sublime_plugin -from sublime import Region -import re - -# for detecting "real" brackets in BracketeerCommand, and bracket matching in BracketeerBracketMatcher -OPENING_BRACKETS = ['{', '[', '('] -OPENING_BRACKET_LIKE = ['{', '[', '(', '"', "'", u'“', '‘', '«', '‹'] -CLOSING_BRACKETS = ['}', ']', ')'] -CLOSING_BRACKET_LIKE = ['}', ']', ')', '"', "'", u'”', '’', '»', '›'] -QUOTING_BRACKETS = ['\'', "\""] - - -class BracketeerCommand(sublime_plugin.TextCommand): - def run(self, edit, **kwargs): - e = self.view.begin_edit('bracketeer') - regions = [region for region in self.view.sel()] - - # sort by region.end() DESC - def get_end(region): - return region.end() - regions.sort(key=get_end, reverse=True) - - for region in regions: - self.run_each(edit, region, **kwargs) - - self.view.end_edit(e) - - def complicated_quote_checker(self, insert_braces, region, pressed, after, r_brace): - in_string_scope = self.view.score_selector(region.a, 'string') - in_double_string_scope = in_string_scope and self.view.score_selector(region.a, 'string.quoted.double') - in_single_string_scope = in_string_scope and self.view.score_selector(region.a, 'string.quoted.single') - at_eol = region.a == self.view.line(region.a).b - in_comment_scope = self.view.score_selector(region.a, 'comment') - in_text_scope = self.view.score_selector(region.a, 'text') - in_embedded_scope = self.view.score_selector(region.a, 'source.php') + self.view.score_selector(region.a, 'source.js') - in_text_scope = in_text_scope and not in_embedded_scope - - if pressed and pressed in QUOTING_BRACKETS and (in_comment_scope or in_text_scope or in_string_scope): - # if the cursor: - # (a) is preceded by odd numbers of '\'s? - if in_comment_scope: - scope_test = 'comment' - else: - scope_test = 'string' - begin_of_string = region.a - while begin_of_string and self.view.score_selector(begin_of_string - 1, scope_test): - begin_of_string -= 1 - check_a = self.view.substr(Region(begin_of_string, region.a)) - check_a = len(re.search(r'[\\]*$', check_a).group(0)) - check_a = check_a % 2 - - # (b) is an apostrophe and (inside double quotes or in text or comment scope) - check_b = (in_double_string_scope or in_text_scope or in_comment_scope) and pressed == "'" - - # (c) we are at the end of the line and pressed the closing quote - check_c = at_eol and ( - in_single_string_scope and pressed == "'" - or - in_double_string_scope and pressed == '"' - ) - - # then don't insert both, just insert the one. - if check_a or check_b or check_c: - return pressed - - def run_each(self, edit, region, braces='{}', pressed=None, unindent=False, select=False, replace=False): - self.view.sel().subtract(region) - if self.view.settings().get('translate_tabs_to_spaces'): - tab = ' ' * self.view.settings().get('tab_size') - else: - tab = "\t" - - row, col = self.view.rowcol(region.begin()) - indent_point = self.view.text_point(row, 0) - if indent_point < region.begin(): - indent = self.view.substr(Region(indent_point, region.begin())) - indent = re.match('[ \t]*', indent).group(0) - else: - indent = '' - line = self.view.substr(self.view.line(region.a)) - selection = self.view.substr(region) - - # for braces that have newlines ("""), insert the current line's indent - if isinstance(braces, list): - l_brace = braces[0] - r_brace = braces[1] - braces = ''.join(braces) - braces = braces.replace("\n", "\n" + indent) - length = len(l_brace) - else: - braces = braces.replace("\n", "\n" + indent) - length = len(braces) / 2 - l_brace = braces[:length] - r_brace = braces[length:] - - if region.empty(): - after = self.view.substr(Region(region.a, region.a + length)) - - insert_braces = braces - complicated_check = self.complicated_quote_checker(insert_braces, region, pressed, after, r_brace) - - if complicated_check: - insert_braces = complicated_check - elif pressed and after == r_brace and r_brace[-1] == pressed: # and (pressed not in QUOTING_BRACKETS or in_string_scope): - # in this case we pressed the closing character, and that's the character that is to the right - # so do nothing except advance cursor position - insert_braces = False - elif unindent and row > 0 and indent and line == indent: - # indent has the current line's indent - # get previous line's indent: - prev_point = self.view.text_point(row - 1, 0) - prev_line = self.view.line(prev_point) - prev_indent = self.view.substr(prev_line) - prev_indent = re.match('[ \t]*', prev_indent).group(0) - - if (not pressed or pressed == l_brace) and len(indent) > len(prev_indent) and indent[len(prev_indent):] == tab: - # move region.a back by 'indent' amount - region = Region(region.a - len(tab), region.b - len(tab)) - # and remove the tab - self.view.replace(edit, Region(region.a, region.a + len(tab) - 1), '') - elif pressed and pressed == r_brace: - if len(indent) == len(prev_indent): - # move region.a back by 'indent' amount - region = Region(region.a - len(tab), region.b - len(tab)) - # and remove the tab - self.view.replace(edit, Region(region.a, region.a + len(tab) - 1), '') - insert_braces = r_brace - elif pressed and pressed != l_brace: - # we pressed the closing bracket or quote. This *never* - insert_braces = r_brace - - if insert_braces: - self.view.insert(edit, region.a, insert_braces) - self.view.sel().add(Region(region.a + length, region.a + length)) - elif selection in QUOTING_BRACKETS and pressed in QUOTING_BRACKETS and selection != pressed: - # changing a quote from single <=> double, just insert the quote. - self.view.replace(edit, region, pressed) - self.view.sel().add(Region(region.end(), region.end())) - elif pressed and pressed != l_brace: - b = region.begin() + len(r_brace) - self.view.replace(edit, region, r_brace) - self.view.sel().add(Region(b, b)) - else: - substitute = self.view.substr(region) - replacement = l_brace + substitute + r_brace - # if we're inserting "real" brackets, not quotes: - real_brackets = l_brace in OPENING_BRACKETS and r_brace in CLOSING_BRACKETS - # check to see if entire lines are selected, and if so do some smart indenting - bol_is_nl = region.begin() == 0 or self.view.substr(region.begin() - 1) == "\n" - eol_is_nl = region.end() == self.view.size() - 1 or self.view.substr(region.end() - 1) == "\n" - if real_brackets and bol_is_nl and eol_is_nl: - indent = '' - final = '' - m = re.match('([ \t]*)' + tab, self.view.substr(region)) - if m: - indent = m.group(1) - final = "\n" - else: - substitute = tab + substitute - replacement = indent + l_brace + "\n" + substitute + indent + r_brace + final - b = region.begin() + len(replacement) - len("\n" + indent + r_brace + final) - else: - b = region.begin() + len(replacement) - - if replace and self.view.substr(region.begin() - 1) in OPENING_BRACKET_LIKE and self.view.substr(region.end()) in CLOSING_BRACKET_LIKE: - b -= 1 - self.view.replace(edit, Region(region.begin() - 1, region.end() + 1), replacement) - elif replace and self.view.substr(region.begin()) in OPENING_BRACKET_LIKE and self.view.substr(region.end() - 1) in CLOSING_BRACKET_LIKE: - replacement = l_brace + replacement[2:-2] + r_brace - b -= 2 - self.view.replace(edit, region, replacement) - l_brace = r_brace = '' - else: - self.view.replace(edit, region, replacement) - - if select: - self.view.sel().add(Region(b - len(replacement) + len(l_brace), b - len(r_brace))) - else: - self.view.sel().add(Region(b, b)) - - -class BracketeerIndentCommand(sublime_plugin.TextCommand): - def run(self, edit): - e = self.view.begin_edit('bracketeer') - if self.view.settings().get('translate_tabs_to_spaces'): - tab = ' ' * self.view.settings().get('tab_size') - else: - tab = "\t" - - regions = [region for region in self.view.sel()] - - # sort by region.end() DESC - def get_end(region): - return region.end() - regions.sort(key=get_end, reverse=True) - - for region in regions: - if region.empty(): - # insert tab at beginning of line - point = self.view.text_point(self.view.rowcol(region.a)[0], 0) - self.view.insert(edit, point, tab) - else: - # insert tab in front of lines 1:-1 - lines = self.view.substr(region).split("\n") - # just one line? indent it - if len(lines) == 1: - substitute = tab + lines[0] + "\n" - else: - default_settings = sublime.load_settings("bracketeer.sublime-settings") - dont_indent_list = default_settings.get('dont_indent') - - # lines that start with these strings don't get indented - def dont_indent(line): - return any(dont for dont in dont_indent_list if line[:len(dont)] == dont) - - # cursor is at start of line? indent that, too - if len(lines[0]) > 0 and not dont_indent(lines[0]): - substitute = tab - else: - substitute = '' - substitute += lines[0] + "\n" - - for line in lines[1:-1]: - if len(line): - if not dont_indent(line): - substitute += tab - substitute += line - substitute += "\n" - substitute += lines[-1] - self.view.replace(edit, region, substitute) - - self.view.end_edit(e) - - -class BracketeerBracketMatcher(sublime_plugin.TextCommand): - def find_brackets(self, region, closing_search_brackets=None): - match_map = { - '}': '{', - ']': '[', - ')': '(', - } - # find next brace in closing_search_brackets - if not closing_search_brackets: - closing_search_brackets = CLOSING_BRACKETS - elif isinstance(closing_search_brackets, basestring): - closing_search_brackets = [closing_search_brackets] - - opening_search_brackets = [match_map[bracket] for bracket in closing_search_brackets] - begin_point = region.begin() - 1 - end_point = region.end() - - # LaTEX: if selection directly preceeds \right, examine the string that includes \right instead of the actual selection - if self.view.substr( Region(end_point, min(end_point+6,self.view.size())) ) == '\\right': end_point += 6 - # /LaTEX - - # end_point gets incremented immediately, which skips the first - # character, *unless* the selection is empty, in which case the - # inner contents should be selected before scanning past - if region.empty(): - # if the current character is a bracket, and the character to the left is the - # *matching* bracket, don't match the empty contents - c = self.view.substr(end_point) - if c in closing_search_brackets and self.view.substr(end_point - 1) == match_map[c]: - # cursor is between two brackets - select them and return - return Region(begin_point, end_point + 1) - - else: - # if the selection is inside two brackets, select them and return - c1 = self.view.substr(begin_point) - c2 = self.view.substr(end_point) - - if c2 in closing_search_brackets and c1 == match_map[c2]: - # LaTEX: if \left preceeds selection, select it as well - if self.view.substr(Region(max(begin_point-5,0), begin_point))=='\left': begin_point -= 5 - # /LaTEX - return Region(begin_point, end_point + 1) - - # scan forward searching for a closing bracket. - started_in_string = bool(self.view.score_selector(end_point, 'string') or self.view.score_selector(begin_point, 'string')) - bracket_count = 0 - while True: - c = self.view.substr(end_point) - if started_in_string or not self.view.score_selector(end_point, 'string'): - if bracket_count <= 0 and c in closing_search_brackets: - break - elif c in opening_search_brackets and c in OPENING_BRACKETS: - bracket_count += 1 - elif c in closing_search_brackets and c in CLOSING_BRACKETS: - bracket_count -= 1 - - end_point += 1 - if end_point >= self.view.size(): - return None - - # found a bracket, scan backwards until matching bracket is found. - # matching bracket is determined by counting closing brackets (+1) - # and opening brackets (-1) and when the count is zero and the - # matching opening bracket is found - look_for = match_map[c] - while True: - c = self.view.substr(begin_point) - if started_in_string or not self.view.score_selector(begin_point, 'string'): - if bracket_count == 0 and c == look_for: - break - elif c in opening_search_brackets and c in OPENING_BRACKETS: - bracket_count += 1 - elif c in closing_search_brackets and c in CLOSING_BRACKETS: - bracket_count -= 1 - begin_point -= 1 - if begin_point < 0: - return None - # the current point is to the left of the opening bracket, - # I want it to be to the right. - begin_point += 1 - - # LaTEX: if selection ends in \right, don't select it - if self.view.substr( Region(max(end_point-6,0), end_point) ) == '\\right': end_point -= 6 - # /LaTEX - return Region(begin_point, end_point) - - -class BracketeerGotoCommand(BracketeerBracketMatcher): - def run(self, edit, **kwargs): - e = self.view.begin_edit('bracketeer') - regions = [region for region in self.view.sel()] - - # sort by region.end() DESC - def get_end(region): - return region.end() - regions.sort(key=get_end, reverse=True) - - for region in regions: - self.run_each(edit, region, **kwargs) - self.view.end_edit(e) - - def run_each(self, edit, region, goto): - cursor = region.b - if goto == "left" and self.view.substr(cursor - 1) == '{': - cursor -= 1 - elif goto == "both" and self.view.substr(cursor) == '{': - cursor += 1 - elif goto in ["left", "both"] and self.view.substr(cursor - 1) == '}': - cursor -= 1 - - new_region = self.find_brackets(Region(cursor, cursor), '}') - - if new_region: - self.view.sel().subtract(region) - a = new_region.begin() - b = new_region.end() - if self.view.substr(a) in OPENING_BRACKETS: - a += 1 - if self.view.substr(b) in CLOSING_BRACKETS: - b += 1 - - if goto == "left": - new_region = Region(a, a) - self.view.sel().add(new_region) - self.view.show(new_region) - elif goto == "right": - new_region = Region(b, b) - self.view.sel().add(new_region) - self.view.show(new_region) - elif goto == "both": - self.view.sel().add(Region(a, a)) - self.view.sel().add(Region(b, b)) - self.view.show(new_region.b) - else: - raise ValueError("`goto` should have a value of 'left', 'right', or 'both'), not '" + goto + '"') - - -class BracketeerSelectCommand(BracketeerBracketMatcher): - def run(self, edit, **kwargs): - e = self.view.begin_edit('bracketeer') - regions = [region for region in self.view.sel()] - - # sort by region.end() DESC - def get_end(region): - return region.end() - regions.sort(key=get_end, reverse=True) - - for region in regions: - self.run_each(edit, region, **kwargs) - self.view.end_edit(e) - - def run_each(self, edit, region): - new_region = self.find_brackets(region) - if new_region: - self.view.sel().subtract(region) - self.view.sel().add(new_region) - self.view.show(new_region.b) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/bracketeer.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/bracketeer.sublime-settings deleted file mode 100644 index e525157..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/bracketeer.sublime-settings +++ /dev/null @@ -1,3 +0,0 @@ -{ - "dont_indent": ["", "{%", "%}", "{#", "#}"] -} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/package-metadata.json deleted file mode 100644 index 938aa82..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://github.com/colinta/SublimeBracketeer", "version": "2013.07.09.15.11.00", "description": "Some bracket manipulation, selection, and insertion commands."} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/package.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/package.json deleted file mode 100644 index 1c084b6..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Bracketeer/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "repo": "SublimeBracketeer", - "name": "Bracketeer", - "description": "Some bracket manipulation, selection, and insertion commands.", - "author": "Colin Thomas-Arnold (colinta)", - "homepage": "https://github.com/colinta/SublimeBracketeer" -} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/Default.sublime-commands b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/Default.sublime-commands deleted file mode 100644 index f519741..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/Default.sublime-commands +++ /dev/null @@ -1,42 +0,0 @@ -[ - { - "caption": "Clipboard Manager: Cut", - "command": "clipboard_manager_cut" - }, - { - "caption": "Clipboard Manager: Copy", - "command": "clipboard_manager_copy" - }, - { - "caption": "Clipboard Manager: Paste", - "command": "clipboard_manager_paste" - }, - { - "caption": "Clipboard Manager: Next & Paste", - "command": "clipboard_manager_next_and_paste" - }, - { - "caption": "Clipboard Manager: Previous & Paste", - "command": "clipboard_manager_previous_and_paste" - }, - { - "caption": "Clipboard Manager: Next", - "command": "clipboard_manager_next" - }, - { - "caption": "Clipboard Manager: Previous", - "command": "clipboard_manager_previous" - }, - { - "caption": "Clipboard Manager: Choose & Paste", - "command": "clipboard_manager_choose_and_paste" - }, - { - "caption": "Clipboard Manager: Show History", - "command": "clipboard_manager_show" - }, - { - "caption": "Clipboard Manager: Show Registers", - "command": "clipboard_manager_show_registers" - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/Example.sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/Example.sublime-keymap deleted file mode 100644 index f9dbca8..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/Example.sublime-keymap +++ /dev/null @@ -1,96 +0,0 @@ -[ - { "keys": ["super+x"], "command": "clipboard_manager_cut" }, - { "keys": ["super+c"], "command": "clipboard_manager_copy" }, - - { "keys": ["super+v"], "command": "clipboard_manager_paste", "args": { "indent": true } }, - { "keys": ["super+ctrl+v"], "command": "clipboard_manager_paste", "args": { "indent": false } }, - - { "keys": ["super+alt+v"], "command": "clipboard_manager_next_and_paste" }, - { "keys": ["super+shift+v"], "command": "clipboard_manager_previous_and_paste" }, - - { "keys": ["super+pageup"], "command": "clipboard_manager_next" }, - { "keys": ["super+pagedown"], "command": "clipboard_manager_previous" }, - { "keys": ["super+home"], "command": "clipboard_manager_show" }, - { "keys": ["super+end"], "command": "clipboard_manager_show_registers" }, - - { "keys": ["super+alt+ctrl+v"], "command": "clipboard_manager_choose_and_paste" }, - - { "keys": ["super+ctrl+shift+v", "?"], "command": "clipboard_manager_show_registers" }, - { "keys": ["super+ctrl+shift+v", "/"], "command": "clipboard_manager_show" }, - - { "keys": ["super+ctrl+shift+c", "1"], "command": "clipboard_manager_copy_to_register", "args": { "register": "1" } }, - { "keys": ["super+ctrl+shift+c", "2"], "command": "clipboard_manager_copy_to_register", "args": { "register": "2" } }, - { "keys": ["super+ctrl+shift+c", "3"], "command": "clipboard_manager_copy_to_register", "args": { "register": "3" } }, - { "keys": ["super+ctrl+shift+c", "4"], "command": "clipboard_manager_copy_to_register", "args": { "register": "4" } }, - { "keys": ["super+ctrl+shift+c", "5"], "command": "clipboard_manager_copy_to_register", "args": { "register": "5" } }, - { "keys": ["super+ctrl+shift+c", "6"], "command": "clipboard_manager_copy_to_register", "args": { "register": "6" } }, - { "keys": ["super+ctrl+shift+c", "7"], "command": "clipboard_manager_copy_to_register", "args": { "register": "7" } }, - { "keys": ["super+ctrl+shift+c", "8"], "command": "clipboard_manager_copy_to_register", "args": { "register": "8" } }, - { "keys": ["super+ctrl+shift+c", "9"], "command": "clipboard_manager_copy_to_register", "args": { "register": "9" } }, - { "keys": ["super+ctrl+shift+c", "0"], "command": "clipboard_manager_copy_to_register", "args": { "register": "0" } }, - - { "keys": ["super+ctrl+shift+c", "a"], "command": "clipboard_manager_copy_to_register", "args": { "register": "a" } }, - { "keys": ["super+ctrl+shift+c", "b"], "command": "clipboard_manager_copy_to_register", "args": { "register": "b" } }, - { "keys": ["super+ctrl+shift+c", "c"], "command": "clipboard_manager_copy_to_register", "args": { "register": "c" } }, - { "keys": ["super+ctrl+shift+c", "d"], "command": "clipboard_manager_copy_to_register", "args": { "register": "d" } }, - { "keys": ["super+ctrl+shift+c", "e"], "command": "clipboard_manager_copy_to_register", "args": { "register": "e" } }, - { "keys": ["super+ctrl+shift+c", "f"], "command": "clipboard_manager_copy_to_register", "args": { "register": "f" } }, - { "keys": ["super+ctrl+shift+c", "g"], "command": "clipboard_manager_copy_to_register", "args": { "register": "g" } }, - { "keys": ["super+ctrl+shift+c", "h"], "command": "clipboard_manager_copy_to_register", "args": { "register": "h" } }, - { "keys": ["super+ctrl+shift+c", "i"], "command": "clipboard_manager_copy_to_register", "args": { "register": "i" } }, - { "keys": ["super+ctrl+shift+c", "j"], "command": "clipboard_manager_copy_to_register", "args": { "register": "j" } }, - { "keys": ["super+ctrl+shift+c", "k"], "command": "clipboard_manager_copy_to_register", "args": { "register": "k" } }, - { "keys": ["super+ctrl+shift+c", "l"], "command": "clipboard_manager_copy_to_register", "args": { "register": "l" } }, - { "keys": ["super+ctrl+shift+c", "m"], "command": "clipboard_manager_copy_to_register", "args": { "register": "m" } }, - { "keys": ["super+ctrl+shift+c", "n"], "command": "clipboard_manager_copy_to_register", "args": { "register": "n" } }, - { "keys": ["super+ctrl+shift+c", "o"], "command": "clipboard_manager_copy_to_register", "args": { "register": "o" } }, - { "keys": ["super+ctrl+shift+c", "p"], "command": "clipboard_manager_copy_to_register", "args": { "register": "p" } }, - { "keys": ["super+ctrl+shift+c", "q"], "command": "clipboard_manager_copy_to_register", "args": { "register": "q" } }, - { "keys": ["super+ctrl+shift+c", "r"], "command": "clipboard_manager_copy_to_register", "args": { "register": "r" } }, - { "keys": ["super+ctrl+shift+c", "s"], "command": "clipboard_manager_copy_to_register", "args": { "register": "s" } }, - { "keys": ["super+ctrl+shift+c", "t"], "command": "clipboard_manager_copy_to_register", "args": { "register": "t" } }, - { "keys": ["super+ctrl+shift+c", "u"], "command": "clipboard_manager_copy_to_register", "args": { "register": "u" } }, - { "keys": ["super+ctrl+shift+c", "v"], "command": "clipboard_manager_copy_to_register", "args": { "register": "v" } }, - { "keys": ["super+ctrl+shift+c", "w"], "command": "clipboard_manager_copy_to_register", "args": { "register": "w" } }, - { "keys": ["super+ctrl+shift+c", "x"], "command": "clipboard_manager_copy_to_register", "args": { "register": "x" } }, - { "keys": ["super+ctrl+shift+c", "y"], "command": "clipboard_manager_copy_to_register", "args": { "register": "y" } }, - { "keys": ["super+ctrl+shift+c", "z"], "command": "clipboard_manager_copy_to_register", "args": { "register": "z" } }, - - { "keys": ["super+ctrl+shift+v", "1"], "command": "clipboard_manager_paste_from_register", "args": { "register": "1" } }, - { "keys": ["super+ctrl+shift+v", "2"], "command": "clipboard_manager_paste_from_register", "args": { "register": "2" } }, - { "keys": ["super+ctrl+shift+v", "3"], "command": "clipboard_manager_paste_from_register", "args": { "register": "3" } }, - { "keys": ["super+ctrl+shift+v", "4"], "command": "clipboard_manager_paste_from_register", "args": { "register": "4" } }, - { "keys": ["super+ctrl+shift+v", "5"], "command": "clipboard_manager_paste_from_register", "args": { "register": "5" } }, - { "keys": ["super+ctrl+shift+v", "6"], "command": "clipboard_manager_paste_from_register", "args": { "register": "6" } }, - { "keys": ["super+ctrl+shift+v", "7"], "command": "clipboard_manager_paste_from_register", "args": { "register": "7" } }, - { "keys": ["super+ctrl+shift+v", "8"], "command": "clipboard_manager_paste_from_register", "args": { "register": "8" } }, - { "keys": ["super+ctrl+shift+v", "9"], "command": "clipboard_manager_paste_from_register", "args": { "register": "9" } }, - { "keys": ["super+ctrl+shift+v", "0"], "command": "clipboard_manager_paste_from_register", "args": { "register": "0" } }, - - { "keys": ["super+ctrl+shift+v", "a"], "command": "clipboard_manager_paste_from_register", "args": { "register": "a" } }, - { "keys": ["super+ctrl+shift+v", "b"], "command": "clipboard_manager_paste_from_register", "args": { "register": "b" } }, - { "keys": ["super+ctrl+shift+v", "c"], "command": "clipboard_manager_paste_from_register", "args": { "register": "c" } }, - { "keys": ["super+ctrl+shift+v", "d"], "command": "clipboard_manager_paste_from_register", "args": { "register": "d" } }, - { "keys": ["super+ctrl+shift+v", "e"], "command": "clipboard_manager_paste_from_register", "args": { "register": "e" } }, - { "keys": ["super+ctrl+shift+v", "f"], "command": "clipboard_manager_paste_from_register", "args": { "register": "f" } }, - { "keys": ["super+ctrl+shift+v", "g"], "command": "clipboard_manager_paste_from_register", "args": { "register": "g" } }, - { "keys": ["super+ctrl+shift+v", "h"], "command": "clipboard_manager_paste_from_register", "args": { "register": "h" } }, - { "keys": ["super+ctrl+shift+v", "i"], "command": "clipboard_manager_paste_from_register", "args": { "register": "i" } }, - { "keys": ["super+ctrl+shift+v", "j"], "command": "clipboard_manager_paste_from_register", "args": { "register": "j" } }, - { "keys": ["super+ctrl+shift+v", "k"], "command": "clipboard_manager_paste_from_register", "args": { "register": "k" } }, - { "keys": ["super+ctrl+shift+v", "l"], "command": "clipboard_manager_paste_from_register", "args": { "register": "l" } }, - { "keys": ["super+ctrl+shift+v", "m"], "command": "clipboard_manager_paste_from_register", "args": { "register": "m" } }, - { "keys": ["super+ctrl+shift+v", "n"], "command": "clipboard_manager_paste_from_register", "args": { "register": "n" } }, - { "keys": ["super+ctrl+shift+v", "o"], "command": "clipboard_manager_paste_from_register", "args": { "register": "o" } }, - { "keys": ["super+ctrl+shift+v", "p"], "command": "clipboard_manager_paste_from_register", "args": { "register": "p" } }, - { "keys": ["super+ctrl+shift+v", "q"], "command": "clipboard_manager_paste_from_register", "args": { "register": "q" } }, - { "keys": ["super+ctrl+shift+v", "r"], "command": "clipboard_manager_paste_from_register", "args": { "register": "r" } }, - { "keys": ["super+ctrl+shift+v", "s"], "command": "clipboard_manager_paste_from_register", "args": { "register": "s" } }, - { "keys": ["super+ctrl+shift+v", "t"], "command": "clipboard_manager_paste_from_register", "args": { "register": "t" } }, - { "keys": ["super+ctrl+shift+v", "u"], "command": "clipboard_manager_paste_from_register", "args": { "register": "u" } }, - { "keys": ["super+ctrl+shift+v", "v"], "command": "clipboard_manager_paste_from_register", "args": { "register": "v" } }, - { "keys": ["super+ctrl+shift+v", "w"], "command": "clipboard_manager_paste_from_register", "args": { "register": "w" } }, - { "keys": ["super+ctrl+shift+v", "x"], "command": "clipboard_manager_paste_from_register", "args": { "register": "x" } }, - { "keys": ["super+ctrl+shift+v", "y"], "command": "clipboard_manager_paste_from_register", "args": { "register": "y" } }, - { "keys": ["super+ctrl+shift+v", "z"], "command": "clipboard_manager_paste_from_register", "args": { "register": "z" } } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/LICENSE b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/LICENSE deleted file mode 100644 index 8da8c54..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2012, Colin T.A. Gray -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those -of the authors and should not be interpreted as representing official policies, -either expressed or implied, of this project. diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/README.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/README.md deleted file mode 100644 index 66a2844..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/README.md +++ /dev/null @@ -1,132 +0,0 @@ -Clipboard Manager plugin for Sublime Text 2 -=========================================== - -A version of the Sublime Text 2 plugin at -that makes for TextMate-like clipboard history. - -Originally written by AJ Palkovic ([ajpalkovic](https://github.com/ajpalkovic/SublimePlugins)), -modified by Martin Aspeli ([optilude](https://gist.github.com/1132507)), and -further modified and packaged for `Package Control` by Colin Thomas-Arnold -([colinta](https://github.com/colinta/SublimeClipboardManager)) - -My version of this plugin *does not use* `clipboard_history` as the prefix. See -the full command-list below. - -Installation ------------- - -### Sublime Text 2 - -1. Using Package Control, install "Clipboard Manager" - -Or: - -1. Open the Sublime Text 2 Packages folder - - - OS X: ~/Library/Application Support/Sublime Text 2/Packages/ - - Windows: %APPDATA%/Sublime Text 2/Packages/ - - Linux: ~/.Sublime Text 2/Packages/ - -2. clone this repo -3. Install keymaps for the commands (see Example.sublime-keymap for my preferred keys) - -### Sublime Text 3 - -1. Open the Sublime Text 2 Packages folder -2. clone this repo, but use the `st3` branch - - git clone -b st3 git@github.com:colinta/SublimeClipboardManager - -Commands --------- - -**The basics** - -`clipboard_manager_cut`: Self Explanatory - -`clipboard_manager_copy`: Self Explanatory - -`clipboard_manager_paste`: Self Explanatory. - -*Options*: indent (default: False): Determines whether to use the `paste` or -`paste_and_indent` built-in command. - -- - - - - - - -**Navigating clipboard history** - -`clipboard_manager_next_and_paste` (`super+alt+v`) - -Goes to the next entry in the history and pastes it. -*Options*: indent (default: `False`) - -`clipboard_manager_previous_and_paste` (`super+shift+v`) - -Goes to the previous entry in the history and pastes it. -*Options*: indent (default: `False`) - -`clipboard_manager_next` (`super+pageup` aka `super+fn+up`) - -Goes to the next entry in the history, but doesn't paste. (the content will -appear as a status message) - -`clipboard_manager_previous` (`super+pagedown` aka `super+fn+down`) - -Goes to the previous entry in the history, but doesn't paste. (the content will -appear as a status message) - -`clipboard_manager_choose_and_paste` (`super+ctrl+alt+v`) - -Shows the clipboard history in a "quick panel". - -`clipboard_manager_show` (`super+ctrl+shift+v, /`) - -Shows the clipboard history in an "output panel", and points to the current -clipboard item. This was mostly useful for development, but you might find it -beneficial as well. - -- - - - - - - -**Registers** - -Right now registers do not add/remove from the clipboard history. *This may -change!!* I would appreciate feedback about this feature. - -`clipboard_manager_copy_to_register` (there are a ton, e.g. `super+ctrl+shift+c, 1`, `super+ctrl+shift+c, a`) - -Puts the selection into a `register`. The example keymap includes a register -binding for every number and letter. Register keys should be single characters. - -`clipboard_manager_paste_from_register` (`super+ctrl+shift+v, 1`, `super+ctrl+shift+v, a`) - -Pastes the contents of a `register`. Again, there are lots of example key -bindings. - -`clipboard_manager_show_registers` (`super+ctrl+shift+v, ?`) - -Shows the clipboard registers in an "output panel", similar to -`clipboard_manager_show`. - -- - - - - - - -**Helpful Tips** - -There are two ways to find out what you've got hanging out in your clipboard -history, you should use both. The `clipboard_manager_choose_and_paste` command -is your goto. It uses the fuzzy finder input panel, so you can quickly find and -paste the entry you want. - -The other useful trick is to use `clipboard_manager_show` to show an output -panel at the bottom of the screen. As you scroll through history using -`clipboard_manager_next` and `clipboard_manager_previous`, it will update that -panel, with an arrow pointing the current entry. Then you can -`clipboard_manager_next_and_paste`, and it will get updated then, too. Keeps -you sane if you're doing something crazy. - -If you've got a repetive task to do, with lots of copy/pastes, use registers. -They do not get affected by usual copy/pasting, so you can rest assured that -your work flow will not get affected. The keyboard shortcuts are unfortunately -quite verbose (`super+ctrl+shift+c, letter/digit`), but look at -Example.sublime-keymap and you'll see that it is easy to assign a quicker -shortcut for registers you like to use. Registers do not have to be one letter, -any string can be used as the key. diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/clipboard_manager.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/clipboard_manager.py deleted file mode 100644 index 272d0ca..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/clipboard_manager.py +++ /dev/null @@ -1,230 +0,0 @@ -import sublime -import sublime_plugin - - -class HistoryList(list): - """ - List type for storing the history. - Maintains a "pointer" to the current clipboard item - """ - registers = {} - SIZE = 256 - __index = 0 - - def show(self): - ret = "" - ret += " CLIPBOARD HISTORY (%d)\n" % len(self) - ret += "====================%s==\n" % ("=" * len(str(len(self)))) - for i, item in enumerate(self): - if i == self.__index: - ret += '--> ' - else: - ret += ' ' - item = item.replace("\t", '\\t') - item = item.replace("\r\n", "\n") - item = item.replace("\r", "\n") - item = item.replace("\n", "\n" + ' > ') - ret += u'{i:>3}. {item}\n'.format(i=str(i + 1)[-3:], item=item) - return ret - - def show_registers(self): - ret = "" - ret += " CLIPBOARD REGISTERS (%d)\n" % len(self.registers.items()) - ret += "=====================%s==\n" % ("=" * len(str(len(self.registers.items())))) - for key, item in self.registers.iteritems(): - item = item.replace("\t", '\\t') - item = item.replace("\r\n", "\n") - item = item.replace("\r", "\n") - item = item.replace("\n", "\n" + ' > ') - ret += u'{key:<1}: {item}\n'.format(key=key, item=item) - return ret - - def register(self, register, *args): - if args: - if len(args) == 1: - copy = args[0] - else: - copy = "\n".join(args) - self.registers[register] = copy - copy = copy.replace("\t", "\\t") - copy = copy.replace("\n", "\\n") - copy = copy.replace("\r", "\\r") - sublime.status_message('Set Clipboard Register "{0}" to "{1}"'.format(register, copy)) - else: - return self.registers[register] - - def append(self, item): - """ - Appends to the history only if it isn't the current item. - """ - if not self or self[self.__index] != item: - self.insert(0, item) - self.__index = 0 - if len(self) > self.SIZE: - del self[self.SIZE:] - - def current(self): - if len(self) == 0: - return None - return self[self.__index] - - def at(self, idx): - self.__index = (idx if idx < len(self) else 0) - self.status() - - def next(self): - if self.__index > 0: - self.__index -= 1 - self.status() - - def previous(self): - if self.__index < len(self) - 1: - self.__index += 1 - self.status() - - def first(self): - """"first" actually kind of means "last", since this is a FIFO stack""" - self.__index = len(self) - 1 - self.status() - - def last(self): - """"last" actually kind of means "first", since this is a FIFO stack""" - self.__index = 0 - self.status() - - def status(self): - copy = self.current() - copy = copy.replace("\t", "\\t") - copy = copy.replace("\n", "\\n") - copy = copy.replace("\r", "\\r") - sublime.status_message(u'Set Clipboard to "{copy}"'.format(copy=copy)) - sublime.set_clipboard(self.current()) - - -HISTORY = HistoryList([sublime.get_clipboard()]) - - -def append_clipboard(): - # append the contents of the clipboard to the history - HISTORY.append(sublime.get_clipboard()) - - -class ClipboardManagerPaste(sublime_plugin.TextCommand): - def run(self, edit, indent=False): - if indent: - self.view.run_command('paste_and_indent') - else: - self.view.run_command('paste') - - -class ClipboardManagerCut(sublime_plugin.TextCommand): - def run(self, edit): - # First run sublime's command to extract the selected text. - # This will set the cut/copy'd data on the clipboard which we can easily steal without recreating the cut/copy logic. - self.view.run_command('cut') - append_clipboard() - self.view.window().run_command('clipboard_manager_show', {'show': False}) - - -class ClipboardManagerCopy(sublime_plugin.TextCommand): - def run(self, edit): - self.view.run_command('copy') - append_clipboard() - self.view.window().run_command('clipboard_manager_show', {'show': False}) - - -class ClipboardManagerCopyToRegister(sublime_plugin.TextCommand): - def run(self, edit, register): - self.view.run_command('copy') - HISTORY.register(register, sublime.get_clipboard()) - self.view.window().run_command('clipboard_manager_show_registers', {'show': False}) - - -class ClipboardManagerPasteFromRegister(sublime_plugin.TextCommand): - def run(self, edit, register): - sublime.set_clipboard(HISTORY.register(register)) - self.view.run_command('paste') - - -class ClipboardManagerNext(sublime_plugin.TextCommand): - def run(self, edit): - HISTORY.next() - self.view.window().run_command('clipboard_manager_show', {'show': False}) - - -class ClipboardManagerNextAndPaste(sublime_plugin.TextCommand): - def run(self, edit, indent=False): - HISTORY.next() - if indent: - self.view.run_command('paste_and_indent') - else: - self.view.run_command('paste') - self.view.window().run_command('clipboard_manager_show', {'show': False}) - - -class ClipboardManagerPrevious(sublime_plugin.TextCommand): - def run(self, edit): - HISTORY.previous() - self.view.window().run_command('clipboard_manager_show', {'show': False}) - - -class ClipboardManagerPreviousAndPaste(sublime_plugin.TextCommand): - def run(self, edit, indent=False): - HISTORY.previous() - if indent: - self.view.run_command('paste_and_indent') - else: - self.view.run_command('paste') - self.view.window().run_command('clipboard_manager_show', {'show': False}) - - -class ClipboardManagerShow(sublime_plugin.WindowCommand): - def run(self, show=True): - v = self.window.get_output_panel('clipboard_manager') - e = v.begin_edit('clipboard_manager') - v.replace(e, sublime.Region(0, v.size()), '') - v.insert(e, 0, HISTORY.show()) - v.end_edit(e) - if show: - self.window.run_command('show_panel', {'panel': 'output.clipboard_manager'}) - - -class ClipboardManagerShowRegisters(sublime_plugin.WindowCommand): - def run(self, show=True): - v = self.window.get_output_panel('clipboard_manager') - e = v.begin_edit('clipboard_manager') - v.replace(e, sublime.Region(0, v.size()), '') - v.insert(e, 0, HISTORY.show_registers()) - v.end_edit(e) - if show: - self.window.run_command('show_panel', {'panel': 'output.clipboard_manager'}) - - -class ClipboardManagerChooseAndPaste(sublime_plugin.TextCommand): - def run(self, edit): - def format(line): - return line.replace('\n', '\\n')[:64] - - lines = [] - line_map = {} - # filter out duplicates, keeping the first instance, and format - for i, line in enumerate(HISTORY): - if i == HISTORY.index(line): - line_map[len(lines)] = i - lines.append(format(line)) - - def on_done(idx): - if idx >= 0: - idx = line_map[idx] - HISTORY.at(idx) - self.view.run_command('paste') - - if lines: - sublime.active_window().show_quick_panel(lines, on_done) - else: - sublime.status_message('Nothing in history') - - -class ClipboardManagerEventListener(sublime_plugin.EventListener): - def on_activated(self, view): - append_clipboard() diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/package-metadata.json deleted file mode 100644 index 2b56d8f..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://gist.github.com/1590661", "version": "2013.07.09.15.13.48", "description": "A version of the Sublime Text 2 plugin at that makes for TextMate-like clipboard history."} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/package.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/package.json deleted file mode 100644 index ea57497..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Clipboard Manager/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "repo": "SublimeClipboardManager", - "name": "Clipboard Manager", - "description": "A version of the Sublime Text 2 plugin at that makes for TextMate-like clipboard history.", - "author": "AJ Palkovic (ajpalkovic), Martin Aspeli (optilude) and Colin Thomas-Arnold (colinta)", - "homepage": "https://gist.github.com/1590661" -} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/.gitignore b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/.gitignore deleted file mode 100644 index 7e99e36..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.pyc \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/Default (Linux).sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/Default (Linux).sublime-keymap deleted file mode 100644 index e86b53b..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/Default (Linux).sublime-keymap +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "keys": ["ctrl+;", ""], - "command": "easy_motion", - "args": {"select_text": false} - }, - { - "keys": ["ctrl+;", "enter"], - "command": "easy_motion", - "args": {"select_text": false, "character": "enter"} - }, - { - "keys": ["ctrl+shift+;", ""], - "command": "easy_motion", - "args": {"select_text": true} - }, - { - "keys": ["ctrl+shift+;", "enter"], - "command": "easy_motion", - "args": {"select_text": true, "character": "enter"} - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/Default (OSX).sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/Default (OSX).sublime-keymap deleted file mode 100644 index 83db6b5..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/Default (OSX).sublime-keymap +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "keys": ["super+;", ""], - "command": "easy_motion", - "args": {"select_text": false} - }, - { - "keys": ["super+;", "enter"], - "command": "easy_motion", - "args": {"select_text": false, "character": "enter"} - }, - { - "keys": ["super+shift+;", ""], - "command": "easy_motion", - "args": {"select_text": true} - }, - { - "keys": ["super+shift+;", "enter"], - "command": "easy_motion", - "args": {"select_text": true, "character": "enter"} - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/Default (Windows).sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/Default (Windows).sublime-keymap deleted file mode 100644 index e86b53b..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/Default (Windows).sublime-keymap +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "keys": ["ctrl+;", ""], - "command": "easy_motion", - "args": {"select_text": false} - }, - { - "keys": ["ctrl+;", "enter"], - "command": "easy_motion", - "args": {"select_text": false, "character": "enter"} - }, - { - "keys": ["ctrl+shift+;", ""], - "command": "easy_motion", - "args": {"select_text": true} - }, - { - "keys": ["ctrl+shift+;", "enter"], - "command": "easy_motion", - "args": {"select_text": true, "character": "enter"} - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/Default.sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/Default.sublime-keymap deleted file mode 100644 index 8d1e0de..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/Default.sublime-keymap +++ /dev/null @@ -1,23 +0,0 @@ -[ - /* haven't figured out why yet, but for some reason you need to hit ctrl+c or escape twice to get it to deactivate jump targets */ - { - "keys": ["ctrl+c"], - "command": "deactivate_jump_targets", "context": [{"key": "setting.easy_motion_mode"}] - }, - { - "keys": ["escape"], - "command": "deactivate_jump_targets", "context": [{"key": "setting.easy_motion_mode"}] - }, - { - "keys": [""], - "command": "jump_to", "context": [{"key": "setting.easy_motion_mode"}] - }, - { - "keys": ["enter"], - "command": "show_jump_group", "context": [{"key": "setting.easy_motion_mode"}] - }, - { - "keys": ["shift+enter"], - "command": "show_jump_group", "context": [{"key": "setting.easy_motion_mode"}], "args": {"next": false} - } -] \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/EasyMotion.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/EasyMotion.sublime-settings deleted file mode 100644 index 164c331..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/EasyMotion.sublime-settings +++ /dev/null @@ -1,11 +0,0 @@ -{ - // defines syntax highlighting scope that will be used to highlight matched jump targets - // other examples include: keyword, string, number - "jump_target_scope" : "entity.name.class", - - // define the characters that we can jump to, in the order that they'll appear, they should be unique - "placeholder_chars" : "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ", - - // searches are case sensitive by default - "case_sensitive" : true -} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/LICENSE b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/LICENSE deleted file mode 100644 index 5aeb903..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/LICENSE +++ /dev/null @@ -1,203 +0,0 @@ -/* -* Apache License -* Version 2.0, January 2004 -* http://www.apache.org/licenses/ -* -* TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -* -* 1. Definitions. -* -* "License" shall mean the terms and conditions for use, reproduction, -* and distribution as defined by Sections 1 through 9 of this document. -* -* "Licensor" shall mean the copyright owner or entity authorized by -* the copyright owner that is granting the License. -* -* "Legal Entity" shall mean the union of the acting entity and all -* other entities that control, are controlled by, or are under common -* control with that entity. For the purposes of this definition, -* "control" means (i) the power, direct or indirect, to cause the -* direction or management of such entity, whether by contract or -* otherwise, or (ii) ownership of fifty percent (50%) or more of the -* outstanding shares, or (iii) beneficial ownership of such entity. -* -* "You" (or "Your") shall mean an individual or Legal Entity -* exercising permissions granted by this License. -* -* "Source" form shall mean the preferred form for making modifications, -* including but not limited to software source code, documentation -* source, and configuration files. -* -* "Object" form shall mean any form resulting from mechanical -* transformation or translation of a Source form, including but -* not limited to compiled object code, generated documentation, -* and conversions to other media types. -* -* "Work" shall mean the work of authorship, whether in Source or -* Object form, made available under the License, as indicated by a -* copyright notice that is included in or attached to the work -* (an example is provided in the Appendix below). -* -* "Derivative Works" shall mean any work, whether in Source or Object -* form, that is based on (or derived from) the Work and for which the -* editorial revisions, annotations, elaborations, or other modifications -* represent, as a whole, an original work of authorship. For the purposes -* of this License, Derivative Works shall not include works that remain -* separable from, or merely link (or bind by name) to the interfaces of, -* the Work and Derivative Works thereof. -* -* "Contribution" shall mean any work of authorship, including -* the original version of the Work and any modifications or additions -* to that Work or Derivative Works thereof, that is intentionally -* submitted to Licensor for inclusion in the Work by the copyright owner -* or by an individual or Legal Entity authorized to submit on behalf of -* the copyright owner. For the purposes of this definition, "submitted" -* means any form of electronic, verbal, or written communication sent -* to the Licensor or its representatives, including but not limited to -* communication on electronic mailing lists, source code control systems, -* and issue tracking systems that are managed by, or on behalf of, the -* Licensor for the purpose of discussing and improving the Work, but -* excluding communication that is conspicuously marked or otherwise -* designated in writing by the copyright owner as "Not a Contribution." -* -* "Contributor" shall mean Licensor and any individual or Legal Entity -* on behalf of whom a Contribution has been received by Licensor and -* subsequently incorporated within the Work. -* -* 2. Grant of Copyright License. Subject to the terms and conditions of -* this License, each Contributor hereby grants to You a perpetual, -* worldwide, non-exclusive, no-charge, royalty-free, irrevocable -* copyright license to reproduce, prepare Derivative Works of, -* publicly display, publicly perform, sublicense, and distribute the -* Work and such Derivative Works in Source or Object form. -* -* 3. Grant of Patent License. Subject to the terms and conditions of -* this License, each Contributor hereby grants to You a perpetual, -* worldwide, non-exclusive, no-charge, royalty-free, irrevocable -* (except as stated in this section) patent license to make, have made, -* use, offer to sell, sell, import, and otherwise transfer the Work, -* where such license applies only to those patent claims licensable -* by such Contributor that are necessarily infringed by their -* Contribution(s) alone or by combination of their Contribution(s) -* with the Work to which such Contribution(s) was submitted. If You -* institute patent litigation against any entity (including a -* cross-claim or counterclaim in a lawsuit) alleging that the Work -* or a Contribution incorporated within the Work constitutes direct -* or contributory patent infringement, then any patent licenses -* granted to You under this License for that Work shall terminate -* as of the date such litigation is filed. -* -* 4. Redistribution. You may reproduce and distribute copies of the -* Work or Derivative Works thereof in any medium, with or without -* modifications, and in Source or Object form, provided that You -* meet the following conditions: -* -* (a) You must give any other recipients of the Work or -* Derivative Works a copy of this License; and -* -* (b) You must cause any modified files to carry prominent notices -* stating that You changed the files; and -* -* (c) You must retain, in the Source form of any Derivative Works -* that You distribute, all copyright, patent, trademark, and -* attribution notices from the Source form of the Work, -* excluding those notices that do not pertain to any part of -* the Derivative Works; and -* -* (d) If the Work includes a "NOTICE" text file as part of its -* distribution, then any Derivative Works that You distribute must -* include a readable copy of the attribution notices contained -* within such NOTICE file, excluding those notices that do not -* pertain to any part of the Derivative Works, in at least one -* of the following places: within a NOTICE text file distributed -* as part of the Derivative Works; within the Source form or -* documentation, if provided along with the Derivative Works; or, -* within a display generated by the Derivative Works, if and -* wherever such third-party notices normally appear. The contents -* of the NOTICE file are for informational purposes only and -* do not modify the License. You may add Your own attribution -* notices within Derivative Works that You distribute, alongside -* or as an addendum to the NOTICE text from the Work, provided -* that such additional attribution notices cannot be construed -* as modifying the License. -* -* You may add Your own copyright statement to Your modifications and -* may provide additional or different license terms and conditions -* for use, reproduction, or distribution of Your modifications, or -* for any such Derivative Works as a whole, provided Your use, -* reproduction, and distribution of the Work otherwise complies with -* the conditions stated in this License. -* -* 5. Submission of Contributions. Unless You explicitly state otherwise, -* any Contribution intentionally submitted for inclusion in the Work -* by You to the Licensor shall be under the terms and conditions of -* this License, without any additional terms or conditions. -* Notwithstanding the above, nothing herein shall supersede or modify -* the terms of any separate license agreement you may have executed -* with Licensor regarding such Contributions. -* -* 6. Trademarks. This License does not grant permission to use the trade -* names, trademarks, service marks, or product names of the Licensor, -* except as required for reasonable and customary use in describing the -* origin of the Work and reproducing the content of the NOTICE file. -* -* 7. Disclaimer of Warranty. Unless required by applicable law or -* agreed to in writing, Licensor provides the Work (and each -* Contributor provides its Contributions) on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -* implied, including, without limitation, any warranties or conditions -* of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A -* PARTICULAR PURPOSE. You are solely responsible for determining the -* appropriateness of using or redistributing the Work and assume any -* risks associated with Your exercise of permissions under this License. -* -* 8. Limitation of Liability. In no event and under no legal theory, -* whether in tort (including negligence), contract, or otherwise, -* unless required by applicable law (such as deliberate and grossly -* negligent acts) or agreed to in writing, shall any Contributor be -* liable to You for damages, including any direct, indirect, special, -* incidental, or consequential damages of any character arising as a -* result of this License or out of the use or inability to use the -* Work (including but not limited to damages for loss of goodwill, -* work stoppage, computer failure or malfunction, or any and all -* other commercial damages or losses), even if such Contributor -* has been advised of the possibility of such damages. -* -* 9. Accepting Warranty or Additional Liability. While redistributing -* the Work or Derivative Works thereof, You may choose to offer, -* and charge a fee for, acceptance of support, warranty, indemnity, -* or other liability obligations and/or rights consistent with this -* License. However, in accepting such obligations, You may act only -* on Your own behalf and on Your sole responsibility, not on behalf -* of any other Contributor, and only if You agree to indemnify, -* defend, and hold each Contributor harmless for any liability -* incurred by, or claims asserted against, such Contributor by reason -* of your accepting any such warranty or additional liability. -* -* END OF TERMS AND CONDITIONS -* -* APPENDIX: How to apply the Apache License to your work. -* -* To apply the Apache License to your work, attach the following -* boilerplate notice, with the fields enclosed by brackets "[]" -* replaced with your own identifying information. (Don't include -* the brackets!) The text should be enclosed in the appropriate -* comment syntax for the file format. We also recommend that a -* file or class name and description of purpose be included on the -* same "printed page" as the copyright notice for easier -* identification within third-party archives. -* -* Copyright [yyyy] [name of copyright owner] -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/Main.sublime-menu b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/Main.sublime-menu deleted file mode 100644 index 45795cf..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/Main.sublime-menu +++ /dev/null @@ -1,90 +0,0 @@ -[ - { - "id": "preferences", - "children": - [ - { - "id": "package-settings", - "children": - [ - { - "caption": "EasyMotion", - "children": - [ - // README - { - "caption": "View README", - "command": "open_file", "args": {"file": "${packages}/EasyMotion/README.md"} - }, - { "caption": "-" }, - - // Settings - { - "caption": "Settings – Default", - "command": "open_file", "args": {"file": "${packages}/EasyMotion/EasyMotion.sublime-settings"} - }, - { - "caption": "Settings – User", - "command": "open_file", "args": {"file": "${packages}/User/EasyMotion.sublime-settings"} - }, - { "caption": "-" }, - - // Keybindings - Default - { - "caption": "Key Bindings – Default", - "command": "open_file", - "args": { - "file": "${packages}/EasyMotion/Default (OSX).sublime-keymap", - "platform": "OSX" - } - }, - { - "caption": "Key Bindings – Default", - "command": "open_file", - "args": { - "file": "${packages}/EasyMotion/Default (Linux).sublime-keymap", - "platform": "Linux" - } - }, - { - "caption": "Key Bindings – Default", - "command": "open_file", - "args": { - "file": "${packages}/EasyMotion/Default (Windows).sublime-keymap", - "platform": "Windows" - } - }, - - // Keybindings - User - { - "caption": "Key Bindings – User", - "command": "open_file", - "args": { - "file": "${packages}/User/Default (OSX).sublime-keymap", - "platform": "OSX" - } - }, - { - "caption": "Key Bindings – User", - "command": "open_file", - "args": { - "file": "${packages}/User/Default (Linux).sublime-keymap", - "platform": "Linux" - } - }, - { - "caption": "Key Bindings – User", - "command": "open_file", - "args": { - "file": "${packages}/User/Default (Windows).sublime-keymap", - "platform": "Windows" - } - }, - { "caption": "-" } - ] - } - ] - } - ] - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/README.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/README.md deleted file mode 100644 index 8dab70b..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/README.md +++ /dev/null @@ -1,146 +0,0 @@ -# Sublime EasyMotion - -EasyMotion is a [Sublime Text 2](http://www.sublimetext.com/2) plugin that allows you to move the cursor to any character in your current view. - -It's heavily inspired by [Vim's EasyMotion](http://www.vim.org/scripts/script.php?script_id=3526), and [Emacs' AceJump](http://www.emacswiki.org/emacs/AceJump) plugins. - -After pressing the EasyMotion shortcut (default `cmd-;`/`ctrl-;`), you then press the character that you'd like to jump to. EasyMotion will then replace all currently visible instances of that character with one of `a-zA-Z0-9`. Press the key for the one you want and your cursor will be moved right to it. - -Here I'm pressing `cmd-;` followed by `f`. EasyMotion highlights the 6 visible "f" characters with `a-f`. I then press `d` to jump to the beginning of the `function`. - -![Animated Gif](https://raw.github.com/tednaleid/sublime-EasyMotion/add_images/images/easymotion.gif) - - -## Installation - -### Install via PackageControl -If you have the [PackageControl](http://wbond.net/sublime_packages/package_control) plugin installed, you can use that to install `EasyMotion`. - -Just type `cmd-shift-p` (`ctrl-shift-p` on win/linux) to bring up the command pallate then type `install` and pick `Package Control: Install Package` from the dropdown. - -Then type `EasyMotion` and choose the EasyMotion plugin from the dropdown. Hit `enter` and it will install. - -### Manual Installation - -Manual installation should be as easy as cloning this git repository into your Sublime `Packages` directory. On OSX: - - cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages - git clone git://github.com/tednaleid/sublime-EasyMotion.git EasyMotion - -(The directory name underneath packages __must__ be `EasyMotion` and not `sublime-EasyMotion` for some preferences to get picked up) - -If you're interested in trying the next release of the plugin, you can switch your branch to the development branch: - - cd EasyMotion - git checkout development - -This branch will have features that are marked as fixed in the issue, but haven't yet been merged to `master`. - -### Sublime Text 3 Experimental Support - -There is experimental support for Sublime Text 3 on the `st3` branch that requires manual installation and the use of the `st3` branch. - - cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages - git clone git://github.com/tednaleid/sublime-EasyMotion.git EasyMotion - cd EasyMotion - git checkout st3 - - -## Usage - -### Jump to any visible character - - cmd-; // OSX - ctrl-; // Linux/Windows - -it will label all instances of that character with a unique value in `a-zA-Z0-9`, type the label you want and it will jump you to it. - -#### Example - -The cursor is at the end of the file and we want to jump to the beginning of the `realpart` variable on line 3 - -![EasyMotion Begin](https://raw.github.com/tednaleid/sublime-EasyMotion/add_images/images/sublimejump_begin.png) - -Instead of hitting the up arrow twice and scrolling over to the r (or grabbing your mouse), you could press `cmd-;` followed by `r`. That will transform your file into this (notice that each instance of `r` has been turned into one of `a-zA-Z0-9`): - -![EasyMotion Middle](https://raw.github.com/tednaleid/sublime-EasyMotion/add_images/images/sublimejump_middle.png) - -Press `e` and your cursor will jump right there: - -![EasyMotion Middle](https://raw.github.com/tednaleid/sublime-EasyMotion/add_images/images/sublimejump_end.png) - -If your target character occurs more than 62 times in the visible area, it will decorate them in batches. - -So if we search this for the letter `l` using `cmd-;`+`l` - -![Many Matches Start](https://raw.github.com/tednaleid/sublime-EasyMotion/add_images/images/many_matches_start.png) - -The first batch of 62 targets will look like this: - -![Many Matches First](https://raw.github.com/tednaleid/sublime-EasyMotion/add_images/images/many_matches_first.png) - -**Just hit `enter` and it will highlight the next group of matches.** - -![Many Matches Second](https://raw.github.com/tednaleid/sublime-EasyMotion/add_images/images/many_matches_second.png) - -Keep hitting `enter` and it will continue to cycle through them in groups of 62. You can also hit `shift-enter` to cycle backwards through the target groups. Hitting the `spacebar` will exit, and so will `ctrl-c` and `escape` (but for some reason there's currently a bug that makes you hit those twice to exit). - -### Select all text between cursor and any visible character - - cmd-shift-; // OSX - ctrl-shift-; // Linux/Windows - -it will label all instances of that character with a unique value in `a-zA-Z0-9`, type it and it will select all text between your current cursor position and the chosen jump target. - -#### Example - -So in the same situation as above, if we had hit `cmd-shift-;` followed by `r` and picked the `e` target that occurs at the start of the `imagpart` variable on line 3, we would end up with this: - -![EasyMotion Select](https://raw.github.com/tednaleid/sublime-EasyMotion/add_images/images/sublimejump_select.png) - - -## User Modifiable Preferences - -### Remapping the Sublime EasyMotion keyboard shortcut - -You can remap your keys to be something other than the defaults by entering an override value into your "User - KeyBindings" (under Sublime Text 2 -> Preferences -> Package Settings -> Easy Motion on OSX), just make sure to copy the existing key bindings exactly and change only the first item in the `keys` stanza, otherwise it won't work. So if you wanted the jump command to be `ctrl-,`, you'd use: - - - [ - { - "keys": ["ctrl+,", ""], - "command": "easy_motion", - "args": {"select_text": false} - }, - { - "keys": ["ctrl+shift+,", ""], - "command": "easy_motion", - "args": {"select_text": true} - } - ] - - -### Overriding the placeholder characters used for jumping - -Add this to your "User Settings" file (found at "Sublime Text 2 -> Preferences -> Package Settings -> Easy Motion -> Settings - User" on OSX) and change the string to contain whatever characters you'd like to use: - - // define the characters that we can jump to, in the order that they'll appear, they should be unique - "placeholder_chars" : "abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ" - -example using only QWERTY home-row replacements: - - "placeholder_chars" : "jkl;asdfHGJKL:ASDFHG" - -### Override the highlight color for jump targets - -If the highlight color used for jump targets isn't bold enough if your color scheme, you can override it by changing this "User Setting": - - // defines syntax highlighting scope that will be used to highlight matched jump targets - // other examples include: keyword, string, number - "jump_target_scope" : "entity.name.class" - - -# Versions - -- 0.8 - released 2/3/13 - updates location of preferences to EasyMotion specific file and includes plugin specific preferences file. You'll need to migrate preferences over into this file for them to stick. -- 0.9 - released 2/14/13 - removes need for input panel and implements an easy_motion_mode to accept keystrokes, also lets `shift-enter` cycle backwards diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/easy_motion.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/easy_motion.py deleted file mode 100644 index 0c7aa8b..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/easy_motion.py +++ /dev/null @@ -1,293 +0,0 @@ -import sublime -import sublime_plugin -import re -from itertools import izip_longest -from pprint import pprint - -REGEX_ESCAPE_CHARS = '\\+*()[]{}^$?|:].,' - -# not a fan of using globals like this, but not sure if there's a better way with the plugin -# API that ST2 provides. Tried attaching as fields to active_view, but didn't persiste, I'm guessing -# it's just a representation of something that gets regenerated on demand so dynamic fields are transient -JUMP_GROUP_GENERATOR = None -CURRENT_JUMP_GROUP = None -EASY_MOTION_EDIT = None -SELECT_TEXT = False -COMMAND_MODE_WAS = False -JUMP_TARGET_SCOPE = 'string' - - -class JumpGroupGenerator: - ''' - given a list of region jump targets matching the given character, can emit a series of - JumpGroup dictionaries going forwards with next and backwards with previous - ''' - def __init__(self, view, character, placeholder_chars, case_sensitive): - self.view = view - self.case_sensitive = case_sensitive - self.placeholder_chars = placeholder_chars - self.all_jump_targets = self.find_all_jump_targets_in_visible_region(character) - self.interleaved_jump_targets = self.interleave_jump_targets_from_cursor() - self.jump_target_index = 0 - self.jump_target_groups = self.create_jump_target_groups() - self.jump_target_group_index = -1 - - def determine_re_flags(self, character): - if character == 'enter': - return '(?m)' - elif self.case_sensitive: - return '(?i)' - else: - return '' - - def interleave_jump_targets_from_cursor(self): - sel = self.view.sel()[0] # multi select not supported, doesn't really make sense - sel_begin = sel.begin() - sel_end = sel.end() - before = [] - after = [] - - # split them into two lists radiating out from the cursor position - for target in self.all_jump_targets: - if target.begin() < sel_begin: - # add to beginning of list so closest targets to cursor are first - before.insert(0, target) - elif target.begin() > sel_end: - after.append(target) - - # now interleave the two lists together into one list - return [target for targets in izip_longest(before, after) for target in targets if target is not None] - - def create_jump_target_groups(self): - jump_target_groups = [] - - while self.has_next_jump_target(): - jump_group = dict() - - for placeholder_char in self.placeholder_chars: - if self.has_next_jump_target(): - jump_group[placeholder_char] = self.interleaved_jump_targets[self.jump_target_index] - self.jump_target_index += 1 - else: - break - - jump_target_groups.append(jump_group) - - return jump_target_groups - - def has_next_jump_target(self): - return self.jump_target_index < len(self.interleaved_jump_targets) - - def __len__(self): - return len(self.jump_target_groups) - - def next(self): - self.jump_target_group_index += 1 - - if self.jump_target_group_index >= len(self.jump_target_groups) or self.jump_target_group_index < 0: - self.jump_target_group_index = 0 - - return self.jump_target_groups[self.jump_target_group_index] - - def previous(self): - self.jump_target_group_index -= 1 - - if self.jump_target_group_index < 0 or self.jump_target_group_index >= len(self.jump_target_groups): - self.jump_target_group_index = len(self.jump_target_groups) - 1 - - return self.jump_target_groups[self.jump_target_group_index] - - def find_all_jump_targets_in_visible_region(self, character): - visible_region_begin = self.visible_region_begin() - visible_text = self.visible_text() - folded_regions = self.get_folded_regions(self.view) - matching_regions = [] - target_regexp = self.target_regexp(character) - - for char_at in (match.start() for match in re.finditer(target_regexp, visible_text)): - char_point = char_at + visible_region_begin - char_region = sublime.Region(char_point, char_point + 1) - if not self.region_list_contains_region(folded_regions, char_region): - matching_regions.append(char_region) - - return matching_regions - - def region_list_contains_region(self, region_list, region): - - for element_region in region_list: - if element_region.contains(region): - return True - return False - - def visible_region_begin(self): - return self.view.visible_region().begin() - - def visible_text(self): - visible_region = self.view.visible_region() - return self.view.substr(visible_region) - - def target_regexp(self, character): - re_flags = self.determine_re_flags(character) - if (REGEX_ESCAPE_CHARS.find(character) >= 0): - return re_flags + '\\' + character - elif character == "enter": - return re_flags + "(?=^).|.(?=$)" - else: - return re_flags + character - - def get_folded_regions(self, view): - ''' - No way in the API to get the folded regions without unfolding them first - seems to be quick enough that you can't actually see them fold/unfold - ''' - folded_regions = view.unfold(view.visible_region()) - view.fold(folded_regions) - return folded_regions - - -class EasyMotionCommand(sublime_plugin.WindowCommand): - winning_selection = None - - def run(self, character=None, select_text=False): - global JUMP_GROUP_GENERATOR, SELECT_TEXT, JUMP_TARGET_SCOPE - sublime.status_message("EasyMotion: Jump to " + character) - - SELECT_TEXT = select_text - - active_view = self.window.active_view() - - settings = sublime.load_settings("EasyMotion.sublime-settings") - placeholder_chars = settings.get('placeholder_chars', 'abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ') - JUMP_TARGET_SCOPE = settings.get('jump_target_scope', 'string') - case_sensitive = settings.get('case_sensitive', True) - - JUMP_GROUP_GENERATOR = JumpGroupGenerator(active_view, character, placeholder_chars, case_sensitive) - - if len(JUMP_GROUP_GENERATOR) > 0: - self.activate_mode(active_view) - self.window.run_command("show_jump_group") - else: - sublime.status_message("EasyMotion: unable to find any instances of " + character + " in visible region") - - def activate_mode(self, active_view): - global COMMAND_MODE_WAS - active_view.settings().set('easy_motion_mode', True) - # yes, this feels a little dirty to mess with the Vintage plugin, but there - # doesn't appear to be any other way to tell it to not intercept keys, so turn it - # off (if it's on) while we're running EasyMotion - COMMAND_MODE_WAS = active_view.settings().get('command_mode') - if (COMMAND_MODE_WAS): - active_view.settings().set('command_mode', False) - - -class ShowJumpGroup(sublime_plugin.WindowCommand): - active_view = None - - def run(self, next=True): - self.active_view = self.window.active_view() - - self.show_jump_group(next) - - def show_jump_group(self, next=True): - global JUMP_GROUP_GENERATOR, CURRENT_JUMP_GROUP - - if next: - CURRENT_JUMP_GROUP = JUMP_GROUP_GENERATOR.next() - else: - CURRENT_JUMP_GROUP = JUMP_GROUP_GENERATOR.previous() - - self.activate_current_jump_group() - - def activate_current_jump_group(self): - global CURRENT_JUMP_GROUP, EASY_MOTION_EDIT, JUMP_TARGET_SCOPE - ''' - Start up an edit object if we don't have one already, then create all of the jump targets - ''' - if (EASY_MOTION_EDIT is not None): - # normally would call deactivate_current_jump_group here, but apparent ST2 bug prevents it from calling undo correctly - # instead just decorate the new character and keep the same edit object so all changes get undone properly - self.active_view.erase_regions("jump_match_regions") - else: - EASY_MOTION_EDIT = self.active_view.begin_edit() - - for placeholder_char in CURRENT_JUMP_GROUP.keys(): - self.active_view.replace(EASY_MOTION_EDIT, CURRENT_JUMP_GROUP[placeholder_char], placeholder_char) - - self.active_view.add_regions("jump_match_regions", CURRENT_JUMP_GROUP.values(), JUMP_TARGET_SCOPE, "dot") - - -class JumpTo(sublime_plugin.WindowCommand): - def run(self, character=None): - global COMMAND_MODE_WAS - - self.active_view = self.window.active_view() - self.winning_selection = self.winning_selection_from(character) - self.finish_easy_motion() - self.active_view.settings().set('easy_motion_mode', False) - if (COMMAND_MODE_WAS): - self.active_view.settings().set('command_mode', True) - - def winning_selection_from(self, selection): - global CURRENT_JUMP_GROUP, SELECT_TEXT - winning_region = None - if selection in CURRENT_JUMP_GROUP: - winning_region = CURRENT_JUMP_GROUP[selection] - - if winning_region is not None: - if SELECT_TEXT: - for current_selection in self.active_view.sel(): - if winning_region.begin() < current_selection.begin(): - return sublime.Region(current_selection.end(), winning_region.begin()) - else: - return sublime.Region(current_selection.begin(), winning_region.end()) - else: - return sublime.Region(winning_region.begin(), winning_region.begin()) - - def finish_easy_motion(self): - ''' - We need to clean up after ourselves by restoring the view to it's original state, if the user did - press a jump target that we've got saved, jump to it as the last action - ''' - self.deactivate_current_jump_group() - self.jump_to_winning_selection() - - def deactivate_current_jump_group(self): - ''' - Close out the edit that we've been messing with and then undo it right away to return the buffer to - the pristine state that we found it in. Other methods ended up leaving the window in a dirty save state - and this seems to be the cleanest way to get back to the original state - ''' - global EASY_MOTION_EDIT - if (EASY_MOTION_EDIT is not None): - self.active_view.end_edit(EASY_MOTION_EDIT) - self.window.run_command("undo") - EASY_MOTION_EDIT = None - - self.active_view.erase_regions("jump_match_regions") - - def jump_to_winning_selection(self): - if self.winning_selection is not None: - self.active_view.run_command("jump_to_winning_selection", {"begin": self.winning_selection.begin(), "end": self.winning_selection.end()}) - - -class DeactivateJumpTargets(sublime_plugin.WindowCommand): - def run(self): - pprint("DeactivateJumpTargets called") - global EASY_MOTION_EDIT - - active_view = self.window.active_view() - if (EASY_MOTION_EDIT is not None): - active_view.end_edit(EASY_MOTION_EDIT) - self.window.run_command("undo") - EASY_MOTION_EDIT = None - - active_view.erase_regions("jump_match_regions") - - -class JumpToWinningSelection(sublime_plugin.TextCommand): - def run(self, edit, begin, end): - winning_region = sublime.Region(long(begin), long(end)) - sel = self.view.sel() - sel.clear() - sel.add(winning_region) - self.view.show(winning_region) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/package-metadata.json deleted file mode 100644 index 117e61c..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/EasyMotion/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://github.com/tednaleid/sublime-EasyMotion", "version": "2013.08.10.19.55.17", "description": "Sublime Text 2 plugin to quickly jump to any character in the visible area of the active view."} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/.gitignore b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/.gitignore deleted file mode 100644 index 2500b0f..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.pyc -*.cache \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ColorSchemes/Print-Color.tmTheme b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ColorSchemes/Print-Color.tmTheme deleted file mode 100644 index aadedbc..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ColorSchemes/Print-Color.tmTheme +++ /dev/null @@ -1,362 +0,0 @@ - - - - - name - Print Color - settings - - - settings - - background - #FFFFFF - caret - #000000 - foreground - #000000 - invisibles - #3B3A32 - lineHighlight - #2E2E2E22 - selection - #34A7BD - selectionForeground - #FFFFFF - inactiveSelection - #9D550FAA - inactiveSelectionForeground - #6ac4d6 - findHighlight - #FFE792 - findHighlightForeground - #000000 - activeGuide - #34A7BD - gutterForeground - #858585 - gutter - #E5E5E5 - - bracketsForeground - #F8F8F2A5 - bracketsOptions - underline - - bracketContentsForeground - #F8F8F2A5 - bracketContentsOptions - underline - - tagsOptions - stippled_underline - - - - name - Comment - scope - comment - settings - - foreground - #A5A5A5 - - - - name - String - scope - string - settings - - foreground - #8F8634 - - - - name - Number - scope - constant.numeric - settings - - foreground - #7C4FCD - - - - name - Built-in constant - scope - constant.language - settings - - foreground - #7C4FCD - - - - name - User-defined constant - scope - constant.character, constant.other - settings - - foreground - #7C4FCD - - - - name - Variable - scope - variable - settings - - fontStyle - - - - - name - Keyword - scope - keyword - settings - - foreground - #C70040 - - - - name - Storage - scope - storage - settings - - fontStyle - - foreground - #C70040 - - - - name - Storage type - scope - storage.type - settings - - fontStyle - italic - foreground - #34A7BD - - - - name - Class name - scope - entity.name.class - settings - - fontStyle - underline - foreground - #427E00 - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - fontStyle - italic underline - foreground - #427E00 - - - - name - Function name - scope - entity.name.function - settings - - fontStyle - - foreground - #427E00 - - - - name - Function argument - scope - variable.parameter - settings - - fontStyle - italic - foreground - #CB6500 - - - - name - Tag name - scope - entity.name.tag - settings - - fontStyle - - foreground - #C70040 - - - - name - Tag attribute - scope - entity.other.attribute-name - settings - - fontStyle - - foreground - #427E00 - - - - name - Library function - scope - support.function - settings - - fontStyle - - foreground - #34A7BD - - - - name - Library constant - scope - support.constant - settings - - fontStyle - - foreground - #34A7BD - - - - name - Library class/type - scope - support.type, support.class - settings - - fontStyle - italic - foreground - #34A7BD - - - - name - Library variable - scope - support.other.variable - settings - - fontStyle - - - - - name - Invalid - scope - invalid - settings - - background - #C70040 - fontStyle - - foreground - #F8F8F0 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - background - #7C4FCD - foreground - #F8F8F0 - - - - name - JSON String - scope - meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #8F8634 - - - - name - diff.deleted - scope - markup.deleted - settings - - foreground - #C70040 - - - - name - diff.inserted - scope - markup.inserted - settings - - foreground - #427E00 - - - - name - diff.changed - scope - markup.changed - settings - - foreground - #8F8634 - - - - uuid - 22808317-0a5a-4b87-baea-5aeee17bf295 - - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ColorSchemes/Print-Grayscale.tmTheme b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ColorSchemes/Print-Grayscale.tmTheme deleted file mode 100644 index cd26fd1..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ColorSchemes/Print-Grayscale.tmTheme +++ /dev/null @@ -1,133 +0,0 @@ - - - - - name - Print Grayscale - settings - - - settings - - background - #FFFFFF - caret - #000000 - foreground - #000000 - invisibles - #323232 - lineHighlight - #2E2E2E22 - selection - #666666 - selectionForeground - #FFFFFF - inactiveSelection - #888888 - findHighlight - #666666 - findHighlightForeground - #000000 - activeGuide - #888888 - gutterForeground - #000000 - gutter - #E5E5E5 - - bracketsForeground - #000000 - bracketsOptions - underline - - bracketContentsForeground - #000000 - bracketContentsOptions - underline - - tagsOptions - stippled_underline - - - - name - Comment - scope - comment - settings - - foreground - #A5A5A5 - - - - name - Storage type - scope - storage.type - settings - - fontStyle - italic - foreground - #000000 - - - - name - Class name - scope - entity.name.class - settings - - fontStyle - underline - foreground - #000000 - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - fontStyle - italic underline - foreground - #000000 - - - - name - Function argument - scope - variable.parameter - settings - - fontStyle - italic - foreground - #000000 - - - - name - Library class/type - scope - support.type, support.class - settings - - fontStyle - italic - foreground - #000000 - - - - uuid - 07379361-ce49-4e6c-a03f-26378a7a2131 - - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/Context.sublime-menu b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/Context.sublime-menu deleted file mode 100644 index d0320be..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/Context.sublime-menu +++ /dev/null @@ -1,26 +0,0 @@ -[ - { "caption": "-" }, - { - "caption": "Export", - "children": - [ - { "command": "export_html_panel", "caption": "HTML" }, - {"command": "export_bbcode_panel", "caption": "BBCode"} - ] - }, - { - "caption": "Annotations", - "children": - [ - { "command": "enable_annotation_mode", "caption": "Enable Annotation Mode" }, - { "command": "disable_annotation_mode", "caption": "Disable Annotation Mode" }, - { "caption": "-" }, - { "command": "add_annotation", "caption": "Add Annotation" }, - { "command": "edit_annotation", "caption": "Edit Annotation" }, - { "command": "delete_annotations", "caption": "Delete Annotation(s)" }, - { "command": "clear_annotations", "caption": "Delete All Annotations" }, - { "command": "show_annotation_comment", "caption": "Show Annotation Comment" } - ] - }, - { "caption": "-"} -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/Default.sublime-commands b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/Default.sublime-commands deleted file mode 100644 index 4e3776a..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/Default.sublime-commands +++ /dev/null @@ -1,35 +0,0 @@ -[ - // Export to HTML - { - "caption": "Export to HTML: Show Export Menu", - "command": "export_html_panel" - }, - { - "caption": "Export to BBCode: Show Export Menu", - "command": "export_bbcode_panel" - }, - { - "caption": "Export to HTML: Toggle Annotation Mode", - "command": "toggle_annotation_html_mode" - }, - { - "caption": "Export to HTML: Add Annotation", - "command": "add_annotation" - }, - { - "caption": "Export to HTML: Edit Annotation", - "command": "edit_annotation" - }, - { - "caption": "Export to HTML: Delete Annotation(s)", - "command": "delete_annotations" - }, - { - "caption": "Export to HTML: Delete All Annotations", - "command": "clear_annotations" - }, - { - "caption": "Export to HTML: Show Annotation Comment", - "command": "show_annotation_comment" - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportBbcode.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportBbcode.py deleted file mode 100644 index 2be2d0b..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportBbcode.py +++ /dev/null @@ -1,352 +0,0 @@ -import sublime -import sublime_plugin -from os import path -import tempfile -import sys -import re - -PACKAGE_SETTINGS = "ExportHtml.sublime-settings" - -if sublime.platform() == "linux": - # Try and load Linux Python2.6 lib. Default path is for Ubuntu. - linux_lib = sublime.load_settings(PACKAGE_SETTINGS).get("linux_python2.6_lib", "/usr/lib/python2.6/lib-dynload") - if not linux_lib in sys.path and path.exists(linux_lib): - sys.path.append(linux_lib) -from plistlib import readPlist -from ExportHtmlLib.rgba.rgba import RGBA - -NUMBERED_BBCODE_LINE = '[color=%(color)s]%(line)s [/color]%(code)s\n' - -BBCODE_LINE = '%(code)s\n' - -BBCODE_CODE = '[color=%(color)s]%(content)s[/color]' - -BBCODE_ESCAPE = '[/color][color=%(color_open)s]%(content)s[/color][color=%(color_close)s]' - -BBCODE_BOLD = '[b]%(content)s[/b]' - -BBCODE_ITALIC = '[i]%(content)s[/i]' - -POST_START = '[pre=%(bg_color)s]' - -POST_END = '[/pre]\n' - -BBCODE_MATCH = re.compile(r"""(\[/?)((?:code|pre|table|tr|td|th|b|i|u|sup|color|url|img|list|trac|center|quote|size|li|ul|ol|youtube|gvideo)(?:=[^\]]+)?)(\])""") - -FILTER_MATCH = re.compile(r'^(?:(brightness|saturation|hue|colorize)\((-?[\d]+|[\d]*\.[\d]+)\)|(sepia|grayscale|invert))$') - - -class ExportBbcodePanelCommand(sublime_plugin.WindowCommand): - def execute(self, value): - if value >= 0: - view = self.window.active_view() - if view != None: - ExportBbcode(view).run(**self.args[value]) - - def run(self): - options = sublime.load_settings(PACKAGE_SETTINGS).get("bbcode_panel", {}) - menu = [] - self.args = [] - for opt in options: - k, v = opt.items()[0] - menu.append(k) - self.args.append(v) - - if len(menu): - self.window.show_quick_panel( - menu, - self.execute - ) - - -class ExportBbcodeCommand(sublime_plugin.WindowCommand): - def run(self, **kwargs): - view = self.window.active_view() - if view != None: - ExportBbcode(view).run(**kwargs) - - -class ExportBbcode(object): - def __init__(self, view): - self.view = view - - def process_inputs(self, **kwargs): - return { - "numbers": bool(kwargs.get("numbers", False)), - "color_scheme": kwargs.get("color_scheme", None), - "multi_select": bool(kwargs.get("multi_select", False)), - "clipboard_copy": bool(kwargs.get("clipboard_copy", True)), - "view_open": bool(kwargs.get("view_open", False)), - "filter": kwargs.get("filter", "") - } - - def setup(self, **kwargs): - path_packages = sublime.packages_path() - - # Get get general document preferences from sublime preferences - settings = sublime.load_settings('Preferences.sublime-settings') - eh_settings = sublime.load_settings(PACKAGE_SETTINGS) - self.tab_size = settings.get('tab_size', 4) - self.char_limit = int(eh_settings.get("valid_selection_size", 4)) - self.bground = '' - self.fground = '' - self.gbground = '' - self.gfground = '' - self.sbground = '' - self.sfground = '' - self.numbers = kwargs["numbers"] - self.hl_continue = None - self.curr_hl = None - self.sels = [] - self.multi_select = self.check_sel() if kwargs["multi_select"] else False - self.size = self.view.size() - self.pt = 0 - self.end = 0 - self.curr_row = 0 - self.empty_space = None - self.filter = [] - for f in kwargs["filter"].split(";"): - m = FILTER_MATCH.match(f) - if m: - if m.group(1): - self.filter.append((m.group(1), float(m.group(2)))) - else: - self.filter.append((m.group(3), 0.0)) - - # Get color scheme - if kwargs["color_scheme"] != None: - alt_scheme = kwargs["color_scheme"] - else: - alt_scheme = eh_settings.get("alternate_scheme", False) - scheme_file = settings.get('color_scheme') if alt_scheme == False else alt_scheme - colour_scheme = path.normpath(scheme_file) - self.plist_file = self.apply_filters(readPlist(path_packages + colour_scheme.replace('Packages', ''))) - colour_settings = self.plist_file["settings"][0]["settings"] - - # Get general theme colors from color scheme file - self.bground = self.strip_transparency(colour_settings.get("background", '#FFFFFF'), simple_strip=True) - self.fground = self.strip_transparency(colour_settings.get("foreground", '#000000')) - self.gbground = self.bground - self.gfground = self.fground - - # Create scope colors mapping from color scheme file - self.colours = {self.view.scope_name(self.end).split(' ')[0]: {"color": self.fground, "style": []}} - for item in self.plist_file["settings"]: - scope = item.get('scope', None) - colour = None - style = [] - if 'scope' in item: - scope = item['scope'] - if 'settings' in item: - colour = item['settings'].get('foreground', None) - if 'fontStyle' in item['settings']: - for s in item['settings']['fontStyle'].split(' '): - if s == "bold" or s == "italic": # or s == "underline": - style.append(s) - - if scope != None and colour != None: - self.colours[scope] = {"color": self.strip_transparency(colour), "style": style} - - def apply_filters(self, tmtheme): - def filter_color(color): - rgba = RGBA(color) - for f in self.filter: - name = f[0] - value = f[1] - if name == "grayscale": - rgba.grayscale() - elif name == "sepia": - rgba.sepia() - elif name == "saturation": - rgba.saturation(value) - elif name == "invert": - rgba.invert() - elif name == "brightness": - rgba.brightness(value) - elif name == "hue": - rgba.hue(value) - elif name == "colorize": - rgba.colorize(value) - return rgba.get_rgba() - - if len(self.filter): - general_settings_read = False - for settings in tmtheme["settings"]: - if not general_settings_read: - for k, v in settings["settings"].items(): - try: - settings["settings"][k] = filter_color(v) - except: - pass - general_settings_read = True - continue - - try: - settings["settings"]["foreground"] = filter_color(settings["settings"]["foreground"]) - except: - pass - try: - settings["settings"]["background"] = filter_color(settings["settings"]["background"]) - except: - pass - return tmtheme - - def strip_transparency(self, color, track_darkness=False, simple_strip=False): - if color is None: - return color - rgba = RGBA(color.replace(" ", "")) - if not simple_strip: - rgba.apply_alpha(self.bground if self.bground != "" else "#FFFFFF") - return rgba.get_rgb() - - def setup_print_block(self, curr_sel, multi=False): - # Determine start and end points and whether to parse whole file or selection - if not multi and (curr_sel.empty() or curr_sel.size() <= self.char_limit): - self.size = self.view.size() - self.pt = 0 - self.end = 1 - self.curr_row = 1 - else: - self.size = curr_sel.end() - self.pt = curr_sel.begin() - self.end = self.pt + 1 - self.curr_row = self.view.rowcol(self.pt)[0] + 1 - self.start_line = self.curr_row - - self.gutter_pad = len(str(self.view.rowcol(self.size)[0])) + 1 - - def check_sel(self): - multi = False - for sel in self.view.sel(): - if not sel.empty() and sel.size() >= self.char_limit: - multi = True - self.sels.append(sel) - return multi - - def guess_colour(self, the_key): - the_colour = None - the_style = None - if the_key in self.colours: - the_colour = self.colours[the_key]["color"] - the_style = self.colours[the_key]["style"] - else: - best_match = 0 - for key in self.colours: - if self.view.score_selector(self.pt, key) > best_match: - best_match = self.view.score_selector(self.pt, key) - the_colour = self.colours[key]["color"] - the_style = self.colours[key]["style"] - self.colours[the_key] = {"color": the_colour, "style": the_style} - return the_colour, the_style - - def print_line(self, line, num): - if self.numbers: - bbcode_line = NUMBERED_BBCODE_LINE % { - "color": self.gfground, - "line": str(num).rjust(self.gutter_pad), - "code": line - } - else: - bbcode_line = BBCODE_LINE % {"code": line} - - return bbcode_line - - def convert_view_to_bbcode(self, the_bbcode): - for line in self.view.split_by_newlines(sublime.Region(self.end, self.size)): - self.empty_space = None - self.size = line.end() - line = self.convert_line_to_bbcode() - the_bbcode.write(self.print_line(line, self.curr_row)) - self.curr_row += 1 - - def repl(self, m, the_colour): - return m.group(1) + ( - BBCODE_ESCAPE % { - "color_open": the_colour, - "color_close": the_colour, - "content": m.group(2) - } - ) + m.group(3) - - def format_text(self, line, text, the_colour, the_style): - text = text.replace('\t', ' ' * self.tab_size).replace('\n', '') - if self.empty_space != None: - text = self.empty_space + text - self.empty_space = None - if text.strip(' ') == '': - self.empty_space = text - else: - code = "" - text = BBCODE_MATCH.sub(lambda m: self.repl(m, the_colour), text) - bold = False - italic = False - for s in the_style: - if s == "bold": - bold = True - if s == "italic": - italic = True - code += (BBCODE_CODE % {"color": the_colour, "content": text}) - if italic: - code = (BBCODE_ITALIC % {"color": the_colour, "content": code}) - if bold: - code = (BBCODE_BOLD % {"color": the_colour, "content": code}) - line.append(code) - - def convert_line_to_bbcode(self): - line = [] - - while self.end <= self.size: - # Get text of like scope up to a highlight - scope_name = self.view.scope_name(self.pt) - while self.view.scope_name(self.end) == scope_name and self.end < self.size: - self.end += 1 - the_colour, the_style = self.guess_colour(scope_name) - - region = sublime.Region(self.pt, self.end) - # Normal text formatting - text = self.view.substr(region) - self.format_text(line, text, the_colour, the_style) - - # Continue walking through line - self.pt = self.end - self.end = self.pt + 1 - - # Join line segments - return ''.join(line) - - def write_body(self, the_bbcode): - the_bbcode.write(POST_START % {"bg_color": self.bground}) - - # Convert view to HTML - if self.multi_select: - count = 0 - total = len(self.sels) - for sel in self.sels: - self.setup_print_block(sel, multi=True) - self.convert_view_to_bbcode(the_bbcode) - count += 1 - - if count < total: - the_bbcode.write("\n" + (BBCODE_CODE % {"color": self.fground, "content": "..."}) + "\n\n") - - else: - self.setup_print_block(self.view.sel()[0]) - self.convert_view_to_bbcode(the_bbcode) - - the_bbcode.write(POST_END) - - def run(self, **kwargs): - inputs = self.process_inputs(**kwargs) - self.setup(**inputs) - - delete = False if inputs["view_open"] else True - - with tempfile.NamedTemporaryFile(delete=delete, suffix='.txt') as the_bbcode: - self.write_body(the_bbcode) - if inputs["clipboard_copy"]: - the_bbcode.seek(0) - sublime.set_clipboard(the_bbcode.read()) - sublime.status_message("Export to BBCode: copied to clipboard") - - if inputs["view_open"]: - self.view.window().open_file(the_bbcode.name) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtml.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtml.py deleted file mode 100644 index bb46af1..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtml.py +++ /dev/null @@ -1,914 +0,0 @@ -import sublime -import sublime_plugin -from os import path -import tempfile -import sys -import time -import webbrowser -import re -from HtmlAnnotations import get_annotations -import ExportHtmlLib.desktop as desktop -import json - -PACKAGE_SETTINGS = "ExportHtml.sublime-settings" -JS_DIR = path.join(sublime.packages_path(), 'ExportHtml', "js") -CSS_DIR = path.join(sublime.packages_path(), 'ExportHtml', "css") - -if sublime.platform() == "linux": - # Try and load Linux Python2.6 lib. Default path is for Ubuntu. - linux_lib = sublime.load_settings(PACKAGE_SETTINGS).get("linux_python2.6_lib", "/usr/lib/python2.6/lib-dynload") - if not linux_lib in sys.path and path.exists(linux_lib): - sys.path.append(linux_lib) -from plistlib import readPlist -from ExportHtmlLib.rgba.rgba import RGBA - -FILTER_MATCH = re.compile(r'^(?:(brightness|saturation|hue|colorize)\((-?[\d]+|[\d]*\.[\d]+)\)|(sepia|grayscale|invert))$') - -# HTML Code -HTML_HEADER = \ -''' - - -%(title)s - - - - -%(js)s - -''' - -TOOL_GUTTER = '''''' - -TOOL_PLAIN_TEXT = '''''' - -TOOL_PRINT = '''''' - -TOOL_ANNOTATION = '''''' - -TOOL_DUMP_THEME = '''''' - -TOOL_WRAPPING = '''''' - -TOOLBAR = '''
%(options)s
''' - -ANNOTATE_OPEN = '''%(code)s''' - -ANNOTATE_CLOSE = '''''' - -BODY_START = '''
'''
-
-FILE_INFO = '''
%(date_time)s %(file)s\n\n
''' - -TABLE_START = '''''' - -LINE = ( - '' + - '' + - '' + - '' -) - -CODE = '''%(content)s''' -ANNOTATION_CODE = '''%(content)s''' - -TABLE_END = '''
' + - '%(line)s ' + - '' + - '
%(code)s\n
' + - '
''' - -ROW_START = '''''' - -ROW_END = '''''' - -DIVIDER = '''\n...\n\n''' - -ANNOTATION_TBL_START = ( - '''' - -ANNOTATION_ROW = ( - '' + - '' + - '%(link)s' + - '' + - '
%(comment)s
' + - '' -) - -ANNOTATION_FOOTER = ( - '' + - '' + - '' -) - -BODY_END = '''
%(toolbar)s\n%(js)s\n\n\n''' - -INCLUDE_THEME = \ -''' - -''' - -TOGGLE_LINE_OPTIONS = \ -''' - -''' - -AUTO_PRINT = \ -''' - -''' - -WRAP = \ -''' - -''' - -HTML_JS_WRAP = \ -''' - -''' - - -def getjs(file_name): - code = "" - try: - with open(path.join(JS_DIR, file_name), "r") as f: - code = f.read() - except: - pass - return code - - -def getcss(file_name, options): - code = "" - final_code = "" - last_pt = 0 - keys = '|'.join(options.keys()) - replace = re.compile("/\\* *%(" + keys + ")% * \\*/") - - try: - with open(path.join(CSS_DIR, file_name), "r") as f: - code = f.read() - for m in replace.finditer(code): - final_code += code[last_pt:m.start()] + options[m.group(1)] - last_pt = m.end() - final_code += code[last_pt:] - except: - pass - - return final_code - - -class ExportHtmlPanelCommand(sublime_plugin.WindowCommand): - def execute(self, value): - if value >= 0: - view = self.window.active_view() - if view != None: - ExportHtml(view).run(**self.args[value]) - - def run(self): - options = sublime.load_settings(PACKAGE_SETTINGS).get("html_panel", {}) - menu = [] - self.args = [] - for opt in options: - k, v = opt.items()[0] - menu.append(k) - self.args.append(v) - - if len(menu): - self.window.show_quick_panel( - menu, - self.execute - ) - - -class ExportHtmlCommand(sublime_plugin.WindowCommand): - def run(self, **kwargs): - view = self.window.active_view() - if view != None: - ExportHtml(view).run(**kwargs) - - -class ExportHtml(object): - def __init__(self, view): - self.view = view - - def process_inputs(self, **kwargs): - return { - "numbers": bool(kwargs.get("numbers", False)), - "highlight_selections": bool(kwargs.get("highlight_selections", False)), - "browser_print": bool(kwargs.get("browser_print", False)), - "color_scheme": kwargs.get("color_scheme", None), - "wrap": kwargs.get("wrap", None), - "multi_select": bool(kwargs.get("multi_select", False)), - "style_gutter": bool(kwargs.get("style_gutter", True)), - "no_header": bool(kwargs.get("no_header", False)), - "date_time_format": kwargs.get("date_time_format", "%m/%d/%y %I:%M:%S"), - "show_full_path": bool(kwargs.get("show_full_path", True)), - "toolbar": kwargs.get("toolbar", ["plain_text", "gutter", "wrapping", "print", "annotation", "theme"]), - "save_location": kwargs.get("save_location", None), - "time_stamp": kwargs.get("time_stamp", "_%m%d%y%H%M%S"), - "clipboard_copy": bool(kwargs.get("clipboard_copy", False)), - "view_open": bool(kwargs.get("view_open", False)), - "shift_brightness": bool(kwargs.get("shift_brightness", False)), - "filter": kwargs.get("filter", "") - } - - def setup(self, **kwargs): - path_packages = sublime.packages_path() - - # Get get general document preferences from sublime preferences - eh_settings = sublime.load_settings(PACKAGE_SETTINGS) - settings = sublime.load_settings('Preferences.sublime-settings') - alternate_font_size = eh_settings.get("alternate_font_size", False) - alternate_font_face = eh_settings.get("alternate_font_face", False) - self.font_size = settings.get('font_size', 10) if alternate_font_size == False else alternate_font_size - self.font_face = settings.get('font_face', 'Consolas') if alternate_font_face == False else alternate_font_face - self.tab_size = settings.get('tab_size', 4) - self.padd_top = settings.get('line_padding_top', 0) - self.padd_bottom = settings.get('line_padding_bottom', 0) - self.char_limit = int(eh_settings.get("valid_selection_size", 4)) - self.bground = '' - self.fground = '' - self.gbground = '' - self.gfground = '' - self.sbground = '' - self.sfground = '' - self.numbers = kwargs["numbers"] - self.date_time_format = kwargs["date_time_format"] - self.time = time.localtime() - self.show_full_path = kwargs["show_full_path"] - self.highlight_selections = kwargs["highlight_selections"] - self.browser_print = kwargs["browser_print"] - self.auto_wrap = kwargs["wrap"] != None and int(kwargs["wrap"]) > 0 - self.wrap = 900 if not self.auto_wrap else int(kwargs["wrap"]) - self.hl_continue = None - self.curr_hl = None - self.sels = [] - self.multi_select = self.check_sel() if kwargs["multi_select"] and not kwargs["highlight_selections"] else False - self.size = self.view.size() - self.pt = 0 - self.end = 0 - self.curr_row = 0 - self.tables = 0 - self.curr_annot = None - self.curr_comment = None - self.annotations = self.get_annotations() - self.annot_num = -1 - self.new_annot = False - self.open_annot = False - self.no_header = kwargs["no_header"] - self.annot_tbl = [] - self.toolbar = kwargs["toolbar"] - self.toolbar_orientation = "block" if eh_settings.get("toolbar_orientation", "horizontal") == "vertical" else "inline-block" - self.matched = {} - self.ebground = self.bground - self.dark_lumens = None - self.lumens_limit = float(eh_settings.get("bg_min_lumen_threshold", 62)) - self.filter = [] - for f in kwargs["filter"].split(";"): - m = FILTER_MATCH.match(f) - if m: - if m.group(1): - self.filter.append((m.group(1), float(m.group(2)))) - else: - self.filter.append((m.group(3), 0.0)) - - fname = self.view.file_name() - if fname == None or not path.exists(fname): - fname = "Untitled" - self.file_name = fname - - # Get color scheme - if kwargs["color_scheme"] != None: - alt_scheme = kwargs["color_scheme"] - else: - alt_scheme = eh_settings.get("alternate_scheme", False) - scheme_file = settings.get('color_scheme') if alt_scheme == False else alt_scheme - colour_scheme = path.normpath(scheme_file) - self.scheme_file = path.basename(colour_scheme) - self.plist_file = self.apply_filters(readPlist(path_packages + colour_scheme.replace('Packages', ''))) - colour_settings = self.plist_file["settings"][0]["settings"] - - # Get general theme colors from color scheme file - self.bground = self.strip_transparency(colour_settings.get("background", '#FFFFFF'), True, True) - self.fground = self.strip_transparency(colour_settings.get("foreground", '#000000')) - self.sbground = self.strip_transparency(colour_settings.get("selection", self.fground), True) - self.sfground = self.strip_transparency(colour_settings.get("selectionForeground", None)) - self.gbground = self.strip_transparency(colour_settings.get("gutter", self.bground)) if kwargs["style_gutter"] else self.bground - self.gfground = self.strip_transparency(colour_settings.get("gutterForeground", self.fground), True) if kwargs["style_gutter"] else self.fground - - self.highlights = [] - if self.highlight_selections: - for sel in self.view.sel(): - if not sel.empty(): - self.highlights.append(sel) - - # Create scope colors mapping from color scheme file - self.colours = {self.view.scope_name(self.end).split(' ')[0]: {"color": self.fground, "bgcolor": None, "style": None}} - for item in self.plist_file["settings"]: - scope = item.get('scope', None) - colour = None - style = [] - if 'scope' in item: - scope = item['scope'] - if 'settings' in item: - colour = item['settings'].get('foreground', None) - bgcolour = item['settings'].get('background', None) - if 'fontStyle' in item['settings']: - for s in item['settings']['fontStyle'].split(' '): - if s == "bold" or s == "italic": # or s == "underline": - style.append(s) - - if scope != None and (colour != None or bgcolour != None): - self.colours[scope] = { - "color": self.strip_transparency(colour), - "bgcolor": self.strip_transparency(bgcolour, True), - "style": style - } - - self.shift_brightness = kwargs["shift_brightness"] and self.dark_lumens is not None and self.dark_lumens < self.lumens_limit - if self.shift_brightness: - self.color_adjust() - - def apply_filters(self, tmtheme): - def filter_color(color): - rgba = RGBA(color) - for f in self.filter: - name = f[0] - value = f[1] - if name == "grayscale": - rgba.grayscale() - elif name == "sepia": - rgba.sepia() - elif name == "saturation": - rgba.saturation(value) - elif name == "invert": - rgba.invert() - elif name == "brightness": - rgba.brightness(value) - elif name == "hue": - rgba.hue(value) - elif name == "colorize": - rgba.colorize(value) - return rgba.get_rgba() - - if len(self.filter): - general_settings_read = False - for settings in tmtheme["settings"]: - if not general_settings_read: - for k, v in settings["settings"].items(): - try: - settings["settings"][k] = filter_color(v) - except: - pass - general_settings_read = True - continue - - try: - settings["settings"]["foreground"] = filter_color(settings["settings"]["foreground"]) - except: - pass - try: - settings["settings"]["background"] = filter_color(settings["settings"]["background"]) - except: - pass - return tmtheme - - def color_adjust(self): - factor = 1 + ((self.lumens_limit - self.dark_lumens) / 255.0) if self.shift_brightness else None - for k, v in self.colours.items(): - fg, bg = v["color"], v["bgcolor"] - if v["color"] is not None: - self.colours[k]["color"] = self.apply_color_change(v["color"], factor) - if v["bgcolor"] is not None: - self.colours[k]["bgcolor"] = self.apply_color_change(v["bgcolor"], factor) - self.bground = self.apply_color_change(self.bground, factor) - self.fground = self.apply_color_change(self.fground, factor) - self.sbground = self.apply_color_change(self.sbground, factor) - if self.sfground is not None: - self.sfground = self.apply_color_change(self.sfground, factor) - self.gbground = self.apply_color_change(self.gbground, factor) - self.gfground = self.apply_color_change(self.gfground, factor) - - def apply_color_change(self, color, shift_factor): - rgba = RGBA(color) - if shift_factor is not None: - rgba.brightness(shift_factor) - return rgba.get_rgb() - - def get_tools(self, tools, use_annotation, use_wrapping): - toolbar_options = { - "gutter": TOOL_GUTTER, - "print": TOOL_PRINT, - "plain_text": TOOL_PLAIN_TEXT, - "annotation": TOOL_ANNOTATION if use_annotation else "", - "theme": TOOL_DUMP_THEME, - "wrapping": TOOL_WRAPPING if use_wrapping else "" - } - t_opt = "" - toolbar_element = "" - - if len(tools): - for t in tools: - if t in toolbar_options: - t_opt += toolbar_options[t] - toolbar_element = TOOLBAR % {"options": t_opt} - return toolbar_element - - def strip_transparency(self, color, track_darkness=False, simple_strip=False): - if color is None: - return color - rgba = RGBA(color.replace(" ", "")) - if not simple_strip: - rgba.apply_alpha(self.bground if self.bground != "" else "#FFFFFF") - if track_darkness: - lumens = rgba.luminance() - if self.dark_lumens is None or lumens < self.dark_lumens: - self.dark_lumens = lumens - return rgba.get_rgb() - - def setup_print_block(self, curr_sel, multi=False): - # Determine start and end points and whether to parse whole file or selection - if not multi and (curr_sel.empty() or self.highlight_selections or curr_sel.size() <= self.char_limit): - self.size = self.view.size() - self.pt = 0 - self.end = 1 - self.curr_row = 1 - else: - self.size = curr_sel.end() - self.pt = curr_sel.begin() - self.end = self.pt + 1 - self.curr_row = self.view.rowcol(self.pt)[0] + 1 - self.start_line = self.curr_row - - self.gutter_pad = len(str(self.view.rowcol(self.size)[0])) + 1 - - def check_sel(self): - multi = False - for sel in self.view.sel(): - if not sel.empty() and sel.size() >= self.char_limit: - multi = True - self.sels.append(sel) - return multi - - def print_line(self, line, num): - html_line = LINE % { - "line_id": num, - "color": self.gfground, - "bgcolor": self.gbground, - "line": str(num).rjust(self.gutter_pad).replace(" ", ' '), - "code_id": num, - "code": line, - "table": self.tables, - "pad_color": self.ebground or self.bground - } - - return html_line - - def guess_colour(self, pt, the_key): - the_colour = self.fground - the_bgcolour = None - the_style = set([]) - if the_key in self.matched: - the_colour = self.matched[the_key]["color"] - the_style = self.matched[the_key]["style"] - the_bgcolour = self.matched[the_key]["bgcolor"] - else: - best_match_bg = 0 - best_match_fg = 0 - best_match_style = 0 - for key in self.colours: - match = self.view.score_selector(pt, key) - if self.colours[key]["color"] is not None and match > best_match_fg: - best_match_fg = match - the_colour = self.colours[key]["color"] - if self.colours[key]["style"] is not None and match > best_match_style: - best_match_style = match - for s in self.colours[key]["style"]: - the_style.add(s) - if self.colours[key]["bgcolor"] is not None and match > best_match_bg: - best_match_bg = match - the_bgcolour = self.colours[key]["bgcolor"] - self.matched[the_key] = {"color": the_colour, "bgcolor": the_bgcolour, "style": the_style} - if len(the_style) == 0: - the_style = "normal" - else: - the_style = ' '.join(the_style) - return the_colour, the_style, the_bgcolour - - def write_header(self, the_html): - header = HTML_HEADER % { - "title": path.basename(self.file_name), - "css": getcss( - 'export.css', - { - "font_size": str(self.font_size), - "font_face": '"' + self.font_face + '"', - "page_bg": self.bground, - "gutter_bg": self.gbground, - "body_fg": self.fground, - "display_mode": 'table-cell' if self.numbers else 'none', - "dot_color": self.fground, - "toolbar_orientation": self.toolbar_orientation - } - ), - "js": INCLUDE_THEME % { - "jscode": getjs('plist.js'), - "theme": json.dumps(self.plist_file, sort_keys=True, indent=4, separators=(',', ': ')).encode('raw_unicode_escape'), - "name": self.scheme_file, - } - } - the_html.write(header) - - def convert_view_to_html(self, the_html): - for line in self.view.split_by_newlines(sublime.Region(self.pt, self.size)): - self.size = line.end() - empty = not bool(line.size()) - line = self.convert_line_to_html(the_html, empty) - the_html.write(self.print_line(line, self.curr_row)) - self.curr_row += 1 - - def html_encode(self, text): - # Format text to HTML - encode_table = { - '&': '&', - '>': '>', - '<': '<', - '\t': ' ' * self.tab_size, - '\n': '' - } - - return re.sub( - r'(?!\s($|\S))\s', - ' ', - ''.join( - encode_table.get(c, c) for c in text - ).encode('ascii', 'xmlcharrefreplace') - ) - - def get_annotations(self): - annotations = get_annotations(self.view) - comments = [] - for x in range(0, int(annotations["count"])): - region = annotations["annotations"]["html_annotation_%d" % x]["region"] - comments.append((region, annotations["annotations"]["html_annotation_%d" % x]["comment"])) - comments.sort() - return comments - - def annotate_text(self, line, the_colour, the_bgcolour, the_style, empty): - pre_text = None - annot_text = None - post_text = None - start = None - - # Pretext Check - if self.pt >= self.curr_annot.begin(): - # Region starts with an annotation - start = self.pt - else: - # Region has text before annoation - pre_text = self.html_encode(self.view.substr(sublime.Region(self.pt, self.curr_annot.begin()))) - start = self.curr_annot.begin() - - if self.end == self.curr_annot.end(): - # Region ends annotation - annot_text = self.html_encode(self.view.substr(sublime.Region(start, self.end))) - self.curr_annot = None - elif self.end > self.curr_annot.end(): - # Region has text following annotation - annot_text = self.html_encode(self.view.substr(sublime.Region(start, self.curr_annot.end()))) - post_text = self.html_encode(self.view.substr(sublime.Region(self.curr_annot.end(), self.end))) - self.curr_annot = None - else: - # Region ends but annotation is not finished - annot_text = self.html_encode(self.view.substr(sublime.Region(start, self.end))) - self.curr_annot = sublime.Region(self.end, self.curr_annot.end()) - - # Print the separate parts pre text, annotation, post text - if pre_text != None: - self.format_text(line, pre_text, the_colour, the_bgcolour, the_style, empty) - if annot_text != None: - self.format_text(line, annot_text, the_colour, the_bgcolour, the_style, empty, annotate=True) - if self.curr_annot == None: - self.curr_comment = None - if post_text != None: - self.format_text(line, post_text, the_colour, the_bgcolour, the_style, empty) - - def add_annotation_table_entry(self): - row, col = self.view.rowcol(self.annot_pt) - self.annot_tbl.append( - ( - self.tables, self.curr_row, "Line %d Col %d" % (row + 1, col + 1), - self.curr_comment.encode('ascii', 'xmlcharrefreplace') - ) - ) - self.annot_pt = None - - def format_text(self, line, text, the_colour, the_bgcolour, the_style, empty, annotate=False): - if empty: - text = ' ' - else: - the_style += " real_text" - - if the_bgcolour is None: - the_bgcolour = self.bground - - if annotate: - code = ANNOTATION_CODE % {"highlight": the_bgcolour, "color": the_colour, "content": text, "class": the_style} - else: - code = CODE % {"highlight": the_bgcolour, "color": the_colour, "content": text, "class": the_style} - - if annotate: - if self.curr_annot != None and not self.open_annot: - # Open an annotation - if self.annot_pt != None: - self.add_annotation_table_entry() - if self.new_annot: - self.annot_num += 1 - self.new_annot = False - code = ANNOTATE_OPEN % {"code": code, "comment": str(self.annot_num)} - self.open_annot = True - elif self.curr_annot == None: - if self.open_annot: - # Close an annotation - code += ANNOTATE_CLOSE - self.open_annot = False - else: - # Do a complete annotation - if self.annot_pt != None: - self.add_annotation_table_entry() - if self.new_annot: - self.annot_num += 1 - self.new_annot = False - code = ( - ANNOTATE_OPEN % {"code": code, "comment": str(self.annot_num)} + - ANNOTATE_CLOSE - ) - line.append(code) - - def convert_line_to_html(self, the_html, empty): - line = [] - hl_done = False - - # Continue highlight form last line - if self.hl_continue != None: - self.curr_hl = self.hl_continue - self.hl_continue = None - - while self.end <= self.size: - # Get next highlight region - if self.highlight_selections and self.curr_hl == None and len(self.highlights) > 0: - self.curr_hl = self.highlights.pop(0) - - # See if we are starting a highlight region - if self.curr_hl != None and self.pt == self.curr_hl.begin(): - # Get text of like scope up to a highlight - scope_name = self.view.scope_name(self.pt) - while self.view.scope_name(self.end) == scope_name and self.end < self.size: - # Kick out if we hit a highlight region - if self.end == self.curr_hl.end(): - break - self.end += 1 - if self.end < self.curr_hl.end(): - if self.end >= self.size: - self.hl_continue = sublime.Region(self.end, self.curr_hl.end()) - else: - self.curr_hl = sublime.Region(self.end, self.curr_hl.end()) - else: - hl_done = True - if hl_done and empty: - the_colour, the_style, the_bgcolour = self.guess_colour(self.pt, scope_name) - elif self.sfground is None: - the_colour, the_style, _ = self.guess_colour(self.pt, scope_name) - the_bgcolour = self.sbground - else: - the_colour, the_style = self.sfground, "normal" - the_bgcolour = self.sbground - else: - # Get text of like scope up to a highlight - scope_name = self.view.scope_name(self.pt) - while self.view.scope_name(self.end) == scope_name and self.end < self.size: - # Kick out if we hit a highlight region - if self.curr_hl != None and self.end == self.curr_hl.begin(): - break - self.end += 1 - the_colour, the_style, the_bgcolour = self.guess_colour(self.pt, scope_name) - - # Get new annotation - if (self.curr_annot == None or self.curr_annot.end() < self.pt) and len(self.annotations): - self.curr_annot, self.curr_comment = self.annotations.pop(0) - self.annot_pt = self.curr_annot[0] - while self.pt > self.curr_annot[1]: - if len(self.annotations): - self.curr_annot, self.curr_comment = self.annotations.pop(0) - self.annot_pt = self.curr_annot[0] - else: - self.curr_annot = None - self.curr_comment = None - break - self.new_annot = True - self.curr_annot = sublime.Region(self.curr_annot[0], self.curr_annot[1]) - - region = sublime.Region(self.pt, self.end) - if self.curr_annot != None and region.intersects(self.curr_annot): - # Apply annotation within the text and format the text - self.annotate_text(line, the_colour, the_bgcolour, the_style, empty) - else: - # Normal text formatting - tidied_text = self.html_encode(self.view.substr(region)) - self.format_text(line, tidied_text, the_colour, the_bgcolour, the_style, empty) - - if hl_done: - # Clear highlight flags and variables - hl_done = False - self.curr_hl = None - - # Continue walking through line - self.pt = self.end - self.end = self.pt + 1 - - # Close annotation if open at end of line - if self.open_annot: - line.append(ANNOTATE_CLOSE % {"comment": self.curr_comment}) - self.open_annot = False - - # Get the color for the space at the end of a line - if self.end < self.view.size(): - end_key = self.view.scope_name(self.pt) - _, _, self.ebground = self.guess_colour(self.pt, end_key) - - # Join line segments - return ''.join(line) - - def write_body(self, the_html): - processed_rows = "" - the_html.write(BODY_START) - - the_html.write(TABLE_START) - if not self.no_header: - # Write file name - date_time = time.strftime(self.date_time_format, self.time) - the_html.write( - FILE_INFO % { - "bgcolor": self.bground, - "color": self.fground, - "date_time": date_time, - "file": self.file_name if self.show_full_path else path.basename(self.file_name) - } - ) - - the_html.write(ROW_START) - the_html.write(TABLE_START) - # Convert view to HTML - if self.multi_select: - count = 0 - total = len(self.sels) - for sel in self.sels: - self.setup_print_block(sel, multi=True) - processed_rows += "[" + str(self.curr_row) + "," - self.convert_view_to_html(the_html) - count += 1 - self.tables = count - processed_rows += str(self.curr_row) + "]," - - if count < total: - the_html.write(TABLE_END) - the_html.write(ROW_END) - the_html.write(ROW_START) - the_html.write(DIVIDER % {"color": self.fground}) - the_html.write(ROW_END) - the_html.write(ROW_START) - the_html.write(TABLE_START) - else: - self.setup_print_block(self.view.sel()[0]) - processed_rows += "[" + str(self.curr_row) + "," - self.convert_view_to_html(the_html) - processed_rows += str(self.curr_row) + "]," - self.tables += 1 - - the_html.write(TABLE_END) - the_html.write(ROW_END) - the_html.write(TABLE_END) - - js_options = [] - if len(self.annot_tbl): - self.add_comments_table(the_html) - js_options.append(HTML_JS_WRAP % {"jscode": getjs('annotation.js')}) - - # Write javascript snippets - js_options.append(HTML_JS_WRAP % {"jscode": getjs('print.js')}) - js_options.append(HTML_JS_WRAP % {"jscode": getjs('plaintext.js')}) - js_options.append(TOGGLE_LINE_OPTIONS % { - "jscode": getjs('lines.js'), - "wrap_size": self.wrap, - "ranges": processed_rows.rstrip(','), - "tables": self.tables, - "header": ("false" if self.no_header else "true"), - "gutter": ('true' if self.numbers else 'false') - } - ) - if self.auto_wrap: - js_options.append(WRAP) - - if self.browser_print: - js_options.append(AUTO_PRINT) - - # Write empty line to allow copying of last line and line number without issue - the_html.write(BODY_END % {"js": ''.join(js_options), "toolbar": self.get_tools(self.toolbar, len(self.annot_tbl), self.auto_wrap)}) - - def add_comments_table(self, the_html): - the_html.write(ANNOTATION_TBL_START) - the_html.write(''.join([ANNOTATION_ROW % {"table": t, "row": r, "link": l, "comment": c} for t, r, l, c in self.annot_tbl])) - the_html.write(ANNOTATION_FOOTER) - the_html.write(ANNOTATION_TBL_END) - - def run(self, **kwargs): - inputs = self.process_inputs(**kwargs) - self.setup(**inputs) - - save_location = inputs["save_location"] - time_stamp = inputs["time_stamp"] - - if save_location is not None: - fname = self.view.file_name() - if ( - ((fname == None or not path.exists(fname)) and save_location == ".") or - not path.exists(save_location) - or not path.isdir(save_location) - ): - html_file = ".html" - save_location = None - elif save_location == ".": - html_file = "%s%s.html" % (fname, time.strftime(time_stamp, self.time)) - elif fname is None or not path.exists(fname): - html_file = path.join(save_location, "Untitled%s.html" % time.strftime(time_stamp, self.time)) - else: - html_file = path.join(save_location, "%s%s.html" % (path.basename(fname), time.strftime(time_stamp, self.time))) - else: - html_file = ".html" - - if save_location is not None: - open_html = lambda x: open(x, "w") - else: - open_html = lambda x: tempfile.NamedTemporaryFile(delete=False, suffix=x) - - with open_html(html_file) as the_html: - self.write_header(the_html) - self.write_body(the_html) - if inputs["clipboard_copy"]: - the_html.seek(0) - sublime.set_clipboard(the_html.read()) - sublime.status_message("Export to HTML: copied to clipboard") - - if inputs["view_open"]: - self.view.window().open_file(the_html.name) - else: - # Open in web browser; check return code, if failed try webbrowser - status = desktop.open(the_html.name, status=True) - if not status: - webbrowser.open(the_html.name, new=2) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtml.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtml.sublime-settings deleted file mode 100644 index 81ce6ae..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtml.sublime-settings +++ /dev/null @@ -1,180 +0,0 @@ -{ - // By default, the current color scheme is used - // You can define a string path to an alternate default - // Color scheme here, it must be relative to the - // Example: - // "alternate_scheme": "Packages/ExportHtml/themes/Print-Color.tmTheme" - "alternate_scheme": false, - - // By default, ExportHtml uses your current font_face and font_size. - // You can change this setting to always use this value. By default, - // the setting is a literal false, but you can change it to an actual - // font_face to enable this setting. - "alternate_font_face": false, - - // By default, ExportHtml uses your current font_face and font_size. - // You can change this setting to always use this value. By default, - // the setting is a literal false, but you can change it to an actual - // font_size to enable this setting. - "alternate_font_size": false, - - //Path to linux Python 2.6 lib - "linux_python2.6_lib": "/usr/lib/python2.6/lib-dynload", - - // Minimum allowable size for a selection to be accepted for only the selection to be exproted - // Multi-select will also ignore selections whose size is less than this. - "valid_selection_size": 4, - - // Scope to use for color for annotations in a Sublime Text view - "annotation_highlight_scope": "comment", - - // Style to use for for annotations in a Sublime Text view - // (outline|solid) - "annotation_highlight_style": "outline", - - // Orientation that the toolbar will be rendered with. - // (horizontal|vertical) - "toolbar_orientation": "horizontal", - - // Define configurations for the drop down export menu - "html_panel": [ - // Browser print color (selections and multi-selections allowed) - { - "Browser Print - Color": { - "numbers": true, - "wrap": 900, - "browser_print": true, - "multi_select": true, - "color_scheme": "Packages/ExportHtml/ColorSchemes/Print-Color.tmTheme", - "style_gutter": false - } - }, - - // Browser print black and white (selections and multi-selections allowed) - { - "Browser Print - Grayscale": { - "numbers": true, - "wrap": 900, - "browser_print": true, - "multi_select": true, - "color_scheme": "Packages/ExportHtml/ColorSchemes/Print-Grayscale.tmTheme", - "style_gutter": false - } - }, - - // Browser print color; highlight selections(selections and multi-selections allowed) - // Background colors are disabled in browser printing by default, so they will not - // print until background color printing is enabled - { - "Browser Print - Color (Selection Highlights)": { - "numbers": true, - "wrap": 900, - "browser_print": true, - "highlight_selections": true, - "color_scheme": "Packages/ExportHtml/ColorSchemes/Print-Color.tmTheme", - "style_gutter": false - } - }, - - // Browser print black and white; highlight selections(selections and multi-selections allowed) - // Background colors are disabled in browser printing by default, so they will not - // print until background color printing is enabled - { - "Browser Print - Grayscale (Selection Highlights)": { - "numbers": true, - "wrap": 900, - "browser_print": true, - "highlight_selections": true, - "color_scheme": "Packages/ExportHtml/ColorSchemes/Print-Grayscale.tmTheme", - "style_gutter": false - } - }, - // Browser view color (selections and multi-selections allowed) - { - "Browser View - Color": { - "numbers": true, - "multi_select": true, - "color_scheme": "Packages/ExportHtml/ColorSchemes/Print-Color.tmTheme" - } - }, - - // Browser view black and white (selections and multi-selections allowed) - { - "Browser View - Grayscale": { - "numbers": true, - "multi_select": true, - "color_scheme": "Packages/ExportHtml/ColorSchemes/Print-Grayscale.tmTheme" - } - }, - - // Browser view color; highlight selections(selections and multi-selections allowed) - { - "Browser View - Color (Selection Highlights)": { - "numbers": true, - "highlight_selections": true, - "color_scheme": "Packages/ExportHtml/ColorSchemes/Print-Color.tmTheme" - } - }, - - // Browser view black and white; highlight selections(selections and multi-selections allowed) - { - "Browser View - Grayscale (Selection Highlights)": { - "numbers": true, - "highlight_selections": true, - "color_scheme": "Packages/ExportHtml/ColorSchemes/Print-Grayscale.tmTheme" - } - }, - - // Sublime view grayscale HTML source; (selections and multi-selections allowed) - { - "Sublime View - Color": { - "view_open": true, - "numbers": true, - "wrap": 900, - "multi_select": true, - "color_scheme": "Packages/ExportHtml/ColorSchemes/Print-Color.tmTheme" - } - }, - - // Sublime view grayscale HTML source; (selections and multi-selections allowed) - { - "Sublime View - Grayscale": { - "view_open": true, - "numbers": true, - "wrap": 900, - "multi_select": true, - "color_scheme": "Packages/ExportHtml/ColorSchemes/Print-Grayscale.tmTheme" - } - } - ], - - "bbcode_panel": [ - { - "To Clipboard - Format as BBCode": { - "numbers": false, - "multi_select": true - } - }, - - { - "To Clipboard - Format as BBCode (show gutter)": { - "numbers": true, - "multi_select": true - } - }, - { - "Sublime View - Show BBCode in View": { - "numbers": false, - "multi_select": true, - "view_open": true - } - }, - { - "Sublime View - Show BBCode in View (show gutter)": { - "numbers": false, - "multi_select": true, - "view_open": true - } - } - ] -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtmlLib/__init__.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtmlLib/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtmlLib/desktop/__init__.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtmlLib/desktop/__init__.py deleted file mode 100644 index 9be2bbc..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtmlLib/desktop/__init__.py +++ /dev/null @@ -1,285 +0,0 @@ -#!/usr/bin/env python - -""" -Simple desktop integration for Python. This module provides desktop environment -detection and resource opening support for a selection of common and -standardised desktop environments. - -Copyright (C) 2005, 2006, 2007, 2008, 2009 Paul Boddie - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 3 of the License, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more -details. - -You should have received a copy of the GNU Lesser General Public License along -with this program. If not, see . - --------- - -Desktop Detection ------------------ - -To detect a specific desktop environment, use the get_desktop function. -To detect whether the desktop environment is standardised (according to the -proposed DESKTOP_LAUNCH standard), use the is_standard function. - -Opening URLs ------------- - -To open a URL in the current desktop environment, relying on the automatic -detection of that environment, use the desktop.open function as follows: - -desktop.open("http://www.python.org") - -To override the detected desktop, specify the desktop parameter to the open -function as follows: - -desktop.open("http://www.python.org", "KDE") # Insists on KDE -desktop.open("http://www.python.org", "GNOME") # Insists on GNOME - -Without overriding using the desktop parameter, the open function will attempt -to use the "standard" desktop opening mechanism which is controlled by the -DESKTOP_LAUNCH environment variable as described below. - -The DESKTOP_LAUNCH Environment Variable ---------------------------------------- - -The DESKTOP_LAUNCH environment variable must be shell-quoted where appropriate, -as shown in some of the following examples: - -DESKTOP_LAUNCH="kdialog --msgbox" Should present any opened URLs in - their entirety in a KDE message box. - (Command "kdialog" plus parameter.) -DESKTOP_LAUNCH="my\ opener" Should run the "my opener" program to - open URLs. - (Command "my opener", no parameters.) -DESKTOP_LAUNCH="my\ opener --url" Should run the "my opener" program to - open URLs. - (Command "my opener" plus parameter.) - -Details of the DESKTOP_LAUNCH environment variable convention can be found here: -http://lists.freedesktop.org/archives/xdg/2004-August/004489.html - -Other Modules -------------- - -The desktop.dialog module provides support for opening dialogue boxes. -The desktop.windows module permits the inspection of desktop windows. -""" - -__version__ = "0.4" - -import os -import sys - -# Provide suitable process creation functions. - -try: - import subprocess - def _run(cmd, shell, wait): - opener = subprocess.Popen(cmd, shell=shell) - if wait: opener.wait() - return opener.pid - - def _readfrom(cmd, shell): - opener = subprocess.Popen(cmd, shell=shell, stdin=subprocess.PIPE, stdout=subprocess.PIPE) - opener.stdin.close() - return opener.stdout.read() - - def _status(cmd, shell): - opener = subprocess.Popen(cmd, shell=shell) - opener.wait() - return opener.returncode == 0 - -except ImportError: - import popen2 - def _run(cmd, shell, wait): - opener = popen2.Popen3(cmd) - if wait: opener.wait() - return opener.pid - - def _readfrom(cmd, shell): - opener = popen2.Popen3(cmd) - opener.tochild.close() - opener.childerr.close() - return opener.fromchild.read() - - def _status(cmd, shell): - opener = popen2.Popen3(cmd) - opener.wait() - return opener.poll() == 0 - -import commands - -# Private functions. - -def _get_x11_vars(): - - "Return suitable environment definitions for X11." - - if not os.environ.get("DISPLAY", "").strip(): - return "DISPLAY=:0.0 " - else: - return "" - -def _is_xfce(): - - "Return whether XFCE is in use." - - # XFCE detection involves testing the output of a program. - - try: - return _readfrom(_get_x11_vars() + "xprop -root _DT_SAVE_MODE", shell=1).strip().endswith(' = "xfce4"') - except OSError: - return 0 - -def _is_x11(): - - "Return whether the X Window System is in use." - - return os.environ.has_key("DISPLAY") - -# Introspection functions. - -def get_desktop(): - - """ - Detect the current desktop environment, returning the name of the - environment. If no environment could be detected, None is returned. - """ - - if os.environ.has_key("KDE_FULL_SESSION") or \ - os.environ.has_key("KDE_MULTIHEAD"): - return "KDE" - elif os.environ.has_key("GNOME_DESKTOP_SESSION_ID") or \ - os.environ.has_key("GNOME_KEYRING_SOCKET"): - return "GNOME" - elif sys.platform == "darwin": - return "Mac OS X" - elif hasattr(os, "startfile"): - return "Windows" - elif _is_xfce(): - return "XFCE" - - # KDE, GNOME and XFCE run on X11, so we have to test for X11 last. - - if _is_x11(): - return "X11" - else: - return None - -def use_desktop(desktop): - - """ - Decide which desktop should be used, based on the detected desktop and a - supplied 'desktop' argument (which may be None). Return an identifier - indicating the desktop type as being either "standard" or one of the results - from the 'get_desktop' function. - """ - - # Attempt to detect a desktop environment. - - detected = get_desktop() - - # Start with desktops whose existence can be easily tested. - - if (desktop is None or desktop == "standard") and is_standard(): - return "standard" - elif (desktop is None or desktop == "Windows") and detected == "Windows": - return "Windows" - - # Test for desktops where the overriding is not verified. - - elif (desktop or detected) == "KDE": - return "KDE" - elif (desktop or detected) == "GNOME": - return "GNOME" - elif (desktop or detected) == "XFCE": - return "XFCE" - elif (desktop or detected) == "Mac OS X": - return "Mac OS X" - elif (desktop or detected) == "X11": - return "X11" - else: - return None - -def is_standard(): - - """ - Return whether the current desktop supports standardised application - launching. - """ - - return os.environ.has_key("DESKTOP_LAUNCH") - -# Activity functions. - -def open(url, desktop=None, wait=0, status=False): - - """ - Open the 'url' in the current desktop's preferred file browser. If the - optional 'desktop' parameter is specified then attempt to use that - particular desktop environment's mechanisms to open the 'url' instead of - guessing or detecting which environment is being used. - - Suggested values for 'desktop' are "standard", "KDE", "GNOME", "XFCE", - "Mac OS X", "Windows" where "standard" employs a DESKTOP_LAUNCH environment - variable to open the specified 'url'. DESKTOP_LAUNCH should be a command, - possibly followed by arguments, and must have any special characters - shell-escaped. - - The process identifier of the "opener" (ie. viewer, editor, browser or - program) associated with the 'url' is returned by this function. If the - process identifier cannot be determined, None is returned. - - An optional 'wait' parameter is also available for advanced usage and, if - 'wait' is set to a true value, this function will wait for the launching - mechanism to complete before returning (as opposed to immediately returning - as is the default behaviour). - """ - - # Decide on the desktop environment in use. - - desktop_in_use = use_desktop(desktop) - - if desktop_in_use == "standard": - arg = "".join([os.environ["DESKTOP_LAUNCH"], commands.mkarg(url)]) - return _run(arg, 1, wait) - - elif desktop_in_use == "Windows": - # NOTE: This returns None in current implementations. - os.startfile(url) - return True if status else None - - elif desktop_in_use == "KDE": - cmd = ["kfmclient", "exec", url] - - elif desktop_in_use == "GNOME": - cmd = ["gnome-open", url] - - elif desktop_in_use == "XFCE": - cmd = ["exo-open", url] - - elif desktop_in_use == "Mac OS X": - cmd = ["open", url] - - elif desktop_in_use == "X11" and os.environ.has_key("BROWSER"): - cmd = [os.environ["BROWSER"], url] - - # Finish with an error where no suitable desktop was identified. - - else: - raise OSError, "Desktop '%s' not supported (neither DESKTOP_LAUNCH nor os.startfile could be used)" % desktop_in_use - - if status: - return _status(cmd, 0) - else: - return _run(cmd, 0, wait) - -# vim: tabstop=4 expandtab shiftwidth=4 diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtmlLib/desktop/dialog.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtmlLib/desktop/dialog.py deleted file mode 100644 index 9525004..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtmlLib/desktop/dialog.py +++ /dev/null @@ -1,549 +0,0 @@ -#!/usr/bin/env python - -""" -Simple desktop dialogue box support for Python. - -Copyright (C) 2007, 2009 Paul Boddie - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 3 of the License, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more -details. - -You should have received a copy of the GNU Lesser General Public License along -with this program. If not, see . - --------- - -Opening Dialogue Boxes (Dialogs) --------------------------------- - -To open a dialogue box (dialog) in the current desktop environment, relying on -the automatic detection of that environment, use the appropriate dialogue box -class: - -question = desktop.dialog.Question("Are you sure?") -result = question.open() - -To override the detected desktop, specify the desktop parameter to the open -function as follows: - -question.open("KDE") # Insists on KDE -question.open("GNOME") # Insists on GNOME - -The dialogue box options are documented in each class's docstring. - -Available dialogue box classes are listed in the desktop.dialog.available -attribute. - -Supported desktop environments are listed in the desktop.dialog.supported -attribute. -""" - -from desktop import use_desktop, _run, _readfrom, _status - -class _wrapper: - def __init__(self, handler): - self.handler = handler - -class _readvalue(_wrapper): - def __call__(self, cmd, shell): - return self.handler(cmd, shell).strip() - -class _readinput(_wrapper): - def __call__(self, cmd, shell): - return self.handler(cmd, shell)[:-1] - -class _readvalues_kdialog(_wrapper): - def __call__(self, cmd, shell): - result = self.handler(cmd, shell).strip().strip('"') - if result: - return result.split('" "') - else: - return [] - -class _readvalues_zenity(_wrapper): - def __call__(self, cmd, shell): - result = self.handler(cmd, shell).strip() - if result: - return result.split("|") - else: - return [] - -class _readvalues_Xdialog(_wrapper): - def __call__(self, cmd, shell): - result = self.handler(cmd, shell).strip() - if result: - return result.split("/") - else: - return [] - -# Dialogue parameter classes. - -class String: - - "A generic parameter." - - def __init__(self, name): - self.name = name - - def convert(self, value, program): - return [value or ""] - -class Strings(String): - - "Multiple string parameters." - - def convert(self, value, program): - return value or [] - -class StringPairs(String): - - "Multiple string parameters duplicated to make identifiers." - - def convert(self, value, program): - l = [] - for v in value: - l.append(v) - l.append(v) - return l - -class StringKeyword: - - "A keyword parameter." - - def __init__(self, keyword, name): - self.keyword = keyword - self.name = name - - def convert(self, value, program): - return [self.keyword + "=" + (value or "")] - -class StringKeywords: - - "Multiple keyword parameters." - - def __init__(self, keyword, name): - self.keyword = keyword - self.name = name - - def convert(self, value, program): - l = [] - for v in value or []: - l.append(self.keyword + "=" + v) - return l - -class Integer(String): - - "An integer parameter." - - defaults = { - "width" : 40, - "height" : 15, - "list_height" : 10 - } - scale = 8 - - def __init__(self, name, pixels=0): - String.__init__(self, name) - if pixels: - self.factor = self.scale - else: - self.factor = 1 - - def convert(self, value, program): - if value is None: - value = self.defaults[self.name] - return [str(int(value) * self.factor)] - -class IntegerKeyword(Integer): - - "An integer keyword parameter." - - def __init__(self, keyword, name, pixels=0): - Integer.__init__(self, name, pixels) - self.keyword = keyword - - def convert(self, value, program): - if value is None: - value = self.defaults[self.name] - return [self.keyword + "=" + str(int(value) * self.factor)] - -class Boolean(String): - - "A boolean parameter." - - values = { - "kdialog" : ["off", "on"], - "zenity" : ["FALSE", "TRUE"], - "Xdialog" : ["off", "on"] - } - - def convert(self, value, program): - values = self.values[program] - if value: - return [values[1]] - else: - return [values[0]] - -class MenuItemList(String): - - "A menu item list parameter." - - def convert(self, value, program): - l = [] - for v in value: - l.append(v.value) - l.append(v.text) - return l - -class ListItemList(String): - - "A radiolist/checklist item list parameter." - - def __init__(self, name, status_first=0): - String.__init__(self, name) - self.status_first = status_first - - def convert(self, value, program): - l = [] - for v in value: - boolean = Boolean(None) - status = boolean.convert(v.status, program) - if self.status_first: - l += status - l.append(v.value) - l.append(v.text) - if not self.status_first: - l += status - return l - -# Dialogue argument values. - -class MenuItem: - - "A menu item which can also be used with radiolists and checklists." - - def __init__(self, value, text, status=0): - self.value = value - self.text = text - self.status = status - -# Dialogue classes. - -class Dialogue: - - commands = { - "KDE" : "kdialog", - "GNOME" : "zenity", - "XFCE" : "zenity", # NOTE: Based on observations with Xubuntu. - "X11" : "Xdialog" - } - - def open(self, desktop=None): - - """ - Open a dialogue box (dialog) using a program appropriate to the desktop - environment in use. - - If the optional 'desktop' parameter is specified then attempt to use - that particular desktop environment's mechanisms to open the dialog - instead of guessing or detecting which environment is being used. - - Suggested values for 'desktop' are "standard", "KDE", "GNOME", - "Mac OS X", "Windows". - - The result of the dialogue interaction may be a string indicating user - input (for Input, Password, Menu, Pulldown), a list of strings - indicating selections of one or more items (for RadioList, CheckList), - or a value indicating true or false (for Question, Warning, Message, - Error). - - Where a string value may be expected but no choice is made, an empty - string may be returned. Similarly, where a list of values is expected - but no choice is made, an empty list may be returned. - """ - - # Decide on the desktop environment in use. - - desktop_in_use = use_desktop(desktop) - - # Get the program. - - try: - program = self.commands[desktop_in_use] - except KeyError: - raise OSError, "Desktop '%s' not supported (no known dialogue box command could be suggested)" % desktop_in_use - - # The handler is one of the functions communicating with the subprocess. - # Some handlers return boolean values, others strings. - - handler, options = self.info[program] - - cmd = [program] - for option in options: - if isinstance(option, str): - cmd.append(option) - else: - value = getattr(self, option.name, None) - cmd += option.convert(value, program) - - return handler(cmd, 0) - -class Simple(Dialogue): - def __init__(self, text, width=None, height=None): - self.text = text - self.width = width - self.height = height - -class Question(Simple): - - """ - A dialogue asking a question and showing response buttons. - Options: text, width (in characters), height (in characters) - Response: a boolean value indicating an affirmative response (true) or a - negative response - """ - - name = "question" - info = { - "kdialog" : (_status, ["--yesno", String("text")]), - "zenity" : (_status, ["--question", StringKeyword("--text", "text")]), - "Xdialog" : (_status, ["--stdout", "--yesno", String("text"), Integer("height"), Integer("width")]), - } - -class Warning(Simple): - - """ - A dialogue asking a question and showing response buttons. - Options: text, width (in characters), height (in characters) - Response: a boolean value indicating an affirmative response (true) or a - negative response - """ - - name = "warning" - info = { - "kdialog" : (_status, ["--warningyesno", String("text")]), - "zenity" : (_status, ["--warning", StringKeyword("--text", "text")]), - "Xdialog" : (_status, ["--stdout", "--yesno", String("text"), Integer("height"), Integer("width")]), - } - -class Message(Simple): - - """ - A message dialogue. - Options: text, width (in characters), height (in characters) - Response: a boolean value indicating an affirmative response (true) or a - negative response - """ - - name = "message" - info = { - "kdialog" : (_status, ["--msgbox", String("text")]), - "zenity" : (_status, ["--info", StringKeyword("--text", "text")]), - "Xdialog" : (_status, ["--stdout", "--msgbox", String("text"), Integer("height"), Integer("width")]), - } - -class Error(Simple): - - """ - An error dialogue. - Options: text, width (in characters), height (in characters) - Response: a boolean value indicating an affirmative response (true) or a - negative response - """ - - name = "error" - info = { - "kdialog" : (_status, ["--error", String("text")]), - "zenity" : (_status, ["--error", StringKeyword("--text", "text")]), - "Xdialog" : (_status, ["--stdout", "--msgbox", String("text"), Integer("height"), Integer("width")]), - } - -class Menu(Simple): - - """ - A menu of options, one of which being selectable. - Options: text, width (in characters), height (in characters), - list_height (in items), items (MenuItem objects) - Response: a value corresponding to the chosen item - """ - - name = "menu" - info = { - "kdialog" : (_readvalue(_readfrom), ["--menu", String("text"), MenuItemList("items")]), - "zenity" : (_readvalue(_readfrom), ["--list", StringKeyword("--text", "text"), StringKeywords("--column", "titles"), - MenuItemList("items")] - ), - "Xdialog" : (_readvalue(_readfrom), ["--stdout", "--menubox", - String("text"), Integer("height"), Integer("width"), Integer("list_height"), MenuItemList("items")] - ), - } - item = MenuItem - number_of_titles = 2 - - def __init__(self, text, titles, items=None, width=None, height=None, list_height=None): - - """ - Initialise a menu with the given heading 'text', column 'titles', and - optional 'items' (which may be added later), 'width' (in characters), - 'height' (in characters) and 'list_height' (in items). - """ - - Simple.__init__(self, text, width, height) - self.titles = ([""] * self.number_of_titles + titles)[-self.number_of_titles:] - self.items = items or [] - self.list_height = list_height - - def add(self, *args, **kw): - - """ - Add an item, passing the given arguments to the appropriate item class. - """ - - self.items.append(self.item(*args, **kw)) - -class RadioList(Menu): - - """ - A list of radio buttons, one of which being selectable. - Options: text, width (in characters), height (in characters), - list_height (in items), items (MenuItem objects), titles - Response: a list of values corresponding to chosen items (since some - programs, eg. zenity, appear to support multiple default - selections) - """ - - name = "radiolist" - info = { - "kdialog" : (_readvalues_kdialog(_readfrom), ["--radiolist", String("text"), ListItemList("items")]), - "zenity" : (_readvalues_zenity(_readfrom), - ["--list", "--radiolist", StringKeyword("--text", "text"), StringKeywords("--column", "titles"), - ListItemList("items", 1)] - ), - "Xdialog" : (_readvalues_Xdialog(_readfrom), ["--stdout", "--radiolist", - String("text"), Integer("height"), Integer("width"), Integer("list_height"), ListItemList("items")] - ), - } - number_of_titles = 3 - -class CheckList(Menu): - - """ - A list of checkboxes, many being selectable. - Options: text, width (in characters), height (in characters), - list_height (in items), items (MenuItem objects), titles - Response: a list of values corresponding to chosen items - """ - - name = "checklist" - info = { - "kdialog" : (_readvalues_kdialog(_readfrom), ["--checklist", String("text"), ListItemList("items")]), - "zenity" : (_readvalues_zenity(_readfrom), - ["--list", "--checklist", StringKeyword("--text", "text"), StringKeywords("--column", "titles"), - ListItemList("items", 1)] - ), - "Xdialog" : (_readvalues_Xdialog(_readfrom), ["--stdout", "--checklist", - String("text"), Integer("height"), Integer("width"), Integer("list_height"), ListItemList("items")] - ), - } - number_of_titles = 3 - -class Pulldown(Menu): - - """ - A pull-down menu of options, one of which being selectable. - Options: text, width (in characters), height (in characters), - items (list of values) - Response: a value corresponding to the chosen item - """ - - name = "pulldown" - info = { - "kdialog" : (_readvalue(_readfrom), ["--combobox", String("text"), Strings("items")]), - "zenity" : (_readvalue(_readfrom), - ["--list", "--radiolist", StringKeyword("--text", "text"), StringKeywords("--column", "titles"), - StringPairs("items")] - ), - "Xdialog" : (_readvalue(_readfrom), - ["--stdout", "--combobox", String("text"), Integer("height"), Integer("width"), Strings("items")]), - } - item = unicode - number_of_titles = 2 - -class Input(Simple): - - """ - An input dialogue, consisting of an input field. - Options: text, input, width (in characters), height (in characters) - Response: the text entered into the dialogue by the user - """ - - name = "input" - info = { - "kdialog" : (_readinput(_readfrom), - ["--inputbox", String("text"), String("data")]), - "zenity" : (_readinput(_readfrom), - ["--entry", StringKeyword("--text", "text"), StringKeyword("--entry-text", "data")]), - "Xdialog" : (_readinput(_readfrom), - ["--stdout", "--inputbox", String("text"), Integer("height"), Integer("width"), String("data")]), - } - - def __init__(self, text, data="", width=None, height=None): - Simple.__init__(self, text, width, height) - self.data = data - -class Password(Input): - - """ - A password dialogue, consisting of a password entry field. - Options: text, width (in characters), height (in characters) - Response: the text entered into the dialogue by the user - """ - - name = "password" - info = { - "kdialog" : (_readinput(_readfrom), - ["--password", String("text")]), - "zenity" : (_readinput(_readfrom), - ["--entry", StringKeyword("--text", "text"), "--hide-text"]), - "Xdialog" : (_readinput(_readfrom), - ["--stdout", "--password", "--inputbox", String("text"), Integer("height"), Integer("width")]), - } - -class TextFile(Simple): - - """ - A text file input box. - Options: filename, text, width (in characters), height (in characters) - Response: any text returned by the dialogue program (typically an empty - string) - """ - - name = "textfile" - info = { - "kdialog" : (_readfrom, ["--textbox", String("filename"), Integer("width", pixels=1), Integer("height", pixels=1)]), - "zenity" : (_readfrom, ["--text-info", StringKeyword("--filename", "filename"), IntegerKeyword("--width", "width", pixels=1), - IntegerKeyword("--height", "height", pixels=1)] - ), - "Xdialog" : (_readfrom, ["--stdout", "--textbox", String("filename"), Integer("height"), Integer("width")]), - } - - def __init__(self, filename, text="", width=None, height=None): - Simple.__init__(self, text, width, height) - self.filename = filename - -# Available dialogues. - -available = [Question, Warning, Message, Error, Menu, CheckList, RadioList, Input, Password, Pulldown, TextFile] - -# Supported desktop environments. - -supported = Dialogue.commands.keys() - -# vim: tabstop=4 expandtab shiftwidth=4 diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtmlLib/desktop/windows.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtmlLib/desktop/windows.py deleted file mode 100644 index 2b19e85..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtmlLib/desktop/windows.py +++ /dev/null @@ -1,273 +0,0 @@ -#!/usr/bin/env python - -""" -Simple desktop window enumeration for Python. - -Copyright (C) 2007, 2008, 2009 Paul Boddie - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 3 of the License, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more -details. - -You should have received a copy of the GNU Lesser General Public License along -with this program. If not, see . - --------- - -Finding Open Windows on the Desktop ------------------------------------ - -To obtain a list of windows, use the desktop.windows.list function as follows: - -windows = desktop.windows.list() - -To obtain the root window, typically the desktop background, use the -desktop.windows.root function as follows: - -root = desktop.windows.root() - -Each window object can be inspected through a number of methods. For example: - -name = window.name() -width, height = window.size() -x, y = window.position() -child_windows = window.children() - -See the desktop.windows.Window class for more information. -""" - -from desktop import _is_x11, _get_x11_vars, _readfrom, use_desktop -import re - -# System functions. - -def _xwininfo(identifier, action): - if identifier is None: - args = "-root" - else: - args = "-id " + identifier - - s = _readfrom(_get_x11_vars() + "xwininfo %s -%s" % (args, action), shell=1) - - # Return a mapping of keys to values for the "stats" action. - - if action == "stats": - d = {} - for line in s.split("\n"): - fields = line.split(":") - if len(fields) < 2: - continue - key, value = fields[0].strip(), ":".join(fields[1:]).strip() - d[key] = value - - return d - - # Otherwise, return the raw output. - - else: - return s - -def _get_int_properties(d, properties): - results = [] - for property in properties: - results.append(int(d[property])) - return results - -# Finder functions. - -def find_all(name): - return 1 - -def find_named(name): - return name is not None - -def find_by_name(name): - return lambda n, t=name: n == t - -# Window classes. -# NOTE: X11 is the only supported desktop so far. - -class Window: - - "A window on the desktop." - - _name_pattern = re.compile(r':\s+\(.*?\)\s+[-0-9x+]+\s+[-0-9+]+$') - _absent_names = "(has no name)", "(the root window) (has no name)" - - def __init__(self, identifier): - - "Initialise the window with the given 'identifier'." - - self.identifier = identifier - - # Finder methods (from above). - - self.find_all = find_all - self.find_named = find_named - self.find_by_name = find_by_name - - def __repr__(self): - return "Window(%r)" % self.identifier - - # Methods which deal with the underlying commands. - - def _get_handle_and_name(self, text): - fields = text.strip().split(" ") - handle = fields[0] - - # Get the "" part, stripping off the quotes. - - name = " ".join(fields[1:]) - if len(name) > 1 and name[0] == '"' and name[-1] == '"': - name = name[1:-1] - - if name in self._absent_names: - return handle, None - else: - return handle, name - - def _get_this_handle_and_name(self, line): - fields = line.split(":") - return self._get_handle_and_name(":".join(fields[1:])) - - def _get_descendant_handle_and_name(self, line): - match = self._name_pattern.search(line) - if match: - return self._get_handle_and_name(line[:match.start()].strip()) - else: - raise OSError, "Window information from %r did not contain window details." % line - - def _descendants(self, s, fn): - handles = [] - adding = 0 - for line in s.split("\n"): - if line.endswith("child:") or line.endswith("children:"): - if not adding: - adding = 1 - elif adding and line: - handle, name = self._get_descendant_handle_and_name(line) - if fn(name): - handles.append(handle) - return [Window(handle) for handle in handles] - - # Public methods. - - def children(self, all=0): - - """ - Return a list of windows which are children of this window. If the - optional 'all' parameter is set to a true value, all such windows will - be returned regardless of whether they have any name information. - """ - - s = _xwininfo(self.identifier, "children") - return self._descendants(s, all and self.find_all or self.find_named) - - def descendants(self, all=0): - - """ - Return a list of windows which are descendants of this window. If the - optional 'all' parameter is set to a true value, all such windows will - be returned regardless of whether they have any name information. - """ - - s = _xwininfo(self.identifier, "tree") - return self._descendants(s, all and self.find_all or self.find_named) - - def find(self, callable): - - """ - Return windows using the given 'callable' (returning a true or a false - value when invoked with a window name) for descendants of this window. - """ - - s = _xwininfo(self.identifier, "tree") - return self._descendants(s, callable) - - def name(self): - - "Return the name of the window." - - d = _xwininfo(self.identifier, "stats") - - # Format is 'xwininfo: Window id: "" - - return self._get_this_handle_and_name(d["xwininfo"])[1] - - def size(self): - - "Return a tuple containing the width and height of this window." - - d = _xwininfo(self.identifier, "stats") - return _get_int_properties(d, ["Width", "Height"]) - - def position(self): - - "Return a tuple containing the upper left co-ordinates of this window." - - d = _xwininfo(self.identifier, "stats") - return _get_int_properties(d, ["Absolute upper-left X", "Absolute upper-left Y"]) - - def displayed(self): - - """ - Return whether the window is displayed in some way (but not necessarily - visible on the current screen). - """ - - d = _xwininfo(self.identifier, "stats") - return d["Map State"] != "IsUnviewable" - - def visible(self): - - "Return whether the window is displayed and visible." - - d = _xwininfo(self.identifier, "stats") - return d["Map State"] == "IsViewable" - -def list(desktop=None): - - """ - Return a list of windows for the current desktop. If the optional 'desktop' - parameter is specified then attempt to use that particular desktop - environment's mechanisms to look for windows. - """ - - root_window = root(desktop) - window_list = [window for window in root_window.descendants() if window.displayed()] - window_list.insert(0, root_window) - return window_list - -def root(desktop=None): - - """ - Return the root window for the current desktop. If the optional 'desktop' - parameter is specified then attempt to use that particular desktop - environment's mechanisms to look for windows. - """ - - # NOTE: The desktop parameter is currently ignored and X11 is tested for - # NOTE: directly. - - if _is_x11(): - return Window(None) - else: - raise OSError, "Desktop '%s' not supported" % use_desktop(desktop) - -def find(callable, desktop=None): - - """ - Find and return windows using the given 'callable' for the current desktop. - If the optional 'desktop' parameter is specified then attempt to use that - particular desktop environment's mechanisms to look for windows. - """ - - return root(desktop).find(callable) - -# vim: tabstop=4 expandtab shiftwidth=4 diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtmlLib/rgba/__init__.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtmlLib/rgba/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtmlLib/rgba/rgba.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtmlLib/rgba/rgba.py deleted file mode 100644 index b21f885..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/ExportHtmlLib/rgba/rgba.py +++ /dev/null @@ -1,173 +0,0 @@ -''' -RGBA -Licensed under MIT -Copyright (c) 2012 Isaac Muse -''' - -import re -from colorsys import rgb_to_hls, hls_to_rgb, rgb_to_hsv, hsv_to_rgb - -RGB_CHANNEL_SCALE = 1.0 / 255.0 -HUE_SCALE = 1.0 / 360.0 - - -def clamp(value, mn, mx): - return max(min(value, mx), mn) - - -class RGBA(object): - r = None - g = None - b = None - a = None - color_pattern = re.compile(r"^#(?:([A-Fa-f\d]{6})([A-Fa-f\d]{2})?|([A-Fa-f\d]{3}))") - - def __init__(self, s=None): - if s is None: - s = "#000000FF" - self.r, self.g, self.b, self.a = self._split_channels(s) - - def _split_channels(self, s): - def alpha_channel(alpha): - return int(alpha, 16) if alpha else 0xFF - - m = self.color_pattern.match(s) - assert(m is not None) - if m.group(1): - return int(s[1:3], 16), int(s[3:5], 16), int(s[5:7], 16), alpha_channel(m.group(2)) - else: - return int(s[1] * 2, 16), int(s[2] * 2, 16), int(s[3] * 2, 16), 0xFF - - def get_rgba(self): - return "#%02X%02X%02X%02X" % (self.r, self.g, self.b, self.a) - - def get_rgb(self): - return "#%02X%02X%02X" % (self.r, self.g, self.b) - - def apply_alpha(self, background="#000000AA"): - def tx_alpha(cf, af, cb, ab): - return int(abs(cf * (af / 255.0) + cb * (ab / 255.0) * (1 - (af / 255.0)))) & 0xFF - - if self.a < 0xFF: - r, g, b, a = self._split_channels(background) - - self.r, self.g, self.b = (tx_alpha(self.r, self.a, r, a), tx_alpha(self.g, self.a, g, a), tx_alpha(self.b, self.a, b, a)) - - return self.get_rgb() - - def luminance(self): - return clamp(int(round(0.299 * self.r + 0.587 * self.g + 0.114 * self.b)), 0, 255) - - def tohsv(self): - return rgb_to_hsv(self.r * RGB_CHANNEL_SCALE, self.g * RGB_CHANNEL_SCALE, self.b * RGB_CHANNEL_SCALE) - - def fromhsv(self, h, s, v): - r, g, b = hsv_to_rgb(h, s, v) - self.r = int(round(r * 255)) & 0xFF - self.g = int(round(g * 255)) & 0xFF - self.b = int(round(b * 255)) & 0xFF - - def tohls(self): - return rgb_to_hls(self.r * RGB_CHANNEL_SCALE, self.g * RGB_CHANNEL_SCALE, self.b * RGB_CHANNEL_SCALE) - - def fromhls(self, h, l, s): - r, g, b = hls_to_rgb(h, l, s) - self.r = int(round(r * 255)) & 0xFF - self.g = int(round(g * 255)) & 0xFF - self.b = int(round(b * 255)) & 0xFF - - def colorize(self, deg): - h, l, s = self.tohls() - h = clamp(deg * HUE_SCALE, 0.0, 1.0) - self.fromhls(h, l, s) - - def hue(self, deg): - d = deg * HUE_SCALE - h, l, s = self.tohls() - h = h + d - while h > 1.0: - h -= 1.0 - while h < 0.0: - h += 1.0 - self.fromhls(h, l, s) - - def invert(self): - self.r ^= 0xFF - self.g ^= 0xFF - self.b ^= 0xFF - - def saturation(self, factor): - h, l, s = self.tohls() - s = clamp(s * factor, 0.0, 1.0) - self.fromhls(h, l, s) - - def grayscale(self): - luminance = self.luminance() & 0xFF - self.r = luminance - self.g = luminance - self.b = luminance - - def sepia(self): - r = clamp(int((self.r * .393) + (self.g * .769) + (self.b * .189)), 0, 255) & 0xFF - g = clamp(int((self.r * .349) + (self.g * .686) + (self.b * .168)), 0, 255) & 0xFF - b = clamp(int((self.r * .272) + (self.g * .534) + (self.b * .131)), 0, 255) & 0xFF - self.r, self.g, self.b = r, g, b - - def brightness(self, factor): - # Caculate brightness based on RGB luminance. - # Maybe HLS or HSV brightness adjustment is better? - def get_overage(c): - if c < 0.0: - o = 0.0 + c - c = 0.0 - elif c > 255.0: - o = c - 255.0 - c = 255.0 - else: - o = 0.0 - return o, c - - def distribute_overage(c, o, s): - channels = len(s) - if channels == 0: - return c - parts = o / len(s) - if "r" in s and "g" in s: - c = c[0] + parts, c[1] + parts, c[2] - elif "r" in s and "b" in s: - c = c[0] + parts, c[1], c[2] + parts - elif "g" in s and "b" in s: - c = c[0], c[1] + parts, c[2] + parts - elif "r" in s: - c = c[0] + parts, c[1], c[2] - elif "g" in s: - c = c[0], c[1] + parts, c[2] - else: # "b" in s: - c = c[0], c[1], c[2] + parts - return c - - channels = ["r", "g", "b"] - total_lumes = clamp(self.luminance() + (255.0 * factor) - 255.0, 0.0, 255.0) - - if total_lumes == 255: - # white - self.r, self.g, self.b = 0xFF, 0xFF, 0xFF - elif total_lumes == 0: - # black - self.r, self.g, self.b = 0x00, 0x00, 0x00 - else: - # Adjust Brightness - pts = (total_lumes - 0.299 * self.r - 0.587 * self.g - 0.114 * self.b) - slots = set(channels) - components = [float(self.r) + pts, float(self.g) + pts, float(self.b) + pts] - count = 0 - for c in channels: - overage, components[count] = get_overage(components[count]) - if overage: - slots.remove(c) - components = list(distribute_overage(components, overage, slots)) - count += 1 - - self.r = int(round(components[0])) & 0xFF - self.g = int(round(components[1])) & 0xFF - self.b = int(round(components[2])) & 0xFF diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/HtmlAnnotations.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/HtmlAnnotations.py deleted file mode 100644 index 133dc88..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/HtmlAnnotations.py +++ /dev/null @@ -1,262 +0,0 @@ -import sublime -import sublime_plugin - -PACKAGE_SETTINGS = "ExportHtml.sublime-settings" - - -def get_highlight_style(): - style_flag = 0 - settings = sublime.load_settings(PACKAGE_SETTINGS) - scope = settings.get("annotation_highlight_scope", "comment") - style = settings.get("annotation_highlight_style", "outline") - if style == "outline": - style_flag |= sublime.DRAW_OUTLINED - return scope, style_flag - - -def clean_invalid_regions(view, annotations): - deletions = 0 - for x in range(0, int(annotations["count"])): - key_name = "html_annotation_%d" % x - regions = view.get_regions(key_name) - if len(regions) and not regions[0].empty(): - annotations["annotations"]["html_annotation_%d" % x]["region"] = [regions[0].begin(), regions[0].end()] - if deletions: - new_key = "html_annotation_%d" % (x - deletions) - annotations["annotations"][new_key] = annotations["annotations"][key_name] - del annotations["annotations"][key_name] - new_region = annotations["annotations"][new_key]["region"] - view.erase_regions(key_name) - scope, style = get_highlight_style() - view.add_regions( - new_key, - [sublime.Region(new_region[0], new_region[1])], - scope, - "", - style - ) - else: - del annotations["annotations"]["html_annotation_%d" % x] - annotations["count"] -= 1 - deletions += 1 - if len(regions): - view.erase_regions(key_name) - - view.settings().set("annotation_comments", annotations) - - -def get_annotations(view): - annotations = view.settings().get("annotation_comments", {"count": 0, "annotations": {}}) - clean_invalid_regions(view, annotations) - return annotations - - -def clear_annotations(view): - annotations = view.settings().get("annotation_comments", {"count": 0, "annotations": {}}) - for x in range(0, int(annotations["count"])): - view.erase_regions("html_annotation_%d" % x) - view.settings().set("annotation_comments", {"count": 0, "annotations": {}}) - - -def delete_annotations(view): - annotations = view.settings().get("annotation_comments", {"count": 0, "annotations": {}}) - for sel in view.sel(): - for x in range(0, int(annotations["count"])): - region = annotations["annotations"]["html_annotation_%d" % x]["region"] - annotation = sublime.Region(int(region[0]), int(region[1])) - if annotation.contains(sel): - view.erase_regions("html_annotation_%d" % x) - break - clean_invalid_regions(view, annotations) - - -def get_annotation_comment(view): - comment = None - annotations = view.settings().get("annotation_comments", {"count": 0, "annotations": {}}) - if len(view.sel()): - sel = view.sel()[0] - for x in range(0, int(annotations["count"])): - region = annotations["annotations"]["html_annotation_%d" % x]["region"] - annotation = sublime.Region(int(region[0]), int(region[1])) - if annotation.contains(sel): - comment = annotations["annotations"]["html_annotation_%d" % x]["comment"] - return comment - - -def is_selection_in_annotation(view, first_only=False): - mode = view.settings().get("annotation_mode", False) - selection = False - if mode: - annotations = view.settings().get("annotation_comments", {"count": 0, "annotations": {}}) - for sel in view.sel(): - for x in range(0, int(annotations["count"])): - region = annotations["annotations"]["html_annotation_%d" % x]["region"] - annotation = sublime.Region(int(region[0]), int(region[1])) - if annotation.contains(sel): - selection = True - break - if first_only: - break - return mode and selection - - -def annotations_exist(view): - mode = view.settings().get("annotation_mode", False) - found = False - if mode: - annotations = view.settings().get("annotation_comments", {"count": 0, "annotations": {}}) - if int(annotations["count"]): - found = True - return mode and found - - -def is_selected(view): - mode = view.settings().get("annotation_mode", False) - selected = not view.sel()[0].empty() - return mode and selected - - -class ShowAnnotationCommentCommand(sublime_plugin.TextCommand): - def is_visible(self): - return is_selection_in_annotation(self.view) - - def run(self, edit): - comment = get_annotation_comment(self.view) - if comment != None: - sublime.message_dialog("Annotation Comment:\n\n%s" % comment) - sublime.set_clipboard(comment) - - -class ClearAnnotationsCommand(sublime_plugin.TextCommand): - def is_visible(self): - return annotations_exist(self.view) - - def run(self, edit): - clear_annotations(self.view) - - -class DeleteAnnotationsCommand(sublime_plugin.TextCommand): - def is_visible(self): - return is_selection_in_annotation(self.view) - - def run(self, edit): - delete_annotations(self.view) - - -class EnableAnnotationModeCommand(sublime_plugin.TextCommand): - def is_visible(self): - return not self.view.settings().get("annotation_mode", False) - - def run(self, edit): - self.view.run_command("toggle_annotation_html_mode") - - -class DisableAnnotationModeCommand(sublime_plugin.TextCommand): - def is_visible(self): - return self.view.settings().get("annotation_mode", False) - - def run(self, edit): - self.view.run_command("toggle_annotation_html_mode") - - -class ToggleAnnotationHtmlModeCommand(sublime_plugin.TextCommand): - def is_enabled(self): - return not self.view.settings().get('is_widget') - - def run(self, edit): - mode = False if self.view.settings().get("annotation_mode", False) else True - self.view.settings().set("annotation_mode", mode) - if mode: - self.view.settings().set("annotation_read_mode", self.view.is_read_only()) - self.view.set_read_only(True) - self.view.set_status("html_annotation_mode", "Annotation Mode: ON") - else: - clear_annotations(self.view) - self.view.set_read_only(self.view.settings().get("annotation_read_mode", False)) - self.view.erase_status("html_annotation_mode") - - -class AddAnnotationCommand(sublime_plugin.TextCommand): - def is_visible(self): - return is_selected(self.view) - - def run(self, edit): - AnnotateHtml(self.view).run() - - -class EditAnnotationCommand(sublime_plugin.TextCommand): - def is_visible(self): - return is_selection_in_annotation(self.view, first_only=True) - - def run(self, edit): - AnnotateHtml(self.view).run() - - -class AnnotateHtml(object): - def __init__(self, view): - self.view = view - - def subset_annotation_adjust(self): - subset = None - comment = "" - parent = None - intersect = False - for k, v in self.annotations["annotations"].items(): - region = sublime.Region(int(v["region"][0]), int(v["region"][1])) - if region.contains(self.sel): - subset = region - comment = v["comment"] - parent = k - break - elif region.intersects(self.sel): - intersect = True - break - if subset != None: - self.sel = subset - return comment, parent, intersect - - def add_annotation(self, s, view_id, subset): - window = sublime.active_window() - view = window.active_view() if window != None else None - if s != "" and view != None and view_id == view.id(): - if subset == None: - idx = self.annotations["count"] - key_name = ("html_annotation_%d" % idx) - else: - key_name = subset - - self.annotations["annotations"][key_name] = { - "region": [self.sel.begin(), self.sel.end()], - "comment": s - } - if subset == None: - self.annotations["count"] += 1 - self.view.settings().set("annotation_comments", self.annotations) - - scope, style = get_highlight_style() - self.view.add_regions( - key_name, - [self.sel], - scope, - "", - style - ) - - def annotation_panel(self, default_comment, subset): - view_id = self.view.id() - self.view.window().show_input_panel( - ("Annotate region (%d, %d)" % (self.sel.begin(), self.sel.end())), - default_comment, - lambda x: self.add_annotation(x, view_id=view_id, subset=subset), - None, - None - ) - - def run(self): - self.sel = self.view.sel()[0] - self.annotations = get_annotations(self.view) - comment, subset, intersects = self.subset_annotation_adjust() - if not intersects: - self.annotation_panel(comment, subset) - else: - sublime.error_message("Cannot have intersecting annotation regions!") diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/Main.sublime-menu b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/Main.sublime-menu deleted file mode 100644 index 548aa4a..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/Main.sublime-menu +++ /dev/null @@ -1,40 +0,0 @@ -[ - { - "caption": "Preferences", - "mnemonic": "n", - "id": "preferences", - "children": - [ - { - "caption": "Package Settings", - "mnemonic": "P", - "id": "package-settings", - "children": - [ - { - "caption": "ExportHTML", - "children": - [ - { - "command": "open_file", - "args": {"file": "${packages}/ExportHtml/readme.md"}, - "caption": "README" - }, - { "caption": "-" }, - { - "command": "open_file", - "args": {"file": "${packages}/ExportHtml/ExportHtml.sublime-settings"}, - "caption": "Settings – Default" - }, - { - "command": "open_file", - "args": {"file": "${packages}/User/ExportHtml.sublime-settings"}, - "caption": "Settings – User" - } - ] - } - ] - } - ] - } -] \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/css/export.css b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/css/export.css deleted file mode 100644 index fcefd28..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/css/export.css +++ /dev/null @@ -1,153 +0,0 @@ -/* General */ -* html a:hover { background: transparent; } -body { color: /* %body_fg% */; } -pre { border: 0; margin: 0; padding: 0; } -td { padding: 0; } -table { border: 0; margin: 0; padding: 0; border-collapse: collapse; empty-cells: show; } -.code_text { font: /* %font_size% */pt /* %font_face% */, "Courier", Monospace; } -.code_page { background-color: /* %page_bg% */; } -.simple_code_page { background-color: white; color: black } -.code_gutter { display: /* %display_mode% */; background-color: /* %gutter_bg% */; padding-right: 10px; } -td.code_line div { width: 100%; } -span { display: inline-block; border: 0; margin: 0; } -span.bold { font-weight: bold; } -span.italic { font-style: italic; } -span.normal { font-style: normal; } -span.underline { text-decoration:underline; } - -/* Wrapping */ -div.wrap { - white-space: -moz-pre-wrap; /* Mozilla */ - white-space: -hp-pre-wrap; /* HP printers */ - white-space: -o-pre-wrap; /* Opera 7 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: pre-wrap; /* CSS 2.1 */ - white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */ - word-wrap: break-word; /* IE */ -} -div.wrap span { display: inline; } - -/* Toolbar */ -div#toolbarhide { - position: fixed; - top: 0px; - right: 0px; - padding-top: 5px; - padding-right: 10px; -} -div#toolbar { - visibility: hidden; - text-align: center; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; - opacity: 0; - -webkit-transform: translateZ(0); /* webkit flicker fix */ - -webkit-font-smoothing: antialiased; /* webkit text rendering fix */ - -webkit-transition: all .25s ease-in; - -moz-transition: all .25s ease-in; - -ms-transition: all .25s ease-in; - -o-transition: all .25s ease-in; - transition: all .25s ease-in; - background-color:black; - color: white; -} -div#toolbarhide:hover div#toolbar { - visibility: visible; - opacity: .8; - -webkit-transition: all .25s ease-out; - -moz-transition: all .25s ease-out; - -ms-transition: all .25s ease-out; - -o-transition: all .25s ease-out; - transition: all .25s ease-out; -} - -div#toolbar img { - display: /* %toolbar_orientation% */ ; - vertical-align: middle; - border: 0; - cursor: pointer; - height: 16px; - width: 16px; - padding: 5px; -} - -/* tooltips */ -#tooltip { - border-radius: 5px 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1); - -webkit-box-shadow: 5px 5px rgba(0, 0, 0, 0.1); - -moz-box-shadow: 5px 5px rgba(0, 0, 0, 0.1); - white-space: -moz-pre-wrap; /* Mozilla */ - white-space: -hp-pre-wrap; /* HP printers */ - white-space: -o-pre-wrap; /* Opera 7 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: pre-wrap; /* CSS 2.1 */ - white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */ - word-wrap: break-word; /* IE */ - position:absolute; display:block; - color: black; - padding: 0.8em 1em; - background: #FFFFE0; border: solid black; - font-family: Calibri, Tahoma, Geneva, sans-serif; - font-size: 10pt; - font-weight: bold; -} - -a.annotation { - color: /* %body_fg% */; - outline: none; - text-decoration: underline; -} - -span.annotation{ display: inline; } - -.tooltip_hotspot { cursor:pointer; } - -/* Annotation Table */ -div#comment_list { - visibility: hidden; - display: none; - margin: auto auto; - text-align: center; - position: fixed; - z-index: 99; - left:0px; - top: 0px; -} -div#comment_wrapper { - max-height: 200px; - overflow: auto; - border: solid black; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1); - -webkit-box-shadow: 5px 5px rgba(0, 0, 0, 0.1); - -moz-box-shadow: 5px 5px rgba(0, 0, 0, 0.1); -} -table#comment_table { - border: thin solid; border-collapse: collapse; - color: #000000; background-color: #FFFFE0; margin: auto auto; -} -div.table_footer { text-align:right; font-size: 8pt; font-weight: bold;} -a.table_close { color: black; float: right; } -a.table_close:link { text-decoration: none; } -a.table_close:active { text-decoration: none; } -a.table_close:visited { text-decoration: none; } -a.table_close:hover { text-decoration: none; } -table#comment_table th, table#comment_table td { border: thin solid; padding: 5px; } -td.annotation_link { width: 60px; text-align: right; padding-right: 20px; } -.annotation_comment { width: 500px; } -div.annotation_comment { - float: left; - text-align: left; - white-space: -moz-pre-wrap; /* Mozilla */ - white-space: -hp-pre-wrap; /* HP printers */ - white-space: -o-pre-wrap; /* Opera 7 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: pre-wrap; /* CSS 2.1 */ - white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */ - word-wrap: break-word; /* IE */ -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/bubble.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/bubble.png deleted file mode 100644 index ffbe903..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/bubble.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/down.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/down.png deleted file mode 100644 index 7e866f8..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/down.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/gutter.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/gutter.png deleted file mode 100644 index d28b142..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/gutter.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/print.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/print.png deleted file mode 100644 index c9c279b..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/print.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/text.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/text.png deleted file mode 100644 index 0859e6a..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/text.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/toolbar.xcf b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/toolbar.xcf deleted file mode 100644 index 7448447..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/toolbar.xcf and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/wrap.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/wrap.png deleted file mode 100644 index c8e0a32..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/icons/wrap.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/js/annotation.js b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/js/annotation.js deleted file mode 100644 index 87692e8..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/js/annotation.js +++ /dev/null @@ -1,206 +0,0 @@ -/*jshint globalstrict: true*/ -"use strict"; - -var win_attr = { - get_center : function (dim) { - var c = { - 'x' : (win_attr.get_size('x')/2), - 'y' : (win_attr.get_size('y')/2) - }; - return ((dim) ? c[dim] : c); - }, - - get_size : function(dir) { - dir = (dir === 'x') ? 'Width' : 'Height'; - return ((window['inner'+dir]) ? - window['inner'+dir] : - ((window.document.documentElement && window.document.documentElement['client'+dir]) ? - window.document.documentElement['client'+dir] : - window.document.body['client'+dir] - ) - ); - } -}, - -position_el = { - center : function (el, dim) { - var c = win_attr.get_center(), - top = (c.y - (el.offsetHeight/2)), - left = (c.x - (el.offsetWidth/2)); - if (dim == null || dim === 'y') el.style.top = (top < 0) ? 0 + 'px' : top + 'px'; - if (dim == null || dim === 'x') el.style.left = (left < 0) ? 0 + 'px' : left + 'px'; - }, - - set : function (el, x, y) { - var left, top; - - if (typeof x === "undefined") x = null; - if (typeof y === "undefined") y = null; - - if (y === 'center') { - position_el.center(el, 'y'); - } else if (y === 'top') { - el.style.top = 0 + 'px'; - } else if (y === 'bottom') { - top = (win_attr.get_size('y') - (el.offsetHeight)); - el.style.top = (top < 0) ? 0 + 'px' : top + 'px'; - } else if (y.match(/^[\d]+(%|px|em|mm|cm|in|pt|pc)$/) != null) { - el.style.top = y; - } - - if (x === "center") { - position_el.center(el, 'x'); - } else if (x === 'left') { - el.style.left = 0 + 'px'; - } else if (x === 'right') { - left = (win_attr.get_size('x') - (el.offsetWidth)); - el.style.left = (left < 0) ? 0 + 'px' : left + 'px'; - } else if (x.match(/^[\d]+(%|px|em|mm|cm|in|pt|pc)$/) != null) { - el.style.left = x; - } - } -}; - -function position_table(el) { - var x, y, - sel = document.getElementById('dock'), - option = sel.options[sel.selectedIndex].value; - switch(option) { - case "0": x = 'center'; y = 'center'; break; - case "1": x = 'center'; y = 'top'; break; - case "2": x = 'center'; y = 'bottom'; break; - case "3": x = 'left'; y = 'center'; break; - case "4": x = 'right'; y = 'center'; break; - case "5": x = 'left'; y = 'top'; break; - case "6": x = 'right'; y = 'top'; break; - case "7": x = 'left'; y = 'bottom'; break; - case "8": x = 'right'; y = 'bottom'; break; - default: break; - } - setTimeout(function () {position_el.set(el, x, y); el.style.visibility = 'visible';}, 300); -} - -function toggle_annotations() { - var comments_div = document.getElementById('comment_list'), - mode = comments_div.style.display; - if (mode == 'none') { - comments_div.style.display = 'block'; - position_table(comments_div); - } else { - comments_div.style.visibility = 'hidden'; - comments_div.style.display = 'none'; - } -} - -function dock_table() { - var comments_div = document.getElementById('comment_list'); - position_table(comments_div); -} - -function scroll_to_line(value) { - var pos = 0, - el = document.getElementById(value); - window.scrollTo(0, 0); - while(el) { - pos += el.offsetTop; - el = el.offsetParent; - } - pos -= win_attr.get_center('y'); - if (pos < 0) { - pos = 0; - } - window.scrollTo(0, pos); -} - -// Tooltips from http://www.scriptiny.com/2008/06/javascript-tooltip/ -var tooltip = function() { - var id = 'tooltip', - top = 3, - left = 3, - maxw = 300, - speed = 10, - timer = 20, - endalpha = 95, - alpha = 0, - ie = document.all ? true : false, - tt, t, c, b, h; - return{ - annotation_list: {}, - init: function() { - var i, comment, comments, len; - comments = document.querySelectorAll("div.annotation_comment"); - len = comments.length; - for (i = 0; i < len; i++) { - comment = comments[i]; - if ("textContent" in comment) { - tooltip.annotation_list[i] = comment.textContent; - } else { - tooltip.annotation_list[i] = comment.innerText; - } - } - }, - show:function(v, w) { - if(tt == null) { - tt = document.createElement('div'); - tt.setAttribute('id', id); - document.body.appendChild(tt); - tt.style.opacity = 0; - tt.style.filter = 'alpha(opacity=0)'; - document.onmousemove = this.pos; - } - tt.style.display = 'block'; - tt.innerHTML = v in tooltip.annotation_list ? tooltip.annotation_list[v] : '?'; - tt.style.width = w ? w + 'px' : 'auto'; - if(!w && ie){ - tt.style.width = tt.offsetWidth; - } - if(tt.offsetWidth > maxw){ - tt.style.width = maxw + 'px'; - } - h = parseInt(tt.offsetHeight, 10) + top; - clearInterval(tt.timer); - tooltip.instantshow(true); - // tt.timer = setInterval(function(){tooltip.fade(1);}, timer); - }, - pos:function(e) { - var u = ie ? event.clientY + document.documentElement.scrollTop : e.pageY, - l = ie ? event.clientX + document.documentElement.scrollLeft : e.pageX; - tt.style.top = (u - h) + 'px'; - tt.style.left = (l + left) + 'px'; - }, - instantshow: function(show) { - if (show === true) { - tt.style.opacity = endalpha * 0.01; - tt.style.filter = 'alpha(opacity=' + endalpha + ')'; - } else { - tt.style.display = 'none'; - } - }, - fade:function(d) { - var a = alpha, i; - if((a != endalpha && d == 1) || (a !== 0 && d == -1)){ - i = speed; - if(endalpha - a < speed && d == 1){ - i = endalpha - a; - }else if(alpha < speed && d == -1){ - i = a; - } - alpha = a + (i * d); - tt.style.opacity = alpha * 0.01; - tt.style.filter = 'alpha(opacity=' + alpha + ')'; - }else{ - clearInterval(tt.timer); - if(d == -1){ - tt.style.display = 'none'; - } - } - }, - hide:function() { - clearInterval(tt.timer); - tooltip.instantshow(false); - // tt.timer = setInterval(function(){tooltip.fade(-1);},timer); - } - }; -}(); - -tooltip.init(); diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/js/lines.js b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/js/lines.js deleted file mode 100644 index 20e9d49..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/js/lines.js +++ /dev/null @@ -1,87 +0,0 @@ -/*jshint globalstrict: true*/ -"use strict"; - -var page_line_info = { - wrap: false, - ranges: null, - wrap_size: null, - tables: null, - header: null, - gutter: false - }; - -function wrap_code() { - var start, end, i, j, mode, idx, - width = 0, el; - if (page_line_info.header) { - document.getElementById("file_info").style.width = page_line_info.wrap_size + "px"; - } - for (i = 1; i <= page_line_info.tables; i++) { - idx = i - 1; - start = page_line_info.ranges[idx][0]; - end = page_line_info.ranges[idx][1]; - for(j = start; j < end; j++) { - if (mode == null) { - mode = true; - if (page_line_info.gutter) { - width = document.getElementById("L_" + idx + "_" + j).offsetWidth; - } - } - el = document.getElementById("C_" + idx + "_" + j); - el.style.width = (page_line_info.wrap_size - width) + "px"; - el.className = "wrap"; - } - } -} - -function toggle_gutter() { - var i, j, mode, rows, r, tbls, cells; - tbls = document.getElementsByTagName('table'); - for (i = 1; i <= page_line_info.tables; i++) { - rows = tbls[i].getElementsByTagName('tr'); - r = rows.length; - for (j = 0; j < r; j++) { - cells = rows[j].getElementsByTagName('td'); - if (mode == null) { - if (page_line_info.gutter) { - mode = 'none'; - page_line_info.gutter = false; - } else { - mode = 'table-cell'; - page_line_info.gutter = true; - } - } - cells[0].style.display = mode; - } - } - if (page_line_info.wrap && mode != null) { - setTimeout(function() {wrap_code();}, 500); - } -} - -function unwrap_code() { - var i, j, idx, start, end, el; - if (page_line_info.header) { - document.getElementById("file_info").style.width = "100%"; - } - for (i = 1; i <= page_line_info.tables; i++) { - idx = i - 1; - start = page_line_info.ranges[idx][0]; - end = page_line_info.ranges[idx][1]; - for(j = start; j < end; j++) { - el = document.getElementById("C_" + idx + "_" + j); - el.style.width = "100%"; - el.className = ""; - } - } -} - -function toggle_wrapping() { - if (page_line_info.wrap) { - page_line_info.wrap = false; - unwrap_code(); - } else { - page_line_info.wrap = true; - wrap_code(); - } -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/js/plaintext.js b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/js/plaintext.js deleted file mode 100644 index 183117d..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/js/plaintext.js +++ /dev/null @@ -1,39 +0,0 @@ -/*jshint globalstrict: true*/ -"use strict"; - -var plain_text_clone = null; - -function toggle_plain_text() { - var lines = document.querySelectorAll("td.code_line"), - line_len = lines.length, - text = "", - plain_pre = document.querySelectorAll("pre.simple_code_page"), - orig_pre, pre, i, j, spans, span_len, span; - if (plain_pre.length > 0) { - document.body.removeChild(plain_pre[0]); - document.body.appendChild(plain_text_clone); - document.body.className = "code_page"; - } else { - for (i = 0; i < line_len; i++) { - spans = lines[i].querySelectorAll("span.real_text"); - span_len = spans.length; - for (j = 0; j < span_len; j++) { - span = spans[j]; - if ("textContent" in span) { - text += span.textContent; - } else { - text += span.innerText; - } - } - text += "\n"; - } - orig_pre = document.querySelectorAll("pre.code_page")[0]; - plain_text_clone = orig_pre.cloneNode(true); - pre = document.createElement('pre'); - pre.className = "simple_code_page"; - pre.appendChild(document.createTextNode(text)); - document.body.removeChild(orig_pre); - document.body.appendChild(pre); - document.body.className = "simple_code_page"; - } -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/js/plist.js b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/js/plist.js deleted file mode 100644 index c61be48..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/js/plist.js +++ /dev/null @@ -1,129 +0,0 @@ -/*jshint globalstrict: true*/ -"use strict"; - -var plist = { - color_scheme: {}, - content: "", - indentlevel: 0, - - get: function(file_name) { - this.content = '\n' + - '\n' + - '\n' + - '\n'; - this.parsedict(this.color_scheme); - this.content += '\n'; - return this.content; - }, - - isinstance: function(obj, s) { - return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase() === s; - }, - - sortkeys: function(obj) { - var sorted = {}, - keys = [], - key; - - for (key in obj) { - if (obj.hasOwnProperty(key)) { - keys.push(key); - } - } - keys.sort(); - return keys; - }, - - indent: function() { - var i; - for (i = 0; i < this.indentlevel; i++) { - this.content += " "; - } - }, - - parsekey: function(k) { - this.indent(); - this.content += '' + k + '\n'; - }, - - parseitem: function(obj) { - if (this.isinstance(obj, "string")) { - this.parsestring(obj); - } else if (this.isinstance(obj, "array")) { - this.parsearray(obj); - } else if (this.isinstance(obj, "object")) { - this.parsedict(obj); - } - }, - - parsearray: function(obj) { - var i, len = obj.length; - this.indent(); - this.content += '\n'; - this.indentlevel++; - for (i = 0; i < len; i++) { - this.parseitem(obj[i]); - } - this.indentlevel--; - this.indent(); - this.content += '\n'; - }, - - parsestring: function(s) { - this.indent(); - this.content += '' + s + '\n'; - }, - - parsedict: function(obj) { - var keys = this.sortkeys(obj), - len = keys.length, - k, i; - - this.indent(); - this.content += '\n'; - this.indentlevel++; - for (i = 0; i < len; i++) - { - k = keys[i]; - this.parsekey(k); - this.parseitem(obj[k]); - } - this.indentlevel--; - this.indent(); - this.content += '\n'; - } -}, - -escape_html = { - safe_chars: { - "&": "&", - "<": "<", - ">": ">", - '"': '"', - "'": ''', - "/": '/' - }, - escape: function (s) { - return String(s).replace(/[&<>"'\/]/g, function (c) {return escape_html.safe_chars[c];}); - } -}; - -function extract_theme(name) { - var text, wnd, doc, - a = document.createElement('a'); - window.URL = window.URL || window.webkitURL; - - if (window.Blob != null && a.download != null) { - text = new Blob([plist.get(name)], {'type':'application/octet-stream'}); - a.href = window.URL.createObjectURL(text); - a.download = name; - a.click(); - } else { - text = '
' + escape_html.escape(plist.get(name)) + '
', - wnd = window.open('', '_blank', "status=1,toolbar=0,scrollbars=1"), - doc = wnd.document; - doc.write(text); - doc.close(); - wnd.focus(); - } -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/js/print.js b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/js/print.js deleted file mode 100644 index cf5594d..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/js/print.js +++ /dev/null @@ -1,15 +0,0 @@ -/*jshint globalstrict: true*/ -"use strict"; - -function page_print() { - var element = document.getElementById("toolbarhide"); - if (element != null) { - element.style.display = "none"; - } - if (window.print) { - window.print(); - } - if (element != null) { - element.style.display = "block"; - } -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/package-metadata.json deleted file mode 100644 index 5ff7671..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://github.com/facelessuser/ExportHtml", "version": "2013.05.24.14.57.59", "description": "Sublime Text - Export code to HTML for copying/printing/saving. Also, export code to BBCode for forum posts."} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/readme.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/readme.md deleted file mode 100644 index c9957c1..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ExportHtml/readme.md +++ /dev/null @@ -1,220 +0,0 @@ -# About -This is a fork of agibsonsw's [PrintHtml](https://github.com/agibsonsw/PrintHtml) plugin. This plugin allows the exporting of a document in ST2 to an HTML file or to BBCode. It duplicates ST2's theme colors and font styles. You can play with the demo page that has actual html pages generated with this plugin [here](http://facelessuser.github.com/ExportHtml). - - - -# Features -- Export to HTML using any tmTheme for syntax highlighting -- Can handle any language supported by ST2 -- Supports bold and italic theme font styles as well -- Configurable output -- Format suitable for copying and pasting in emails -- 2 included tmTheme files for color and grayscale printing (but any can be used) -- Export only selections (multi-select supported) -- Export and show highlights (multi-select supported) -- Toggle gutter on/off in browser view -- Automatically open browser print dialog (optional) -- Enable/disable configurable word wrapping -- Configurable toolbar to appear in the generated webpage - -# Usage: Exporting HTML -ExportHtml comes with a number of default commands available, but these can be overridden in the settings file. Or you can create commands directly outside of the settings file bound to the command palette, key bindings, or even the menu. - -If adding a command to the settings file, it goes under the ```html_panel``` setting. These configurations will appear under the ```Export to HTML: Show Export Menu``` command palette command. - -```javascript -// Define configurations for the drop down export menu -"html_panel": [ - // Browser print color (selections and multi-selections allowed) - { - "Browser Print - Color": { - "numbers": true, - "wrap": 900, - "browser_print": true, - "multi_select": true, - "color_scheme": "Packages/ExportHtml/ColorSchemes/Print-Color.tmTheme", - "style_gutter": false - } - } - ] -``` - -The name of the command is the key value, and then you add the parameters you wish to specify. You can use any combination of settings below. - -- numbers (boolean): Display line numbers in the gutter. -- style_gutter (boolean): Style gutter with theme backgrounds and foregrounds, or just use the default background/foreground. Default is ```true```. -- multi_select (boolean): If multiple regions are selected in a document, only export what is under those selections. By default only the first selection is recognized. Default is ```false``` -- highlight_selections (boolean): Highlights all selections in HTML output using the themes selection colors. Multi-select option will be ignored if this is set ```true```. Default is ```false``` -- wrap (integer): Define the allowable size in px to wrap lines at. By default wrapping is not used. -- color_scheme (string): The color scheme (tmTheme) file you would like to use. By default the current color scheme file is used, or the the alternate default color scheme if defined in the setting ```alternate_scheme```. -- clipboard_copy (boolean): Copy html to the clipboard after generation. Default is ```false```. -- browser_print (boolean): When opening in the web browser, also open the brower's print dialog. This will be ignored if ```view_open``` is ```true```. Default is ```false```. -- view_open (boolean): Open HTML in a Sublime Text tab instead of the web browser. Default is ```false```. -- no_header (boolean): Do not display file name, date, and time at the top of the HTML document. Default is ```false```. -- date_time_format (string): String denoting the format for date and time when displaying header. Please see Python's documentation on ```time.strftime``` for detailed info on formatting syntax. Default is ```"%m/%d/%y %I:%M:%S"``` -- show_full_path (boolean): Show full path for filename when displaying header. Default is ```true``` -- save_location (string): Path to save html file. If the file is wanted in the same file as the original, use ".". Otherwise, use the absolute path to where the file is desired. If there is an issue determining where to save the file, or the path does not exist, the OS temp folder will be used. Default is ```None``` (use temp folder). -- time_stamp (string): Configure the time stamp of saved html when using ```save_location```. To remove time stamps, just set to an empty string ```""```. Please see Python's documentation on ```time.strftime``` for detailed info on formatting syntax. Default is ```"_%m%d%y%H%M%S"``` -- toolbar (array of strings): Option to display a toolbar with to access features in a generated HTML. This setting is an array of keywords that represent the icons in the toolbar to show. Valid keywords include ```gutter```, ```print```, ```plain_text```, ```annotation```, ```theme```, and ```wrapping```. Toolbar will appear when you mouse over the uppert right corner of the window of the generated html. Default enables all. -- filter (string): Filters to use on the theme's colors. The string is a sequence of filters separated by ```;```. The accepted filters are ```grayscale```, ```invert```, ```sepia```, ```brightness```,, ```saturation```, ```hue```, and ```colorize```. ```brightness``` and ```saturation``` requires a float parameter to specify to what magnitude the filter should be applied at. ```hue``` and ```colorize``` take a float that represents a degree. ```hue``` shifts the hue via the degree given (can accept negative degrees); hues will wrap if they extend past 0 degrees or 360 degrees. Example: ```"filter": "sepia;invert;brightness(1.1);saturation(1.3);"```. Default is ```""```. -- shift_brightness (bool): This setting shifts the entire theme's brightness if a background color's luminace is below the global setting ```bg_min_lumen_threshold```. This was added to solve an issue that I had when copying dark themes into an outlook email; if a html span had a background that was too dark, the foreground would just be white. This allows me to not have to worry about how dark the theme is, and probably serves very little use besides that. - -If you wish to bind a command to a key combination etc., the same settings as above can be used. - -Example: - -```javascript -{ - "keys": ["ctrl+alt+n"], - "command": "export_html", - "args": { - "numbers": true, - "wrap": 900, - "browser_print": true, - "multi_select": true, - "color_scheme": "Packages/ExportHtml/ColorSchemes/Print-Color.tmTheme", - "style_gutter": false - } -} -``` - -When viewing the HTML in your web browser, regardless of the gutter settings, the gutter can be toggled to show or be hidden using the toolbar. - -# Usage: Exporting BBCode -ExportHtml can also export selected code as BBCode for posting in forums. Exporting BBCode is very similar to exporting HTML code. - -If adding a command to the settings file, it goes under the ```bbcode_panel``` setting. These configurations will appear under the ```Export to BBCode: Show Export Menu``` command palette command. - -```javascript -// Define configurations for the drop down export menu -"bbcode_panel": [ - { - "To Clipboard - Format as BBCode": { - "numbers": false, - "multi_select": true - } - } -] -``` - -The name of the command is the key value, and then you add the parameters you wish to specify. You can use any combination of settings below. - -- numbers (boolean): Display line numbers in the gutter. -- multi_select (boolean): If multiple regions are selected in a document, only export what is under those selections. By default only the first selection is recognized. Default is ```false``` -- color_scheme (string): The color scheme (tmTheme) file you would like to use. By default the current color scheme file is used, or the the alternate default color scheme if defined in the setting ```alternate_scheme```. -- clipboard_copy (boolean): Copy BBCode to the clipboard after generation. Default is ```true```. -- view_open (boolean): Open txt file of BBCode in a Sublime Text tab. Default is ```false```. -- no_header (boolean): Do not display file name, date, and time at the top of the HTML document. Default is ```false```. - -If you wish to bind a command to a key combination etc., the same settings as above can be used. - -Example: - -```javascript -{ - "keys": ["ctrl+alt+n"], - "command": "export_bbcode", - "args": { - "numbers": false, - "multi_select": true - } -} -``` - -# Usage: Annotations (HTML only) -Annotations are comments you can make on selected text. When the HTML is generated, the selected text will be underlined, and when the mouse hovers over them, a tooltip will appear with your comment. - - - -In order to use annotations, you must enter into an "Annotation Mode". This puts your file in a read only state. At this point, you can select text and create annotations using the annotation commands provided. When you leave the "Annotation Mode", all annotations will be lost. So you must print before leaving annotation mode. - -You can access the annotation commands from the command palette or from the context menu. - -The commands are as follows: - -- Enable Annotation Mode: Turn annotation mode on. -- Disable Annotation Mode: Turn annotation mode off. -- Annotate Selection: Annote the given selection (no multi-select support currently). -- Delete Annotation(s): Delete the annotation region the the cursor resides in (multi-select support). -- Delete All Annotations: Delete all annotation regions. -- Show Annotation Comment: Show the annotation comment of the region under the cursor. - -You can navigate the annotations in the generate HTML by using a jump table. You can show the jump table at any time by selecting the annotation button in the toolbar. You can also click any annotation to show the jump table as well. If it gets in the way, you can dock it in a different location. - - - - -# Settings File options -- alternate_scheme (string or false): Defines a default theme to be used if a theme is not specified in a command. When this is false, the current Sublime Text theme in use is used. -- alternate_font_size (int or false): Define an alternate font_size to use by default instead of the current one in use. Use the current one in use if set to a literal ```false```. Default is ```false```. -- alternate_font_face (string or false): Define an alternate font_face to use by default instead of the current one in use. Use the current one in use if set to a literal ```false```. Default is ```false```. -- valid_selection_size (integer): Minimum allowable size for a selection to be accepted for only the selection to be printed. -- linux_python2.6_lib (string): If you are on linux and Sublime Text is not including your Python 2.6 library folder, you can try and configure it here. -- html_panel (array of commands): Define export configurations to appear under the ```Export to HTML: Show Export Menu``` command palette command. -- bbcode_panel (array of commands): Define export configurations to appear under the ```Export to BBCode: Show Export Menu``` command palette command. - -#Credits -- agibsonsw: Original idea and algorithm for the plugin -- Paul Boddie: Desktop module for open files in web browser cross platform -- Print-Color and Print-Grayscale tmThemes were derived from Monokai Bright - -#Version 0.5.7 -- Better tooltips for annotations (they now follow the mouse) -- Remove workaround to fix gaps in background color (it is recommended to just use a reliable font like Courier) -- Change method of underlining annotations to work in wrap mode and non-wrap mode and with background colors -- Fix for CSS in annotation table not handling comment overflow - -#Version 0.5.6 -- Expose filters to ExportBbcode -- Port transparency simulation to ExportBbcode -- Add hue and colorize filters - -#Version 0.5.5 -- Various bug fixes -- Add color filters that can be applied to a theme -- Add shift_brightness to solve an issue I had with copying the html of very dark themes into Outlook at work - -#Version 0.5.0 -- Added ability to define path to save generated html to a specific folder with optional timestamp -- If selection foreground is not defined, use normal colors for text. -- Click annotations to show annotation jump table -- Removed shortcut actions -- Themes are now embedded in the html and can be extracted -- Added toggle plain text option and toggle wrapping (if enababled) -- Added toolbar to print, download theme, disable toggle wrapping (if enabled), toggle annotation jump table (if annotations available), toggle plain text, and toggle gutter -- Exposed toolbar options in configuration (can define any toolbar item to appear) -- Split out javascript into separate files -- Improved and fixed javascript issues - -# Version 0.4.1 -- Add date_time_format and show_full_path options -- Some internal adjustments - -# Version 0.4.0 -- Fix regression with option numbers = false -- Fix issue where if transparency was included in hex color, color would not render -- Fix regression where annotation table would not show - -# Version 0.3.2 -- Allow alternate font size and face via the settings file -- Tweak annotation jump table style and code - -# Version 0.3.1 -- Position annotation jump table in different locations via drop down list - -# Version 0.3.0 -- Add annotation jump table for the HTML. Show table with "alt+double_click" - -# Version 0.2.0 -- Fix issue where html is opened twice -- New annotation feature -- New export to BBCode -- Rename PrintHTML to ExportHTML -- Fix HTML Title (display actual file name of content) -- Update documentation - -# Version 0.1.1 -- Fix status returnd as None for Windows - -# Version 0.1.0 -- Initial release diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Context.sublime-menu b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Context.sublime-menu deleted file mode 100644 index 2cf4afd..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Context.sublime-menu +++ /dev/null @@ -1,8 +0,0 @@ -[ - { "caption": "-" }, - { "caption": "FileDiffs Menu", "command": "file_diff_menu" }, - { "caption": "Diff Selections", "command": "file_diff_selections" }, - { "caption": "Diff with Clipboard", "command": "file_diff_clipboard" }, - { "caption": "Diff with Saved", "command": "file_diff_saved" }, - { "caption": "-" } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Default.sublime-commands b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Default.sublime-commands deleted file mode 100644 index 596557d..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Default.sublime-commands +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "caption": "FileDiffs: Menu", - "command": "file_diff_menu" - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Example.sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Example.sublime-keymap deleted file mode 100644 index 33e5eb1..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Example.sublime-keymap +++ /dev/null @@ -1,3 +0,0 @@ -[ - { "keys": ["ctrl+shift+d"], "command": "file_diff_menu" } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/FileDiffs.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/FileDiffs.sublime-settings deleted file mode 100644 index c6f0b9d..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/FileDiffs.sublime-settings +++ /dev/null @@ -1,31 +0,0 @@ -// You can set a command like this -// "cmd": ["command", "$file1", "$file2"] - -// You can also include other command line parameters like this -// "cmd": ["command", "-parameter1", "-parameter2", "$file1", "$file2"] - -{ - // just uncomment one of the examples - // or write your own command - // NOTE: Copy/paste example below or write your own command in: Package Settings --> FileDiffs --> Settings - User - // This file will be overwritten if the package is updated. - - // opendiff (FileMerge) - // "cmd": ["opendiff", "$file1", "$file2"] - - // ksdiff (Kaleidoscope) - // "cmd": ["ksdiff", "$file1", "$file2"] - - // "open_in_sublime": false - // twdiff (Textwrangler) - // "cmd": ["twdiff", "$file1", "$file2"] - - // bbdiff (BBEdit) NOTE: Use example below if you receive error. - // "cmd": ["bbdiff", "$file1", "$file2"] - - // bbdiff (BBEdit) - // "cmd" ["/usr/local/bin/bbdiff", "$file1", "$file2"] - - // deltawalker (DeltaWalker) - // "cmd": ["deltawalker", "-nosplash", "$file1", "$file2"] -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/LICENSE b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/LICENSE deleted file mode 100644 index 8da8c54..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2012, Colin T.A. Gray -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those -of the authors and should not be interpreted as representing official policies, -either expressed or implied, of this project. diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Main.sublime-menu b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Main.sublime-menu deleted file mode 100644 index edb3be8..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Main.sublime-menu +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "caption": "Preferences", - "mnemonic": "n", - "id": "preferences", - "children": - [ - { - "caption": "Package Settings", - "mnemonic": "P", - "id": "package-settings", - "children": - [ - { - "caption": "FileDiffs", - "children": - [ - { "command": "open_file", "args": {"file": "${packages}/FileDiffs/FileDiffs.sublime-settings"}, "caption": "Settings – Default" }, - { "command": "open_file", "args": {"file": "${packages}/User/FileDiffs.sublime-settings"}, "caption": "Settings – User" }, - { "caption": "-" } - ] - } - ] - } - ] - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/README.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/README.md deleted file mode 100644 index 91c3161..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/README.md +++ /dev/null @@ -1,64 +0,0 @@ -FileDiffs Plugin for Sublime Text 2 -=================================== - -Shows diffs - also in an external diff tool - between the current file, or selection(s) in the current file, and clipboard, another file, or unsaved changes. - - -Installation ------------- - -### Sublime Text 2 - -1. Using Package Control, install "FileDiffs" - -Or: - -1. Open the Sublime Text 2 Packages folder - - - OS X: ~/Library/Application Support/Sublime Text 2/Packages/ - - Windows: %APPDATA%/Sublime Text 2/Packages/ - - Linux: ~/.Sublime Text 2/Packages/ or ~/.config/sublime-text-2/Packages - -2. clone this repo -3. Install keymaps for the commands (see Example.sublime-keymap for my preferred keys) - -### Sublime Text 3 - -1. Open the Sublime Text 2 Packages folder -2. clone this repo, but use the `st3` branch - - git clone -b st3 git@github.com:colinta/SublimeFileDiffs - -Add External Diff Tool --------- - -(IMPORTANT: Dont forget to make a correct symlink (e.g. in /usr/bin) pointing to the command line tool of your external diff tool) - -1. Preferences > Package Settings > FileDiffs > Settings - Default - -2. Uncomment one of the examples or write you own command to open external diff tool. - - -Commands --------- - -`file_diff_menu`: Shows a menu to select one of the file_diff commands. Bound to `ctrl+shift+d`. - -The rest of the commands are not bound by default: - -`file_diff_clipboard`: Shows the diff of the current file or selection(s) and the clipboard (the clipboard is considered the "new" file unless `reverse` is True) - -`file_diff_selections`: Shows the diff of the first and second selected regions. The file_diff_menu command checks for exactly two regions selected, otherwise it doesn't display this command. - -`file_diff_saved`: Shows the diff of the current file or selection(s) and the saved file. - -`file_diff_file`: Shows the diff of the current file or selection(s) and a file that is in the current project. - -`file_diff_tab`: Shows the diff of the current file or selection(s) and an open file (aka a file that has a tab). - -Help! ------ - -Check the [wiki][] for more tips - -[wiki]: https://github.com/colinta/SublimeFileDiffs/wiki diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Side Bar.sublime-menu b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Side Bar.sublime-menu deleted file mode 100644 index 3200757..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Side Bar.sublime-menu +++ /dev/null @@ -1,6 +0,0 @@ -[ - { "caption": "-" }, - { "caption": "FileDiffs Menu", "command": "file_diff_menu" }, - { "caption": "Diff with File in Project…", "command": "file_diff_file" }, - { "caption": "-" } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Tab Context.sublime-menu b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Tab Context.sublime-menu deleted file mode 100644 index 2a7fc9e..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/Tab Context.sublime-menu +++ /dev/null @@ -1,6 +0,0 @@ -[ - { "caption": "-" }, - { "caption": "FileDiffs Menu", "command": "file_diff_menu" }, - { "caption": "Diff with Tab…", "command": "file_diff_tab" }, - { "caption": "-" } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/file_diffs.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/file_diffs.py deleted file mode 100644 index 7aa5c2d..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/file_diffs.py +++ /dev/null @@ -1,294 +0,0 @@ -# coding: utf8 -import os -import re - -import sublime -import sublime_plugin -import difflib -import tempfile - -from fnmatch import fnmatch -import codecs - -SETTINGS = sublime.load_settings('FileDiffs.sublime-settings') - -CLIPBOARD = u'Diff file with Clipboard' -SELECTIONS = u'Diff Selections' -SAVED = u'Diff file with Saved' -FILE = u'Diff file with File in Project…' -TAB = u'Diff file with Open Tab…' - -FILE_DIFFS = [CLIPBOARD, SAVED, FILE, TAB] - - -class FileDiffMenuCommand(sublime_plugin.TextCommand): - def run(self, edit): - menu_items = FILE_DIFFS[:] - saved = SAVED - non_empty_regions = [region for region in self.view.sel() if not region.empty()] - if len(non_empty_regions) == 2: - menu_items.insert(1, SELECTIONS) - elif len(non_empty_regions): - menu_items = [f.replace(u'Diff file', u'Diff selection') for f in menu_items] - saved = saved.replace(u'Diff file', u'Diff selection') - - if not (self.view.file_name() and self.view.is_dirty()): - menu_items.remove(saved) - - def on_done(index): - restored_menu_items = [f.replace(u'Diff selection', u'Diff file') for f in menu_items] - if index == -1: - return - elif restored_menu_items[index] == CLIPBOARD: - self.view.run_command('file_diff_clipboard') - elif restored_menu_items[index] == SELECTIONS: - self.view.run_command('file_diff_selections') - elif restored_menu_items[index] == SAVED: - self.view.run_command('file_diff_saved') - elif restored_menu_items[index] == FILE: - self.view.run_command('file_diff_file') - elif restored_menu_items[index] == TAB: - self.view.run_command('file_diff_tab') - self.view.window().show_quick_panel(menu_items, on_done) - - -class FileDiffCommand(sublime_plugin.TextCommand): - def diff_content(self): - content = '' - - regions = [region for region in self.view.sel()] - for region in regions: - if region.empty(): - continue - content += self.view.substr(region) - - if not content: - content = self.view.substr(sublime.Region(0, self.view.size())) - return content - - def run_diff(self, a, b, from_file=None, to_file=None): - from_content = a - to_content = b - - if os.path.exists(a): - if from_file is None: - from_file = a - with codecs.open(from_file, mode='U', encoding='utf-8') as f: - from_content = f.readlines() - else: - from_content = a.splitlines(True) - if from_file is None: - from_file = 'from_file' - - if os.path.exists(b): - if to_file is None: - to_file = b - with codecs.open(to_file, mode='U', encoding='utf-8') as f: - to_content = f.readlines() - else: - to_content = b.splitlines(True) - if to_file is None: - to_file = 'to_file' - - diffs = list(difflib.unified_diff(from_content, to_content, from_file, to_file)) - - open_in_sublime = SETTINGS.get('open_in_sublime', True) - external_command = SETTINGS.get('cmd') - if not diffs: - sublime.status_message('No Difference') - else: - if external_command: - self.diff_with_external(a, b, from_file, to_file) - - if open_in_sublime: - # fix diffs - diffs = map(lambda line: (line and line[-1] == "\n") and line or line + "\n", diffs) - self.diff_in_sublime(diffs) - - def diff_with_external(self, a, b, from_file=None, to_file=None): - try: - if not os.path.exists(from_file): - tmp_file = tempfile.NamedTemporaryFile(delete=False) - from_file = tmp_file.name - tmp_file.close() - - with codecs.open(from_file, encoding='utf-8', mode='w+') as tmp_file: - tmp_file.write(a) - - if not os.path.exists(to_file): - tmp_file = tempfile.NamedTemporaryFile(delete=False) - to_file = tmp_file.name - tmp_file.close() - - with codecs.open(to_file, encoding='utf-8', mode='w+') as tmp_file: - tmp_file.write(b) - - if os.path.exists(from_file): - command = SETTINGS.get('cmd') - if command is not None: - command = [c.replace(u'$file1', from_file) for c in command] - command = [c.replace(u'$file2', to_file) for c in command] - self.view.window().run_command("exec", {"cmd": command}) - except Exception as e: - # some basic logging here, since we are cluttering the /tmp folder - print repr(e) - sublime.status_message(str(e)) - - def diff_in_sublime(self, diffs): - scratch = self.view.window().new_file() - scratch.set_scratch(True) - scratch.set_syntax_file('Packages/Diff/Diff.tmLanguage') - scratch_edit = scratch.begin_edit('file_diffs') - scratch.insert(scratch_edit, 0, ''.join(diffs)) - scratch.end_edit(scratch_edit) - - -class FileDiffClipboardCommand(FileDiffCommand): - def run(self, edit, **kwargs): - current = sublime.get_clipboard() - self.run_diff(self.diff_content(), current, - from_file=self.view.file_name(), - to_file='(clipboard)') - - -class FileDiffSelectionsCommand(FileDiffCommand): - def run(self, edit, **kwargs): - regions = self.view.sel() - current = self.view.substr(regions[0]) - diff = self.view.substr(regions[1]) - - # trim off indent - indent = None - for line in current.splitlines(): - new_indent = re.match('[ \t]*', line).group(0) - if new_indent == '': - continue - - if indent is None: - indent = new_indent - elif len(new_indent) < len(indent): - indent = new_indent - - if not indent: - break - - if indent: - current = u"\n".join(line[len(indent):] for line in current.splitlines()) - - # trim off indent - indent = None - for line in diff.splitlines(): - new_indent = re.match('[ \t]*', line).group(0) - if new_indent == '': - continue - - if indent is None: - indent = new_indent - elif len(new_indent) < len(indent): - indent = new_indent - - if indent: - diff = u"\n".join(line[len(indent):] for line in diff.splitlines()) - - self.run_diff(current, diff, - from_file='first selection', - to_file='second selection') - - -class FileDiffSavedCommand(FileDiffCommand): - def run(self, edit, **kwargs): - content = '' - regions = [region for region in self.view.sel()] - for region in regions: - if region.empty(): - continue - content += self.view.substr(region) - if not content: - content = self.view.substr(sublime.Region(0, self.view.size())) - - self.run_diff(self.view.file_name(), content, - from_file=self.view.file_name(), - to_file=self.view.file_name() + u' (Unsaved)') - - -class FileDiffFileCommand(FileDiffCommand): - def run(self, edit, **kwargs): - common = None - folders = self.view.window().folders() - files = self.find_files(folders) - for folder in folders: - if common == None: - common = folder - else: - common_len = len(common) - while folder[0:common_len] != common[0:common_len]: - common_len -= 1 - common = common[0:common_len] - - my_file = self.view.file_name() - # filter out my_file - files = [file for file in files if file != my_file] - # shorten names using common length - file_picker = [file[len(common):] for file in files] - - def on_done(index): - if index > -1: - self.run_diff(self.diff_content(), files[index], - from_file=self.view.file_name()) - self.view.window().show_quick_panel(file_picker, on_done) - - def find_files(self, folders): - # Cannot access these settings!! WHY!? - # folder_exclude_patterns = self.view.settings().get('folder_exclude_patterns') - # file_exclude_patterns = self.view.settings().get('file_exclude_patterns') - folder_exclude_patterns = [".svn", ".git", ".hg", "CVS"] - file_exclude_patterns = ["*.pyc", "*.pyo", "*.exe", "*.dll", "*.obj", "*.o", "*.a", "*.lib", "*.so", "*.dylib", "*.ncb", "*.sdf", "*.suo", "*.pdb", "*.idb", ".DS_Store", "*.class", "*.psd", "*.db"] - - ret = [] - for folder in folders: - if not os.path.isdir(folder): - continue - - for file in os.listdir(folder): - fullpath = os.path.join(folder, file) - if os.path.isdir(fullpath): - # excluded folder? - if not len([True for pattern in folder_exclude_patterns if fnmatch(file, pattern)]): - ret += self.find_files([fullpath]) - else: - # excluded file? - if not len([True for pattern in file_exclude_patterns if fnmatch(file, pattern)]): - ret.append(fullpath) - return ret - - -class FileDiffTabCommand(FileDiffCommand): - def run(self, edit, **kwargs): - my_id = self.view.id() - files = [] - contents = [] - untitled_count = 1 - for v in self.view.window().views(): - if v.id() != my_id: - this_content = v.substr(sublime.Region(0, v.size())) - if v.file_name(): - files.append(v.file_name()) - elif v.name(): - files.append(v.name()) - else: - files.append('untitled %d' % untitled_count) - untitled_count += 1 - - contents.append(this_content) - - def on_done(index): - if index > -1: - self.run_diff(self.diff_content(), contents[index], - from_file=self.view.file_name(), - to_file=files[index]) - - if len(files) == 1: - on_done(0) - else: - menu_items = [os.path.basename(f) for f in files] - self.view.window().show_quick_panel(menu_items, on_done) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/package-metadata.json deleted file mode 100644 index ea4ac7a..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://github.com/colinta/SublimeFileDiffs", "version": "2013.07.09.15.11.56", "description": "Shows diffs between the current file, or selection(s) in the current file, and clipboard, another file, or unsaved changes."} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/package.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/package.json deleted file mode 100644 index d78b90a..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/FileDiffs/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "repo": "SublimeFileDiffs", - "name": "FileDiffs", - "description": "Shows diffs - also in an external diff tool - between the current file, or selection(s) in the current file, and clipboard, another file, or unsaved changes.", - "author": "Colin Thomas-Arnold (colinta), Sebastian Pape (spape), Jiri Urban (jiriurban)", - "homepage": "https://github.com/spape/SublimeFileDiffs" -} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/LiveReload/LiveReload.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/LiveReload/LiveReload.sublime-settings deleted file mode 100644 index 8dc3ca9..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/LiveReload/LiveReload.sublime-settings +++ /dev/null @@ -1,8 +0,0 @@ -{ - "version" : "1.6" - , "port" : 35729 - , "delay_ms" : 100 - , "apply_js_live" : false - , "apply_css_live" : true - , "apply_images_live" : true -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/LiveReload/Main.sublime-menu b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/LiveReload/Main.sublime-menu deleted file mode 100644 index 8622061..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/LiveReload/Main.sublime-menu +++ /dev/null @@ -1,39 +0,0 @@ -[ - { - "caption": "Preferences", - "mnemonic": "n", - "id": "preferences", - "children": - [ - { - "caption": "Package Settings", - "mnemonic": "P", - "id": "package-settings", - "children": - [ - { - "caption": "LiveReload", - "children": - [ - { - "command": "open_file", "args": - { - "file": "${packages}/LiveReload/LiveReload.sublime-settings" - }, - "caption": "Settings – Default" - }, - { - "command": "open_file", "args": - { - "file": "${packages}/User/LiveReload.sublime-settings" - }, - "caption": "Settings – User" - }, - { "caption": "-" } - ] - } - ] - } - ] - } -] \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/LiveReload/README.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/LiveReload/README.md deleted file mode 100644 index bf14a91..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/LiveReload/README.md +++ /dev/null @@ -1,62 +0,0 @@ -LiveReload for Sublime Text 2 -========= - -A web browser page reloading plugin for the [Sublime Text 2](http://sublimetext.com "Sublime Text 2") editor. - -Installing ------ - -Install with [Sublime Package Control](http://wbond.net/sublime_packages/package_control "Sublime Package Control"), search for LiveReload and install. - -Devel branch ------ -Have a look at [devel version](https://github.com/dz0ny/LiveReload-sublimetext2/tree/devel). Which is total rewrite of plugin, supporting SublimeText 3, plugins and much more. - -Browser extensions ------ -You can use both major LiveReload versions. For old one you can find instructions bellow, for new ones please visit [New browser extensions](http://help.livereload.com/kb/general-use/browser-extensions "New browser extensions") or try [self loading version](http://help.livereload.com/kb/general-use/using-livereload-without-browser-extensions "self loading version"). - - -### [Google Chrome extension](https://chrome.google.com/extensions/detail/jnihajbhpnppcggbcgedagnkighmdlei) - -![](https://github.com/mockko/livereload/raw/master/docs/images/chrome-install-prompt.png) - -Click “Install”. Actually, LiveReload does not access your browser history. The warning is misleading. - -![](https://github.com/mockko/livereload/raw/master/docs/images/chrome-button.png) - -If you want to use it with local files, be sure to enable “Allow access to file URLs” checkbox in Tools > Extensions > LiveReload after installation. - -### Safari extension - -For now it only works with self loading version: - - - - -### [Firefox 4 extension](http://feedback.livereload.com/knowledgebase/articles/86242-how-do-i-install-and-use-the-browser-extensions-) - -![](http://static-cdn.addons.mozilla.net/img/uploads/previews/full/63/63478.png?modified=1317506904) - - -## Usage - -Now, if you are using Safari, right-click the page you want to be livereload'ed and choose “Enable LiveReload”: - -![](https://github.com/mockko/livereload/raw/master/docs/images/safari-context-menu.png) - -If you are using Chrome, just click the toolbar button (it will turn green to indicate that LiveReload is active). - ----- - -You can also use the Preferences menu to change port, version and type of reloading(full, js,css). - -## Compass - -![](http://cdn.nmecdesign.com/wp/wp-content/uploads/2011/12/Compass-Logo.png) - -Want to use Livereload with compass ? Now you can ! - -.scss and .css have to be in the same directory , if no config.rb file is found one will automatically generated ! - -So if you want to start using compass, install compass gem, edit a xxx.scss file and voila ! A .css file would be automatically generated. diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/LiveReload/assets/config.rb b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/LiveReload/assets/config.rb deleted file mode 100644 index 10577cd..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/LiveReload/assets/config.rb +++ /dev/null @@ -1,8 +0,0 @@ -http_path = "/" -css_dir = "." -sass_dir = "." -images_dir = "img" -javascripts_dir = "js" -output_style = :compressed -relative_assets=true -line_comments = false \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/LiveReload/livereload.js b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/LiveReload/livereload.js deleted file mode 100644 index 3a14a06..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/LiveReload/livereload.js +++ /dev/null @@ -1,942 +0,0 @@ -(function() { -var __customevents = {}, __protocol = {}, __connector = {}, __timer = {}, __options = {}, __reloader = {}, __livereload = {}, __less = {}, __startup = {}; - -// customevents -var CustomEvents; -CustomEvents = { - bind: function(element, eventName, handler) { - if (element.addEventListener) { - return element.addEventListener(eventName, handler, false); - } else if (element.attachEvent) { - element[eventName] = 1; - return element.attachEvent('onpropertychange', function(event) { - if (event.propertyName === eventName) { - return handler(); - } - }); - } else { - throw new Error("Attempt to attach custom event " + eventName + " to something which isn't a DOMElement"); - } - }, - fire: function(element, eventName) { - var event; - if (element.addEventListener) { - event = document.createEvent('HTMLEvents'); - event.initEvent(eventName, true, true); - return document.dispatchEvent(event); - } else if (element.attachEvent) { - if (element[eventName]) { - return element[eventName]++; - } - } else { - throw new Error("Attempt to fire custom event " + eventName + " on something which isn't a DOMElement"); - } - } -}; -__customevents.bind = CustomEvents.bind; -__customevents.fire = CustomEvents.fire; - -// protocol -var PROTOCOL_6, PROTOCOL_7, Parser, ProtocolError; -var __indexOf = Array.prototype.indexOf || function(item) { - for (var i = 0, l = this.length; i < l; i++) { - if (this[i] === item) return i; - } - return -1; -}; -__protocol.PROTOCOL_6 = PROTOCOL_6 = 'http://livereload.com/protocols/official-6'; -__protocol.PROTOCOL_7 = PROTOCOL_7 = 'http://livereload.com/protocols/official-7'; -__protocol.ProtocolError = ProtocolError = (function() { - function ProtocolError(reason, data) { - this.message = "LiveReload protocol error (" + reason + ") after receiving data: \"" + data + "\"."; - } - return ProtocolError; -})(); -__protocol.Parser = Parser = (function() { - function Parser(handlers) { - this.handlers = handlers; - this.reset(); - } - Parser.prototype.reset = function() { - return this.protocol = null; - }; - Parser.prototype.process = function(data) { - var command, message, options, _ref; - try { - if (!(this.protocol != null)) { - if (data.match(/^!!ver:([\d.]+)$/)) { - this.protocol = 6; - } else if (message = this._parseMessage(data, ['hello'])) { - if (!message.protocols.length) { - throw new ProtocolError("no protocols specified in handshake message"); - } else if (__indexOf.call(message.protocols, PROTOCOL_7) >= 0) { - this.protocol = 7; - } else if (__indexOf.call(message.protocols, PROTOCOL_6) >= 0) { - this.protocol = 6; - } else { - throw new ProtocolError("no supported protocols found"); - } - } - return this.handlers.connected(this.protocol); - } else if (this.protocol === 6) { - message = JSON.parse(data); - if (!message.length) { - throw new ProtocolError("protocol 6 messages must be arrays"); - } - command = message[0], options = message[1]; - if (command !== 'refresh') { - throw new ProtocolError("unknown protocol 6 command"); - } - return this.handlers.message({ - command: 'reload', - path: options.path, - liveCSS: (_ref = options.apply_css_live) != null ? _ref : true - }); - } else { - message = this._parseMessage(data, ['reload', 'alert']); - return this.handlers.message(message); - } - } catch (e) { - if (e instanceof ProtocolError) { - return this.handlers.error(e); - } else { - throw e; - } - } - }; - Parser.prototype._parseMessage = function(data, validCommands) { - var message, _ref; - try { - message = JSON.parse(data); - } catch (e) { - throw new ProtocolError('unparsable JSON', data); - } - if (!message.command) { - throw new ProtocolError('missing "command" key', data); - } - if (_ref = message.command, __indexOf.call(validCommands, _ref) < 0) { - throw new ProtocolError("invalid command '" + message.command + "', only valid commands are: " + (validCommands.join(', ')) + ")", data); - } - return message; - }; - return Parser; -})(); - -// connector -var Connector, PROTOCOL_6, PROTOCOL_7, Parser, Version, _ref; - -_ref = __protocol, Parser = _ref.Parser, PROTOCOL_6 = _ref.PROTOCOL_6, PROTOCOL_7 = _ref.PROTOCOL_7; - -Version = '2.0.7'; - -__connector.Connector = Connector = (function() { - - function Connector(options, WebSocket, Timer, handlers) { - var _this = this; - this.options = options; - this.WebSocket = WebSocket; - this.Timer = Timer; - this.handlers = handlers; - this._uri = "ws://" + this.options.host + ":" + this.options.port + "/livereload"; - this._nextDelay = this.options.mindelay; - this._connectionDesired = false; - this.protocol = 0; - this.protocolParser = new Parser({ - connected: function(protocol) { - _this.protocol = protocol; - _this._handshakeTimeout.stop(); - _this._nextDelay = _this.options.mindelay; - _this._disconnectionReason = 'broken'; - return _this.handlers.connected(protocol); - }, - error: function(e) { - _this.handlers.error(e); - return _this._closeOnError(); - }, - message: function(message) { - return _this.handlers.message(message); - } - }); - this._handshakeTimeout = new Timer(function() { - if (!_this._isSocketConnected()) return; - _this._disconnectionReason = 'handshake-timeout'; - return _this.socket.close(); - }); - this._reconnectTimer = new Timer(function() { - if (!_this._connectionDesired) return; - return _this.connect(); - }); - this.connect(); - } - - Connector.prototype._isSocketConnected = function() { - return this.socket && this.socket.readyState === this.WebSocket.OPEN; - }; - - Connector.prototype.connect = function() { - var _this = this; - this._connectionDesired = true; - if (this._isSocketConnected()) return; - this._reconnectTimer.stop(); - this._disconnectionReason = 'cannot-connect'; - this.protocolParser.reset(); - this.handlers.connecting(); - this.socket = new this.WebSocket(this._uri); - this.socket.onopen = function(e) { - return _this._onopen(e); - }; - this.socket.onclose = function(e) { - return _this._onclose(e); - }; - this.socket.onmessage = function(e) { - return _this._onmessage(e); - }; - return this.socket.onerror = function(e) { - return _this._onerror(e); - }; - }; - - Connector.prototype.disconnect = function() { - this._connectionDesired = false; - this._reconnectTimer.stop(); - if (!this._isSocketConnected()) return; - this._disconnectionReason = 'manual'; - return this.socket.close(); - }; - - Connector.prototype._scheduleReconnection = function() { - if (!this._connectionDesired) return; - if (!this._reconnectTimer.running) { - this._reconnectTimer.start(this._nextDelay); - return this._nextDelay = Math.min(this.options.maxdelay, this._nextDelay * 2); - } - }; - - Connector.prototype.sendCommand = function(command) { - if (this.protocol == null) return; - return this._sendCommand(command); - }; - - Connector.prototype._sendCommand = function(command) { - return this.socket.send(JSON.stringify(command)); - }; - - Connector.prototype._closeOnError = function() { - this._handshakeTimeout.stop(); - this._disconnectionReason = 'error'; - return this.socket.close(); - }; - - Connector.prototype._onopen = function(e) { - var hello; - this.handlers.socketConnected(); - this._disconnectionReason = 'handshake-failed'; - hello = { - command: 'hello', - protocols: [PROTOCOL_6, PROTOCOL_7] - }; - hello.ver = Version; - if (this.options.ext) hello.ext = this.options.ext; - if (this.options.extver) hello.extver = this.options.extver; - if (this.options.snipver) hello.snipver = this.options.snipver; - this._sendCommand(hello); - return this._handshakeTimeout.start(this.options.handshake_timeout); - }; - - Connector.prototype._onclose = function(e) { - this.protocol = 0; - this.handlers.disconnected(this._disconnectionReason, this._nextDelay); - return this._scheduleReconnection(); - }; - - Connector.prototype._onerror = function(e) {}; - - Connector.prototype._onmessage = function(e) { - return this.protocolParser.process(e.data); - }; - - return Connector; - -})(); - -// timer -var Timer; -var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; -__timer.Timer = Timer = (function() { - function Timer(func) { - this.func = func; - this.running = false; - this.id = null; - this._handler = __bind(function() { - this.running = false; - this.id = null; - return this.func(); - }, this); - } - Timer.prototype.start = function(timeout) { - if (this.running) { - clearTimeout(this.id); - } - this.id = setTimeout(this._handler, timeout); - return this.running = true; - }; - Timer.prototype.stop = function() { - if (this.running) { - clearTimeout(this.id); - this.running = false; - return this.id = null; - } - }; - return Timer; -})(); -Timer.start = function(timeout, func) { - return setTimeout(func, timeout); -}; - -// options -var Options; -__options.Options = Options = (function() { - function Options() { - this.host = null; - this.port = 35729; - this.snipver = null; - this.ext = null; - this.extver = null; - this.mindelay = 1000; - this.maxdelay = 60000; - this.handshake_timeout = 5000; - } - Options.prototype.set = function(name, value) { - switch (typeof this[name]) { - case 'undefined': - break; - case 'number': - return this[name] = +value; - default: - return this[name] = value; - } - }; - return Options; -})(); -Options.extract = function(document) { - var element, keyAndValue, m, mm, options, pair, src, _i, _j, _len, _len2, _ref, _ref2; - _ref = document.getElementsByTagName('script'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - element = _ref[_i]; - if ((src = element.src) && (m = src.match(/^[^:]+:\/\/(.*)\/z?livereload\.js(?:\?(.*))?$/))) { - options = new Options(); - if (mm = m[1].match(/^([^\/:]+)(?::(\d+))?$/)) { - options.host = mm[1]; - if (mm[2]) { - options.port = parseInt(mm[2], 10); - } - } - if (m[2]) { - _ref2 = m[2].split('&'); - for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { - pair = _ref2[_j]; - if ((keyAndValue = pair.split('=')).length > 1) { - options.set(keyAndValue[0].replace(/-/g, '_'), keyAndValue.slice(1).join('=')); - } - } - } - return options; - } - } - return null; -}; - -// reloader -var IMAGE_STYLES, Reloader, numberOfMatchingSegments, pathFromUrl, pathsMatch, pickBestMatch, splitUrl; - -splitUrl = function(url) { - var hash, index, params; - if ((index = url.indexOf('#')) >= 0) { - hash = url.slice(index); - url = url.slice(0, index); - } else { - hash = ''; - } - if ((index = url.indexOf('?')) >= 0) { - params = url.slice(index); - url = url.slice(0, index); - } else { - params = ''; - } - return { - url: url, - params: params, - hash: hash - }; -}; - -pathFromUrl = function(url) { - var path; - url = splitUrl(url).url; - if (url.indexOf('file://') === 0) { - path = url.replace(/^file:\/\/(localhost)?/, ''); - } else { - path = url.replace(/^([^:]+:)?\/\/([^:\/]+)(:\d*)?\//, '/'); - } - return decodeURIComponent(path); -}; - -pickBestMatch = function(path, objects, pathFunc) { - var bestMatch, object, score, _i, _len; - bestMatch = { - score: 0 - }; - for (_i = 0, _len = objects.length; _i < _len; _i++) { - object = objects[_i]; - score = numberOfMatchingSegments(path, pathFunc(object)); - if (score > bestMatch.score) { - bestMatch = { - object: object, - score: score - }; - } - } - if (bestMatch.score > 0) { - return bestMatch; - } else { - return null; - } -}; - -numberOfMatchingSegments = function(path1, path2) { - var comps1, comps2, eqCount, len; - path1 = path1.replace(/^\/+/, '').toLowerCase(); - path2 = path2.replace(/^\/+/, '').toLowerCase(); - if (path1 === path2) return 10000; - comps1 = path1.split('/').reverse(); - comps2 = path2.split('/').reverse(); - len = Math.min(comps1.length, comps2.length); - eqCount = 0; - while (eqCount < len && comps1[eqCount] === comps2[eqCount]) { - ++eqCount; - } - return eqCount; -}; - -pathsMatch = function(path1, path2) { - return numberOfMatchingSegments(path1, path2) > 0; -}; - -IMAGE_STYLES = [ - { - selector: 'background', - styleNames: ['backgroundImage'] - }, { - selector: 'border', - styleNames: ['borderImage', 'webkitBorderImage', 'MozBorderImage'] - } -]; - -__reloader.Reloader = Reloader = (function() { - - function Reloader(window, console, Timer) { - this.window = window; - this.console = console; - this.Timer = Timer; - this.document = this.window.document; - this.stylesheetGracePeriod = 200; - this.importCacheWaitPeriod = 200; - this.plugins = []; - } - - Reloader.prototype.addPlugin = function(plugin) { - return this.plugins.push(plugin); - }; - - Reloader.prototype.analyze = function(callback) { - return results; - }; - - Reloader.prototype.reload = function(path, options) { - var plugin, _i, _len, _ref; - this.options = options; - _ref = this.plugins; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - plugin = _ref[_i]; - if (plugin.reload && plugin.reload(path, options)) return; - } - if (options.liveCSS) { - if (path.match(/\.css$/i)) if (this.reloadStylesheet(path)) return; - } - if (options.liveImg) { - if (path.match(/\.(jpe?g|png|gif)$/i)) { - this.reloadImages(path); - return; - } - } - return this.reloadPage(); - }; - - Reloader.prototype.reloadPage = function() { - return this.window.document.location.reload(); - }; - - Reloader.prototype.reloadImages = function(path) { - var expando, img, selector, styleNames, styleSheet, _i, _j, _k, _l, _len, _len2, _len3, _len4, _ref, _ref2, _ref3, _ref4, _results; - expando = this.generateUniqueString(); - _ref = this.document.images; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - img = _ref[_i]; - if (pathsMatch(path, pathFromUrl(img.src))) { - img.src = this.generateCacheBustUrl(img.src, expando); - } - } - if (this.document.querySelectorAll) { - for (_j = 0, _len2 = IMAGE_STYLES.length; _j < _len2; _j++) { - _ref2 = IMAGE_STYLES[_j], selector = _ref2.selector, styleNames = _ref2.styleNames; - _ref3 = this.document.querySelectorAll("[style*=" + selector + "]"); - for (_k = 0, _len3 = _ref3.length; _k < _len3; _k++) { - img = _ref3[_k]; - this.reloadStyleImages(img.style, styleNames, path, expando); - } - } - } - if (this.document.styleSheets) { - _ref4 = this.document.styleSheets; - _results = []; - for (_l = 0, _len4 = _ref4.length; _l < _len4; _l++) { - styleSheet = _ref4[_l]; - _results.push(this.reloadStylesheetImages(styleSheet, path, expando)); - } - return _results; - } - }; - - Reloader.prototype.reloadStylesheetImages = function(styleSheet, path, expando) { - var rule, rules, styleNames, _i, _j, _len, _len2; - try { - rules = styleSheet != null ? styleSheet.cssRules : void 0; - } catch (e) { - - } - if (!rules) return; - for (_i = 0, _len = rules.length; _i < _len; _i++) { - rule = rules[_i]; - switch (rule.type) { - case CSSRule.IMPORT_RULE: - this.reloadStylesheetImages(rule.styleSheet, path, expando); - break; - case CSSRule.STYLE_RULE: - for (_j = 0, _len2 = IMAGE_STYLES.length; _j < _len2; _j++) { - styleNames = IMAGE_STYLES[_j].styleNames; - this.reloadStyleImages(rule.style, styleNames, path, expando); - } - break; - case CSSRule.MEDIA_RULE: - this.reloadStylesheetImages(rule, path, expando); - } - } - }; - - Reloader.prototype.reloadStyleImages = function(style, styleNames, path, expando) { - var newValue, styleName, value, _i, _len; - var _this = this; - for (_i = 0, _len = styleNames.length; _i < _len; _i++) { - styleName = styleNames[_i]; - value = style[styleName]; - if (typeof value === 'string') { - newValue = value.replace(/\burl\s*\(([^)]*)\)/, function(match, src) { - if (pathsMatch(path, pathFromUrl(src))) { - return "url(" + (_this.generateCacheBustUrl(src, expando)) + ")"; - } else { - return match; - } - }); - if (newValue !== value) style[styleName] = newValue; - } - } - }; - - Reloader.prototype.reloadStylesheet = function(path) { - var imported, link, links, match, style, _i, _j, _k, _len, _len2, _len3, _ref; - links = (function() { - var _i, _len, _ref, _results; - _ref = this.document.getElementsByTagName('link'); - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; - if (link.rel === 'stylesheet' && !link.__LiveReload_pendingRemoval) { - _results.push(link); - } - } - return _results; - }).call(this); - imported = []; - _ref = this.document.getElementsByTagName('style'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - style = _ref[_i]; - if (style.sheet) { - this.collectImportedStylesheets(style, style.sheet, imported); - } - } - for (_j = 0, _len2 = links.length; _j < _len2; _j++) { - link = links[_j]; - this.collectImportedStylesheets(link, link.sheet, imported); - } - this.console.log("LiveReload found " + links.length + " LINKed stylesheets, " + imported.length + " @imported stylesheets"); - match = pickBestMatch(path, links.concat(imported), function(l) { - return pathFromUrl(l.href); - }); - if (match) { - if (match.object.rule) { - this.console.log("LiveReload is reloading imported stylesheet: " + match.object.href); - this.reattachImportedRule(match.object); - } else { - this.console.log("LiveReload is reloading stylesheet: " + match.object.href); - this.reattachStylesheetLink(match.object); - } - } else { - this.console.log("LiveReload will reload all stylesheets because path '" + path + "' did not match any specific one"); - for (_k = 0, _len3 = links.length; _k < _len3; _k++) { - link = links[_k]; - this.reattachStylesheetLink(link); - } - } - return true; - }; - - Reloader.prototype.collectImportedStylesheets = function(link, styleSheet, result) { - var index, rule, rules, _len; - try { - rules = styleSheet != null ? styleSheet.cssRules : void 0; - } catch (e) { - - } - if (rules && rules.length) { - for (index = 0, _len = rules.length; index < _len; index++) { - rule = rules[index]; - switch (rule.type) { - case CSSRule.CHARSET_RULE: - continue; - case CSSRule.IMPORT_RULE: - result.push({ - link: link, - rule: rule, - index: index, - href: rule.href - }); - this.collectImportedStylesheets(link, rule.styleSheet, result); - break; - default: - break; - } - } - } - }; - - Reloader.prototype.reattachStylesheetLink = function(link) { - var clone, parent, timer; - if (link.__LiveReload_pendingRemoval) return; - link.__LiveReload_pendingRemoval = true; - clone = link.cloneNode(false); - clone.href = this.generateCacheBustUrl(link.href); - parent = link.parentNode; - if (parent.lastChild === link) { - parent.appendChild(clone); - } else { - parent.insertBefore(clone, link.nextSibling); - } - timer = new this.Timer(function() { - if (link.parentNode) return link.parentNode.removeChild(link); - }); - return timer.start(this.stylesheetGracePeriod); - }; - - Reloader.prototype.reattachImportedRule = function(_arg) { - var href, index, link, media, newRule, parent, rule, tempLink; - var _this = this; - rule = _arg.rule, index = _arg.index, link = _arg.link; - parent = rule.parentStyleSheet; - href = this.generateCacheBustUrl(rule.href); - media = rule.media.length ? [].join.call(rule.media, ', ') : ''; - newRule = "@import url(\"" + href + "\") " + media + ";"; - rule.__LiveReload_newHref = href; - tempLink = this.document.createElement("link"); - tempLink.rel = 'stylesheet'; - tempLink.href = href; - tempLink.__LiveReload_pendingRemoval = true; - if (link.parentNode) link.parentNode.insertBefore(tempLink, link); - return this.Timer.start(this.importCacheWaitPeriod, function() { - if (tempLink.parentNode) tempLink.parentNode.removeChild(tempLink); - if (rule.__LiveReload_newHref !== href) return; - parent.insertRule(newRule, index); - parent.deleteRule(index + 1); - rule = parent.cssRules[index]; - rule.__LiveReload_newHref = href; - return _this.Timer.start(_this.importCacheWaitPeriod, function() { - if (rule.__LiveReload_newHref !== href) return; - parent.insertRule(newRule, index); - return parent.deleteRule(index + 1); - }); - }); - }; - - Reloader.prototype.generateUniqueString = function() { - return 'livereload=' + Date.now(); - }; - - Reloader.prototype.generateCacheBustUrl = function(url, expando) { - var hash, oldParams, params, _ref; - if (expando == null) expando = this.generateUniqueString(); - _ref = splitUrl(url), url = _ref.url, hash = _ref.hash, oldParams = _ref.params; - if (this.options.overrideURL) { - if (url.indexOf(this.options.serverURL) < 0) { - url = this.options.serverURL + this.options.overrideURL + "?url=" + encodeURIComponent(url); - } - } - params = oldParams.replace(/(\?|&)livereload=(\d+)/, function(match, sep) { - return "" + sep + expando; - }); - if (params === oldParams) { - if (oldParams.length === 0) { - params = "?" + expando; - } else { - params = "" + oldParams + "&" + expando; - } - } - return url + params + hash; - }; - - return Reloader; - -})(); - -// livereload -var Connector, LiveReload, Options, Reloader, Timer; - -Connector = __connector.Connector; - -Timer = __timer.Timer; - -Options = __options.Options; - -Reloader = __reloader.Reloader; - -__livereload.LiveReload = LiveReload = (function() { - - function LiveReload(window) { - var _this = this; - this.window = window; - this.listeners = {}; - this.plugins = []; - this.pluginIdentifiers = {}; - this.console = this.window.location.href.match(/LR-verbose/) && this.window.console && this.window.console.log && this.window.console.error ? this.window.console : { - log: function() {}, - error: function() {} - }; - if (!(this.WebSocket = this.window.WebSocket || this.window.MozWebSocket)) { - console.error("LiveReload disabled because the browser does not seem to support web sockets"); - return; - } - if (!(this.options = Options.extract(this.window.document))) { - console.error("LiveReload disabled because it could not find its own " % load_utf8(js_file) - else: - scripts += u"" % js_file - return scripts - - def get_mathjax(self): - ''' return the MathJax script if enabled ''' - - if self.settings.get('enable_mathjax') is True: - return load_resource('mathjax.html') - return '' - - def get_highlight(self): - ''' return the Highlight.js and css if enabled ''' - - highlight = '' - if self.settings.get('enable_highlight') is True and self.settings.get('parser') == 'default': - highlight += "" % load_resource('highlight.css') - highlight += "" % load_resource('highlight.js') - highlight += "" - return highlight - - - def get_contents(self, wholefile=False): - ''' Get contents or selection from view and optionally strip the YAML front matter ''' - region = sublime.Region(0, self.view.size()) - contents = self.view.substr(region) - if not wholefile: - # use selection if any - selection = self.view.substr(self.view.sel()[0]) - if selection.strip() != '': - contents = selection - if self.settings.get('strip_yaml_front_matter') and contents.startswith('---'): - title = '' - title_match = re.search('(?:title:)(.+)', contents, flags=re.IGNORECASE) - if title_match: - stripped_title = title_match.group(1).strip() - title = '%s\n%s\n\n' % (stripped_title, '=' * len(stripped_title)) - contents_without_front_matter = re.sub(r'(?s)^---.*---\n', '', contents) - contents = '%s%s' % (title, contents_without_front_matter) - return contents - - def postprocessor(self, html): - ''' fix relative paths in images, scripts, and links for the internal parser ''' - def tag_fix(match): - tag, src = match.groups() - filename = self.view.file_name() - if filename: - if not src.startswith(('file://', 'https://', 'http://', '/', '#')): - abs_path = u'file://%s/%s' % (os.path.dirname(filename), src) - tag = tag.replace(src, abs_path) - return tag - RE_SOURCES = re.compile("""(?P<(?:img|script|a)[^>]+(?:src|href)=["'](?P[^"']+)[^>]*>)""") - html = RE_SOURCES.sub(tag_fix, html) - return html - - def get_config_extensions(self, default_extensions): - config_extensions = self.settings.get('enabled_extensions') - if not config_extensions or config_extensions == 'default': - return default_extensions - if 'default' in config_extensions: - config_extensions.remove( 'default' ) - config_extensions.extend( default_extensions ) - return config_extensions - - def convert_markdown(self, markdown_text, parser): - ''' convert input markdown to HTML, with github or builtin parser ''' - - markdown_html = _CANNOT_CONVERT - if parser == 'github': - github_oauth_token = self.settings.get('github_oauth_token') - - # use the github API - sublime.status_message('converting markdown with github API...') - try: - github_mode = self.settings.get('github_mode', 'gfm') - data = { - "text": markdown_text, - "mode": github_mode - } - headers = { - 'Content-Type': 'application/json' - } - if github_oauth_token: - headers['Authorization'] = "token %s" % github_oauth_token - data = json.dumps(data).encode('utf-8') - url = "https://api.github.com/markdown" - sublime.status_message(url) - request = Request(url, data, headers) - markdown_html = urlopen(request).read().decode('utf-8') - except HTTPError: - e = sys.exc_info()[1] - if e.code == 401: - sublime.error_message('github API auth failed. Please check your OAuth token.') - else: - sublime.error_message('github API responded in an unfashion way :/') - except URLError: - sublime.error_message('cannot use github API to convert markdown. SSL is not included in your Python installation') - except: - e = sys.exc_info()[1] - print(e) - traceback.print_exc() - sublime.error_message('cannot use github API to convert markdown. Please check your settings.') - else: - sublime.status_message('converted markdown with github API successfully') - - elif parser == 'markdown2': - # convert the markdown - enabled_extras = set(self.get_config_extensions(['footnotes', 'toc', 'fenced-code-blocks', 'cuddled-lists'])) - if self.settings.get("enable_mathjax") is True or self.settings.get("enable_highlight") is True: - enabled_extras.add('code-friendly') - markdown_html = markdown2.markdown(markdown_text, extras=list(enabled_extras)) - toc_html = markdown_html.toc_html - if toc_html: - toc_markers = ['[toc]', '[TOC]', ''] - for marker in toc_markers: - markdown_html = markdown_html.replace(marker, toc_html) - - # postprocess the html from internal parser - markdown_html = self.postprocessor(markdown_html) - else: - sublime.status_message('converting markdown with Python markdown...') - config_extensions = self.get_config_extensions(['extra', 'toc']) - markdown_html = markdown.markdown(markdown_text, extensions=config_extensions) - markdown_html = self.postprocessor(markdown_html) - - return markdown_html - - def get_title(self): - title = self.view.name() - if not title: - fn = self.view.file_name() - title = 'untitled' if not fn else os.path.splitext(os.path.basename(fn))[0] - return '%s' % title - - def run(self, view, parser, wholefile=False): - ''' return full html and body html for view. ''' - self.settings = sublime.load_settings('MarkdownPreview.sublime-settings') - self.view = view - - contents = self.get_contents(wholefile) - - body = self.convert_markdown(contents, parser) - - html = u'' - html += '' - html += self.get_stylesheet() - html += self.get_javascript() - html += self.get_highlight() - html += self.get_mathjax() - html += self.get_title() - html += '' - html += body - html += '' - html += '' - return html, body - - -compiler = MarkdownCompiler() - - - -class MarkdownPreviewCommand(sublime_plugin.TextCommand): - def run(self, edit, parser='markdown', target='browser'): - settings = sublime.load_settings('MarkdownPreview.sublime-settings') - html, body = compiler.run(self.view, parser) - - if target in ['disk', 'browser']: - # check if LiveReload ST2 extension installed and add its script to the resulting HTML - livereload_installed = ('LiveReload' in os.listdir(sublime.packages_path())) - # build the html - if livereload_installed: - html += '' - # update output html file - tmp_fullpath = getTempMarkdownPreviewPath(self.view) - save_utf8(tmp_fullpath, html) - # now opens in browser if needed - if target == 'browser': - config_browser = settings.get('browser') - if config_browser and config_browser != 'default': - cmd = '"%s" %s' % (config_browser, tmp_fullpath) - if sys.platform == 'darwin': - cmd = "open -a %s" % cmd - elif sys.platform == 'linux2': - cmd += ' &' - result = os.system(cmd) - if result != 0: - sublime.error_message('cannot execute "%s" Please check your Markdown Preview settings' % config_browser) - else: - sublime.status_message('Markdown preview launched in %s' % config_browser) - else: - desktop.open(tmp_fullpath) - sublime.status_message('Markdown preview launched in default html viewer') - elif target == 'sublime': - # create a new buffer and paste the output HTML - new_scratch_view(self.view.window(), body) - sublime.status_message('Markdown preview launched in sublime') - elif target == 'clipboard': - # clipboard copy the full HTML - sublime.set_clipboard(html) - sublime.status_message('Markdown export copied to clipboard') - - -class MarkdownBuildCommand(sublime_plugin.WindowCommand): - def init_panel(self): - if not hasattr(self, 'output_view'): - if sublime.version() >= '3000': - self.output_view = self.window.create_output_panel("markdown") - else: - self.output_view = self.window.get_output_panel("markdown") - - def puts(self, message): - message = message + '\n' - if sublime.version() >= '3000': - self.output_view.run_command('append', {'characters': message, 'force': True, 'scroll_to_end': True}) - else: - selection_was_at_end = (len(self.output_view.sel()) == 1 - and self.output_view.sel()[0] - == sublime.Region(self.output_view.size())) - self.output_view.set_read_only(False) - edit = self.output_view.begin_edit() - self.output_view.insert(edit, self.output_view.size(), message) - if selection_was_at_end: - self.output_view.show(self.output_view.size()) - self.output_view.end_edit(edit) - self.output_view.set_read_only(True) - - def run(self): - view = self.window.active_view() - if not view: - return - start_time = time.time() - - self.init_panel() - - show_panel_on_build = sublime.load_settings("Preferences.sublime-settings").get("show_panel_on_build", True) - if show_panel_on_build: - self.window.run_command("show_panel", {"panel": "output.markdown"}) - - mdfile = view.file_name() - if mdfile is None: - self.puts("Can't build a unsaved markdown file.") - return - - self.puts("Compiling %s..." % mdfile) - - html, body = compiler.run(view, 'markdown', True) - - htmlfile = os.path.splitext(mdfile)[0]+'.html' - self.puts(" ->"+htmlfile) - save_utf8(htmlfile, html) - - elapsed = time.time() - start_time - if body == _CANNOT_CONVERT: - self.puts(_CANNOT_CONVERT) - self.puts("[Finished in %.1fs]" % (elapsed)) - sublime.status_message("Build finished") diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/MarkdownPreview.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/MarkdownPreview.sublime-settings deleted file mode 100644 index f3478e0..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/MarkdownPreview.sublime-settings +++ /dev/null @@ -1,114 +0,0 @@ -/* - Markdown Preview default settings -*/ -{ - /* - Sets the default opener for html files - - default - Use the system default HTML viewer - other - Set a full path to any executable. ex: /Applications/Google Chrome Canary.app or /Applications/Firefox.app - */ - "browser": "default", - - /* - Sets the parser used for build markdown to html. - - NOTE: The parser setting is not for the preview commands now. - The preivew have sperated commands for each parser markdown. - - Warning for github API : if you have a ST2 linux build, Python is not built with SSL o it may not work - - default - The current default parser is python-markdown parser. - markdown - Use the buildin python-markdown parser - markdown2 - (Deprecated) Use the builtin python-markdown2 parser. - github - User github API to convert markdown, so you can use GitHub flavored Markdown, see http://github.github.com/github-flavored-markdown/ - */ - "parser": "default", - - /* - Enable or not mathjax support. - */ - "enable_mathjax": false, - - /* - Enable or not highlight.js support for syntax highlighting. - */ - "enable_highlight": false, - - /* - List of enabled extensions of the selected markdown parser. - - You can get the full list of extensions at: - * The markdown2 parser, the `default`: https://github.com/trentm/python-markdown2/wiki/Extras - * The python markdown parser, the `markdown`: http://pythonhosted.org/Markdown/extensions/index.html - - - default - use the default set of extensions, see table latter. - [ "default", "def_list", ... ] - a list of extensions. Use "default" to include the default extensions. - - Parser | "default" Values - ------------|--------------------------- - default | ["footnotes", "toc", "fenced-code-blocks", "cuddled-lists" ] - markdown | ["extra", "toc"] - github | extensions values are not used. - - */ - "enabled_extensions": "default", - - /* - Default mode for the github Markdon parser : markdown (documents) or gfm (comments) - see http://developer.github.com/v3/markdown/#render-an-arbitrary-markdown-document - */ - "github_mode": "markdown", - - /* - Uses an OAuth token to when parsing markdown with GitHub API. To create one for Markdown Preview, see https://help.github.com/articles/creating-an-oauth-token-for-command-line-use. - */ - // "github_oauth_token": "secret" - - /* - Sets the default css file to embed in the HTML - - default - Use the builtin CSS or github CSS, depending on parser config (markdown.css or github.css) - other - Set an absolute path or url to any css file - */ - "css": "default", - - /* - Allow CSS overrides - - true - Any file with matching a .markdown_filetype extension with .css will be loaded as an override - false - Matching files ignored - */ - "allow_css_overrides": true, - - /* - Sets the JavaScript files to embed in the HTML - - Set an array of URLs or filepaths to JavaScript files. Absolute filepaths will be loaded - into the script tag; others will be set as the `src` attribute. The order of files in the - array is the order in which they are embedded. - */ - // "js": ["http://example.com/script.js", "/path/to/script.js"], - - /* - Sets the supported filetypes for auto-reload on save - */ - "markdown_filetypes": [".md", ".markdown", ".mdown"], - - /* - Sets a custom temporary folder for MarkdownPreview-generated html files. Useful if you're - using LiveReload and don't want to use the OS default. The directory must already exist. - - Examples: /tmp/custom_folder (Linux/OSX) - C:/TEMP/MYNOTES (Windows - note it's forward slash, even on Windows) - */ - // "path_tempfile": "/tmp/my_notes", - - /* - Strips the YAML front matter header and converts title to a heading - */ - "strip_yaml_front_matter": false -} - - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/README.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/README.md deleted file mode 100644 index f430cb1..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/README.md +++ /dev/null @@ -1,91 +0,0 @@ -Sublime Text 2/3 Markdown Preview -================================= - -Preview your markdown files quickly in you web browser from sublime text 2/3. - -You can use builtin [python-markdown][10] parser or use the [github markdown API][5] for the conversion. - -**NOTE:** If you choose the GitHub API for conversion (set parser: github in your settings), your code will be sent through https to github for live conversion. You'll have [Github flavored markdown][6], syntax highlighting and EMOJI support for free :heart: :octocat: :gift:. If you make more than 60 calls a day, be sure to set your GitHub API key in the settings :) - -**LINUX users:** If you want to use GitHub API for conversion, you'll need to have a custom Python install that includes python-ssl as its not built in the Sublime Text 2 Linux package. see [@dusteye comment][8]. If you use a custom window manager, also be sure to set a `BROWSER` environnement variable. see [@PPvG comments][9] - -## Features : - - - Markdown preivew using the [Python-markdown][10] or the Github API just choose select the build commands. - - Build markdown file using Sublime Text build system. The build parser are config via the `"parser"` config. - - Browser preview auto reload on save if you have the [ST2 LiveReload plugin][7] installed. - - Builtin parser : supports `abbr`, `attr_list`, `def_list`, `fenced_code`, `footnotes`, `tables`, `smart_strong` and `toc` markdown extensions. - - CSS search path for local and build-in CSS files (always enabled) and/or CSS overriding if you need - - YAML support thanks to @tommi - - Clipboard selection and copy to clipboard thanks to @hexatrope - - MathJax support : \\(\frac{\pi}{2}\\) thanks to @bps10 - -## Installation : - -### Using [Package Control][3] (*Recommanded*) - -For all Sublime Text 2/3 users we recommand installe via [Package Control][3]. - -1. [Install][11] Package Control if you haven't yet. -2. Use `cmd+shift+P` then `Package Control: Install Package` -3. Look for `Markdown Preview` and install it. - -### Manual Install - -1. Click the `Preferences > Browse Packages…` menu -2. Browse up a folder and then into the `Installed Packages/` folder -3. Download [zip package][12] rename it to `Markdown Preview.sublime-package` and copy it into the `Installed Packages/` directory -4. Restart Sublime Text - -## Usage : - -### To preivew : - - - optionnaly select some of your markdown for conversion - - use `cmd+shift+P` then `Markdown Preview` to show the follow commands: - - Markdown Preview: Python Markdown: Preview in Browser - - Markdown Preview: Python Markdown: Export HTML in Sublime Text - - Markdown Preview: Python Markdown: Copy to Clipboard - - Markdown Preview: Github Flavored Markdown: Preview in Browser - - Markdown Preview: Github Flavored Markdown: Export HTML in Sublime Text - - Markdown Preview: Github Flavored Markdown: Copy to Clipboard - - Markdown Preview: Open Markdown Cheat sheet - - or bind some key in your user key binding, using a line like this one: - `{ "keys": ["alt+m"], "command": "markdown_preview", "args": {"target": "browser", "parser":"markdown"} },` - - once converted a first time, the output HTML will be updated on each file save (with LiveReload plugin) - -### To build : - - - Just use `Ctrl+B` (Windows/Linux) or `cmd+B` (Mac) to build current file. - -### To config : - -Using Sublime Text menu: `Preferences`->`Package Settings`->`Markdown Preivew` - -- `Settings - User` is where you change your serrings for Markdown Preview. -- `Settings - Default` is a good reference with detail description for each setting. - - -## Support : - -- Any bugs about Markdown Preview please fell free to report [here][issue]. -- And you are welcome to fork and submit pullrequests. - - -## Licence : - -The code is available at github [project][home] under [MIT licence][4]. - - [0]: https://github.com/trentm/python-markdown2 - [home]: https://github.com/revolunet/sublimetext-markdown-preview - [3]: https://sublime.wbond.net/ - [4]: http://revolunet.mit-license.org - [5]: http://developer.github.com/v3/markdown - [6]: http://github.github.com/github-flavored-markdown/ - [7]: https://github.com/dz0ny/LiveReload-sublimetext2 - [8]: https://github.com/revolunet/sublimetext-markdown-preview/issues/27#issuecomment-11772098 - [9]: https://github.com/revolunet/sublimetext-markdown-preview/issues/78#issuecomment-15644727 - [10]: https://github.com/waylan/Python-Markdown - [11]: https://sublime.wbond.net/installation - [12]: https://github.com/revolunet/sublimetext-markdown-preview/archive/master.zip - [issue]: https://github.com/revolunet/sublimetext-markdown-preview/issues \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/desktop/__init__.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/desktop/__init__.py deleted file mode 100644 index 49e4545..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/desktop/__init__.py +++ /dev/null @@ -1,293 +0,0 @@ -#!/usr/bin/env python - -""" -Simple desktop integration for Python. This module provides desktop environment -detection and resource opening support for a selection of common and -standardised desktop environments. - -Copyright (C) 2005, 2006, 2007, 2008, 2009 Paul Boddie - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 3 of the License, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more -details. - -You should have received a copy of the GNU Lesser General Public License along -with this program. If not, see . - --------- - -Desktop Detection ------------------ - -To detect a specific desktop environment, use the get_desktop function. -To detect whether the desktop environment is standardised (according to the -proposed DESKTOP_LAUNCH standard), use the is_standard function. - -Opening URLs ------------- - -To open a URL in the current desktop environment, relying on the automatic -detection of that environment, use the desktop.open function as follows: - -desktop.open("http://www.python.org") - -To override the detected desktop, specify the desktop parameter to the open -function as follows: - -desktop.open("http://www.python.org", "KDE") # Insists on KDE -desktop.open("http://www.python.org", "GNOME") # Insists on GNOME -desktop.open("http://www.python.org", "MATE") # Insists on MATE - -Without overriding using the desktop parameter, the open function will attempt -to use the "standard" desktop opening mechanism which is controlled by the -DESKTOP_LAUNCH environment variable as described below. - -The DESKTOP_LAUNCH Environment Variable ---------------------------------------- - -The DESKTOP_LAUNCH environment variable must be shell-quoted where appropriate, -as shown in some of the following examples: - -DESKTOP_LAUNCH="kdialog --msgbox" Should present any opened URLs in - their entirety in a KDE message box. - (Command "kdialog" plus parameter.) -DESKTOP_LAUNCH="my\ opener" Should run the "my opener" program to - open URLs. - (Command "my opener", no parameters.) -DESKTOP_LAUNCH="my\ opener --url" Should run the "my opener" program to - open URLs. - (Command "my opener" plus parameter.) - -Details of the DESKTOP_LAUNCH environment variable convention can be found here: -http://lists.freedesktop.org/archives/xdg/2004-August/004489.html - -Other Modules -------------- - -The desktop.dialog module provides support for opening dialogue boxes. -The desktop.windows module permits the inspection of desktop windows. -""" - -__version__ = "0.4" - -import os -import sys - -# Provide suitable process creation functions. - -try: - import subprocess - def _run(cmd, shell, wait): - opener = subprocess.Popen(cmd, shell=shell) - if wait: opener.wait() - return opener.pid - - def _readfrom(cmd, shell): - opener = subprocess.Popen(cmd, shell=shell, stdin=subprocess.PIPE, stdout=subprocess.PIPE) - opener.stdin.close() - return opener.stdout.read() - - def _status(cmd, shell): - opener = subprocess.Popen(cmd, shell=shell) - opener.wait() - return opener.returncode == 0 - -except ImportError: - import popen2 - def _run(cmd, shell, wait): - opener = popen2.Popen3(cmd) - if wait: opener.wait() - return opener.pid - - def _readfrom(cmd, shell): - opener = popen2.Popen3(cmd) - opener.tochild.close() - opener.childerr.close() - return opener.fromchild.read() - - def _status(cmd, shell): - opener = popen2.Popen3(cmd) - opener.wait() - return opener.poll() == 0 - -import subprocess - -# Private functions. - -def _get_x11_vars(): - - "Return suitable environment definitions for X11." - - if not os.environ.get("DISPLAY", "").strip(): - return "DISPLAY=:0.0 " - else: - return "" - -def _is_xfce(): - - "Return whether XFCE is in use." - - # XFCE detection involves testing the output of a program. - - try: - return _readfrom(_get_x11_vars() + "xprop -root _DT_SAVE_MODE", shell=1).decode("utf-8").strip().endswith(' = "xfce4"') - except OSError: - return 0 - -def _is_x11(): - - "Return whether the X Window System is in use." - - return "DISPLAY" in os.environ - -# Introspection functions. - -def get_desktop(): - - """ - Detect the current desktop environment, returning the name of the - environment. If no environment could be detected, None is returned. - """ - - if "KDE_FULL_SESSION" in os.environ or \ - "KDE_MULTIHEAD" in os.environ: - return "KDE" - elif "GNOME_DESKTOP_SESSION_ID" in os.environ or \ - "GNOME_KEYRING_SOCKET" in os.environ: - return "GNOME" - elif "MATE_DESKTOP_SESSION_ID" in os.environ or \ - "MATE_KEYRING_SOCKET" in os.environ: - return "MATE" - elif sys.platform == "darwin": - return "Mac OS X" - elif hasattr(os, "startfile"): - return "Windows" - elif _is_xfce(): - return "XFCE" - - # KDE, GNOME, MATE and XFCE run on X11, so we have to test for X11 last. - - if _is_x11(): - return "X11" - else: - return None - -def use_desktop(desktop): - - """ - Decide which desktop should be used, based on the detected desktop and a - supplied 'desktop' argument (which may be None). Return an identifier - indicating the desktop type as being either "standard" or one of the results - from the 'get_desktop' function. - """ - - # Attempt to detect a desktop environment. - - detected = get_desktop() - - # Start with desktops whose existence can be easily tested. - - if (desktop is None or desktop == "standard") and is_standard(): - return "standard" - elif (desktop is None or desktop == "Windows") and detected == "Windows": - return "Windows" - - # Test for desktops where the overriding is not verified. - - elif (desktop or detected) == "KDE": - return "KDE" - elif (desktop or detected) == "GNOME": - return "GNOME" - elif (desktop or detected) == "MATE": - return "MATE" - elif (desktop or detected) == "XFCE": - return "XFCE" - elif (desktop or detected) == "Mac OS X": - return "Mac OS X" - elif (desktop or detected) == "X11": - return "X11" - else: - return None - -def is_standard(): - - """ - Return whether the current desktop supports standardised application - launching. - """ - - return "DESKTOP_LAUNCH" in os.environ - -# Activity functions. - -def open(url, desktop=None, wait=0): - - """ - Open the 'url' in the current desktop's preferred file browser. If the - optional 'desktop' parameter is specified then attempt to use that - particular desktop environment's mechanisms to open the 'url' instead of - guessing or detecting which environment is being used. - - Suggested values for 'desktop' are "standard", "KDE", "GNOME", "GNOME", - "XFCE", "Mac OS X", "Windows" where "standard" employs a DESKTOP_LAUNCH - environment variable to open the specified 'url'. DESKTOP_LAUNCH should - be a command, possibly followed by arguments, and must have any special - characters shell-escaped. - - The process identifier of the "opener" (ie. viewer, editor, browser or - program) associated with the 'url' is returned by this function. If the - process identifier cannot be determined, None is returned. - - An optional 'wait' parameter is also available for advanced usage and, if - 'wait' is set to a true value, this function will wait for the launching - mechanism to complete before returning (as opposed to immediately returning - as is the default behaviour). - """ - - # Decide on the desktop environment in use. - - desktop_in_use = use_desktop(desktop) - - if desktop_in_use == "standard": - arg = "".join([os.environ["DESKTOP_LAUNCH"], subprocess.mkarg(url)]) - return _run(arg, 1, wait) - - elif desktop_in_use == "Windows": - # NOTE: This returns None in current implementations. - return os.startfile(url) - - elif desktop_in_use == "KDE": - cmd = ["xdg-open", url] - - elif desktop_in_use == "GNOME": - cmd = ["xdg-open", url] - - elif desktop_in_use == "MATE": - cmd = ["xdg-open", url] - - elif desktop_in_use == "XFCE": - cmd = ["xdg-open", url] - - elif desktop_in_use == "Mac OS X": - cmd = ["open", url] - - elif desktop_in_use == "X11" and "BROWSER" in os.environ: - cmd = [os.environ["BROWSER"], url] - - elif desktop_in_use == "X11": - cmd = ["xdg-open", url] - - # Finish with an error where no suitable desktop was identified. - - else: - raise OSError("Desktop '%s' not supported (neither DESKTOP_LAUNCH nor os.startfile could be used)" % desktop_in_use) - - return _run(cmd, 0, wait) - -# vim: tabstop=4 expandtab shiftwidth=4 diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/desktop/dialog.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/desktop/dialog.py deleted file mode 100644 index 429ad06..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/desktop/dialog.py +++ /dev/null @@ -1,551 +0,0 @@ -#!/usr/bin/env python - -""" -Simple desktop dialogue box support for Python. - -Copyright (C) 2007, 2009 Paul Boddie - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 3 of the License, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more -details. - -You should have received a copy of the GNU Lesser General Public License along -with this program. If not, see . - --------- - -Opening Dialogue Boxes (Dialogs) --------------------------------- - -To open a dialogue box (dialog) in the current desktop environment, relying on -the automatic detection of that environment, use the appropriate dialogue box -class: - -question = desktop.dialog.Question("Are you sure?") -result = question.open() - -To override the detected desktop, specify the desktop parameter to the open -function as follows: - -question.open("KDE") # Insists on KDE -question.open("GNOME") # Insists on GNOME -question.open("MATE") # Insists on MATE - -The dialogue box options are documented in each class's docstring. - -Available dialogue box classes are listed in the desktop.dialog.available -attribute. - -Supported desktop environments are listed in the desktop.dialog.supported -attribute. -""" - -from desktop import use_desktop, _run, _readfrom, _status - -class _wrapper: - def __init__(self, handler): - self.handler = handler - -class _readvalue(_wrapper): - def __call__(self, cmd, shell): - return self.handler(cmd, shell).strip() - -class _readinput(_wrapper): - def __call__(self, cmd, shell): - return self.handler(cmd, shell)[:-1] - -class _readvalues_kdialog(_wrapper): - def __call__(self, cmd, shell): - result = self.handler(cmd, shell).strip().strip('"') - if result: - return result.split('" "') - else: - return [] - -class _readvalues_zenity(_wrapper): - def __call__(self, cmd, shell): - result = self.handler(cmd, shell).strip() - if result: - return result.split("|") - else: - return [] - -class _readvalues_Xdialog(_wrapper): - def __call__(self, cmd, shell): - result = self.handler(cmd, shell).strip() - if result: - return result.split("/") - else: - return [] - -# Dialogue parameter classes. - -class String: - - "A generic parameter." - - def __init__(self, name): - self.name = name - - def convert(self, value, program): - return [value or ""] - -class Strings(String): - - "Multiple string parameters." - - def convert(self, value, program): - return value or [] - -class StringPairs(String): - - "Multiple string parameters duplicated to make identifiers." - - def convert(self, value, program): - l = [] - for v in value: - l.append(v) - l.append(v) - return l - -class StringKeyword: - - "A keyword parameter." - - def __init__(self, keyword, name): - self.keyword = keyword - self.name = name - - def convert(self, value, program): - return [self.keyword + "=" + (value or "")] - -class StringKeywords: - - "Multiple keyword parameters." - - def __init__(self, keyword, name): - self.keyword = keyword - self.name = name - - def convert(self, value, program): - l = [] - for v in value or []: - l.append(self.keyword + "=" + v) - return l - -class Integer(String): - - "An integer parameter." - - defaults = { - "width" : 40, - "height" : 15, - "list_height" : 10 - } - scale = 8 - - def __init__(self, name, pixels=0): - String.__init__(self, name) - if pixels: - self.factor = self.scale - else: - self.factor = 1 - - def convert(self, value, program): - if value is None: - value = self.defaults[self.name] - return [str(int(value) * self.factor)] - -class IntegerKeyword(Integer): - - "An integer keyword parameter." - - def __init__(self, keyword, name, pixels=0): - Integer.__init__(self, name, pixels) - self.keyword = keyword - - def convert(self, value, program): - if value is None: - value = self.defaults[self.name] - return [self.keyword + "=" + str(int(value) * self.factor)] - -class Boolean(String): - - "A boolean parameter." - - values = { - "kdialog" : ["off", "on"], - "zenity" : ["FALSE", "TRUE"], - "Xdialog" : ["off", "on"] - } - - def convert(self, value, program): - values = self.values[program] - if value: - return [values[1]] - else: - return [values[0]] - -class MenuItemList(String): - - "A menu item list parameter." - - def convert(self, value, program): - l = [] - for v in value: - l.append(v.value) - l.append(v.text) - return l - -class ListItemList(String): - - "A radiolist/checklist item list parameter." - - def __init__(self, name, status_first=0): - String.__init__(self, name) - self.status_first = status_first - - def convert(self, value, program): - l = [] - for v in value: - boolean = Boolean(None) - status = boolean.convert(v.status, program) - if self.status_first: - l += status - l.append(v.value) - l.append(v.text) - if not self.status_first: - l += status - return l - -# Dialogue argument values. - -class MenuItem: - - "A menu item which can also be used with radiolists and checklists." - - def __init__(self, value, text, status=0): - self.value = value - self.text = text - self.status = status - -# Dialogue classes. - -class Dialogue: - - commands = { - "KDE" : "kdialog", - "GNOME" : "zenity", - "MATE" : "zenity", - "XFCE" : "zenity", # NOTE: Based on observations with Xubuntu. - "X11" : "Xdialog" - } - - def open(self, desktop=None): - - """ - Open a dialogue box (dialog) using a program appropriate to the desktop - environment in use. - - If the optional 'desktop' parameter is specified then attempt to use - that particular desktop environment's mechanisms to open the dialog - instead of guessing or detecting which environment is being used. - - Suggested values for 'desktop' are "standard", "KDE", "GNOME", - "MATE", "Mac OS X", "Windows". - - The result of the dialogue interaction may be a string indicating user - input (for Input, Password, Menu, Pulldown), a list of strings - indicating selections of one or more items (for RadioList, CheckList), - or a value indicating true or false (for Question, Warning, Message, - Error). - - Where a string value may be expected but no choice is made, an empty - string may be returned. Similarly, where a list of values is expected - but no choice is made, an empty list may be returned. - """ - - # Decide on the desktop environment in use. - - desktop_in_use = use_desktop(desktop) - - # Get the program. - - try: - program = self.commands[desktop_in_use] - except KeyError: - raise OSError("Desktop '%s' not supported (no known dialogue box command could be suggested)" % desktop_in_use) - - # The handler is one of the functions communicating with the subprocess. - # Some handlers return boolean values, others strings. - - handler, options = self.info[program] - - cmd = [program] - for option in options: - if isinstance(option, str): - cmd.append(option) - else: - value = getattr(self, option.name, None) - cmd += option.convert(value, program) - - return handler(cmd, 0) - -class Simple(Dialogue): - def __init__(self, text, width=None, height=None): - self.text = text - self.width = width - self.height = height - -class Question(Simple): - - """ - A dialogue asking a question and showing response buttons. - Options: text, width (in characters), height (in characters) - Response: a boolean value indicating an affirmative response (true) or a - negative response - """ - - name = "question" - info = { - "kdialog" : (_status, ["--yesno", String("text")]), - "zenity" : (_status, ["--question", StringKeyword("--text", "text")]), - "Xdialog" : (_status, ["--stdout", "--yesno", String("text"), Integer("height"), Integer("width")]), - } - -class Warning(Simple): - - """ - A dialogue asking a question and showing response buttons. - Options: text, width (in characters), height (in characters) - Response: a boolean value indicating an affirmative response (true) or a - negative response - """ - - name = "warning" - info = { - "kdialog" : (_status, ["--warningyesno", String("text")]), - "zenity" : (_status, ["--warning", StringKeyword("--text", "text")]), - "Xdialog" : (_status, ["--stdout", "--yesno", String("text"), Integer("height"), Integer("width")]), - } - -class Message(Simple): - - """ - A message dialogue. - Options: text, width (in characters), height (in characters) - Response: a boolean value indicating an affirmative response (true) or a - negative response - """ - - name = "message" - info = { - "kdialog" : (_status, ["--msgbox", String("text")]), - "zenity" : (_status, ["--info", StringKeyword("--text", "text")]), - "Xdialog" : (_status, ["--stdout", "--msgbox", String("text"), Integer("height"), Integer("width")]), - } - -class Error(Simple): - - """ - An error dialogue. - Options: text, width (in characters), height (in characters) - Response: a boolean value indicating an affirmative response (true) or a - negative response - """ - - name = "error" - info = { - "kdialog" : (_status, ["--error", String("text")]), - "zenity" : (_status, ["--error", StringKeyword("--text", "text")]), - "Xdialog" : (_status, ["--stdout", "--msgbox", String("text"), Integer("height"), Integer("width")]), - } - -class Menu(Simple): - - """ - A menu of options, one of which being selectable. - Options: text, width (in characters), height (in characters), - list_height (in items), items (MenuItem objects) - Response: a value corresponding to the chosen item - """ - - name = "menu" - info = { - "kdialog" : (_readvalue(_readfrom), ["--menu", String("text"), MenuItemList("items")]), - "zenity" : (_readvalue(_readfrom), ["--list", StringKeyword("--text", "text"), StringKeywords("--column", "titles"), - MenuItemList("items")] - ), - "Xdialog" : (_readvalue(_readfrom), ["--stdout", "--menubox", - String("text"), Integer("height"), Integer("width"), Integer("list_height"), MenuItemList("items")] - ), - } - item = MenuItem - number_of_titles = 2 - - def __init__(self, text, titles, items=None, width=None, height=None, list_height=None): - - """ - Initialise a menu with the given heading 'text', column 'titles', and - optional 'items' (which may be added later), 'width' (in characters), - 'height' (in characters) and 'list_height' (in items). - """ - - Simple.__init__(self, text, width, height) - self.titles = ([""] * self.number_of_titles + titles)[-self.number_of_titles:] - self.items = items or [] - self.list_height = list_height - - def add(self, *args, **kw): - - """ - Add an item, passing the given arguments to the appropriate item class. - """ - - self.items.append(self.item(*args, **kw)) - -class RadioList(Menu): - - """ - A list of radio buttons, one of which being selectable. - Options: text, width (in characters), height (in characters), - list_height (in items), items (MenuItem objects), titles - Response: a list of values corresponding to chosen items (since some - programs, eg. zenity, appear to support multiple default - selections) - """ - - name = "radiolist" - info = { - "kdialog" : (_readvalues_kdialog(_readfrom), ["--radiolist", String("text"), ListItemList("items")]), - "zenity" : (_readvalues_zenity(_readfrom), - ["--list", "--radiolist", StringKeyword("--text", "text"), StringKeywords("--column", "titles"), - ListItemList("items", 1)] - ), - "Xdialog" : (_readvalues_Xdialog(_readfrom), ["--stdout", "--radiolist", - String("text"), Integer("height"), Integer("width"), Integer("list_height"), ListItemList("items")] - ), - } - number_of_titles = 3 - -class CheckList(Menu): - - """ - A list of checkboxes, many being selectable. - Options: text, width (in characters), height (in characters), - list_height (in items), items (MenuItem objects), titles - Response: a list of values corresponding to chosen items - """ - - name = "checklist" - info = { - "kdialog" : (_readvalues_kdialog(_readfrom), ["--checklist", String("text"), ListItemList("items")]), - "zenity" : (_readvalues_zenity(_readfrom), - ["--list", "--checklist", StringKeyword("--text", "text"), StringKeywords("--column", "titles"), - ListItemList("items", 1)] - ), - "Xdialog" : (_readvalues_Xdialog(_readfrom), ["--stdout", "--checklist", - String("text"), Integer("height"), Integer("width"), Integer("list_height"), ListItemList("items")] - ), - } - number_of_titles = 3 - -class Pulldown(Menu): - - """ - A pull-down menu of options, one of which being selectable. - Options: text, width (in characters), height (in characters), - items (list of values) - Response: a value corresponding to the chosen item - """ - - name = "pulldown" - info = { - "kdialog" : (_readvalue(_readfrom), ["--combobox", String("text"), Strings("items")]), - "zenity" : (_readvalue(_readfrom), - ["--list", "--radiolist", StringKeyword("--text", "text"), StringKeywords("--column", "titles"), - StringPairs("items")] - ), - "Xdialog" : (_readvalue(_readfrom), - ["--stdout", "--combobox", String("text"), Integer("height"), Integer("width"), Strings("items")]), - } - item = str - number_of_titles = 2 - -class Input(Simple): - - """ - An input dialogue, consisting of an input field. - Options: text, input, width (in characters), height (in characters) - Response: the text entered into the dialogue by the user - """ - - name = "input" - info = { - "kdialog" : (_readinput(_readfrom), - ["--inputbox", String("text"), String("data")]), - "zenity" : (_readinput(_readfrom), - ["--entry", StringKeyword("--text", "text"), StringKeyword("--entry-text", "data")]), - "Xdialog" : (_readinput(_readfrom), - ["--stdout", "--inputbox", String("text"), Integer("height"), Integer("width"), String("data")]), - } - - def __init__(self, text, data="", width=None, height=None): - Simple.__init__(self, text, width, height) - self.data = data - -class Password(Input): - - """ - A password dialogue, consisting of a password entry field. - Options: text, width (in characters), height (in characters) - Response: the text entered into the dialogue by the user - """ - - name = "password" - info = { - "kdialog" : (_readinput(_readfrom), - ["--password", String("text")]), - "zenity" : (_readinput(_readfrom), - ["--entry", StringKeyword("--text", "text"), "--hide-text"]), - "Xdialog" : (_readinput(_readfrom), - ["--stdout", "--password", "--inputbox", String("text"), Integer("height"), Integer("width")]), - } - -class TextFile(Simple): - - """ - A text file input box. - Options: filename, text, width (in characters), height (in characters) - Response: any text returned by the dialogue program (typically an empty - string) - """ - - name = "textfile" - info = { - "kdialog" : (_readfrom, ["--textbox", String("filename"), Integer("width", pixels=1), Integer("height", pixels=1)]), - "zenity" : (_readfrom, ["--text-info", StringKeyword("--filename", "filename"), IntegerKeyword("--width", "width", pixels=1), - IntegerKeyword("--height", "height", pixels=1)] - ), - "Xdialog" : (_readfrom, ["--stdout", "--textbox", String("filename"), Integer("height"), Integer("width")]), - } - - def __init__(self, filename, text="", width=None, height=None): - Simple.__init__(self, text, width, height) - self.filename = filename - -# Available dialogues. - -available = [Question, Warning, Message, Error, Menu, CheckList, RadioList, Input, Password, Pulldown, TextFile] - -# Supported desktop environments. - -supported = list(Dialogue.commands.keys()) - -# vim: tabstop=4 expandtab shiftwidth=4 diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/desktop/windows.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/desktop/windows.py deleted file mode 100644 index 029ad34..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/desktop/windows.py +++ /dev/null @@ -1,273 +0,0 @@ -#!/usr/bin/env python - -""" -Simple desktop window enumeration for Python. - -Copyright (C) 2007, 2008, 2009 Paul Boddie - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the Free -Software Foundation; either version 3 of the License, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more -details. - -You should have received a copy of the GNU Lesser General Public License along -with this program. If not, see . - --------- - -Finding Open Windows on the Desktop ------------------------------------ - -To obtain a list of windows, use the desktop.windows.list function as follows: - -windows = desktop.windows.list() - -To obtain the root window, typically the desktop background, use the -desktop.windows.root function as follows: - -root = desktop.windows.root() - -Each window object can be inspected through a number of methods. For example: - -name = window.name() -width, height = window.size() -x, y = window.position() -child_windows = window.children() - -See the desktop.windows.Window class for more information. -""" - -from desktop import _is_x11, _get_x11_vars, _readfrom, use_desktop -import re - -# System functions. - -def _xwininfo(identifier, action): - if identifier is None: - args = "-root" - else: - args = "-id " + identifier - - s = _readfrom(_get_x11_vars() + "xwininfo %s -%s" % (args, action), shell=1) - - # Return a mapping of keys to values for the "stats" action. - - if action == "stats": - d = {} - for line in s.split("\n"): - fields = line.split(":") - if len(fields) < 2: - continue - key, value = fields[0].strip(), ":".join(fields[1:]).strip() - d[key] = value - - return d - - # Otherwise, return the raw output. - - else: - return s - -def _get_int_properties(d, properties): - results = [] - for property in properties: - results.append(int(d[property])) - return results - -# Finder functions. - -def find_all(name): - return 1 - -def find_named(name): - return name is not None - -def find_by_name(name): - return lambda n, t=name: n == t - -# Window classes. -# NOTE: X11 is the only supported desktop so far. - -class Window: - - "A window on the desktop." - - _name_pattern = re.compile(r':\s+\(.*?\)\s+[-0-9x+]+\s+[-0-9+]+$') - _absent_names = "(has no name)", "(the root window) (has no name)" - - def __init__(self, identifier): - - "Initialise the window with the given 'identifier'." - - self.identifier = identifier - - # Finder methods (from above). - - self.find_all = find_all - self.find_named = find_named - self.find_by_name = find_by_name - - def __repr__(self): - return "Window(%r)" % self.identifier - - # Methods which deal with the underlying commands. - - def _get_handle_and_name(self, text): - fields = text.strip().split(" ") - handle = fields[0] - - # Get the "" part, stripping off the quotes. - - name = " ".join(fields[1:]) - if len(name) > 1 and name[0] == '"' and name[-1] == '"': - name = name[1:-1] - - if name in self._absent_names: - return handle, None - else: - return handle, name - - def _get_this_handle_and_name(self, line): - fields = line.split(":") - return self._get_handle_and_name(":".join(fields[1:])) - - def _get_descendant_handle_and_name(self, line): - match = self._name_pattern.search(line) - if match: - return self._get_handle_and_name(line[:match.start()].strip()) - else: - raise OSError("Window information from %r did not contain window details." % line) - - def _descendants(self, s, fn): - handles = [] - adding = 0 - for line in s.split("\n"): - if line.endswith("child:") or line.endswith("children:"): - if not adding: - adding = 1 - elif adding and line: - handle, name = self._get_descendant_handle_and_name(line) - if fn(name): - handles.append(handle) - return [Window(handle) for handle in handles] - - # Public methods. - - def children(self, all=0): - - """ - Return a list of windows which are children of this window. If the - optional 'all' parameter is set to a true value, all such windows will - be returned regardless of whether they have any name information. - """ - - s = _xwininfo(self.identifier, "children") - return self._descendants(s, all and self.find_all or self.find_named) - - def descendants(self, all=0): - - """ - Return a list of windows which are descendants of this window. If the - optional 'all' parameter is set to a true value, all such windows will - be returned regardless of whether they have any name information. - """ - - s = _xwininfo(self.identifier, "tree") - return self._descendants(s, all and self.find_all or self.find_named) - - def find(self, callable): - - """ - Return windows using the given 'callable' (returning a true or a false - value when invoked with a window name) for descendants of this window. - """ - - s = _xwininfo(self.identifier, "tree") - return self._descendants(s, callable) - - def name(self): - - "Return the name of the window." - - d = _xwininfo(self.identifier, "stats") - - # Format is 'xwininfo: Window id: "" - - return self._get_this_handle_and_name(d["xwininfo"])[1] - - def size(self): - - "Return a tuple containing the width and height of this window." - - d = _xwininfo(self.identifier, "stats") - return _get_int_properties(d, ["Width", "Height"]) - - def position(self): - - "Return a tuple containing the upper left co-ordinates of this window." - - d = _xwininfo(self.identifier, "stats") - return _get_int_properties(d, ["Absolute upper-left X", "Absolute upper-left Y"]) - - def displayed(self): - - """ - Return whether the window is displayed in some way (but not necessarily - visible on the current screen). - """ - - d = _xwininfo(self.identifier, "stats") - return d["Map State"] != "IsUnviewable" - - def visible(self): - - "Return whether the window is displayed and visible." - - d = _xwininfo(self.identifier, "stats") - return d["Map State"] == "IsViewable" - -def list(desktop=None): - - """ - Return a list of windows for the current desktop. If the optional 'desktop' - parameter is specified then attempt to use that particular desktop - environment's mechanisms to look for windows. - """ - - root_window = root(desktop) - window_list = [window for window in root_window.descendants() if window.displayed()] - window_list.insert(0, root_window) - return window_list - -def root(desktop=None): - - """ - Return the root window for the current desktop. If the optional 'desktop' - parameter is specified then attempt to use that particular desktop - environment's mechanisms to look for windows. - """ - - # NOTE: The desktop parameter is currently ignored and X11 is tested for - # NOTE: directly. - - if _is_x11(): - return Window(None) - else: - raise OSError("Desktop '%s' not supported" % use_desktop(desktop)) - -def find(callable, desktop=None): - - """ - Find and return windows using the given 'callable' for the current desktop. - If the optional 'desktop' parameter is specified then attempt to use that - particular desktop environment's mechanisms to look for windows. - """ - - return root(desktop).find(callable) - -# vim: tabstop=4 expandtab shiftwidth=4 diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/github.css b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/github.css deleted file mode 100644 index dc1dcbf..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/github.css +++ /dev/null @@ -1,738 +0,0 @@ -body -{ - font-size:15px; - line-height:1.7; - overflow-x:hidden; - - background-color: white; - border-radius: 3px; - border: 3px solid #EEE; - box-shadow: inset 0 0 0 1px #CECECE; - font-family: Helvetica, arial, freesans, clean, sans-serif; - width: 912px; - padding: 30px; - margin: 2em auto; - - color:#333333; -} - - -.body-classic{ - color:#444; - font-family:Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', "Hiragino Sans GB", "STXihei", "微软雅黑", serif; - font-size:16px; - line-height:1.5em; - background:#fefefe; - width: 45em; - margin: 10px auto; - padding: 1em; - outline: 1300px solid #FAFAFA; -} - -body>:first-child -{ - margin-top:0!important; -} - -body>:last-child -{ - margin-bottom:0!important; -} - -blockquote,dl,ol,p,pre,table,ul { - border: 0; - margin: 15px 0; - padding: 0; -} - -body a.absent -{ - color:#c00; -} - -body a.anchor -{ - display:block; - padding-left:30px; - margin-left:-30px; - cursor:pointer; - position:absolute; - top:0; - left:0; - bottom:0 -} - -/*h4,h5,h6{ font-weight: bold; }*/ - -.octicon{ - font:normal normal 16px sans-serif; - width: 1em; - height: 1em; - line-height:1; - display:inline-block; - text-decoration:none; - -webkit-font-smoothing:antialiased -} - -.octicon-link { - background: url("data:image/svg+xml;utf8, Copyright (C) 2013 by GitHub "); - background-size: contain; - background-repeat: no-repeat; - background-position: bottom; -} - -.octicon-link:before{ - content:'\a0'; -} - -body h1,body h2,body h3,body h4,body h5,body h6{ - margin:1em 0 15px; - padding:0; - font-weight:bold; - line-height:1.7; - cursor:text; - position:relative -} - -body h1 .octicon-link,body h2 .octicon-link,body h3 .octicon-link,body h4 .octicon-link,body h5 .octicon-link,body h6 .octicon-link{ - display:none; - color:#000 -} - -body h1:hover a.anchor,body h2:hover a.anchor,body h3:hover a.anchor,body h4:hover a.anchor,body h5:hover a.anchor,body h6:hover a.anchor{ - text-decoration:none; - line-height:1; - padding-left:0; - margin-left:-22px; - top:15% -} - -body h1:hover a.anchor .octicon-link,body h2:hover a.anchor .octicon-link,body h3:hover a.anchor .octicon-link,body h4:hover a.anchor .octicon-link,body h5:hover a.anchor .octicon-link,body h6:hover a.anchor .octicon-link{ - display:inline-block -} - -body h1 tt,body h1 code,body h2 tt,body h2 code,body h3 tt,body h3 code,body h4 tt,body h4 code,body h5 tt,body h5 code,body h6 tt,body h6 code{ - font-size:inherit -} - -body h1{ - font-size:2.5em; - border-bottom:1px solid #ddd -} - -body h2{ - font-size:2em; - border-bottom:1px solid #eee -} - -body h3{ - font-size:1.5em -} - -body h4{ - font-size:1.2em -} - -body h5{ - font-size:1em -} - -body h6{ - color:#777; - font-size:1em -} - -body p,body blockquote,body ul,body ol,body dl,body table,body pre{ - margin:15px 0 -} - -body h1 tt,body h1 code,body h2 tt,body h2 code,body h3 tt,body h3 code,body h4 tt,body h4 code,body h5 tt,body h5 code,body h6 tt,body h6 code -{ - font-size:inherit; -} - - -body hr -{ - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAECAYAAACtBE5DAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OENDRjNBN0E2NTZBMTFFMEI3QjRBODM4NzJDMjlGNDgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OENDRjNBN0I2NTZBMTFFMEI3QjRBODM4NzJDMjlGNDgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4Q0NGM0E3ODY1NkExMUUwQjdCNEE4Mzg3MkMyOUY0OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4Q0NGM0E3OTY1NkExMUUwQjdCNEE4Mzg3MkMyOUY0OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PqqezsUAAAAfSURBVHjaYmRABcYwBiM2QSA4y4hNEKYDQxAEAAIMAHNGAzhkPOlYAAAAAElFTkSuQmCC); - background-repeat: repeat-x; - /*background:transparent url(http://overblown.net/files/markdown/dirty-shade.png) repeat-x 0 0;*/ - background-color: transparent; - background-position: 0; - border:0 none; - color:#ccc; - height:4px; - margin:15px 0; - padding:0; -} - -body li p.first -{ - display:inline-block; -} - -body ul,body ol -{ - padding-left:30px; -} - -body ul.no-list,body ol.no-list -{ - list-style-type:none; - padding:0; -} - -body ul ul,body ul ol,body ol ol,body ol ul -{ - margin-bottom:0; - margin-top:0; -} - -body dl -{ - padding:0; -} - -body dl dt -{ - font-size:14px; - font-style:italic; - font-weight:700; - margin-top:15px; - padding:0; -} - -body dl dd -{ - margin-bottom:15px; - padding:0 15px; -} - -body blockquote -{ - border-left:4px solid #DDD; - color:#777; - padding:0 15px; -} - -body blockquote>:first-child -{ - margin-top:0; -} - -body blockquote>:last-child -{ - margin-bottom:0; -} - -body table -{ - display:block; - overflow:auto; - width:100%; -} - -body table th -{ - font-weight:700; -} - -body table th,body table td -{ - border:1px solid #ddd; - padding:6px 13px; -} - -body table tr -{ - background-color:#fff; - border-top:1px solid #ccc; -} - -body table tr:nth-child(2n) -{ - background-color:#f8f8f8; -} - -body img -{ - -moz-box-sizing:border-box; - box-sizing:border-box; - max-width:100%; -} - -body span.frame -{ - display:block; - overflow:hidden; -} - -body span.frame>span -{ - border:1px solid #ddd; - display:block; - float:left; - margin:13px 0 0; - overflow:hidden; - padding:7px; - width:auto; -} - -body span.frame span img -{ - display:block; - float:left; -} - -body span.frame span span -{ - clear:both; - color:#333; - display:block; - padding:5px 0 0; -} - -body span.align-center -{ - clear:both; - display:block; - overflow:hidden; -} - -body span.align-center>span -{ - display:block; - margin:13px auto 0; - overflow:hidden; - text-align:center; -} - -body span.align-center span img -{ - margin:0 auto; - text-align:center; -} - -body span.align-right -{ - clear:both; - display:block; - overflow:hidden; -} - -body span.align-right>span -{ - display:block; - margin:13px 0 0; - overflow:hidden; - text-align:right; -} - -body span.align-right span img -{ - margin:0; - text-align:right; -} - -body span.float-left -{ - display:block; - float:left; - margin-right:13px; - overflow:hidden; -} - -body span.float-left span -{ - margin:13px 0 0; -} - -body span.float-right -{ - display:block; - float:right; - margin-left:13px; - overflow:hidden; -} - -body span.float-right>span -{ - display:block; - margin:13px auto 0; - overflow:hidden; - text-align:right; -} - -body code,body tt -{ - background-color:#f8f8f8; - border:1px solid #ddd; - border-radius:3px; - margin:0 2px; - padding:0 5px; -} - -body code -{ - white-space:nowrap; -} - - -code,pre{ - font-family:Consolas, "Liberation Mono", Courier, monospace; - font-size:12px -} - -body pre>code -{ - background:transparent; - border:none; - margin:0; - padding:0; - white-space:pre; -} - -body .highlight pre,body pre -{ - background-color:#f8f8f8; - border:1px solid #ddd; - font-size:13px; - line-height:19px; - overflow:auto; - padding:6px 10px; - border-radius:3px -} - -body pre code,body pre tt -{ - background-color:transparent; - border:none; - margin:0; - padding:0; -} - -body .task-list{ - list-style-type:none; - padding-left:10px -} - -.task-list-item{ - padding-left:20px -} - -.task-list-item label{ - font-weight:normal -} - -.task-list-item.enabled label{ - cursor:pointer -} - -.task-list-item+.task-list-item{ - margin-top:5px -} - -.task-list-item-checkbox{ - float:left; - margin-left:-20px; - margin-top:7px -} - - -.highlight{ - background:#ffffff -} - -.highlight .c{ - color:#999988; - font-style:italic -} - -.highlight .err{ - color:#a61717; - background-color:#e3d2d2 -} - -.highlight .k{ - font-weight:bold -} - -.highlight .o{ - font-weight:bold -} - -.highlight .cm{ - color:#999988; - font-style:italic -} - -.highlight .cp{ - color:#999999; - font-weight:bold -} - -.highlight .c1{ - color:#999988; - font-style:italic -} - -.highlight .cs{ - color:#999999; - font-weight:bold; - font-style:italic -} - -.highlight .gd{ - color:#000000; - background-color:#ffdddd -} - -.highlight .gd .x{ - color:#000000; - background-color:#ffaaaa -} - -.highlight .ge{ - font-style:italic -} - -.highlight .gr{ - color:#aa0000 -} - -.highlight .gh{ - color:#999999 -} - -.highlight .gi{ - color:#000000; - background-color:#ddffdd -} - -.highlight .gi .x{ - color:#000000; - background-color:#aaffaa -} - -.highlight .go{ - color:#888888 -} - -.highlight .gp{ - color:#555555 -} - -.highlight .gs{ - font-weight:bold -} - -.highlight .gu{ - color:#800080; - font-weight:bold -} - -.highlight .gt{ - color:#aa0000 -} - -.highlight .kc{ - font-weight:bold -} - -.highlight .kd{ - font-weight:bold -} - -.highlight .kn{ - font-weight:bold -} - -.highlight .kp{ - font-weight:bold -} - -.highlight .kr{ - font-weight:bold -} - -.highlight .kt{ - color:#445588; - font-weight:bold -} - -.highlight .m{ - color:#009999 -} - -.highlight .s{ - color:#d14 -} - -.highlight .n{ - color:#333333 -} - -.highlight .na{ - color:#008080 -} - -.highlight .nb{ - color:#0086B3 -} - -.highlight .nc{ - color:#445588; - font-weight:bold -} - -.highlight .no{ - color:#008080 -} - -.highlight .ni{ - color:#800080 -} - -.highlight .ne{ - color:#990000; - font-weight:bold -} - -.highlight .nf{ - color:#990000; - font-weight:bold -} - -.highlight .nn{ - color:#555555 -} - -.highlight .nt{ - color:#000080 -} - -.highlight .nv{ - color:#008080 -} - -.highlight .ow{ - font-weight:bold -} - -.highlight .w{ - color:#bbbbbb -} - -.highlight .mf{ - color:#009999 -} - -.highlight .mh{ - color:#009999 -} - -.highlight .mi{ - color:#009999 -} - -.highlight .mo{ - color:#009999 -} - -.highlight .sb{ - color:#d14 -} - -.highlight .sc{ - color:#d14 -} - -.highlight .sd{ - color:#d14 -} - -.highlight .s2{ - color:#d14 -} - -.highlight .se{ - color:#d14 -} - -.highlight .sh{ - color:#d14 -} - -.highlight .si{ - color:#d14 -} - -.highlight .sx{ - color:#d14 -} - -.highlight .sr{ - color:#009926 -} - -.highlight .s1{ - color:#d14 -} - -.highlight .ss{ - color:#990073 -} - -.highlight .bp{ - color:#999999 -} - -.highlight .vc{ - color:#008080 -} - -.highlight .vg{ - color:#008080 -} - -.highlight .vi{ - color:#008080 -} - -.highlight .il{ - color:#009999 -} - -.highlight .gc{ - color:#999; - background-color:#EAF2F5 -} - -.type-csharp .highlight .k{ - color:#0000FF -} - -.type-csharp .highlight .kt{ - color:#0000FF -} - -.type-csharp .highlight .nf{ - color:#000000; - font-weight:normal -} - -.type-csharp .highlight .nc{ - color:#2B91AF -} - -.type-csharp .highlight .nn{ - color:#000000 -} - -.type-csharp .highlight .s{ - color:#A31515 -} - -.type-csharp .highlight .sc{ - color:#A31515 -} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/helper.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/helper.py deleted file mode 100644 index 30158a0..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/helper.py +++ /dev/null @@ -1,49 +0,0 @@ -import sublime, os, pkgutil -import os.path -import re - -''' -INSTALLED_DIRECTORY - The install directory name for this plugin. - -For ST3 - As descriped in http://www.sublimetext.com/docs/3/packages.html this script locations is one of - Zipped: - "/Packages/Markdown Preview.sublime-package/Markdown Preview.MarkdownPreview" - "/Installed Packages/Markdown Preview.sublime-package/Markdown Preview.MarkdownPreview" - Not Zipped: - "/Packages/Markdown Preview/MarkdownPreview.py" - - All passable path for ST3 are abspath (tested on windows) - -For ST2 - The __file__ will be '.\MarkdownPreview.pyc' that means when this script is loaded, - Sublime Text entered the directoy of this script. So we make use of os.path.abspath() -''' -try: - INSTALLED_DIRECTORY = re.search("[ \\\\/]Packages[\\\\/]([^\\\\/\.]+)", os.path.abspath(__file__)).group(1) -except: - print('Warning failed to detect the install directory, defaulting to: "Markdown Preview"') - INSTALLED_DIRECTORY = "Markdown Preview" - - - - -""" -Preload all python-markdown extensions (ST2 only) -""" - -# By default sublime 2 only imports python packages from the top level of the plugin directory. -# Trying to import packages from subdirectories dynamically at a later time is NOT possible. - -# This package automatically imports all packages from the extension directory -# so they are available when we need them. - -if sublime.version() < '3000': - packages_path = sublime.packages_path() - extension_module = "markdown.extensions" - - - for _, package, _ in pkgutil.walk_packages("."): - if package.startswith(extension_module): - print ("Reloading plugin extension " + os.path.join(packages_path, INSTALLED_DIRECTORY, *package.split(".")) + ".py") - __import__(package) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/highlight.css b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/highlight.css deleted file mode 100644 index 54a8b92..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/highlight.css +++ /dev/null @@ -1,129 +0,0 @@ -/* - -github.com style (c) Vasily Polovnyov - -*/ - -pre code { - display: block; padding: 0.5em; - color: #333; - background: #f8f8ff -} - -pre .comment, -pre .template_comment, -pre .diff .header, -pre .javadoc { - color: #998; - font-style: italic -} - -pre .keyword, -pre .css .rule .keyword, -pre .winutils, -pre .javascript .title, -pre .nginx .title, -pre .subst, -pre .request, -pre .status { - color: #333; - font-weight: bold -} - -pre .number, -pre .hexcolor, -pre .ruby .constant { - color: #099; -} - -pre .string, -pre .tag .value, -pre .phpdoc, -pre .tex .formula { - color: #d14 -} - -pre .title, -pre .id, -pre .coffeescript .params, -pre .scss .preprocessor { - color: #900; - font-weight: bold -} - -pre .javascript .title, -pre .lisp .title, -pre .clojure .title, -pre .subst { - font-weight: normal -} - -pre .class .title, -pre .haskell .type, -pre .vhdl .literal, -pre .tex .command { - color: #458; - font-weight: bold -} - -pre .tag, -pre .tag .title, -pre .rules .property, -pre .django .tag .keyword { - color: #000080; - font-weight: normal -} - -pre .attribute, -pre .variable, -pre .lisp .body { - color: #008080 -} - -pre .regexp { - color: #009926 -} - -pre .class { - color: #458; - font-weight: bold -} - -pre .symbol, -pre .ruby .symbol .string, -pre .lisp .keyword, -pre .tex .special, -pre .prompt { - color: #990073 -} - -pre .built_in, -pre .lisp .title, -pre .clojure .built_in { - color: #0086b3 -} - -pre .preprocessor, -pre .pi, -pre .doctype, -pre .shebang, -pre .cdata { - color: #999; - font-weight: bold -} - -pre .deletion { - background: #fdd -} - -pre .addition { - background: #dfd -} - -pre .diff .change { - background: #0086b3 -} - -pre .chunk { - color: #aaa -} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/highlight.js b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/highlight.js deleted file mode 100644 index 33d17e6..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/highlight.js +++ /dev/null @@ -1 +0,0 @@ -var hljs=new function(){function l(o){return o.replace(/&/gm,"&").replace(//gm,">")}function b(p){for(var o=p.firstChild;o;o=o.nextSibling){if(o.nodeName=="CODE"){return o}if(!(o.nodeType==3&&o.nodeValue.match(/\s+/))){break}}}function h(p,o){return Array.prototype.map.call(p.childNodes,function(q){if(q.nodeType==3){return o?q.nodeValue.replace(/\n/g,""):q.nodeValue}if(q.nodeName=="BR"){return"\n"}return h(q,o)}).join("")}function a(q){var p=(q.className+" "+q.parentNode.className).split(/\s+/);p=p.map(function(r){return r.replace(/^language-/,"")});for(var o=0;o"}while(x.length||v.length){var u=t().splice(0,1)[0];y+=l(w.substr(p,u.offset-p));p=u.offset;if(u.event=="start"){y+=s(u.node);r.push(u.node)}else{if(u.event=="stop"){var o,q=r.length;do{q--;o=r[q];y+=("")}while(o!=u.node);r.splice(q,1);while(q'+L[0]+""}else{r+=L[0]}N=A.lR.lastIndex;L=A.lR.exec(K)}return r+K.substr(N)}function z(){if(A.sL&&!e[A.sL]){return l(w)}var r=A.sL?d(A.sL,w):g(w);if(A.r>0){v+=r.keyword_count;B+=r.r}return''+r.value+""}function J(){return A.sL!==undefined?z():G()}function I(L,r){var K=L.cN?'':"";if(L.rB){x+=K;w=""}else{if(L.eB){x+=l(r)+K;w=""}else{x+=K;w=r}}A=Object.create(L,{parent:{value:A}});B+=L.r}function C(K,r){w+=K;if(r===undefined){x+=J();return 0}var L=o(r,A);if(L){x+=J();I(L,r);return L.rB?0:r.length}var M=s(A,r);if(M){if(!(M.rE||M.eE)){w+=r}x+=J();do{if(A.cN){x+=""}A=A.parent}while(A!=M.parent);if(M.eE){x+=l(r)}w="";if(M.starts){I(M.starts,"")}return M.rE?0:r.length}if(t(r,A)){throw"Illegal"}w+=r;return r.length||1}var F=e[D];f(F);var A=F;var w="";var B=0;var v=0;var x="";try{var u,q,p=0;while(true){A.t.lastIndex=p;u=A.t.exec(E);if(!u){break}q=C(E.substr(p,u.index-p),u[0]);p=u.index+q}C(E.substr(p));return{r:B,keyword_count:v,value:x,language:D}}catch(H){if(H=="Illegal"){return{r:0,keyword_count:0,value:l(E)}}else{throw H}}}function g(s){var o={keyword_count:0,r:0,value:l(s)};var q=o;for(var p in e){if(!e.hasOwnProperty(p)){continue}var r=d(p,s);r.language=p;if(r.keyword_count+r.r>q.keyword_count+q.r){q=r}if(r.keyword_count+r.r>o.keyword_count+o.r){q=o;o=r}}if(q.language){o.second_best=q}return o}function i(q,p,o){if(p){q=q.replace(/^((<[^>]+>|\t)+)/gm,function(r,v,u,t){return v.replace(/\t/g,p)})}if(o){q=q.replace(/\n/g,"
")}return q}function m(r,u,p){var v=h(r,p);var t=a(r);if(t=="no-highlight"){return}var w=t?d(t,v):g(v);t=w.language;var o=c(r);if(o.length){var q=document.createElement("pre");q.innerHTML=w.value;w.value=j(o,c(q),v)}w.value=i(w.value,u,p);var s=r.className;if(!s.match("(\\s|^)(language-)?"+t+"(\\s|$)")){s=s?(s+" "+t):t}r.innerHTML=w.value;r.className=s;r.result={language:t,kw:w.keyword_count,re:w.r};if(w.second_best){r.second_best={language:w.second_best.language,kw:w.second_best.keyword_count,re:w.second_best.r}}}function n(){if(n.called){return}n.called=true;Array.prototype.map.call(document.getElementsByTagName("pre"),b).filter(Boolean).forEach(function(o){m(o,hljs.tabReplace)})}function k(){window.addEventListener("DOMContentLoaded",n,false);window.addEventListener("load",n,false)}var e={};this.LANGUAGES=e;this.highlight=d;this.highlightAuto=g;this.fixMarkup=i;this.highlightBlock=m;this.initHighlighting=n;this.initHighlightingOnLoad=k;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.inherit=function(q,r){var o={};for(var p in q){o[p]=q[p]}if(r){for(var p in r){o[p]=r[p]}}return o}}();hljs.LANGUAGES.bash=function(a){var g="true false";var e="if then else elif fi for break continue while in do done echo exit return set declare";var c={cN:"variable",b:"\\$[a-zA-Z0-9_#]+"};var b={cN:"variable",b:"\\${([^}]|\\\\})+}"};var h={cN:"string",b:'"',e:'"',i:"\\n",c:[a.BE,c,b],r:0};var d={cN:"string",b:"'",e:"'",c:[{b:"''"}],r:0};var f={cN:"test_condition",b:"",e:"",c:[h,d,c,b],k:{literal:g},r:0};return{k:{keyword:e,literal:g},c:[{cN:"shebang",b:"(#!\\/bin\\/bash)|(#!\\/bin\\/sh)",r:10},c,b,a.HCM,h,d,a.inherit(f,{b:"\\[ ",e:" \\]",r:0}),a.inherit(f,{b:"\\[\\[ ",e:" \\]\\]"})]}}(hljs);hljs.LANGUAGES.cs=function(a){return{k:"abstract as base bool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long namespace new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while ascending descending from get group into join let orderby partial select set value var where yield",c:[{cN:"comment",b:"///",e:"$",rB:true,c:[{cN:"xmlDocTag",b:"///|"},{cN:"xmlDocTag",b:""}]},a.CLCM,a.CBLCLM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line region endregion pragma checksum"},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},a.ASM,a.QSM,a.CNM]}}(hljs);hljs.LANGUAGES.ruby=function(e){var a="[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?";var j="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?";var g={keyword:"and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include"};var c={cN:"yardoctag",b:"@[A-Za-z]+"};var k=[{cN:"comment",b:"#",e:"$",c:[c]},{cN:"comment",b:"^\\=begin",e:"^\\=end",c:[c],r:10},{cN:"comment",b:"^__END__",e:"\\n$"}];var d={cN:"subst",b:"#\\{",e:"}",l:a,k:g};var i=[e.BE,d];var b=[{cN:"string",b:"'",e:"'",c:i,r:0},{cN:"string",b:'"',e:'"',c:i,r:0},{cN:"string",b:"%[qw]?\\(",e:"\\)",c:i},{cN:"string",b:"%[qw]?\\[",e:"\\]",c:i},{cN:"string",b:"%[qw]?{",e:"}",c:i},{cN:"string",b:"%[qw]?<",e:">",c:i,r:10},{cN:"string",b:"%[qw]?/",e:"/",c:i,r:10},{cN:"string",b:"%[qw]?%",e:"%",c:i,r:10},{cN:"string",b:"%[qw]?-",e:"-",c:i,r:10},{cN:"string",b:"%[qw]?\\|",e:"\\|",c:i,r:10}];var h={cN:"function",bWK:true,e:" |$|;",k:"def",c:[{cN:"title",b:j,l:a,k:g},{cN:"params",b:"\\(",e:"\\)",l:a,k:g}].concat(k)};var f=k.concat(b.concat([{cN:"class",bWK:true,e:"$|;",k:"class module",c:[{cN:"title",b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?",r:0},{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]}].concat(k)},h,{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:":",c:b.concat([{b:j}]),r:0},{cN:"symbol",b:a+":",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"number",b:"\\?\\w"},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:k.concat([{cN:"regexp",b:"/",e:"/[a-z]*",i:"\\n",c:[e.BE,d]}]),r:0}]));d.c=f;h.c[1].c=f;return{l:a,k:g,c:f}}(hljs);hljs.LANGUAGES.diff=function(a){return{c:[{cN:"chunk",b:"^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$",r:10},{cN:"chunk",b:"^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$",r:10},{cN:"chunk",b:"^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$",r:10},{cN:"header",b:"Index: ",e:"$"},{cN:"header",b:"=====",e:"=====$"},{cN:"header",b:"^\\-\\-\\-",e:"$"},{cN:"header",b:"^\\*{3} ",e:"$"},{cN:"header",b:"^\\+\\+\\+",e:"$"},{cN:"header",b:"\\*{5}",e:"\\*{5}$"},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}}(hljs);hljs.LANGUAGES.javascript=function(a){return{k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const",literal:"true false null undefined NaN Infinity"},c:[a.ASM,a.QSM,a.CLCM,a.CBLCLM,a.CNM,{b:"("+a.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[a.CLCM,a.CBLCLM,{cN:"regexp",b:"/",e:"/[gim]*",i:"\\n",c:[{b:"\\\\/"}]},{b:"<",e:">;",sL:"xml"}],r:0},{cN:"function",bWK:true,e:"{",k:"function",c:[{cN:"title",b:"[A-Za-z$_][0-9A-Za-z$_]*"},{cN:"params",b:"\\(",e:"\\)",c:[a.CLCM,a.CBLCLM],i:"[\"'\\(]"}],i:"\\[|%"}]}}(hljs);hljs.LANGUAGES.css=function(a){var b={cN:"function",b:a.IR+"\\(",e:"\\)",c:[a.NM,a.ASM,a.QSM]};return{cI:true,i:"[=/|']",c:[a.CBLCLM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",eE:true,k:"import page media charset",c:[b,a.ASM,a.QSM,a.NM]},{cN:"tag",b:a.IR,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[a.CBLCLM,{cN:"rule",b:"[^\\s]",rB:true,e:";",eW:true,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:true,i:"[^\\s]",starts:{cN:"value",eW:true,eE:true,c:[b,a.NM,a.QSM,a.ASM,a.CBLCLM,{cN:"hexcolor",b:"\\#[0-9A-F]+"},{cN:"important",b:"!important"}]}}]}]}]}}(hljs);hljs.LANGUAGES.xml=function(a){var c="[A-Za-z0-9\\._:-]+";var b={eW:true,c:[{cN:"attribute",b:c,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"|$)",e:">",k:{title:"style"},c:[b],starts:{e:"",rE:true,sL:"css"}},{cN:"tag",b:"|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"",c:[{cN:"title",b:"[^ />]+"},b]}]}}(hljs);hljs.LANGUAGES.http=function(a){return{i:"\\S",c:[{cN:"status",b:"^HTTP/[0-9\\.]+",e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{cN:"request",b:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",rB:true,e:"$",c:[{cN:"string",b:" ",e:" ",eB:true,eE:true}]},{cN:"attribute",b:"^\\w",e:": ",eE:true,i:"\\n|\\s|=",starts:{cN:"string",e:"$"}},{b:"\\n\\n",starts:{sL:"",eW:true}}]}}(hljs);hljs.LANGUAGES.java=function(a){return{k:"false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws",c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",c:[{cN:"javadoctag",b:"@[A-Za-z]+"}],r:10},a.CLCM,a.CBLCLM,a.ASM,a.QSM,{cN:"class",bWK:true,e:"{",k:"class interface",i:":",c:[{bWK:true,k:"extends implements",r:10},{cN:"title",b:a.UIR}]},a.CNM,{cN:"annotation",b:"@[A-Za-z]+"}]}}(hljs);hljs.LANGUAGES.php=function(a){var e={cN:"variable",b:"\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*"};var b=[a.inherit(a.ASM,{i:null}),a.inherit(a.QSM,{i:null}),{cN:"string",b:'b"',e:'"',c:[a.BE]},{cN:"string",b:"b'",e:"'",c:[a.BE]}];var c=[a.BNM,a.CNM];var d={cN:"title",b:a.UIR};return{cI:true,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return implements parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception php_user_filter default die require __FUNCTION__ enddeclare final try this switch continue endfor endif declare unset true false namespace trait goto instanceof insteadof __DIR__ __NAMESPACE__ __halt_compiler",c:[a.CLCM,a.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+"}]},{cN:"comment",eB:true,b:"__halt_compiler.+?;",eW:true},{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[a.BE]},{cN:"preprocessor",b:"<\\?php",r:10},{cN:"preprocessor",b:"\\?>"},e,{cN:"function",bWK:true,e:"{",k:"function",i:"\\$|\\[|%",c:[d,{cN:"params",b:"\\(",e:"\\)",c:["self",e,a.CBLCLM].concat(b).concat(c)}]},{cN:"class",bWK:true,e:"{",k:"class",i:"[:\\(\\$]",c:[{bWK:true,eW:true,k:"extends",c:[d]},d]},{b:"=>"}].concat(b).concat(c)}}(hljs);hljs.LANGUAGES.python=function(a){var f={cN:"prompt",b:"^(>>>|\\.\\.\\.) "};var c=[{cN:"string",b:"(u|b)?r?'''",e:"'''",c:[f],r:10},{cN:"string",b:'(u|b)?r?"""',e:'"""',c:[f],r:10},{cN:"string",b:"(u|r|ur)'",e:"'",c:[a.BE],r:10},{cN:"string",b:'(u|r|ur)"',e:'"',c:[a.BE],r:10},{cN:"string",b:"(b|br)'",e:"'",c:[a.BE]},{cN:"string",b:'(b|br)"',e:'"',c:[a.BE]}].concat([a.ASM,a.QSM]);var e={cN:"title",b:a.UIR};var d={cN:"params",b:"\\(",e:"\\)",c:["self",a.CNM,f].concat(c)};var b={bWK:true,e:":",i:"[${=;\\n]",c:[e,d],r:10};return{k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10",built_in:"None True False Ellipsis NotImplemented"},i:"(|\\?)",c:c.concat([f,a.HCM,a.inherit(b,{cN:"function",k:"def"}),a.inherit(b,{cN:"class",k:"class"}),a.CNM,{cN:"decorator",b:"@",e:"$"},{b:"\\b(print|exec)\\("}])}}(hljs);hljs.LANGUAGES.sql=function(a){return{cI:true,c:[{cN:"operator",b:"(begin|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma|grant)\\b(?!:)",e:";",eW:true,k:{keyword:"all partial global month current_timestamp using go revoke smallint indicator end-exec disconnect zone with character assertion to add current_user usage input local alter match collate real then rollback get read timestamp session_user not integer bit unique day minute desc insert execute like ilike|2 level decimal drop continue isolation found where constraints domain right national some module transaction relative second connect escape close system_user for deferred section cast current sqlstate allocate intersect deallocate numeric public preserve full goto initially asc no key output collation group by union session both last language constraint column of space foreign deferrable prior connection unknown action commit view or first into float year primary cascaded except restrict set references names table outer open select size are rows from prepare distinct leading create only next inner authorization schema corresponding option declare precision immediate else timezone_minute external varying translation true case exception join hour default double scroll value cursor descriptor values dec fetch procedure delete and false int is describe char as at in varchar null trailing any absolute current_time end grant privileges when cross check write current_date pad begin temporary exec time update catalog user sql date on identity timezone_hour natural whenever interval work order cascade diagnostics nchar having left call do handler load replace truncate start lock show pragma exists number",aggregate:"count sum min max avg"},c:[{cN:"string",b:"'",e:"'",c:[a.BE,{b:"''"}],r:0},{cN:"string",b:'"',e:'"',c:[a.BE,{b:'""'}],r:0},{cN:"string",b:"`",e:"`",c:[a.BE]},a.CNM]},a.CBLCLM,{cN:"comment",b:"--",e:"$"}]}}(hljs);hljs.LANGUAGES.ini=function(a){return{cI:true,i:"[^\\s]",c:[{cN:"comment",b:";",e:"$"},{cN:"title",b:"^\\[",e:"\\]"},{cN:"setting",b:"^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*",e:"$",c:[{cN:"value",eW:true,k:"on off true false yes no",c:[a.QSM,a.NM]}]}]}}(hljs);hljs.LANGUAGES.perl=function(e){var a="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when";var d={cN:"subst",b:"[$@]\\{",e:"\\}",k:a,r:10};var b={cN:"variable",b:"\\$\\d"};var i={cN:"variable",b:"[\\$\\%\\@\\*](\\^\\w\\b|#\\w+(\\:\\:\\w+)*|[^\\s\\w{]|{\\w+}|\\w+(\\:\\:\\w*)*)"};var f=[e.BE,d,b,i];var h={b:"->",c:[{b:e.IR},{b:"{",e:"}"}]};var g={cN:"comment",b:"^(__END__|__DATA__)",e:"\\n$",r:5};var c=[b,i,e.HCM,g,{cN:"comment",b:"^\\=\\w",e:"\\=cut",eW:true},h,{cN:"string",b:"q[qwxr]?\\s*\\(",e:"\\)",c:f,r:5},{cN:"string",b:"q[qwxr]?\\s*\\[",e:"\\]",c:f,r:5},{cN:"string",b:"q[qwxr]?\\s*\\{",e:"\\}",c:f,r:5},{cN:"string",b:"q[qwxr]?\\s*\\|",e:"\\|",c:f,r:5},{cN:"string",b:"q[qwxr]?\\s*\\<",e:"\\>",c:f,r:5},{cN:"string",b:"qw\\s+q",e:"q",c:f,r:5},{cN:"string",b:"'",e:"'",c:[e.BE],r:0},{cN:"string",b:'"',e:'"',c:f,r:0},{cN:"string",b:"`",e:"`",c:[e.BE]},{cN:"string",b:"{\\w+}",r:0},{cN:"string",b:"-?\\w+\\s*\\=\\>",r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"("+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,g,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"sub",bWK:true,e:"(\\s*\\(.*?\\))?[;{]",k:"sub",r:5},{cN:"operator",b:"-\\w\\b",r:0}];d.c=c;h.c[1].c=c;return{k:a,c:c}}(hljs);hljs.LANGUAGES.json=function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{c:d,k:e,i:"\\S"}}(hljs);hljs.LANGUAGES.cpp=function(a){var b={keyword:"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long throw volatile static protected bool template mutable if public friend do return goto auto void enum else break new extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex",built_in:"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr"};return{k:b,i:"",k:b,r:10,c:["self"]}]}}(hljs); diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x32/libssl-0.9.8/_ssl.so b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x32/libssl-0.9.8/_ssl.so deleted file mode 100644 index 8e3ac9a..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x32/libssl-0.9.8/_ssl.so and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x32/libssl-1.0.0/_ssl.so b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x32/libssl-1.0.0/_ssl.so deleted file mode 100644 index 1ff704b..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x32/libssl-1.0.0/_ssl.so and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x32/libssl-10/_ssl.so b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x32/libssl-10/_ssl.so deleted file mode 100644 index d28147b..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x32/libssl-10/_ssl.so and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x64/libssl-0.9.8/_ssl.so b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x64/libssl-0.9.8/_ssl.so deleted file mode 100644 index 83501ef..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x64/libssl-0.9.8/_ssl.so and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x64/libssl-1.0.0/_ssl.so b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x64/libssl-1.0.0/_ssl.so deleted file mode 100644 index 697f33a..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x64/libssl-1.0.0/_ssl.so and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x64/libssl-10/_ssl.so b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x64/libssl-10/_ssl.so deleted file mode 100644 index 70622d4..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux-x64/libssl-10/_ssl.so and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux/ssl.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux/ssl.py deleted file mode 100644 index 4db47ca..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/lib/linux/ssl.py +++ /dev/null @@ -1,437 +0,0 @@ -# Wrapper module for _ssl, providing some additional facilities -# implemented in Python. Written by Bill Janssen. - -"""\ -This module provides some more Pythonic support for SSL. - -Object types: - - SSLSocket -- subtype of socket.socket which does SSL over the socket - -Exceptions: - - SSLError -- exception raised for I/O errors - -Functions: - - cert_time_to_seconds -- convert time string used for certificate - notBefore and notAfter functions to integer - seconds past the Epoch (the time values - returned from time.time()) - - fetch_server_certificate (HOST, PORT) -- fetch the certificate provided - by the server running on HOST at port PORT. No - validation of the certificate is performed. - -Integer constants: - -SSL_ERROR_ZERO_RETURN -SSL_ERROR_WANT_READ -SSL_ERROR_WANT_WRITE -SSL_ERROR_WANT_X509_LOOKUP -SSL_ERROR_SYSCALL -SSL_ERROR_SSL -SSL_ERROR_WANT_CONNECT - -SSL_ERROR_EOF -SSL_ERROR_INVALID_ERROR_CODE - -The following group define certificate requirements that one side is -allowing/requiring from the other side: - -CERT_NONE - no certificates from the other side are required (or will - be looked at if provided) -CERT_OPTIONAL - certificates are not required, but if provided will be - validated, and if validation fails, the connection will - also fail -CERT_REQUIRED - certificates are required, and will be validated, and - if validation fails, the connection will also fail - -The following constants identify various SSL protocol variants: - -PROTOCOL_SSLv2 -PROTOCOL_SSLv3 -PROTOCOL_SSLv23 -PROTOCOL_TLSv1 -""" - -import textwrap - -import _ssl # if we can't import it, let the error propagate - -from _ssl import SSLError -from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED -from _ssl import PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1 -from _ssl import RAND_status, RAND_egd, RAND_add -from _ssl import \ - SSL_ERROR_ZERO_RETURN, \ - SSL_ERROR_WANT_READ, \ - SSL_ERROR_WANT_WRITE, \ - SSL_ERROR_WANT_X509_LOOKUP, \ - SSL_ERROR_SYSCALL, \ - SSL_ERROR_SSL, \ - SSL_ERROR_WANT_CONNECT, \ - SSL_ERROR_EOF, \ - SSL_ERROR_INVALID_ERROR_CODE - -from socket import socket, _fileobject, _delegate_methods -from socket import error as socket_error -from socket import getnameinfo as _getnameinfo -import base64 # for DER-to-PEM translation -import errno - -class SSLSocket(socket): - - """This class implements a subtype of socket.socket that wraps - the underlying OS socket in an SSL context when necessary, and - provides read and write methods over that channel.""" - - def __init__(self, sock, keyfile=None, certfile=None, - server_side=False, cert_reqs=CERT_NONE, - ssl_version=PROTOCOL_SSLv23, ca_certs=None, - do_handshake_on_connect=True, - suppress_ragged_eofs=True): - socket.__init__(self, _sock=sock._sock) - # The initializer for socket overrides the methods send(), recv(), etc. - # in the instancce, which we don't need -- but we want to provide the - # methods defined in SSLSocket. - for attr in _delegate_methods: - try: - delattr(self, attr) - except AttributeError: - pass - - if certfile and not keyfile: - keyfile = certfile - # see if it's connected - try: - socket.getpeername(self) - except socket_error, e: - if e.errno != errno.ENOTCONN: - raise - # no, no connection yet - self._sslobj = None - else: - # yes, create the SSL object - self._sslobj = _ssl.sslwrap(self._sock, server_side, - keyfile, certfile, - cert_reqs, ssl_version, ca_certs) - if do_handshake_on_connect: - self.do_handshake() - self.keyfile = keyfile - self.certfile = certfile - self.cert_reqs = cert_reqs - self.ssl_version = ssl_version - self.ca_certs = ca_certs - self.do_handshake_on_connect = do_handshake_on_connect - self.suppress_ragged_eofs = suppress_ragged_eofs - self._makefile_refs = 0 - - def read(self, len=1024): - - """Read up to LEN bytes and return them. - Return zero-length string on EOF.""" - - try: - return self._sslobj.read(len) - except SSLError, x: - if x.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs: - return '' - else: - raise - - def write(self, data): - - """Write DATA to the underlying SSL channel. Returns - number of bytes of DATA actually transmitted.""" - - return self._sslobj.write(data) - - def getpeercert(self, binary_form=False): - - """Returns a formatted version of the data in the - certificate provided by the other end of the SSL channel. - Return None if no certificate was provided, {} if a - certificate was provided, but not validated.""" - - return self._sslobj.peer_certificate(binary_form) - - def cipher(self): - - if not self._sslobj: - return None - else: - return self._sslobj.cipher() - - def send(self, data, flags=0): - if self._sslobj: - if flags != 0: - raise ValueError( - "non-zero flags not allowed in calls to send() on %s" % - self.__class__) - while True: - try: - v = self._sslobj.write(data) - except SSLError, x: - if x.args[0] == SSL_ERROR_WANT_READ: - return 0 - elif x.args[0] == SSL_ERROR_WANT_WRITE: - return 0 - else: - raise - else: - return v - else: - return socket.send(self, data, flags) - - def sendto(self, data, addr, flags=0): - if self._sslobj: - raise ValueError("sendto not allowed on instances of %s" % - self.__class__) - else: - return socket.sendto(self, data, addr, flags) - - def sendall(self, data, flags=0): - if self._sslobj: - if flags != 0: - raise ValueError( - "non-zero flags not allowed in calls to sendall() on %s" % - self.__class__) - amount = len(data) - count = 0 - while (count < amount): - v = self.send(data[count:]) - count += v - return amount - else: - return socket.sendall(self, data, flags) - - def recv(self, buflen=1024, flags=0): - if self._sslobj: - if flags != 0: - raise ValueError( - "non-zero flags not allowed in calls to recv() on %s" % - self.__class__) - return self.read(buflen) - else: - return socket.recv(self, buflen, flags) - - def recv_into(self, buffer, nbytes=None, flags=0): - if buffer and (nbytes is None): - nbytes = len(buffer) - elif nbytes is None: - nbytes = 1024 - if self._sslobj: - if flags != 0: - raise ValueError( - "non-zero flags not allowed in calls to recv_into() on %s" % - self.__class__) - tmp_buffer = self.read(nbytes) - v = len(tmp_buffer) - buffer[:v] = tmp_buffer - return v - else: - return socket.recv_into(self, buffer, nbytes, flags) - - def recvfrom(self, addr, buflen=1024, flags=0): - if self._sslobj: - raise ValueError("recvfrom not allowed on instances of %s" % - self.__class__) - else: - return socket.recvfrom(self, addr, buflen, flags) - - def recvfrom_into(self, buffer, nbytes=None, flags=0): - if self._sslobj: - raise ValueError("recvfrom_into not allowed on instances of %s" % - self.__class__) - else: - return socket.recvfrom_into(self, buffer, nbytes, flags) - - def pending(self): - if self._sslobj: - return self._sslobj.pending() - else: - return 0 - - def unwrap(self): - if self._sslobj: - s = self._sslobj.shutdown() - self._sslobj = None - return s - else: - raise ValueError("No SSL wrapper around " + str(self)) - - def shutdown(self, how): - self._sslobj = None - socket.shutdown(self, how) - - def close(self): - if self._makefile_refs < 1: - self._sslobj = None - socket.close(self) - else: - self._makefile_refs -= 1 - - def do_handshake(self): - - """Perform a TLS/SSL handshake.""" - - self._sslobj.do_handshake() - - def connect(self, addr): - - """Connects to remote ADDR, and then wraps the connection in - an SSL channel.""" - - # Here we assume that the socket is client-side, and not - # connected at the time of the call. We connect it, then wrap it. - if self._sslobj: - raise ValueError("attempt to connect already-connected SSLSocket!") - socket.connect(self, addr) - self._sslobj = _ssl.sslwrap(self._sock, False, self.keyfile, self.certfile, - self.cert_reqs, self.ssl_version, - self.ca_certs) - if self.do_handshake_on_connect: - self.do_handshake() - - def accept(self): - - """Accepts a new connection from a remote client, and returns - a tuple containing that new connection wrapped with a server-side - SSL channel, and the address of the remote client.""" - - newsock, addr = socket.accept(self) - return (SSLSocket(newsock, - keyfile=self.keyfile, - certfile=self.certfile, - server_side=True, - cert_reqs=self.cert_reqs, - ssl_version=self.ssl_version, - ca_certs=self.ca_certs, - do_handshake_on_connect=self.do_handshake_on_connect, - suppress_ragged_eofs=self.suppress_ragged_eofs), - addr) - - def makefile(self, mode='r', bufsize=-1): - - """Make and return a file-like object that - works with the SSL connection. Just use the code - from the socket module.""" - - self._makefile_refs += 1 - # close=True so as to decrement the reference count when done with - # the file-like object. - return _fileobject(self, mode, bufsize, close=True) - - - -def wrap_socket(sock, keyfile=None, certfile=None, - server_side=False, cert_reqs=CERT_NONE, - ssl_version=PROTOCOL_SSLv23, ca_certs=None, - do_handshake_on_connect=True, - suppress_ragged_eofs=True): - - return SSLSocket(sock, keyfile=keyfile, certfile=certfile, - server_side=server_side, cert_reqs=cert_reqs, - ssl_version=ssl_version, ca_certs=ca_certs, - do_handshake_on_connect=do_handshake_on_connect, - suppress_ragged_eofs=suppress_ragged_eofs) - - -# some utility functions - -def cert_time_to_seconds(cert_time): - - """Takes a date-time string in standard ASN1_print form - ("MON DAY 24HOUR:MINUTE:SEC YEAR TIMEZONE") and return - a Python time value in seconds past the epoch.""" - - import time - return time.mktime(time.strptime(cert_time, "%b %d %H:%M:%S %Y GMT")) - -PEM_HEADER = "-----BEGIN CERTIFICATE-----" -PEM_FOOTER = "-----END CERTIFICATE-----" - -def DER_cert_to_PEM_cert(der_cert_bytes): - - """Takes a certificate in binary DER format and returns the - PEM version of it as a string.""" - - if hasattr(base64, 'standard_b64encode'): - # preferred because older API gets line-length wrong - f = base64.standard_b64encode(der_cert_bytes) - return (PEM_HEADER + '\n' + - textwrap.fill(f, 64) + '\n' + - PEM_FOOTER + '\n') - else: - return (PEM_HEADER + '\n' + - base64.encodestring(der_cert_bytes) + - PEM_FOOTER + '\n') - -def PEM_cert_to_DER_cert(pem_cert_string): - - """Takes a certificate in ASCII PEM format and returns the - DER-encoded version of it as a byte sequence""" - - if not pem_cert_string.startswith(PEM_HEADER): - raise ValueError("Invalid PEM encoding; must start with %s" - % PEM_HEADER) - if not pem_cert_string.strip().endswith(PEM_FOOTER): - raise ValueError("Invalid PEM encoding; must end with %s" - % PEM_FOOTER) - d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)] - return base64.decodestring(d) - -def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None): - - """Retrieve the certificate from the server at the specified address, - and return it as a PEM-encoded string. - If 'ca_certs' is specified, validate the server cert against it. - If 'ssl_version' is specified, use it in the connection attempt.""" - - host, port = addr - if (ca_certs is not None): - cert_reqs = CERT_REQUIRED - else: - cert_reqs = CERT_NONE - s = wrap_socket(socket(), ssl_version=ssl_version, - cert_reqs=cert_reqs, ca_certs=ca_certs) - s.connect(addr) - dercert = s.getpeercert(True) - s.close() - return DER_cert_to_PEM_cert(dercert) - -def get_protocol_name(protocol_code): - if protocol_code == PROTOCOL_TLSv1: - return "TLSv1" - elif protocol_code == PROTOCOL_SSLv23: - return "SSLv23" - elif protocol_code == PROTOCOL_SSLv3: - return "SSLv3" - else: - return "" - - -# a replacement for the old socket.ssl function - -def sslwrap_simple(sock, keyfile=None, certfile=None): - - """A replacement for the old socket.ssl function. Designed - for compability with Python 2.5 and earlier. Will disappear in - Python 3.0.""" - - if hasattr(sock, "_sock"): - sock = sock._sock - - ssl_sock = _ssl.sslwrap(sock, 0, keyfile, certfile, CERT_NONE, - PROTOCOL_SSLv23, None) - try: - sock.getpeername() - except: - # no, no connection yet - pass - else: - # yes, do the handshake - ssl_sock.do_handshake() - - return ssl_sock diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown.css b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown.css deleted file mode 100644 index b96117f..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown.css +++ /dev/null @@ -1,122 +0,0 @@ -html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } - -body{ - color:#444; - font-family:Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman', - "Hiragino Sans GB", "STXihei", "微软雅黑", serif; - font-size:12px; - line-height:1.5em; - background:#fefefe; - width: 45em; - margin: 10px auto; - padding: 1em; - outline: 1300px solid #FAFAFA; -} - -a{ color: #0645ad; text-decoration:none;} -a:visited{ color: #0b0080; } -a:hover{ color: #06e; } -a:active{ color:#faa700; } -a:focus{ outline: thin dotted; } -a:hover, a:active{ outline: 0; } - -span.backtick { - border:1px solid #EAEAEA; - border-radius:3px; - background:#F8F8F8; - padding:0 3px 0 3px; -} - -::-moz-selection{background:rgba(255,255,0,0.3);color:#000} -::selection{background:rgba(255,255,0,0.3);color:#000} - -a::-moz-selection{background:rgba(255,255,0,0.3);color:#0645ad} -a::selection{background:rgba(255,255,0,0.3);color:#0645ad} - -p{ -margin:1em 0; -} - -img{ -max-width:100%; -} - -h1,h2,h3,h4,h5,h6{ -font-weight:normal; -color:#111; -line-height:1em; -} -h4,h5,h6{ font-weight: bold; } -h1{ font-size:2.5em; } -h2{ font-size:2em; border-bottom:1px solid silver; padding-bottom: 5px; } -h3{ font-size:1.5em; } -h4{ font-size:1.2em; } -h5{ font-size:1em; } -h6{ font-size:0.9em; } - -blockquote{ -color:#666666; -margin:0; -padding-left: 3em; -border-left: 0.5em #EEE solid; -} -hr { display: block; height: 2px; border: 0; border-top: 1px solid #aaa;border-bottom: 1px solid #eee; margin: 1em 0; padding: 0; } - - -pre , code, kbd, samp { - color: #000; - font-family: monospace; - font-size: 0.88em; - border-radius:3px; - background-color: #F8F8F8; - border: 1px solid #CCC; -} -pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; padding: 5px 12px;} -pre code { border: 0px !important; padding: 0;} -code { padding: 0 3px 0 3px; } - -b, strong { font-weight: bold; } - -dfn { font-style: italic; } - -ins { background: #ff9; color: #000; text-decoration: none; } - -mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; } - -sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } -sup { top: -0.5em; } -sub { bottom: -0.25em; } - -ul, ol { margin: 1em 0; padding: 0 0 0 2em; } -li p:last-child { margin:0 } -dd { margin: 0 0 0 2em; } - -img { border: 0; -ms-interpolation-mode: bicubic; vertical-align: middle; } - -table { border-collapse: collapse; border-spacing: 0; } -td { vertical-align: top; } - -@media only screen and (min-width: 480px) { -body{font-size:14px;} -} - -@media only screen and (min-width: 768px) { -body{font-size:16px;} -} - -@media print { - * { background: transparent !important; color: black !important; filter:none !important; -ms-filter: none !important; } - body{font-size:12pt; max-width:100%; outline:none;} - a, a:visited { text-decoration: underline; } - hr { height: 1px; border:0; border-bottom:1px solid black; } - a[href]:after { content: " (" attr(href) ")"; } - abbr[title]:after { content: " (" attr(title) ")"; } - .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } - pre, blockquote { border: 1px solid #999; padding-right: 1em; page-break-inside: avoid; } - tr, img { page-break-inside: avoid; } - img { max-width: 100% !important; } - @page :left { margin: 15mm 20mm 15mm 10mm; } - @page :right { margin: 15mm 10mm 15mm 20mm; } - p, h2, h3 { orphans: 3; widows: 3; } - h2, h3 { page-break-after: avoid; } -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/LICENSE.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/LICENSE.md deleted file mode 100644 index 4cd8b14..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/LICENSE.md +++ /dev/null @@ -1,30 +0,0 @@ -Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later) -Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) -Copyright 2004 Manfred Stienstra (the original version) - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of the nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE PYTHON MARKDOWN PROJECT ''AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL ANY CONTRIBUTORS TO THE PYTHON MARKDOWN PROJECT -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/README.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/README.md deleted file mode 100644 index 97a44b1..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/README.md +++ /dev/null @@ -1,30 +0,0 @@ -[Python-Markdown][] -=================== - -This is a Python implementation of John Gruber's [Markdown][]. -It is almost completely compliant with the reference implementation, -though there are a few known issues. See [Features][] for information -on what exactly is supported and what is not. Additional features are -supported by the [Available Extensions][]. - -[Python-Markdown]: http://packages.python.org/Markdown/ -[Markdown]: http://daringfireball.net/projects/markdown/ -[Features]: http://packages.python.org/Markdown/index.html#Features -[Available Extensions]: http://packages.python.org/Markdown/extensions/index.html - - -Documentation -------------- - -Installation and usage documentation is available in the `docs/` directory -of the distribution and on the project website at -. - -Support -------- - -You may ask for help and discuss various other issues on the [mailing list][] and report bugs on the [bug tracker][]. - -[mailing list]: http://lists.sourceforge.net/lists/listinfo/python-markdown-discuss -[bug tracker]: http://github.com/waylan/Python-Markdown/issues - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/__init__.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/__init__.py deleted file mode 100644 index 2fe68de..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/__init__.py +++ /dev/null @@ -1,448 +0,0 @@ -""" -Python Markdown -=============== - -Python Markdown converts Markdown to HTML and can be used as a library or -called from the command line. - -## Basic usage as a module: - - import markdown - html = markdown.markdown(your_text_string) - -See for more -information and instructions on how to extend the functionality of -Python Markdown. Read that before you try modifying this file. - -## Authors and License - -Started by [Manfred Stienstra](http://www.dwerg.net/). Continued and -maintained by [Yuri Takhteyev](http://www.freewisdom.org), [Waylan -Limberg](http://achinghead.com/) and [Artem Yunusov](http://blog.splyer.com). - -Contact: markdown@freewisdom.org - -Copyright 2007-2013 The Python Markdown Project (v. 1.7 and later) -Copyright 200? Django Software Foundation (OrderedDict implementation) -Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) -Copyright 2004 Manfred Stienstra (the original version) - -License: BSD (see LICENSE for details). -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from .__version__ import version, version_info -import re -import codecs -import sys -import logging -from . import util -from .preprocessors import build_preprocessors -from .blockprocessors import build_block_parser -from .treeprocessors import build_treeprocessors -from .inlinepatterns import build_inlinepatterns -from .postprocessors import build_postprocessors -from .extensions import Extension -from .serializers import to_html_string, to_xhtml_string - -__all__ = ['Markdown', 'markdown', 'markdownFromFile'] - -logger = logging.getLogger('MARKDOWN') - - -class Markdown(object): - """Convert Markdown to HTML.""" - - doc_tag = "div" # Element used to wrap document - later removed - - option_defaults = { - 'html_replacement_text' : '[HTML_REMOVED]', - 'tab_length' : 4, - 'enable_attributes' : True, - 'smart_emphasis' : True, - 'lazy_ol' : True, - } - - output_formats = { - 'html' : to_html_string, - 'html4' : to_html_string, - 'html5' : to_html_string, - 'xhtml' : to_xhtml_string, - 'xhtml1': to_xhtml_string, - 'xhtml5': to_xhtml_string, - } - - ESCAPED_CHARS = ['\\', '`', '*', '_', '{', '}', '[', ']', - '(', ')', '>', '#', '+', '-', '.', '!'] - - def __init__(self, *args, **kwargs): - """ - Creates a new Markdown instance. - - Keyword arguments: - - * extensions: A list of extensions. - If they are of type string, the module mdx_name.py will be loaded. - If they are a subclass of markdown.Extension, they will be used - as-is. - * extension_configs: Configuration settingis for extensions. - * output_format: Format of output. Supported formats are: - * "xhtml1": Outputs XHTML 1.x. Default. - * "xhtml5": Outputs XHTML style tags of HTML 5 - * "xhtml": Outputs latest supported version of XHTML (currently XHTML 1.1). - * "html4": Outputs HTML 4 - * "html5": Outputs HTML style tags of HTML 5 - * "html": Outputs latest supported version of HTML (currently HTML 4). - Note that it is suggested that the more specific formats ("xhtml1" - and "html4") be used as "xhtml" or "html" may change in the future - if it makes sense at that time. - * safe_mode: Disallow raw html. One of "remove", "replace" or "escape". - * html_replacement_text: Text used when safe_mode is set to "replace". - * tab_length: Length of tabs in the source. Default: 4 - * enable_attributes: Enable the conversion of attributes. Default: True - * smart_emphasis: Treat `_connected_words_` intelegently Default: True - * lazy_ol: Ignore number of first item of ordered lists. Default: True - - """ - - # For backward compatibility, loop through old positional args - pos = ['extensions', 'extension_configs', 'safe_mode', 'output_format'] - c = 0 - for arg in args: - if pos[c] not in kwargs: - kwargs[pos[c]] = arg - c += 1 - if c == len(pos): - # ignore any additional args - break - - # Loop through kwargs and assign defaults - for option, default in self.option_defaults.items(): - setattr(self, option, kwargs.get(option, default)) - - self.safeMode = kwargs.get('safe_mode', False) - if self.safeMode and 'enable_attributes' not in kwargs: - # Disable attributes in safeMode when not explicitly set - self.enable_attributes = False - - self.registeredExtensions = [] - self.docType = "" - self.stripTopLevelTags = True - - self.build_parser() - - self.references = {} - self.htmlStash = util.HtmlStash() - self.set_output_format(kwargs.get('output_format', 'xhtml1')) - self.registerExtensions(extensions=kwargs.get('extensions', []), - configs=kwargs.get('extension_configs', {})) - self.reset() - - def build_parser(self): - """ Build the parser from the various parts. """ - self.preprocessors = build_preprocessors(self) - self.parser = build_block_parser(self) - self.inlinePatterns = build_inlinepatterns(self) - self.treeprocessors = build_treeprocessors(self) - self.postprocessors = build_postprocessors(self) - return self - - def registerExtensions(self, extensions, configs): - """ - Register extensions with this instance of Markdown. - - Keyword arguments: - - * extensions: A list of extensions, which can either - be strings or objects. See the docstring on Markdown. - * configs: A dictionary mapping module names to config options. - - """ - for ext in extensions: - if isinstance(ext, util.string_type): - ext = self.build_extension(ext, configs.get(ext, [])) - if isinstance(ext, Extension): - ext.extendMarkdown(self, globals()) - elif ext is not None: - raise TypeError( - 'Extension "%s.%s" must be of type: "markdown.Extension"' - % (ext.__class__.__module__, ext.__class__.__name__)) - - return self - - def build_extension(self, ext_name, configs = []): - """Build extension by name, then return the module. - - The extension name may contain arguments as part of the string in the - following format: "extname(key1=value1,key2=value2)" - - """ - - # Parse extensions config params (ignore the order) - configs = dict(configs) - pos = ext_name.find("(") # find the first "(" - if pos > 0: - ext_args = ext_name[pos+1:-1] - ext_name = ext_name[:pos] - pairs = [x.split("=") for x in ext_args.split(",")] - configs.update([(x.strip(), y.strip()) for (x, y) in pairs]) - - # Setup the module name - module_name = ext_name - if '.' not in ext_name: - import sublime - if sublime.version() >= '3000': - from ..helper import INSTALLED_DIRECTORY - module_name = '.'.join([INSTALLED_DIRECTORY, 'markdown.extensions', ext_name]) - else: - module_name = '.'.join(['markdown.extensions', ext_name]) - - # Try loading the extension first from one place, then another - try: # New style (markdown.extensons.) - module = __import__(module_name, {}, {}, [module_name.rpartition('.')[0]]) - except ImportError: - module_name_old_style = '_'.join(['mdx', ext_name]) - try: # Old style (mdx_) - module = __import__(module_name_old_style) - except ImportError as e: - message = "Failed loading extension '%s' from '%s' or '%s'" \ - % (ext_name, module_name, module_name_old_style) - e.args = (message,) + e.args[1:] - raise - - # If the module is loaded successfully, we expect it to define a - # function called makeExtension() - try: - return module.makeExtension(configs.items()) - except AttributeError as e: - message = e.args[0] - message = "Failed to initiate extension " \ - "'%s': %s" % (ext_name, message) - e.args = (message,) + e.args[1:] - raise - - def registerExtension(self, extension): - """ This gets called by the extension """ - self.registeredExtensions.append(extension) - return self - - def reset(self): - """ - Resets all state variables so that we can start with a new text. - """ - self.htmlStash.reset() - self.references.clear() - - for extension in self.registeredExtensions: - if hasattr(extension, 'reset'): - extension.reset() - - return self - - def set_output_format(self, format): - """ Set the output format for the class instance. """ - self.output_format = format.lower() - try: - self.serializer = self.output_formats[self.output_format] - except KeyError as e: - valid_formats = list(self.output_formats.keys()) - valid_formats.sort() - message = 'Invalid Output Format: "%s". Use one of %s.' \ - % (self.output_format, - '"' + '", "'.join(valid_formats) + '"') - e.args = (message,) + e.args[1:] - raise - return self - - def convert(self, source): - """ - Convert markdown to serialized XHTML or HTML. - - Keyword arguments: - - * source: Source text as a Unicode string. - - Markdown processing takes place in five steps: - - 1. A bunch of "preprocessors" munge the input text. - 2. BlockParser() parses the high-level structural elements of the - pre-processed text into an ElementTree. - 3. A bunch of "treeprocessors" are run against the ElementTree. One - such treeprocessor runs InlinePatterns against the ElementTree, - detecting inline markup. - 4. Some post-processors are run against the text after the ElementTree - has been serialized into text. - 5. The output is written to a string. - - """ - - # Fixup the source text - if not source.strip(): - return '' # a blank unicode string - - try: - source = util.text_type(source) - except UnicodeDecodeError as e: - # Customise error message while maintaining original trackback - e.reason += '. -- Note: Markdown only accepts unicode input!' - raise - - # Split into lines and run the line preprocessors. - self.lines = source.split("\n") - for prep in self.preprocessors.values(): - self.lines = prep.run(self.lines) - - # Parse the high-level elements. - root = self.parser.parseDocument(self.lines).getroot() - - # Run the tree-processors - for treeprocessor in self.treeprocessors.values(): - newRoot = treeprocessor.run(root) - if newRoot: - root = newRoot - - # Serialize _properly_. Strip top-level tags. - output = self.serializer(root) - if self.stripTopLevelTags: - try: - start = output.index('<%s>'%self.doc_tag)+len(self.doc_tag)+2 - end = output.rindex(''%self.doc_tag) - output = output[start:end].strip() - except ValueError: - if output.strip().endswith('<%s />'%self.doc_tag): - # We have an empty document - output = '' - else: - # We have a serious problem - raise ValueError('Markdown failed to strip top-level tags. Document=%r' % output.strip()) - - # Run the text post-processors - for pp in self.postprocessors.values(): - output = pp.run(output) - - return output.strip() - - def convertFile(self, input=None, output=None, encoding=None): - """Converts a markdown file and returns the HTML as a unicode string. - - Decodes the file using the provided encoding (defaults to utf-8), - passes the file content to markdown, and outputs the html to either - the provided stream or the file with provided name, using the same - encoding as the source file. The 'xmlcharrefreplace' error handler is - used when encoding the output. - - **Note:** This is the only place that decoding and encoding of unicode - takes place in Python-Markdown. (All other code is unicode-in / - unicode-out.) - - Keyword arguments: - - * input: File object or path. Reads from stdin if `None`. - * output: File object or path. Writes to stdout if `None`. - * encoding: Encoding of input and output files. Defaults to utf-8. - - """ - - encoding = encoding or "utf-8" - - # Read the source - if input: - if isinstance(input, util.string_type): - input_file = codecs.open(input, mode="r", encoding=encoding) - else: - input_file = codecs.getreader(encoding)(input) - text = input_file.read() - input_file.close() - else: - text = sys.stdin.read() - if not isinstance(text, util.text_type): - text = text.decode(encoding) - - text = text.lstrip('\ufeff') # remove the byte-order mark - - # Convert - html = self.convert(text) - - # Write to file or stdout - if output: - if isinstance(output, util.string_type): - output_file = codecs.open(output, "w", - encoding=encoding, - errors="xmlcharrefreplace") - output_file.write(html) - output_file.close() - else: - writer = codecs.getwriter(encoding) - output_file = writer(output, errors="xmlcharrefreplace") - output_file.write(html) - # Don't close here. User may want to write more. - else: - # Encode manually and write bytes to stdout. - html = html.encode(encoding, "xmlcharrefreplace") - try: - # Write bytes directly to buffer (Python 3). - sys.stdout.buffer.write(html) - except AttributeError: - # Probably Python 2, which works with bytes by default. - sys.stdout.write(html) - - return self - - -""" -EXPORTED FUNCTIONS -============================================================================= - -Those are the two functions we really mean to export: markdown() and -markdownFromFile(). -""" - -def markdown(text, *args, **kwargs): - """Convert a markdown string to HTML and return HTML as a unicode string. - - This is a shortcut function for `Markdown` class to cover the most - basic use case. It initializes an instance of Markdown, loads the - necessary extensions and runs the parser on the given text. - - Keyword arguments: - - * text: Markdown formatted text as Unicode or ASCII string. - * Any arguments accepted by the Markdown class. - - Returns: An HTML document as a string. - - """ - md = Markdown(*args, **kwargs) - return md.convert(text) - - -def markdownFromFile(*args, **kwargs): - """Read markdown code from a file and write it to a file or a stream. - - This is a shortcut function which initializes an instance of Markdown, - and calls the convertFile method rather than convert. - - Keyword arguments: - - * input: a file name or readable object. - * output: a file name or writable object. - * encoding: Encoding of input and output. - * Any arguments accepted by the Markdown class. - - """ - # For backward compatibility loop through positional args - pos = ['input', 'output', 'extensions', 'encoding'] - c = 0 - for arg in args: - if pos[c] not in kwargs: - kwargs[pos[c]] = arg - c += 1 - if c == len(pos): - break - - md = Markdown(**kwargs) - md.convertFile(kwargs.get('input', None), - kwargs.get('output', None), - kwargs.get('encoding', None)) - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/__main__.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/__main__.py deleted file mode 100644 index 8ee8c82..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/__main__.py +++ /dev/null @@ -1,87 +0,0 @@ -""" -COMMAND-LINE SPECIFIC STUFF -============================================================================= - -""" - -import markdown -import sys -import optparse - -import logging -from logging import DEBUG, INFO, CRITICAL - -logger = logging.getLogger('MARKDOWN') - -def parse_options(): - """ - Define and parse `optparse` options for command-line usage. - """ - usage = """%prog [options] [INPUTFILE] - (STDIN is assumed if no INPUTFILE is given)""" - desc = "A Python implementation of John Gruber's Markdown. " \ - "http://packages.python.org/Markdown/" - ver = "%%prog %s" % markdown.version - - parser = optparse.OptionParser(usage=usage, description=desc, version=ver) - parser.add_option("-f", "--file", dest="filename", default=None, - help="Write output to OUTPUT_FILE. Defaults to STDOUT.", - metavar="OUTPUT_FILE") - parser.add_option("-e", "--encoding", dest="encoding", - help="Encoding for input and output files.",) - parser.add_option("-q", "--quiet", default = CRITICAL, - action="store_const", const=CRITICAL+10, dest="verbose", - help="Suppress all warnings.") - parser.add_option("-v", "--verbose", - action="store_const", const=INFO, dest="verbose", - help="Print all warnings.") - parser.add_option("-s", "--safe", dest="safe", default=False, - metavar="SAFE_MODE", - help="'replace', 'remove' or 'escape' HTML tags in input") - parser.add_option("-o", "--output_format", dest="output_format", - default='xhtml1', metavar="OUTPUT_FORMAT", - help="'xhtml1' (default), 'html4' or 'html5'.") - parser.add_option("--noisy", - action="store_const", const=DEBUG, dest="verbose", - help="Print debug messages.") - parser.add_option("-x", "--extension", action="append", dest="extensions", - help = "Load extension EXTENSION.", metavar="EXTENSION") - parser.add_option("-n", "--no_lazy_ol", dest="lazy_ol", - action='store_false', default=True, - help="Observe number of first item of ordered lists.") - - (options, args) = parser.parse_args() - - if len(args) == 0: - input_file = None - else: - input_file = args[0] - - if not options.extensions: - options.extensions = [] - - return {'input': input_file, - 'output': options.filename, - 'safe_mode': options.safe, - 'extensions': options.extensions, - 'encoding': options.encoding, - 'output_format': options.output_format, - 'lazy_ol': options.lazy_ol}, options.verbose - -def run(): - """Run Markdown from the command line.""" - - # Parse options and adjust logging level if necessary - options, logging_level = parse_options() - if not options: sys.exit(2) - logger.setLevel(logging_level) - logger.addHandler(logging.StreamHandler()) - - # Run - markdown.markdownFromFile(**options) - -if __name__ == '__main__': - # Support running module as a commandline command. - # Python 2.5 & 2.6 do: `python -m markdown.__main__ [options] [args]`. - # Python 2.7 & 3.x do: `python -m markdown [options] [args]`. - run() diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/__version__.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/__version__.py deleted file mode 100644 index a13559c..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/__version__.py +++ /dev/null @@ -1,28 +0,0 @@ -# -# markdown/__version__.py -# -# version_info should conform to PEP 386 -# (major, minor, micro, alpha/beta/rc/final, #) -# (1, 1, 2, 'alpha', 0) => "1.1.2.dev" -# (1, 2, 0, 'beta', 2) => "1.2b2" -version_info = (2, 3, 1, 'final', 0) - -def _get_version(): - " Returns a PEP 386-compliant version number from version_info. " - assert len(version_info) == 5 - assert version_info[3] in ('alpha', 'beta', 'rc', 'final') - - parts = 2 if version_info[2] == 0 else 3 - main = '.'.join(map(str, version_info[:parts])) - - sub = '' - if version_info[3] == 'alpha' and version_info[4] == 0: - # TODO: maybe append some sort of git info here?? - sub = '.dev' - elif version_info[3] != 'final': - mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'} - sub = mapping[version_info[3]] + str(version_info[4]) - - return str(main + sub) - -version = _get_version() diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/blockparser.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/blockparser.py deleted file mode 100644 index 4504a16..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/blockparser.py +++ /dev/null @@ -1,99 +0,0 @@ -from __future__ import unicode_literals -from __future__ import absolute_import -from . import util -from . import odict - -class State(list): - """ Track the current and nested state of the parser. - - This utility class is used to track the state of the BlockParser and - support multiple levels if nesting. It's just a simple API wrapped around - a list. Each time a state is set, that state is appended to the end of the - list. Each time a state is reset, that state is removed from the end of - the list. - - Therefore, each time a state is set for a nested block, that state must be - reset when we back out of that level of nesting or the state could be - corrupted. - - While all the methods of a list object are available, only the three - defined below need be used. - - """ - - def set(self, state): - """ Set a new state. """ - self.append(state) - - def reset(self): - """ Step back one step in nested state. """ - self.pop() - - def isstate(self, state): - """ Test that top (current) level is of given state. """ - if len(self): - return self[-1] == state - else: - return False - -class BlockParser: - """ Parse Markdown blocks into an ElementTree object. - - A wrapper class that stitches the various BlockProcessors together, - looping through them and creating an ElementTree object. - """ - - def __init__(self, markdown): - self.blockprocessors = odict.OrderedDict() - self.state = State() - self.markdown = markdown - - def parseDocument(self, lines): - """ Parse a markdown document into an ElementTree. - - Given a list of lines, an ElementTree object (not just a parent Element) - is created and the root element is passed to the parser as the parent. - The ElementTree object is returned. - - This should only be called on an entire document, not pieces. - - """ - # Create a ElementTree from the lines - self.root = util.etree.Element(self.markdown.doc_tag) - self.parseChunk(self.root, '\n'.join(lines)) - return util.etree.ElementTree(self.root) - - def parseChunk(self, parent, text): - """ Parse a chunk of markdown text and attach to given etree node. - - While the ``text`` argument is generally assumed to contain multiple - blocks which will be split on blank lines, it could contain only one - block. Generally, this method would be called by extensions when - block parsing is required. - - The ``parent`` etree Element passed in is altered in place. - Nothing is returned. - - """ - self.parseBlocks(parent, text.split('\n\n')) - - def parseBlocks(self, parent, blocks): - """ Process blocks of markdown text and attach to given etree node. - - Given a list of ``blocks``, each blockprocessor is stepped through - until there are no blocks left. While an extension could potentially - call this method directly, it's generally expected to be used internally. - - This is a public method as an extension may need to add/alter additional - BlockProcessors which call this method to recursively parse a nested - block. - - """ - while blocks: - for processor in self.blockprocessors.values(): - if processor.test(parent, blocks[0]): - if processor.run(parent, blocks) is not False: - # run returns True or None - break - - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/blockprocessors.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/blockprocessors.py deleted file mode 100644 index 61977b4..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/blockprocessors.py +++ /dev/null @@ -1,558 +0,0 @@ -""" -CORE MARKDOWN BLOCKPARSER -=========================================================================== - -This parser handles basic parsing of Markdown blocks. It doesn't concern itself -with inline elements such as **bold** or *italics*, but rather just catches -blocks, lists, quotes, etc. - -The BlockParser is made up of a bunch of BlockProssors, each handling a -different type of block. Extensions may add/replace/remove BlockProcessors -as they need to alter how markdown blocks are parsed. -""" - -from __future__ import absolute_import -from __future__ import division -from __future__ import unicode_literals -import logging -import re -from . import util -from .blockparser import BlockParser - -logger = logging.getLogger('MARKDOWN') - - -def build_block_parser(md_instance, **kwargs): - """ Build the default block parser used by Markdown. """ - parser = BlockParser(md_instance) - parser.blockprocessors['empty'] = EmptyBlockProcessor(parser) - parser.blockprocessors['indent'] = ListIndentProcessor(parser) - parser.blockprocessors['code'] = CodeBlockProcessor(parser) - parser.blockprocessors['hashheader'] = HashHeaderProcessor(parser) - parser.blockprocessors['setextheader'] = SetextHeaderProcessor(parser) - parser.blockprocessors['hr'] = HRProcessor(parser) - parser.blockprocessors['olist'] = OListProcessor(parser) - parser.blockprocessors['ulist'] = UListProcessor(parser) - parser.blockprocessors['quote'] = BlockQuoteProcessor(parser) - parser.blockprocessors['paragraph'] = ParagraphProcessor(parser) - return parser - - -class BlockProcessor: - """ Base class for block processors. - - Each subclass will provide the methods below to work with the source and - tree. Each processor will need to define it's own ``test`` and ``run`` - methods. The ``test`` method should return True or False, to indicate - whether the current block should be processed by this processor. If the - test passes, the parser will call the processors ``run`` method. - - """ - - def __init__(self, parser): - self.parser = parser - self.tab_length = parser.markdown.tab_length - - def lastChild(self, parent): - """ Return the last child of an etree element. """ - if len(parent): - return parent[-1] - else: - return None - - def detab(self, text): - """ Remove a tab from the front of each line of the given text. """ - newtext = [] - lines = text.split('\n') - for line in lines: - if line.startswith(' '*self.tab_length): - newtext.append(line[self.tab_length:]) - elif not line.strip(): - newtext.append('') - else: - break - return '\n'.join(newtext), '\n'.join(lines[len(newtext):]) - - def looseDetab(self, text, level=1): - """ Remove a tab from front of lines but allowing dedented lines. """ - lines = text.split('\n') - for i in range(len(lines)): - if lines[i].startswith(' '*self.tab_length*level): - lines[i] = lines[i][self.tab_length*level:] - return '\n'.join(lines) - - def test(self, parent, block): - """ Test for block type. Must be overridden by subclasses. - - As the parser loops through processors, it will call the ``test`` method - on each to determine if the given block of text is of that type. This - method must return a boolean ``True`` or ``False``. The actual method of - testing is left to the needs of that particular block type. It could - be as simple as ``block.startswith(some_string)`` or a complex regular - expression. As the block type may be different depending on the parent - of the block (i.e. inside a list), the parent etree element is also - provided and may be used as part of the test. - - Keywords: - - * ``parent``: A etree element which will be the parent of the block. - * ``block``: A block of text from the source which has been split at - blank lines. - """ - pass - - def run(self, parent, blocks): - """ Run processor. Must be overridden by subclasses. - - When the parser determines the appropriate type of a block, the parser - will call the corresponding processor's ``run`` method. This method - should parse the individual lines of the block and append them to - the etree. - - Note that both the ``parent`` and ``etree`` keywords are pointers - to instances of the objects which should be edited in place. Each - processor must make changes to the existing objects as there is no - mechanism to return new/different objects to replace them. - - This means that this method should be adding SubElements or adding text - to the parent, and should remove (``pop``) or add (``insert``) items to - the list of blocks. - - Keywords: - - * ``parent``: A etree element which is the parent of the current block. - * ``blocks``: A list of all remaining blocks of the document. - """ - pass - - -class ListIndentProcessor(BlockProcessor): - """ Process children of list items. - - Example: - * a list item - process this part - - or this part - - """ - - ITEM_TYPES = ['li'] - LIST_TYPES = ['ul', 'ol'] - - def __init__(self, *args): - BlockProcessor.__init__(self, *args) - self.INDENT_RE = re.compile(r'^(([ ]{%s})+)'% self.tab_length) - - def test(self, parent, block): - return block.startswith(' '*self.tab_length) and \ - not self.parser.state.isstate('detabbed') and \ - (parent.tag in self.ITEM_TYPES or \ - (len(parent) and parent[-1] and \ - (parent[-1].tag in self.LIST_TYPES) - ) - ) - - def run(self, parent, blocks): - block = blocks.pop(0) - level, sibling = self.get_level(parent, block) - block = self.looseDetab(block, level) - - self.parser.state.set('detabbed') - if parent.tag in self.ITEM_TYPES: - # It's possible that this parent has a 'ul' or 'ol' child list - # with a member. If that is the case, then that should be the - # parent. This is intended to catch the edge case of an indented - # list whose first member was parsed previous to this point - # see OListProcessor - if len(parent) and parent[-1].tag in self.LIST_TYPES: - self.parser.parseBlocks(parent[-1], [block]) - else: - # The parent is already a li. Just parse the child block. - self.parser.parseBlocks(parent, [block]) - elif sibling.tag in self.ITEM_TYPES: - # The sibling is a li. Use it as parent. - self.parser.parseBlocks(sibling, [block]) - elif len(sibling) and sibling[-1].tag in self.ITEM_TYPES: - # The parent is a list (``ol`` or ``ul``) which has children. - # Assume the last child li is the parent of this block. - if sibling[-1].text: - # If the parent li has text, that text needs to be moved to a p - # The p must be 'inserted' at beginning of list in the event - # that other children already exist i.e.; a nested sublist. - p = util.etree.Element('p') - p.text = sibling[-1].text - sibling[-1].text = '' - sibling[-1].insert(0, p) - self.parser.parseChunk(sibling[-1], block) - else: - self.create_item(sibling, block) - self.parser.state.reset() - - def create_item(self, parent, block): - """ Create a new li and parse the block with it as the parent. """ - li = util.etree.SubElement(parent, 'li') - self.parser.parseBlocks(li, [block]) - - def get_level(self, parent, block): - """ Get level of indent based on list level. """ - # Get indent level - m = self.INDENT_RE.match(block) - if m: - indent_level = len(m.group(1))/self.tab_length - else: - indent_level = 0 - if self.parser.state.isstate('list'): - # We're in a tightlist - so we already are at correct parent. - level = 1 - else: - # We're in a looselist - so we need to find parent. - level = 0 - # Step through children of tree to find matching indent level. - while indent_level > level: - child = self.lastChild(parent) - if child and (child.tag in self.LIST_TYPES or child.tag in self.ITEM_TYPES): - if child.tag in self.LIST_TYPES: - level += 1 - parent = child - else: - # No more child levels. If we're short of indent_level, - # we have a code block. So we stop here. - break - return level, parent - - -class CodeBlockProcessor(BlockProcessor): - """ Process code blocks. """ - - def test(self, parent, block): - return block.startswith(' '*self.tab_length) - - def run(self, parent, blocks): - sibling = self.lastChild(parent) - block = blocks.pop(0) - theRest = '' - if sibling and sibling.tag == "pre" and len(sibling) \ - and sibling[0].tag == "code": - # The previous block was a code block. As blank lines do not start - # new code blocks, append this block to the previous, adding back - # linebreaks removed from the split into a list. - code = sibling[0] - block, theRest = self.detab(block) - code.text = util.AtomicString('%s\n%s\n' % (code.text, block.rstrip())) - else: - # This is a new codeblock. Create the elements and insert text. - pre = util.etree.SubElement(parent, 'pre') - code = util.etree.SubElement(pre, 'code') - block, theRest = self.detab(block) - code.text = util.AtomicString('%s\n' % block.rstrip()) - if theRest: - # This block contained unindented line(s) after the first indented - # line. Insert these lines as the first block of the master blocks - # list for future processing. - blocks.insert(0, theRest) - - -class BlockQuoteProcessor(BlockProcessor): - - RE = re.compile(r'(^|\n)[ ]{0,3}>[ ]?(.*)') - - def test(self, parent, block): - return bool(self.RE.search(block)) - - def run(self, parent, blocks): - block = blocks.pop(0) - m = self.RE.search(block) - if m: - before = block[:m.start()] # Lines before blockquote - # Pass lines before blockquote in recursively for parsing forst. - self.parser.parseBlocks(parent, [before]) - # Remove ``> `` from begining of each line. - block = '\n'.join([self.clean(line) for line in - block[m.start():].split('\n')]) - sibling = self.lastChild(parent) - if sibling and sibling.tag == "blockquote": - # Previous block was a blockquote so set that as this blocks parent - quote = sibling - else: - # This is a new blockquote. Create a new parent element. - quote = util.etree.SubElement(parent, 'blockquote') - # Recursively parse block with blockquote as parent. - # change parser state so blockquotes embedded in lists use p tags - self.parser.state.set('blockquote') - self.parser.parseChunk(quote, block) - self.parser.state.reset() - - def clean(self, line): - """ Remove ``>`` from beginning of a line. """ - m = self.RE.match(line) - if line.strip() == ">": - return "" - elif m: - return m.group(2) - else: - return line - -class OListProcessor(BlockProcessor): - """ Process ordered list blocks. """ - - TAG = 'ol' - # Detect an item (``1. item``). ``group(1)`` contains contents of item. - RE = re.compile(r'^[ ]{0,3}\d+\.[ ]+(.*)') - # Detect items on secondary lines. they can be of either list type. - CHILD_RE = re.compile(r'^[ ]{0,3}((\d+\.)|[*+-])[ ]+(.*)') - # Detect indented (nested) items of either type - INDENT_RE = re.compile(r'^[ ]{4,7}((\d+\.)|[*+-])[ ]+.*') - # The integer (python string) with which the lists starts (default=1) - # Eg: If list is intialized as) - # 3. Item - # The ol tag will get starts="3" attribute - STARTSWITH = '1' - # List of allowed sibling tags. - SIBLING_TAGS = ['ol', 'ul'] - - def test(self, parent, block): - return bool(self.RE.match(block)) - - def run(self, parent, blocks): - # Check fr multiple items in one block. - items = self.get_items(blocks.pop(0)) - sibling = self.lastChild(parent) - - if sibling and sibling.tag in self.SIBLING_TAGS: - # Previous block was a list item, so set that as parent - lst = sibling - # make sure previous item is in a p- if the item has text, then it - # it isn't in a p - if lst[-1].text: - # since it's possible there are other children for this sibling, - # we can't just SubElement the p, we need to insert it as the - # first item - p = util.etree.Element('p') - p.text = lst[-1].text - lst[-1].text = '' - lst[-1].insert(0, p) - # if the last item has a tail, then the tail needs to be put in a p - # likely only when a header is not followed by a blank line - lch = self.lastChild(lst[-1]) - if lch is not None and lch.tail: - p = util.etree.SubElement(lst[-1], 'p') - p.text = lch.tail.lstrip() - lch.tail = '' - - # parse first block differently as it gets wrapped in a p. - li = util.etree.SubElement(lst, 'li') - self.parser.state.set('looselist') - firstitem = items.pop(0) - self.parser.parseBlocks(li, [firstitem]) - self.parser.state.reset() - elif parent.tag in ['ol', 'ul']: - # this catches the edge case of a multi-item indented list whose - # first item is in a blank parent-list item: - # * * subitem1 - # * subitem2 - # see also ListIndentProcessor - lst = parent - else: - # This is a new list so create parent with appropriate tag. - lst = util.etree.SubElement(parent, self.TAG) - # Check if a custom start integer is set - if not self.parser.markdown.lazy_ol and self.STARTSWITH !='1': - lst.attrib['start'] = self.STARTSWITH - - self.parser.state.set('list') - # Loop through items in block, recursively parsing each with the - # appropriate parent. - for item in items: - if item.startswith(' '*self.tab_length): - # Item is indented. Parse with last item as parent - self.parser.parseBlocks(lst[-1], [item]) - else: - # New item. Create li and parse with it as parent - li = util.etree.SubElement(lst, 'li') - self.parser.parseBlocks(li, [item]) - self.parser.state.reset() - - def get_items(self, block): - """ Break a block into list items. """ - items = [] - for line in block.split('\n'): - m = self.CHILD_RE.match(line) - if m: - # This is a new list item - # Check first item for the start index - if not items and self.TAG=='ol': - # Detect the integer value of first list item - INTEGER_RE = re.compile('(\d+)') - self.STARTSWITH = INTEGER_RE.match(m.group(1)).group() - # Append to the list - items.append(m.group(3)) - elif self.INDENT_RE.match(line): - # This is an indented (possibly nested) item. - if items[-1].startswith(' '*self.tab_length): - # Previous item was indented. Append to that item. - items[-1] = '%s\n%s' % (items[-1], line) - else: - items.append(line) - else: - # This is another line of previous item. Append to that item. - items[-1] = '%s\n%s' % (items[-1], line) - return items - - -class UListProcessor(OListProcessor): - """ Process unordered list blocks. """ - - TAG = 'ul' - RE = re.compile(r'^[ ]{0,3}[*+-][ ]+(.*)') - - -class HashHeaderProcessor(BlockProcessor): - """ Process Hash Headers. """ - - # Detect a header at start of any line in block - RE = re.compile(r'(^|\n)(?P#{1,6})(?P
.*?)#*(\n|$)') - - def test(self, parent, block): - return bool(self.RE.search(block)) - - def run(self, parent, blocks): - block = blocks.pop(0) - m = self.RE.search(block) - if m: - before = block[:m.start()] # All lines before header - after = block[m.end():] # All lines after header - if before: - # As the header was not the first line of the block and the - # lines before the header must be parsed first, - # recursively parse this lines as a block. - self.parser.parseBlocks(parent, [before]) - # Create header using named groups from RE - h = util.etree.SubElement(parent, 'h%d' % len(m.group('level'))) - h.text = m.group('header').strip() - if after: - # Insert remaining lines as first block for future parsing. - blocks.insert(0, after) - else: - # This should never happen, but just in case... - logger.warn("We've got a problem header: %r" % block) - - -class SetextHeaderProcessor(BlockProcessor): - """ Process Setext-style Headers. """ - - # Detect Setext-style header. Must be first 2 lines of block. - RE = re.compile(r'^.*?\n[=-]+[ ]*(\n|$)', re.MULTILINE) - - def test(self, parent, block): - return bool(self.RE.match(block)) - - def run(self, parent, blocks): - lines = blocks.pop(0).split('\n') - # Determine level. ``=`` is 1 and ``-`` is 2. - if lines[1].startswith('='): - level = 1 - else: - level = 2 - h = util.etree.SubElement(parent, 'h%d' % level) - h.text = lines[0].strip() - if len(lines) > 2: - # Block contains additional lines. Add to master blocks for later. - blocks.insert(0, '\n'.join(lines[2:])) - - -class HRProcessor(BlockProcessor): - """ Process Horizontal Rules. """ - - RE = r'^[ ]{0,3}((-+[ ]{0,2}){3,}|(_+[ ]{0,2}){3,}|(\*+[ ]{0,2}){3,})[ ]*' - # Detect hr on any line of a block. - SEARCH_RE = re.compile(RE, re.MULTILINE) - - def test(self, parent, block): - m = self.SEARCH_RE.search(block) - # No atomic grouping in python so we simulate it here for performance. - # The regex only matches what would be in the atomic group - the HR. - # Then check if we are at end of block or if next char is a newline. - if m and (m.end() == len(block) or block[m.end()] == '\n'): - # Save match object on class instance so we can use it later. - self.match = m - return True - return False - - def run(self, parent, blocks): - block = blocks.pop(0) - # Check for lines in block before hr. - prelines = block[:self.match.start()].rstrip('\n') - if prelines: - # Recursively parse lines before hr so they get parsed first. - self.parser.parseBlocks(parent, [prelines]) - # create hr - util.etree.SubElement(parent, 'hr') - # check for lines in block after hr. - postlines = block[self.match.end():].lstrip('\n') - if postlines: - # Add lines after hr to master blocks for later parsing. - blocks.insert(0, postlines) - - - -class EmptyBlockProcessor(BlockProcessor): - """ Process blocks that are empty or start with an empty line. """ - - def test(self, parent, block): - return not block or block.startswith('\n') - - def run(self, parent, blocks): - block = blocks.pop(0) - filler = '\n\n' - if block: - # Starts with empty line - # Only replace a single line. - filler = '\n' - # Save the rest for later. - theRest = block[1:] - if theRest: - # Add remaining lines to master blocks for later. - blocks.insert(0, theRest) - sibling = self.lastChild(parent) - if sibling and sibling.tag == 'pre' and len(sibling) and sibling[0].tag == 'code': - # Last block is a codeblock. Append to preserve whitespace. - sibling[0].text = util.AtomicString('%s%s' % (sibling[0].text, filler)) - - -class ParagraphProcessor(BlockProcessor): - """ Process Paragraph blocks. """ - - def test(self, parent, block): - return True - - def run(self, parent, blocks): - block = blocks.pop(0) - if block.strip(): - # Not a blank block. Add to parent, otherwise throw it away. - if self.parser.state.isstate('list'): - # The parent is a tight-list. - # - # Check for any children. This will likely only happen in a - # tight-list when a header isn't followed by a blank line. - # For example: - # - # * # Header - # Line 2 of list item - not part of header. - sibling = self.lastChild(parent) - if sibling is not None: - # Insetrt after sibling. - if sibling.tail: - sibling.tail = '%s\n%s' % (sibling.tail, block) - else: - sibling.tail = '\n%s' % block - else: - # Append to parent.text - if parent.text: - parent.text = '%s\n%s' % (parent.text, block) - else: - parent.text = block.lstrip() - else: - # Create a regular paragraph - p = util.etree.SubElement(parent, 'p') - p.text = block.lstrip() diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/__init__.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/__init__.py deleted file mode 100644 index 184c4d1..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/__init__.py +++ /dev/null @@ -1,53 +0,0 @@ -""" -Extensions ------------------------------------------------------------------------------ -""" - -from __future__ import unicode_literals - -class Extension(object): - """ Base class for extensions to subclass. """ - def __init__(self, configs = {}): - """Create an instance of an Extention. - - Keyword arguments: - - * configs: A dict of configuration setting used by an Extension. - """ - self.config = configs - - def getConfig(self, key, default=''): - """ Return a setting for the given key or an empty string. """ - if key in self.config: - return self.config[key][0] - else: - return default - - def getConfigs(self): - """ Return all configs settings as a dict. """ - return dict([(key, self.getConfig(key)) for key in self.config.keys()]) - - def getConfigInfo(self): - """ Return all config descriptions as a list of tuples. """ - return [(key, self.config[key][1]) for key in self.config.keys()] - - def setConfig(self, key, value): - """ Set a config setting for `key` with the given `value`. """ - self.config[key][0] = value - - def extendMarkdown(self, md, md_globals): - """ - Add the various proccesors and patterns to the Markdown Instance. - - This method must be overriden by every extension. - - Keyword arguments: - - * md: The Markdown instance. - - * md_globals: Global variables in the markdown module namespace. - - """ - raise NotImplementedError('Extension "%s.%s" must define an "extendMarkdown"' \ - 'method.' % (self.__class__.__module__, self.__class__.__name__)) - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/abbr.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/abbr.py deleted file mode 100644 index 5e46f1d..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/abbr.py +++ /dev/null @@ -1,96 +0,0 @@ -''' -Abbreviation Extension for Python-Markdown -========================================== - -This extension adds abbreviation handling to Python-Markdown. - -Simple Usage: - - >>> import markdown - >>> text = """ - ... Some text with an ABBR and a REF. Ignore REFERENCE and ref. - ... - ... *[ABBR]: Abbreviation - ... *[REF]: Abbreviation Reference - ... """ - >>> print markdown.markdown(text, ['abbr']) -

Some text with an ABBR and a REF. Ignore REFERENCE and ref.

- -Copyright 2007-2008 -* [Waylan Limberg](http://achinghead.com/) -* [Seemant Kulleen](http://www.kulleen.org/) - - -''' - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import Extension -from ..preprocessors import Preprocessor -from ..inlinepatterns import Pattern -from ..util import etree -import re - -# Global Vars -ABBR_REF_RE = re.compile(r'[*]\[(?P[^\]]*)\][ ]?:\s*(?P.*)') - -class AbbrExtension(Extension): - """ Abbreviation Extension for Python-Markdown. """ - - def extendMarkdown(self, md, md_globals): - """ Insert AbbrPreprocessor before ReferencePreprocessor. """ - md.preprocessors.add('abbr', AbbrPreprocessor(md), '<reference') - - -class AbbrPreprocessor(Preprocessor): - """ Abbreviation Preprocessor - parse text for abbr references. """ - - def run(self, lines): - ''' - Find and remove all Abbreviation references from the text. - Each reference is set as a new AbbrPattern in the markdown instance. - - ''' - new_text = [] - for line in lines: - m = ABBR_REF_RE.match(line) - if m: - abbr = m.group('abbr').strip() - title = m.group('title').strip() - self.markdown.inlinePatterns['abbr-%s'%abbr] = \ - AbbrPattern(self._generate_pattern(abbr), title) - else: - new_text.append(line) - return new_text - - def _generate_pattern(self, text): - ''' - Given a string, returns an regex pattern to match that string. - - 'HTML' -> r'(?P<abbr>[H][T][M][L])' - - Note: we force each char as a literal match (in brackets) as we don't - know what they will be beforehand. - - ''' - chars = list(text) - for i in range(len(chars)): - chars[i] = r'[%s]' % chars[i] - return r'(?P<abbr>\b%s\b)' % (r''.join(chars)) - - -class AbbrPattern(Pattern): - """ Abbreviation inline pattern. """ - - def __init__(self, pattern, title): - super(AbbrPattern, self).__init__(pattern) - self.title = title - - def handleMatch(self, m): - abbr = etree.Element('abbr') - abbr.text = m.group('abbr') - abbr.set('title', self.title) - return abbr - -def makeExtension(configs=None): - return AbbrExtension(configs=configs) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/admonition.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/admonition.py deleted file mode 100644 index 9a45b92..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/admonition.py +++ /dev/null @@ -1,118 +0,0 @@ -""" -Admonition extension for Python-Markdown -======================================== - -Adds rST-style admonitions. Inspired by [rST][] feature with the same name. - -The syntax is (followed by an indented block with the contents): - !!! [type] [optional explicit title] - -Where `type` is used as a CSS class name of the div. If not present, `title` -defaults to the capitalized `type`, so "note" -> "Note". - -rST suggests the following `types`, but you're free to use whatever you want: - attention, caution, danger, error, hint, important, note, tip, warning - - -A simple example: - !!! note - This is the first line inside the box. - -Outputs: - <div class="admonition note"> - <p class="admonition-title">Note</p> - <p>This is the first line inside the box</p> - </div> - -You can also specify the title and CSS class of the admonition: - !!! custom "Did you know?" - Another line here. - -Outputs: - <div class="admonition custom"> - <p class="admonition-title">Did you know?</p> - <p>Another line here.</p> - </div> - -[rST]: http://docutils.sourceforge.net/docs/ref/rst/directives.html#specific-admonitions - -By [Tiago Serafim](http://www.tiagoserafim.com/). - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import Extension -from ..blockprocessors import BlockProcessor -from ..util import etree -import re - - -class AdmonitionExtension(Extension): - """ Admonition extension for Python-Markdown. """ - - def extendMarkdown(self, md, md_globals): - """ Add Admonition to Markdown instance. """ - md.registerExtension(self) - - md.parser.blockprocessors.add('admonition', - AdmonitionProcessor(md.parser), - '_begin') - - -class AdmonitionProcessor(BlockProcessor): - - CLASSNAME = 'admonition' - CLASSNAME_TITLE = 'admonition-title' - RE = re.compile(r'(?:^|\n)!!!\ ?([\w\-]+)(?:\ "(.*?)")?') - - def test(self, parent, block): - sibling = self.lastChild(parent) - return self.RE.search(block) or \ - (block.startswith(' ' * self.tab_length) and sibling and \ - sibling.get('class', '').find(self.CLASSNAME) != -1) - - def run(self, parent, blocks): - sibling = self.lastChild(parent) - block = blocks.pop(0) - m = self.RE.search(block) - - if m: - block = block[m.end() + 1:] # removes the first line - - block, theRest = self.detab(block) - - if m: - klass, title = self.get_class_and_title(m) - div = etree.SubElement(parent, 'div') - div.set('class', '%s %s' % (self.CLASSNAME, klass)) - if title: - p = etree.SubElement(div, 'p') - p.text = title - p.set('class', self.CLASSNAME_TITLE) - else: - div = sibling - - self.parser.parseChunk(div, block) - - if theRest: - # This block contained unindented line(s) after the first indented - # line. Insert these lines as the first block of the master blocks - # list for future processing. - blocks.insert(0, theRest) - - def get_class_and_title(self, match): - klass, title = match.group(1).lower(), match.group(2) - if title is None: - # no title was provided, use the capitalized classname as title - # e.g.: `!!! note` will render `<p class="admonition-title">Note</p>` - title = klass.capitalize() - elif title == '': - # an explicit blank title should not be rendered - # e.g.: `!!! warning ""` will *not* render `p` with a title - title = None - return klass, title - - -def makeExtension(configs={}): - return AdmonitionExtension(configs=configs) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/attr_list.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/attr_list.py deleted file mode 100644 index c98aa85..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/attr_list.py +++ /dev/null @@ -1,140 +0,0 @@ -""" -Attribute List Extension for Python-Markdown -============================================ - -Adds attribute list syntax. Inspired by -[maruku](http://maruku.rubyforge.org/proposal.html#attribute_lists)'s -feature of the same name. - -Copyright 2011 [Waylan Limberg](http://achinghead.com/). - -Contact: markdown@freewisdom.org - -License: BSD (see ../LICENSE.md for details) - -Dependencies: -* [Python 2.4+](http://python.org) -* [Markdown 2.1+](http://packages.python.org/Markdown/) - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import Extension -from ..treeprocessors import Treeprocessor -from ..util import isBlockLevel -import re - -try: - Scanner = re.Scanner -except AttributeError: - # must be on Python 2.4 - from sre import Scanner - -def _handle_double_quote(s, t): - k, v = t.split('=') - return k, v.strip('"') - -def _handle_single_quote(s, t): - k, v = t.split('=') - return k, v.strip("'") - -def _handle_key_value(s, t): - return t.split('=') - -def _handle_word(s, t): - if t.startswith('.'): - return '.', t[1:] - if t.startswith('#'): - return 'id', t[1:] - return t, t - -_scanner = Scanner([ - (r'[^ ]+=".*?"', _handle_double_quote), - (r"[^ ]+='.*?'", _handle_single_quote), - (r'[^ ]+=[^ ]*', _handle_key_value), - (r'[^ ]+', _handle_word), - (r' ', None) -]) - -def get_attrs(str): - """ Parse attribute list and return a list of attribute tuples. """ - return _scanner.scan(str)[0] - -def isheader(elem): - return elem.tag in ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] - -class AttrListTreeprocessor(Treeprocessor): - - BASE_RE = r'\{\:?([^\}]*)\}' - HEADER_RE = re.compile(r'[ ]*%s[ ]*$' % BASE_RE) - BLOCK_RE = re.compile(r'\n[ ]*%s[ ]*$' % BASE_RE) - INLINE_RE = re.compile(r'^%s' % BASE_RE) - NAME_RE = re.compile(r'[^A-Z_a-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02ff\u0370-\u037d' - r'\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef' - r'\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd' - r'\:\-\.0-9\u00b7\u0300-\u036f\u203f-\u2040]+') - - def run(self, doc): - for elem in doc.getiterator(): - if isBlockLevel(elem.tag): - # Block level: check for attrs on last line of text - RE = self.BLOCK_RE - if isheader(elem): - # header: check for attrs at end of line - RE = self.HEADER_RE - if len(elem) and elem[-1].tail: - # has children. Get from tail of last child - m = RE.search(elem[-1].tail) - if m: - self.assign_attrs(elem, m.group(1)) - elem[-1].tail = elem[-1].tail[:m.start()] - if isheader(elem): - # clean up trailing #s - elem[-1].tail = elem[-1].tail.rstrip('#').rstrip() - elif elem.text: - # no children. Get from text. - m = RE.search(elem.text) - if m: - self.assign_attrs(elem, m.group(1)) - elem.text = elem.text[:m.start()] - if isheader(elem): - # clean up trailing #s - elem.text = elem.text.rstrip('#').rstrip() - else: - # inline: check for attrs at start of tail - if elem.tail: - m = self.INLINE_RE.match(elem.tail) - if m: - self.assign_attrs(elem, m.group(1)) - elem.tail = elem.tail[m.end():] - - def assign_attrs(self, elem, attrs): - """ Assign attrs to element. """ - for k, v in get_attrs(attrs): - if k == '.': - # add to class - cls = elem.get('class') - if cls: - elem.set('class', '%s %s' % (cls, v)) - else: - elem.set('class', v) - else: - # assign attr k with v - elem.set(self.sanitize_name(k), v) - - def sanitize_name(self, name): - """ - Sanitize name as 'an XML Name, minus the ":"'. - See http://www.w3.org/TR/REC-xml-names/#NT-NCName - """ - return self.NAME_RE.sub('_', name) - - -class AttrListExtension(Extension): - def extendMarkdown(self, md, md_globals): - md.treeprocessors.add('attr_list', AttrListTreeprocessor(md), '>prettify') - - -def makeExtension(configs={}): - return AttrListExtension(configs=configs) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/codehilite.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/codehilite.py deleted file mode 100644 index 72b40fd..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/codehilite.py +++ /dev/null @@ -1,240 +0,0 @@ -""" -CodeHilite Extension for Python-Markdown -======================================== - -Adds code/syntax highlighting to standard Python-Markdown code blocks. - -Copyright 2006-2008 [Waylan Limberg](http://achinghead.com/). - -Project website: <http://packages.python.org/Markdown/extensions/code_hilite.html> -Contact: markdown@freewisdom.org - -License: BSD (see ../LICENSE.md for details) - -Dependencies: -* [Python 2.3+](http://python.org/) -* [Markdown 2.0+](http://packages.python.org/Markdown/) -* [Pygments](http://pygments.org/) - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import Extension -from ..treeprocessors import Treeprocessor -import warnings -try: - from pygments import highlight - from pygments.lexers import get_lexer_by_name, guess_lexer, TextLexer - from pygments.formatters import HtmlFormatter - pygments = True -except ImportError: - pygments = False - -# ------------------ The Main CodeHilite Class ---------------------- -class CodeHilite(object): - """ - Determine language of source code, and pass it into the pygments hilighter. - - Basic Usage: - >>> code = CodeHilite(src = 'some text') - >>> html = code.hilite() - - * src: Source string or any object with a .readline attribute. - - * linenums: (Boolean) Set line numbering to 'on' (True), 'off' (False) or 'auto'(None). - Set to 'auto' by default. - - * guess_lang: (Boolean) Turn language auto-detection 'on' or 'off' (on by default). - - * css_class: Set class name of wrapper div ('codehilite' by default). - - Low Level Usage: - >>> code = CodeHilite() - >>> code.src = 'some text' # String or anything with a .readline attr. - >>> code.linenos = True # True or False; Turns line numbering on or of. - >>> html = code.hilite() - - """ - - def __init__(self, src=None, linenums=None, guess_lang=True, - css_class="codehilite", lang=None, style='default', - noclasses=False, tab_length=4): - self.src = src - self.lang = lang - self.linenums = linenums - self.guess_lang = guess_lang - self.css_class = css_class - self.style = style - self.noclasses = noclasses - self.tab_length = tab_length - - def hilite(self): - """ - Pass code to the [Pygments](http://pygments.pocoo.org/) highliter with - optional line numbers. The output should then be styled with css to - your liking. No styles are applied by default - only styling hooks - (i.e.: <span class="k">). - - returns : A string of html. - - """ - - self.src = self.src.strip('\n') - - if self.lang is None: - self._getLang() - - if pygments: - try: - lexer = get_lexer_by_name(self.lang) - except ValueError: - try: - if self.guess_lang: - lexer = guess_lexer(self.src) - else: - lexer = TextLexer() - except ValueError: - lexer = TextLexer() - formatter = HtmlFormatter(linenos=self.linenums, - cssclass=self.css_class, - style=self.style, - noclasses=self.noclasses) - return highlight(self.src, lexer, formatter) - else: - # just escape and build markup usable by JS highlighting libs - txt = self.src.replace('&', '&') - txt = txt.replace('<', '<') - txt = txt.replace('>', '>') - txt = txt.replace('"', '"') - classes = [] - if self.lang: - classes.append('language-%s' % self.lang) - if self.linenums: - classes.append('linenums') - class_str = '' - if classes: - class_str = ' class="%s"' % ' '.join(classes) - return '<pre class="%s"><code%s>%s</code></pre>\n'% \ - (self.css_class, class_str, txt) - - def _getLang(self): - """ - Determines language of a code block from shebang line and whether said - line should be removed or left in place. If the sheband line contains a - path (even a single /) then it is assumed to be a real shebang line and - left alone. However, if no path is given (e.i.: #!python or :::python) - then it is assumed to be a mock shebang for language identifitation of a - code fragment and removed from the code block prior to processing for - code highlighting. When a mock shebang (e.i: #!python) is found, line - numbering is turned on. When colons are found in place of a shebang - (e.i.: :::python), line numbering is left in the current state - off - by default. - - """ - - import re - - #split text into lines - lines = self.src.split("\n") - #pull first line to examine - fl = lines.pop(0) - - c = re.compile(r''' - (?:(?:^::+)|(?P<shebang>^[#]!)) # Shebang or 2 or more colons. - (?P<path>(?:/\w+)*[/ ])? # Zero or 1 path - (?P<lang>[\w+-]*) # The language - ''', re.VERBOSE) - # search first line for shebang - m = c.search(fl) - if m: - # we have a match - try: - self.lang = m.group('lang').lower() - except IndexError: - self.lang = None - if m.group('path'): - # path exists - restore first line - lines.insert(0, fl) - if self.linenums is None and m.group('shebang'): - # Overridable and Shebang exists - use line numbers - self.linenums = True - else: - # No match - lines.insert(0, fl) - - self.src = "\n".join(lines).strip("\n") - - - -# ------------------ The Markdown Extension ------------------------------- -class HiliteTreeprocessor(Treeprocessor): - """ Hilight source code in code blocks. """ - - def run(self, root): - """ Find code blocks and store in htmlStash. """ - blocks = root.getiterator('pre') - for block in blocks: - children = block.getchildren() - if len(children) == 1 and children[0].tag == 'code': - code = CodeHilite(children[0].text, - linenums=self.config['linenums'], - guess_lang=self.config['guess_lang'], - css_class=self.config['css_class'], - style=self.config['pygments_style'], - noclasses=self.config['noclasses'], - tab_length=self.markdown.tab_length) - placeholder = self.markdown.htmlStash.store(code.hilite(), - safe=True) - # Clear codeblock in etree instance - block.clear() - # Change to p element which will later - # be removed when inserting raw html - block.tag = 'p' - block.text = placeholder - - -class CodeHiliteExtension(Extension): - """ Add source code hilighting to markdown codeblocks. """ - - def __init__(self, configs): - # define default configs - self.config = { - 'linenums': [None, "Use lines numbers. True=yes, False=no, None=auto"], - 'force_linenos' : [False, "Depreciated! Use 'linenums' instead. Force line numbers - Default: False"], - 'guess_lang' : [True, "Automatic language detection - Default: True"], - 'css_class' : ["codehilite", - "Set class name for wrapper <div> - Default: codehilite"], - 'pygments_style' : ['default', 'Pygments HTML Formatter Style (Colorscheme) - Default: default'], - 'noclasses': [False, 'Use inline styles instead of CSS classes - Default false'] - } - - # Override defaults with user settings - for key, value in configs: - # convert strings to booleans - if value == 'True': value = True - if value == 'False': value = False - if value == 'None': value = None - - if key == 'force_linenos': - warnings.warn('The "force_linenos" config setting' - ' to the CodeHilite extension is deprecrecated.' - ' Use "linenums" instead.', PendingDeprecationWarning) - if value: - # Carry 'force_linenos' over to new 'linenos'. - self.setConfig('linenums', True) - - self.setConfig(key, value) - - def extendMarkdown(self, md, md_globals): - """ Add HilitePostprocessor to Markdown instance. """ - hiliter = HiliteTreeprocessor(md) - hiliter.config = self.getConfigs() - md.treeprocessors.add("hilite", hiliter, "<inline") - - md.registerExtension(self) - - -def makeExtension(configs={}): - return CodeHiliteExtension(configs=configs) - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/def_list.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/def_list.py deleted file mode 100644 index 8684652..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/def_list.py +++ /dev/null @@ -1,118 +0,0 @@ -""" -Definition List Extension for Python-Markdown -============================================= - -Added parsing of Definition Lists to Python-Markdown. - -A simple example: - - Apple - : Pomaceous fruit of plants of the genus Malus in - the family Rosaceae. - : An american computer company. - - Orange - : The fruit of an evergreen tree of the genus Citrus. - -Copyright 2008 - [Waylan Limberg](http://achinghead.com) - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import Extension -from ..blockprocessors import BlockProcessor, ListIndentProcessor -from ..util import etree -import re - - -class DefListProcessor(BlockProcessor): - """ Process Definition Lists. """ - - RE = re.compile(r'(^|\n)[ ]{0,3}:[ ]{1,3}(.*?)(\n|$)') - NO_INDENT_RE = re.compile(r'^[ ]{0,3}[^ :]') - - def test(self, parent, block): - return bool(self.RE.search(block)) - - def run(self, parent, blocks): - - raw_block = blocks.pop(0) - m = self.RE.search(raw_block) - terms = [l.strip() for l in raw_block[:m.start()].split('\n') if l.strip()] - block = raw_block[m.end():] - no_indent = self.NO_INDENT_RE.match(block) - if no_indent: - d, theRest = (block, None) - else: - d, theRest = self.detab(block) - if d: - d = '%s\n%s' % (m.group(2), d) - else: - d = m.group(2) - sibling = self.lastChild(parent) - if not terms and sibling is None: - # This is not a definition item. Most likely a paragraph that - # starts with a colon at the begining of a document or list. - blocks.insert(0, raw_block) - return False - if not terms and sibling.tag == 'p': - # The previous paragraph contains the terms - state = 'looselist' - terms = sibling.text.split('\n') - parent.remove(sibling) - # Aquire new sibling - sibling = self.lastChild(parent) - else: - state = 'list' - - if sibling and sibling.tag == 'dl': - # This is another item on an existing list - dl = sibling - if len(dl) and dl[-1].tag == 'dd' and len(dl[-1]): - state = 'looselist' - else: - # This is a new list - dl = etree.SubElement(parent, 'dl') - # Add terms - for term in terms: - dt = etree.SubElement(dl, 'dt') - dt.text = term - # Add definition - self.parser.state.set(state) - dd = etree.SubElement(dl, 'dd') - self.parser.parseBlocks(dd, [d]) - self.parser.state.reset() - - if theRest: - blocks.insert(0, theRest) - -class DefListIndentProcessor(ListIndentProcessor): - """ Process indented children of definition list items. """ - - ITEM_TYPES = ['dd'] - LIST_TYPES = ['dl'] - - def create_item(self, parent, block): - """ Create a new dd and parse the block with it as the parent. """ - dd = etree.SubElement(parent, 'dd') - self.parser.parseBlocks(dd, [block]) - - - -class DefListExtension(Extension): - """ Add definition lists to Markdown. """ - - def extendMarkdown(self, md, md_globals): - """ Add an instance of DefListProcessor to BlockParser. """ - md.parser.blockprocessors.add('defindent', - DefListIndentProcessor(md.parser), - '>indent') - md.parser.blockprocessors.add('deflist', - DefListProcessor(md.parser), - '>ulist') - - -def makeExtension(configs={}): - return DefListExtension(configs=configs) - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/extra.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/extra.py deleted file mode 100644 index e6a1e82..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/extra.py +++ /dev/null @@ -1,54 +0,0 @@ -""" -Python-Markdown Extra Extension -=============================== - -A compilation of various Python-Markdown extensions that imitates -[PHP Markdown Extra](http://michelf.com/projects/php-markdown/extra/). - -Note that each of the individual extensions still need to be available -on your PYTHONPATH. This extension simply wraps them all up as a -convenience so that only one extension needs to be listed when -initiating Markdown. See the documentation for each individual -extension for specifics about that extension. - -In the event that one or more of the supported extensions are not -available for import, Markdown will issue a warning and simply continue -without that extension. - -There may be additional extensions that are distributed with -Python-Markdown that are not included here in Extra. Those extensions -are not part of PHP Markdown Extra, and therefore, not part of -Python-Markdown Extra. If you really would like Extra to include -additional extensions, we suggest creating your own clone of Extra -under a differant name. You could also edit the `extensions` global -variable defined below, but be aware that such changes may be lost -when you upgrade to any future version of Python-Markdown. - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import Extension - -extensions = ['smart_strong', - 'fenced_code', - 'footnotes', - 'attr_list', - 'def_list', - 'tables', - 'abbr', - ] - - -class ExtraExtension(Extension): - """ Add various extensions to Markdown class.""" - - def extendMarkdown(self, md, md_globals): - """ Register extension instances. """ - md.registerExtensions(extensions, self.config) - if not md.safeMode: - # Turn on processing of markdown text within raw html - md.preprocessors['html_block'].markdown_in_raw = True - -def makeExtension(configs={}): - return ExtraExtension(configs=dict(configs)) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/fenced_code.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/fenced_code.py deleted file mode 100644 index ecdb20d..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/fenced_code.py +++ /dev/null @@ -1,161 +0,0 @@ -""" -Fenced Code Extension for Python Markdown -========================================= - -This extension adds Fenced Code Blocks to Python-Markdown. - - >>> import markdown - >>> text = ''' - ... A paragraph before a fenced code block: - ... - ... ~~~ - ... Fenced code block - ... ~~~ - ... ''' - >>> html = markdown.markdown(text, extensions=['fenced_code']) - >>> print html - <p>A paragraph before a fenced code block:</p> - <pre><code>Fenced code block - </code></pre> - -Works with safe_mode also (we check this because we are using the HtmlStash): - - >>> print markdown.markdown(text, extensions=['fenced_code'], safe_mode='replace') - <p>A paragraph before a fenced code block:</p> - <pre><code>Fenced code block - </code></pre> - -Include tilde's in a code block and wrap with blank lines: - - >>> text = ''' - ... ~~~~~~~~ - ... - ... ~~~~ - ... ~~~~~~~~''' - >>> print markdown.markdown(text, extensions=['fenced_code']) - <pre><code> - ~~~~ - </code></pre> - -Language tags: - - >>> text = ''' - ... ~~~~{.python} - ... # Some python code - ... ~~~~''' - >>> print markdown.markdown(text, extensions=['fenced_code']) - <pre><code class="python"># Some python code - </code></pre> - -Optionally backticks instead of tildes as per how github's code block markdown is identified: - - >>> text = ''' - ... ````` - ... # Arbitrary code - ... ~~~~~ # these tildes will not close the block - ... `````''' - >>> print markdown.markdown(text, extensions=['fenced_code']) - <pre><code># Arbitrary code - ~~~~~ # these tildes will not close the block - </code></pre> - -Copyright 2007-2008 [Waylan Limberg](http://achinghead.com/). - -Project website: <http://packages.python.org/Markdown/extensions/fenced_code_blocks.html> -Contact: markdown@freewisdom.org - -License: BSD (see ../docs/LICENSE for details) - -Dependencies: -* [Python 2.4+](http://python.org) -* [Markdown 2.0+](http://packages.python.org/Markdown/) -* [Pygments (optional)](http://pygments.org) - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import Extension -from ..preprocessors import Preprocessor -from .codehilite import CodeHilite, CodeHiliteExtension -import re - -# Global vars -FENCED_BLOCK_RE = re.compile( \ - r'(?P<fence>^(?:~{3,}|`{3,}))[ ]*(\{?\.?(?P<lang>[a-zA-Z0-9_+-]*)\}?)?[ ]*\n(?P<code>.*?)(?<=\n)(?P=fence)[ ]*$', - re.MULTILINE|re.DOTALL - ) -CODE_WRAP = '<pre><code%s>%s</code></pre>' -LANG_TAG = ' class="%s"' - -class FencedCodeExtension(Extension): - - def extendMarkdown(self, md, md_globals): - """ Add FencedBlockPreprocessor to the Markdown instance. """ - md.registerExtension(self) - - md.preprocessors.add('fenced_code_block', - FencedBlockPreprocessor(md), - ">normalize_whitespace") - - -class FencedBlockPreprocessor(Preprocessor): - - def __init__(self, md): - super(FencedBlockPreprocessor, self).__init__(md) - - self.checked_for_codehilite = False - self.codehilite_conf = {} - - def run(self, lines): - """ Match and store Fenced Code Blocks in the HtmlStash. """ - - # Check for code hilite extension - if not self.checked_for_codehilite: - for ext in self.markdown.registeredExtensions: - if isinstance(ext, CodeHiliteExtension): - self.codehilite_conf = ext.config - break - - self.checked_for_codehilite = True - - text = "\n".join(lines) - while 1: - m = FENCED_BLOCK_RE.search(text) - if m: - lang = '' - if m.group('lang'): - lang = LANG_TAG % m.group('lang') - - # If config is not empty, then the codehighlite extension - # is enabled, so we call it to highlite the code - if self.codehilite_conf: - highliter = CodeHilite(m.group('code'), - linenums=self.codehilite_conf['linenums'][0], - guess_lang=self.codehilite_conf['guess_lang'][0], - css_class=self.codehilite_conf['css_class'][0], - style=self.codehilite_conf['pygments_style'][0], - lang=(m.group('lang') or None), - noclasses=self.codehilite_conf['noclasses'][0]) - - code = highliter.hilite() - else: - code = CODE_WRAP % (lang, self._escape(m.group('code'))) - - placeholder = self.markdown.htmlStash.store(code, safe=True) - text = '%s\n%s\n%s'% (text[:m.start()], placeholder, text[m.end():]) - else: - break - return text.split("\n") - - def _escape(self, txt): - """ basic html escaping """ - txt = txt.replace('&', '&') - txt = txt.replace('<', '<') - txt = txt.replace('>', '>') - txt = txt.replace('"', '"') - return txt - - -def makeExtension(configs=None): - return FencedCodeExtension(configs=configs) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/footnotes.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/footnotes.py deleted file mode 100644 index 65ed597..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/footnotes.py +++ /dev/null @@ -1,313 +0,0 @@ -""" -========================= FOOTNOTES ================================= - -This section adds footnote handling to markdown. It can be used as -an example for extending python-markdown with relatively complex -functionality. While in this case the extension is included inside -the module itself, it could just as easily be added from outside the -module. Not that all markdown classes above are ignorant about -footnotes. All footnote functionality is provided separately and -then added to the markdown instance at the run time. - -Footnote functionality is attached by calling extendMarkdown() -method of FootnoteExtension. The method also registers the -extension to allow it's state to be reset by a call to reset() -method. - -Example: - Footnotes[^1] have a label[^label] and a definition[^!DEF]. - - [^1]: This is a footnote - [^label]: A footnote on "label" - [^!DEF]: The footnote for definition - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import Extension -from ..preprocessors import Preprocessor -from ..inlinepatterns import Pattern -from ..treeprocessors import Treeprocessor -from ..postprocessors import Postprocessor -from ..util import etree, text_type -from ..odict import OrderedDict -import re - -FN_BACKLINK_TEXT = "zz1337820767766393qq" -NBSP_PLACEHOLDER = "qq3936677670287331zz" -DEF_RE = re.compile(r'[ ]{0,3}\[\^([^\]]*)\]:\s*(.*)') -TABBED_RE = re.compile(r'((\t)|( ))(.*)') - -class FootnoteExtension(Extension): - """ Footnote Extension. """ - - def __init__ (self, configs): - """ Setup configs. """ - self.config = {'PLACE_MARKER': - ["///Footnotes Go Here///", - "The text string that marks where the footnotes go"], - 'UNIQUE_IDS': - [False, - "Avoid name collisions across " - "multiple calls to reset()."], - "BACKLINK_TEXT": - ["↩", - "The text string that links from the footnote to the reader's place."] - } - - for key, value in configs: - self.config[key][0] = value - - # In multiple invocations, emit links that don't get tangled. - self.unique_prefix = 0 - - self.reset() - - def extendMarkdown(self, md, md_globals): - """ Add pieces to Markdown. """ - md.registerExtension(self) - self.parser = md.parser - self.md = md - self.sep = ':' - if self.md.output_format in ['html5', 'xhtml5']: - self.sep = '-' - # Insert a preprocessor before ReferencePreprocessor - md.preprocessors.add("footnote", FootnotePreprocessor(self), - "<reference") - # Insert an inline pattern before ImageReferencePattern - FOOTNOTE_RE = r'\[\^([^\]]*)\]' # blah blah [^1] blah - md.inlinePatterns.add("footnote", FootnotePattern(FOOTNOTE_RE, self), - "<reference") - # Insert a tree-processor that would actually add the footnote div - # This must be before all other treeprocessors (i.e., inline and - # codehilite) so they can run on the the contents of the div. - md.treeprocessors.add("footnote", FootnoteTreeprocessor(self), - "_begin") - # Insert a postprocessor after amp_substitute oricessor - md.postprocessors.add("footnote", FootnotePostprocessor(self), - ">amp_substitute") - - def reset(self): - """ Clear the footnotes on reset, and prepare for a distinct document. """ - self.footnotes = OrderedDict() - self.unique_prefix += 1 - - def findFootnotesPlaceholder(self, root): - """ Return ElementTree Element that contains Footnote placeholder. """ - def finder(element): - for child in element: - if child.text: - if child.text.find(self.getConfig("PLACE_MARKER")) > -1: - return child, element, True - if child.tail: - if child.tail.find(self.getConfig("PLACE_MARKER")) > -1: - return child, element, False - finder(child) - return None - - res = finder(root) - return res - - def setFootnote(self, id, text): - """ Store a footnote for later retrieval. """ - self.footnotes[id] = text - - def makeFootnoteId(self, id): - """ Return footnote link id. """ - if self.getConfig("UNIQUE_IDS"): - return 'fn%s%d-%s' % (self.sep, self.unique_prefix, id) - else: - return 'fn%s%s' % (self.sep, id) - - def makeFootnoteRefId(self, id): - """ Return footnote back-link id. """ - if self.getConfig("UNIQUE_IDS"): - return 'fnref%s%d-%s' % (self.sep, self.unique_prefix, id) - else: - return 'fnref%s%s' % (self.sep, id) - - def makeFootnotesDiv(self, root): - """ Return div of footnotes as et Element. """ - - if not list(self.footnotes.keys()): - return None - - div = etree.Element("div") - div.set('class', 'footnote') - etree.SubElement(div, "hr") - ol = etree.SubElement(div, "ol") - - for id in self.footnotes.keys(): - li = etree.SubElement(ol, "li") - li.set("id", self.makeFootnoteId(id)) - self.parser.parseChunk(li, self.footnotes[id]) - backlink = etree.Element("a") - backlink.set("href", "#" + self.makeFootnoteRefId(id)) - if self.md.output_format not in ['html5', 'xhtml5']: - backlink.set("rev", "footnote") # Invalid in HTML5 - backlink.set("class", "footnote-backref") - backlink.set("title", "Jump back to footnote %d in the text" % \ - (self.footnotes.index(id)+1)) - backlink.text = FN_BACKLINK_TEXT - - if li.getchildren(): - node = li[-1] - if node.tag == "p": - node.text = node.text + NBSP_PLACEHOLDER - node.append(backlink) - else: - p = etree.SubElement(li, "p") - p.append(backlink) - return div - - -class FootnotePreprocessor(Preprocessor): - """ Find all footnote references and store for later use. """ - - def __init__ (self, footnotes): - self.footnotes = footnotes - - def run(self, lines): - """ - Loop through lines and find, set, and remove footnote definitions. - - Keywords: - - * lines: A list of lines of text - - Return: A list of lines of text with footnote definitions removed. - - """ - newlines = [] - i = 0 - while True: - m = DEF_RE.match(lines[i]) - if m: - fn, _i = self.detectTabbed(lines[i+1:]) - fn.insert(0, m.group(2)) - i += _i-1 # skip past footnote - self.footnotes.setFootnote(m.group(1), "\n".join(fn)) - else: - newlines.append(lines[i]) - if len(lines) > i+1: - i += 1 - else: - break - return newlines - - def detectTabbed(self, lines): - """ Find indented text and remove indent before further proccesing. - - Keyword arguments: - - * lines: an array of strings - - Returns: a list of post processed items and the index of last line. - - """ - items = [] - blank_line = False # have we encountered a blank line yet? - i = 0 # to keep track of where we are - - def detab(line): - match = TABBED_RE.match(line) - if match: - return match.group(4) - - for line in lines: - if line.strip(): # Non-blank line - detabbed_line = detab(line) - if detabbed_line: - items.append(detabbed_line) - i += 1 - continue - elif not blank_line and not DEF_RE.match(line): - # not tabbed but still part of first par. - items.append(line) - i += 1 - continue - else: - return items, i+1 - - else: # Blank line: _maybe_ we are done. - blank_line = True - i += 1 # advance - - # Find the next non-blank line - for j in range(i, len(lines)): - if lines[j].strip(): - next_line = lines[j]; break - else: - break # There is no more text; we are done. - - # Check if the next non-blank line is tabbed - if detab(next_line): # Yes, more work to do. - items.append("") - continue - else: - break # No, we are done. - else: - i += 1 - - return items, i - - -class FootnotePattern(Pattern): - """ InlinePattern for footnote markers in a document's body text. """ - - def __init__(self, pattern, footnotes): - super(FootnotePattern, self).__init__(pattern) - self.footnotes = footnotes - - def handleMatch(self, m): - id = m.group(2) - if id in self.footnotes.footnotes.keys(): - sup = etree.Element("sup") - a = etree.SubElement(sup, "a") - sup.set('id', self.footnotes.makeFootnoteRefId(id)) - a.set('href', '#' + self.footnotes.makeFootnoteId(id)) - if self.footnotes.md.output_format not in ['html5', 'xhtml5']: - a.set('rel', 'footnote') # invalid in HTML5 - a.set('class', 'footnote-ref') - a.text = text_type(self.footnotes.footnotes.index(id) + 1) - return sup - else: - return None - - -class FootnoteTreeprocessor(Treeprocessor): - """ Build and append footnote div to end of document. """ - - def __init__ (self, footnotes): - self.footnotes = footnotes - - def run(self, root): - footnotesDiv = self.footnotes.makeFootnotesDiv(root) - if footnotesDiv: - result = self.footnotes.findFootnotesPlaceholder(root) - if result: - child, parent, isText = result - ind = parent.getchildren().index(child) - if isText: - parent.remove(child) - parent.insert(ind, footnotesDiv) - else: - parent.insert(ind + 1, footnotesDiv) - child.tail = None - else: - root.append(footnotesDiv) - -class FootnotePostprocessor(Postprocessor): - """ Replace placeholders with html entities. """ - def __init__(self, footnotes): - self.footnotes = footnotes - - def run(self, text): - text = text.replace(FN_BACKLINK_TEXT, self.footnotes.getConfig("BACKLINK_TEXT")) - return text.replace(NBSP_PLACEHOLDER, " ") - -def makeExtension(configs=[]): - """ Return an instance of the FootnoteExtension """ - return FootnoteExtension(configs=configs) - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/headerid.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/headerid.py deleted file mode 100644 index 428ee3a..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/headerid.py +++ /dev/null @@ -1,207 +0,0 @@ -""" -HeaderID Extension for Python-Markdown -====================================== - -Auto-generate id attributes for HTML headers. - -Basic usage: - - >>> import markdown - >>> text = "# Some Header #" - >>> md = markdown.markdown(text, ['headerid']) - >>> print md - <h1 id="some-header">Some Header</h1> - -All header IDs are unique: - - >>> text = ''' - ... #Header - ... #Header - ... #Header''' - >>> md = markdown.markdown(text, ['headerid']) - >>> print md - <h1 id="header">Header</h1> - <h1 id="header_1">Header</h1> - <h1 id="header_2">Header</h1> - -To fit within a html template's hierarchy, set the header base level: - - >>> text = ''' - ... #Some Header - ... ## Next Level''' - >>> md = markdown.markdown(text, ['headerid(level=3)']) - >>> print md - <h3 id="some-header">Some Header</h3> - <h4 id="next-level">Next Level</h4> - -Works with inline markup. - - >>> text = '#Some *Header* with [markup](http://example.com).' - >>> md = markdown.markdown(text, ['headerid']) - >>> print md - <h1 id="some-header-with-markup">Some <em>Header</em> with <a href="http://example.com">markup</a>.</h1> - -Turn off auto generated IDs: - - >>> text = ''' - ... # Some Header - ... # Another Header''' - >>> md = markdown.markdown(text, ['headerid(forceid=False)']) - >>> print md - <h1>Some Header</h1> - <h1>Another Header</h1> - -Use with MetaData extension: - - >>> text = '''header_level: 2 - ... header_forceid: Off - ... - ... # A Header''' - >>> md = markdown.markdown(text, ['headerid', 'meta']) - >>> print md - <h2>A Header</h2> - -Copyright 2007-2011 [Waylan Limberg](http://achinghead.com/). - -Project website: <http://packages.python.org/Markdown/extensions/header_id.html> -Contact: markdown@freewisdom.org - -License: BSD (see ../docs/LICENSE for details) - -Dependencies: -* [Python 2.3+](http://python.org) -* [Markdown 2.0+](http://packages.python.org/Markdown/) - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import Extension -from ..treeprocessors import Treeprocessor -import re -import logging -try: - import unicodedata - has_unicodedata = True -except: - has_unicodedata = False - DISALLOWED_RE = re.compile(r'[^a-z0-9]') - -logger = logging.getLogger('MARKDOWN') - -IDCOUNT_RE = re.compile(r'^(.*)_([0-9]+)$') - - -def slugify(value, separator): - """ Slugify a string, to make it URL friendly. """ - if has_unicodedata: - value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore') - value = re.sub('[^\w\s-]', '', value.decode('ascii')).strip().lower() - return re.sub('[%s\s]+' % separator, separator, value) - else: - return separator.join(filter(None, re.split(DISALLOWED_RE, value.lower()))) - - -def unique(id, ids): - """ Ensure id is unique in set of ids. Append '_1', '_2'... if not """ - while id in ids or not id: - m = IDCOUNT_RE.match(id) - if m: - id = '%s_%d'% (m.group(1), int(m.group(2))+1) - else: - id = '%s_%d'% (id, 1) - ids.add(id) - return id - - -def itertext(elem): - """ Loop through all children and return text only. - - Reimplements method of same name added to ElementTree in Python 2.7 - - """ - if elem.text: - yield elem.text - for e in elem: - for s in itertext(e): - yield s - if e.tail: - yield e.tail - - -class HeaderIdTreeprocessor(Treeprocessor): - """ Assign IDs to headers. """ - - IDs = set() - - def run(self, doc): - start_level, force_id = self._get_meta() - slugify = self.config['slugify'] - sep = self.config['separator'] - for elem in doc.getiterator(): - if elem.tag in ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']: - if force_id: - if "id" in elem.attrib: - id = elem.get('id') - else: - id = slugify(''.join(itertext(elem)), sep) - elem.set('id', unique(id, self.IDs)) - if start_level: - level = int(elem.tag[-1]) + start_level - if level > 6: - level = 6 - elem.tag = 'h%d' % level - - - def _get_meta(self): - """ Return meta data suported by this ext as a tuple """ - level = int(self.config['level']) - 1 - force = self._str2bool(self.config['forceid']) - if hasattr(self.md, 'Meta'): - if 'header_level' in self.md.Meta: - level = int(self.md.Meta['header_level'][0]) - 1 - if 'header_forceid' in self.md.Meta: - force = self._str2bool(self.md.Meta['header_forceid'][0]) - return level, force - - def _str2bool(self, s, default=False): - """ Convert a string to a booleen value. """ - s = str(s) - if s.lower() in ['0', 'f', 'false', 'off', 'no', 'n']: - return False - elif s.lower() in ['1', 't', 'true', 'on', 'yes', 'y']: - return True - return default - - -class HeaderIdExtension(Extension): - def __init__(self, configs): - # set defaults - self.config = { - 'level' : ['1', 'Base level for headers.'], - 'forceid' : ['True', 'Force all headers to have an id.'], - 'separator' : ['-', 'Word separator.'], - 'slugify' : [slugify, 'Callable to generate anchors'], - } - - for key, value in configs: - self.setConfig(key, value) - - def extendMarkdown(self, md, md_globals): - md.registerExtension(self) - self.processor = HeaderIdTreeprocessor() - self.processor.md = md - self.processor.config = self.getConfigs() - if 'attr_list' in md.treeprocessors.keys(): - # insert after attr_list treeprocessor - md.treeprocessors.add('headerid', self.processor, '>attr_list') - else: - # insert after 'prettify' treeprocessor. - md.treeprocessors.add('headerid', self.processor, '>prettify') - - def reset(self): - self.processor.IDs = set() - - -def makeExtension(configs=None): - return HeaderIdExtension(configs=configs) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/meta.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/meta.py deleted file mode 100644 index aaff436..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/meta.py +++ /dev/null @@ -1,93 +0,0 @@ -""" -Meta Data Extension for Python-Markdown -======================================= - -This extension adds Meta Data handling to markdown. - -Basic Usage: - - >>> import markdown - >>> text = '''Title: A Test Doc. - ... Author: Waylan Limberg - ... John Doe - ... Blank_Data: - ... - ... The body. This is paragraph one. - ... ''' - >>> md = markdown.Markdown(['meta']) - >>> print md.convert(text) - <p>The body. This is paragraph one.</p> - >>> print md.Meta - {u'blank_data': [u''], u'author': [u'Waylan Limberg', u'John Doe'], u'title': [u'A Test Doc.']} - -Make sure text without Meta Data still works (markdown < 1.6b returns a <p>). - - >>> text = ' Some Code - not extra lines of meta data.' - >>> md = markdown.Markdown(['meta']) - >>> print md.convert(text) - <pre><code>Some Code - not extra lines of meta data. - </code></pre> - >>> md.Meta - {} - -Copyright 2007-2008 [Waylan Limberg](http://achinghead.com). - -Project website: <http://packages.python.org/Markdown/meta_data.html> -Contact: markdown@freewisdom.org - -License: BSD (see ../LICENSE.md for details) - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import Extension -from ..preprocessors import Preprocessor -import re - -# Global Vars -META_RE = re.compile(r'^[ ]{0,3}(?P<key>[A-Za-z0-9_-]+):\s*(?P<value>.*)') -META_MORE_RE = re.compile(r'^[ ]{4,}(?P<value>.*)') - -class MetaExtension (Extension): - """ Meta-Data extension for Python-Markdown. """ - - def extendMarkdown(self, md, md_globals): - """ Add MetaPreprocessor to Markdown instance. """ - - md.preprocessors.add("meta", MetaPreprocessor(md), "_begin") - - -class MetaPreprocessor(Preprocessor): - """ Get Meta-Data. """ - - def run(self, lines): - """ Parse Meta-Data and store in Markdown.Meta. """ - meta = {} - key = None - while 1: - line = lines.pop(0) - if line.strip() == '': - break # blank line - done - m1 = META_RE.match(line) - if m1: - key = m1.group('key').lower().strip() - value = m1.group('value').strip() - try: - meta[key].append(value) - except KeyError: - meta[key] = [value] - else: - m2 = META_MORE_RE.match(line) - if m2 and key: - # Add another line to existing key - meta[key].append(m2.group('value').strip()) - else: - lines.insert(0, line) - break # no meta data - done - self.markdown.Meta = meta - return lines - - -def makeExtension(configs={}): - return MetaExtension(configs=configs) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/nl2br.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/nl2br.py deleted file mode 100644 index da4b339..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/nl2br.py +++ /dev/null @@ -1,38 +0,0 @@ -""" -NL2BR Extension -=============== - -A Python-Markdown extension to treat newlines as hard breaks; like -GitHub-flavored Markdown does. - -Usage: - - >>> import markdown - >>> print markdown.markdown('line 1\\nline 2', extensions=['nl2br']) - <p>line 1<br /> - line 2</p> - -Copyright 2011 [Brian Neal](http://deathofagremmie.com/) - -Dependencies: -* [Python 2.4+](http://python.org) -* [Markdown 2.1+](http://packages.python.org/Markdown/) - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import Extension -from ..inlinepatterns import SubstituteTagPattern - -BR_RE = r'\n' - -class Nl2BrExtension(Extension): - - def extendMarkdown(self, md, md_globals): - br_tag = SubstituteTagPattern(BR_RE, 'br') - md.inlinePatterns.add('nl', br_tag, '_end') - - -def makeExtension(configs=None): - return Nl2BrExtension(configs) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/sane_lists.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/sane_lists.py deleted file mode 100644 index 23e9a7f..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/sane_lists.py +++ /dev/null @@ -1,51 +0,0 @@ -""" -Sane List Extension for Python-Markdown -======================================= - -Modify the behavior of Lists in Python-Markdown t act in a sane manor. - -In standard Markdown sytex, the following would constitute a single -ordered list. However, with this extension, the output would include -two lists, the first an ordered list and the second and unordered list. - - 1. ordered - 2. list - - * unordered - * list - -Copyright 2011 - [Waylan Limberg](http://achinghead.com) - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import Extension -from ..blockprocessors import OListProcessor, UListProcessor -import re - - -class SaneOListProcessor(OListProcessor): - - CHILD_RE = re.compile(r'^[ ]{0,3}((\d+\.))[ ]+(.*)') - SIBLING_TAGS = ['ol'] - - -class SaneUListProcessor(UListProcessor): - - CHILD_RE = re.compile(r'^[ ]{0,3}(([*+-]))[ ]+(.*)') - SIBLING_TAGS = ['ul'] - - -class SaneListExtension(Extension): - """ Add sane lists to Markdown. """ - - def extendMarkdown(self, md, md_globals): - """ Override existing Processors. """ - md.parser.blockprocessors['olist'] = SaneOListProcessor(md.parser) - md.parser.blockprocessors['ulist'] = SaneUListProcessor(md.parser) - - -def makeExtension(configs={}): - return SaneListExtension(configs=configs) - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/smart_strong.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/smart_strong.py deleted file mode 100644 index 4818cf9..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/smart_strong.py +++ /dev/null @@ -1,42 +0,0 @@ -''' -Smart_Strong Extension for Python-Markdown -========================================== - -This extention adds smarter handling of double underscores within words. - -Simple Usage: - - >>> import markdown - >>> print markdown.markdown('Text with double__underscore__words.', - ... extensions=['smart_strong']) - <p>Text with double__underscore__words.</p> - >>> print markdown.markdown('__Strong__ still works.', - ... extensions=['smart_strong']) - <p><strong>Strong</strong> still works.</p> - >>> print markdown.markdown('__this__works__too__.', - ... extensions=['smart_strong']) - <p><strong>this__works__too</strong>.</p> - -Copyright 2011 -[Waylan Limberg](http://achinghead.com) - -''' - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import Extension -from ..inlinepatterns import SimpleTagPattern - -SMART_STRONG_RE = r'(?<!\w)(_{2})(?!_)(.+?)(?<!_)\2(?!\w)' -STRONG_RE = r'(\*{2})(.+?)\2' - -class SmartEmphasisExtension(Extension): - """ Add smart_emphasis extension to Markdown class.""" - - def extendMarkdown(self, md, md_globals): - """ Modify inline patterns. """ - md.inlinePatterns['strong'] = SimpleTagPattern(STRONG_RE, 'strong') - md.inlinePatterns.add('strong2', SimpleTagPattern(SMART_STRONG_RE, 'strong'), '>emphasis2') - -def makeExtension(configs={}): - return SmartEmphasisExtension(configs=dict(configs)) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/tables.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/tables.py deleted file mode 100644 index ad52ec1..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/tables.py +++ /dev/null @@ -1,100 +0,0 @@ -""" -Tables Extension for Python-Markdown -==================================== - -Added parsing of tables to Python-Markdown. - -A simple example: - - First Header | Second Header - ------------- | ------------- - Content Cell | Content Cell - Content Cell | Content Cell - -Copyright 2009 - [Waylan Limberg](http://achinghead.com) -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import Extension -from ..blockprocessors import BlockProcessor -from ..util import etree - -class TableProcessor(BlockProcessor): - """ Process Tables. """ - - def test(self, parent, block): - rows = block.split('\n') - return (len(rows) > 2 and '|' in rows[0] and - '|' in rows[1] and '-' in rows[1] and - rows[1].strip()[0] in ['|', ':', '-']) - - def run(self, parent, blocks): - """ Parse a table block and build table. """ - block = blocks.pop(0).split('\n') - header = block[0].strip() - seperator = block[1].strip() - rows = block[2:] - # Get format type (bordered by pipes or not) - border = False - if header.startswith('|'): - border = True - # Get alignment of columns - align = [] - for c in self._split_row(seperator, border): - if c.startswith(':') and c.endswith(':'): - align.append('center') - elif c.startswith(':'): - align.append('left') - elif c.endswith(':'): - align.append('right') - else: - align.append(None) - # Build table - table = etree.SubElement(parent, 'table') - thead = etree.SubElement(table, 'thead') - self._build_row(header, thead, align, border) - tbody = etree.SubElement(table, 'tbody') - for row in rows: - self._build_row(row.strip(), tbody, align, border) - - def _build_row(self, row, parent, align, border): - """ Given a row of text, build table cells. """ - tr = etree.SubElement(parent, 'tr') - tag = 'td' - if parent.tag == 'thead': - tag = 'th' - cells = self._split_row(row, border) - # We use align here rather than cells to ensure every row - # contains the same number of columns. - for i, a in enumerate(align): - c = etree.SubElement(tr, tag) - try: - c.text = cells[i].strip() - except IndexError: - c.text = "" - if a: - c.set('align', a) - - def _split_row(self, row, border): - """ split a row of text into list of cells. """ - if border: - if row.startswith('|'): - row = row[1:] - if row.endswith('|'): - row = row[:-1] - return row.split('|') - - -class TableExtension(Extension): - """ Add tables to Markdown. """ - - def extendMarkdown(self, md, md_globals): - """ Add an instance of TableProcessor to BlockParser. """ - md.parser.blockprocessors.add('table', - TableProcessor(md.parser), - '<hashheader') - - -def makeExtension(configs={}): - return TableExtension(configs=configs) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/toc.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/toc.py deleted file mode 100644 index 73b0844..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/toc.py +++ /dev/null @@ -1,221 +0,0 @@ -""" -Table of Contents Extension for Python-Markdown -* * * - -(c) 2008 [Jack Miller](http://codezen.org) - -Dependencies: -* [Markdown 2.1+](http://packages.python.org/Markdown/) - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import Extension -from ..treeprocessors import Treeprocessor -from ..util import etree -from .headerid import slugify, unique, itertext -import re - - -def order_toc_list(toc_list): - """Given an unsorted list with errors and skips, return a nested one. - [{'level': 1}, {'level': 2}] - => - [{'level': 1, 'children': [{'level': 2, 'children': []}]}] - - A wrong list is also converted: - [{'level': 2}, {'level': 1}] - => - [{'level': 2, 'children': []}, {'level': 1, 'children': []}] - """ - - def build_correct(remaining_list, prev_elements=[{'level': 1000}]): - - if not remaining_list: - return [], [] - - current = remaining_list.pop(0) - if not 'children' in current.keys(): - current['children'] = [] - - if not prev_elements: - # This happens for instance with [8, 1, 1], ie. when some - # header level is outside a scope. We treat it as a - # top-level - next_elements, children = build_correct(remaining_list, [current]) - current['children'].append(children) - return [current] + next_elements, [] - - prev_element = prev_elements.pop() - children = [] - next_elements = [] - # Is current part of the child list or next list? - if current['level'] > prev_element['level']: - #print "%d is a child of %d" % (current['level'], prev_element['level']) - prev_elements.append(prev_element) - prev_elements.append(current) - prev_element['children'].append(current) - next_elements2, children2 = build_correct(remaining_list, prev_elements) - children += children2 - next_elements += next_elements2 - else: - #print "%d is ancestor of %d" % (current['level'], prev_element['level']) - if not prev_elements: - #print "No previous elements, so appending to the next set" - next_elements.append(current) - prev_elements = [current] - next_elements2, children2 = build_correct(remaining_list, prev_elements) - current['children'].extend(children2) - else: - #print "Previous elements, comparing to those first" - remaining_list.insert(0, current) - next_elements2, children2 = build_correct(remaining_list, prev_elements) - children.extend(children2) - next_elements += next_elements2 - - return next_elements, children - - ordered_list, __ = build_correct(toc_list) - return ordered_list - - -class TocTreeprocessor(Treeprocessor): - - # Iterator wrapper to get parent and child all at once - def iterparent(self, root): - for parent in root.getiterator(): - for child in parent: - yield parent, child - - def add_anchor(self, c, elem_id): #@ReservedAssignment - if self.use_anchors: - anchor = etree.Element("a") - anchor.text = c.text - anchor.attrib["href"] = "#" + elem_id - anchor.attrib["class"] = "toclink" - c.text = "" - for elem in c.getchildren(): - anchor.append(elem) - c.remove(elem) - c.append(anchor) - - def build_toc_etree(self, div, toc_list): - # Add title to the div - if self.config["title"]: - header = etree.SubElement(div, "span") - header.attrib["class"] = "toctitle" - header.text = self.config["title"] - - def build_etree_ul(toc_list, parent): - ul = etree.SubElement(parent, "ul") - for item in toc_list: - # List item link, to be inserted into the toc div - li = etree.SubElement(ul, "li") - link = etree.SubElement(li, "a") - link.text = item.get('name', '') - link.attrib["href"] = '#' + item.get('id', '') - if item['children']: - build_etree_ul(item['children'], li) - return ul - - return build_etree_ul(toc_list, div) - - def run(self, doc): - - div = etree.Element("div") - div.attrib["class"] = "toc" - header_rgx = re.compile("[Hh][123456]") - - self.use_anchors = self.config["anchorlink"] in [1, '1', True, 'True', 'true'] - - # Get a list of id attributes - used_ids = set() - for c in doc.getiterator(): - if "id" in c.attrib: - used_ids.add(c.attrib["id"]) - - toc_list = [] - marker_found = False - for (p, c) in self.iterparent(doc): - text = ''.join(itertext(c)).strip() - if not text: - continue - - # To keep the output from screwing up the - # validation by putting a <div> inside of a <p> - # we actually replace the <p> in its entirety. - # We do not allow the marker inside a header as that - # would causes an enless loop of placing a new TOC - # inside previously generated TOC. - if c.text and c.text.strip() == self.config["marker"] and \ - not header_rgx.match(c.tag) and c.tag not in ['pre', 'code']: - for i in range(len(p)): - if p[i] == c: - p[i] = div - break - marker_found = True - - if header_rgx.match(c.tag): - - # Do not override pre-existing ids - if not "id" in c.attrib: - elem_id = unique(self.config["slugify"](text, '-'), used_ids) - c.attrib["id"] = elem_id - else: - elem_id = c.attrib["id"] - - tag_level = int(c.tag[-1]) - - toc_list.append({'level': tag_level, - 'id': elem_id, - 'name': text}) - - self.add_anchor(c, elem_id) - - toc_list_nested = order_toc_list(toc_list) - self.build_toc_etree(div, toc_list_nested) - prettify = self.markdown.treeprocessors.get('prettify') - if prettify: prettify.run(div) - if not marker_found: - # serialize and attach to markdown instance. - toc = self.markdown.serializer(div) - for pp in self.markdown.postprocessors.values(): - toc = pp.run(toc) - self.markdown.toc = toc - - -class TocExtension(Extension): - - TreeProcessorClass = TocTreeprocessor - - def __init__(self, configs=[]): - self.config = { "marker" : ["[TOC]", - "Text to find and replace with Table of Contents -" - "Defaults to \"[TOC]\""], - "slugify" : [slugify, - "Function to generate anchors based on header text-" - "Defaults to the headerid ext's slugify function."], - "title" : [None, - "Title to insert into TOC <div> - " - "Defaults to None"], - "anchorlink" : [0, - "1 if header should be a self link" - "Defaults to 0"]} - - for key, value in configs: - self.setConfig(key, value) - - def extendMarkdown(self, md, md_globals): - tocext = self.TreeProcessorClass(md) - tocext.config = self.getConfigs() - # Headerid ext is set to '>prettify'. With this set to '_end', - # it should always come after headerid ext (and honor ids assinged - # by the header id extension) if both are used. Same goes for - # attr_list extension. This must come last because we don't want - # to redefine ids after toc is created. But we do want toc prettified. - md.treeprocessors.add("toc", tocext, "_end") - - -def makeExtension(configs={}): - return TocExtension(configs=configs) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/wikilinks.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/wikilinks.py deleted file mode 100644 index 877890b..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/extensions/wikilinks.py +++ /dev/null @@ -1,151 +0,0 @@ -''' -WikiLinks Extension for Python-Markdown -====================================== - -Converts [[WikiLinks]] to relative links. Requires Python-Markdown 2.0+ - -Basic usage: - - >>> import markdown - >>> text = "Some text with a [[WikiLink]]." - >>> html = markdown.markdown(text, ['wikilinks']) - >>> print html - <p>Some text with a <a class="wikilink" href="/WikiLink/">WikiLink</a>.</p> - -Whitespace behavior: - - >>> print markdown.markdown('[[ foo bar_baz ]]', ['wikilinks']) - <p><a class="wikilink" href="/foo_bar_baz/">foo bar_baz</a></p> - >>> print markdown.markdown('foo [[ ]] bar', ['wikilinks']) - <p>foo bar</p> - -To define custom settings the simple way: - - >>> print markdown.markdown(text, - ... ['wikilinks(base_url=/wiki/,end_url=.html,html_class=foo)'] - ... ) - <p>Some text with a <a class="foo" href="/wiki/WikiLink.html">WikiLink</a>.</p> - -Custom settings the complex way: - - >>> md = markdown.Markdown( - ... extensions = ['wikilinks'], - ... extension_configs = {'wikilinks': [ - ... ('base_url', 'http://example.com/'), - ... ('end_url', '.html'), - ... ('html_class', '') ]}, - ... safe_mode = True) - >>> print md.convert(text) - <p>Some text with a <a href="http://example.com/WikiLink.html">WikiLink</a>.</p> - -Use MetaData with mdx_meta.py (Note the blank html_class in MetaData): - - >>> text = """wiki_base_url: http://example.com/ - ... wiki_end_url: .html - ... wiki_html_class: - ... - ... Some text with a [[WikiLink]].""" - >>> md = markdown.Markdown(extensions=['meta', 'wikilinks']) - >>> print md.convert(text) - <p>Some text with a <a href="http://example.com/WikiLink.html">WikiLink</a>.</p> - -MetaData should not carry over to next document: - - >>> print md.convert("No [[MetaData]] here.") - <p>No <a class="wikilink" href="/MetaData/">MetaData</a> here.</p> - -Define a custom URL builder: - - >>> def my_url_builder(label, base, end): - ... return '/bar/' - >>> md = markdown.Markdown(extensions=['wikilinks'], - ... extension_configs={'wikilinks' : [('build_url', my_url_builder)]}) - >>> print md.convert('[[foo]]') - <p><a class="wikilink" href="/bar/">foo</a></p> - -From the command line: - - python markdown.py -x wikilinks(base_url=http://example.com/,end_url=.html,html_class=foo) src.txt - -By [Waylan Limberg](http://achinghead.com/). - -License: [BSD](http://www.opensource.org/licenses/bsd-license.php) - -Dependencies: -* [Python 2.3+](http://python.org) -* [Markdown 2.0+](http://packages.python.org/Markdown/) -''' - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import Extension -from ..inlinepatterns import Pattern -from ..util import etree -import re - -def build_url(label, base, end): - """ Build a url from the label, a base, and an end. """ - clean_label = re.sub(r'([ ]+_)|(_[ ]+)|([ ]+)', '_', label) - return '%s%s%s'% (base, clean_label, end) - - -class WikiLinkExtension(Extension): - def __init__(self, configs): - # set extension defaults - self.config = { - 'base_url' : ['/', 'String to append to beginning or URL.'], - 'end_url' : ['/', 'String to append to end of URL.'], - 'html_class' : ['wikilink', 'CSS hook. Leave blank for none.'], - 'build_url' : [build_url, 'Callable formats URL from label.'], - } - - # Override defaults with user settings - for key, value in configs : - self.setConfig(key, value) - - def extendMarkdown(self, md, md_globals): - self.md = md - - # append to end of inline patterns - WIKILINK_RE = r'\[\[([\w0-9_ -]+)\]\]' - wikilinkPattern = WikiLinks(WIKILINK_RE, self.getConfigs()) - wikilinkPattern.md = md - md.inlinePatterns.add('wikilink', wikilinkPattern, "<not_strong") - - -class WikiLinks(Pattern): - def __init__(self, pattern, config): - super(WikiLinks, self).__init__(pattern) - self.config = config - - def handleMatch(self, m): - if m.group(2).strip(): - base_url, end_url, html_class = self._getMeta() - label = m.group(2).strip() - url = self.config['build_url'](label, base_url, end_url) - a = etree.Element('a') - a.text = label - a.set('href', url) - if html_class: - a.set('class', html_class) - else: - a = '' - return a - - def _getMeta(self): - """ Return meta data or config data. """ - base_url = self.config['base_url'] - end_url = self.config['end_url'] - html_class = self.config['html_class'] - if hasattr(self.md, 'Meta'): - if 'wiki_base_url' in self.md.Meta: - base_url = self.md.Meta['wiki_base_url'][0] - if 'wiki_end_url' in self.md.Meta: - end_url = self.md.Meta['wiki_end_url'][0] - if 'wiki_html_class' in self.md.Meta: - html_class = self.md.Meta['wiki_html_class'][0] - return base_url, end_url, html_class - - -def makeExtension(configs=None) : - return WikiLinkExtension(configs=configs) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/inlinepatterns.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/inlinepatterns.py deleted file mode 100644 index de957ef..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/inlinepatterns.py +++ /dev/null @@ -1,483 +0,0 @@ -""" -INLINE PATTERNS -============================================================================= - -Inline patterns such as *emphasis* are handled by means of auxiliary -objects, one per pattern. Pattern objects must be instances of classes -that extend markdown.Pattern. Each pattern object uses a single regular -expression and needs support the following methods: - - pattern.getCompiledRegExp() # returns a regular expression - - pattern.handleMatch(m) # takes a match object and returns - # an ElementTree element or just plain text - -All of python markdown's built-in patterns subclass from Pattern, -but you can add additional patterns that don't. - -Also note that all the regular expressions used by inline must -capture the whole block. For this reason, they all start with -'^(.*)' and end with '(.*)!'. In case with built-in expression -Pattern takes care of adding the "^(.*)" and "(.*)!". - -Finally, the order in which regular expressions are applied is very -important - e.g. if we first replace http://.../ links with <a> tags -and _then_ try to replace inline html, we would end up with a mess. -So, we apply the expressions in the following order: - -* escape and backticks have to go before everything else, so - that we can preempt any markdown patterns by escaping them. - -* then we handle auto-links (must be done before inline html) - -* then we handle inline HTML. At this point we will simply - replace all inline HTML strings with a placeholder and add - the actual HTML to a hash. - -* then inline images (must be done before links) - -* then bracketed links, first regular then reference-style - -* finally we apply strong and emphasis -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import util -from . import odict -import re -try: - from urllib.parse import urlparse, urlunparse -except ImportError: - from urlparse import urlparse, urlunparse -try: - from html import entities -except ImportError: - import htmlentitydefs as entities - - -def build_inlinepatterns(md_instance, **kwargs): - """ Build the default set of inline patterns for Markdown. """ - inlinePatterns = odict.OrderedDict() - inlinePatterns["backtick"] = BacktickPattern(BACKTICK_RE) - inlinePatterns["escape"] = EscapePattern(ESCAPE_RE, md_instance) - inlinePatterns["reference"] = ReferencePattern(REFERENCE_RE, md_instance) - inlinePatterns["link"] = LinkPattern(LINK_RE, md_instance) - inlinePatterns["image_link"] = ImagePattern(IMAGE_LINK_RE, md_instance) - inlinePatterns["image_reference"] = \ - ImageReferencePattern(IMAGE_REFERENCE_RE, md_instance) - inlinePatterns["short_reference"] = \ - ReferencePattern(SHORT_REF_RE, md_instance) - inlinePatterns["autolink"] = AutolinkPattern(AUTOLINK_RE, md_instance) - inlinePatterns["automail"] = AutomailPattern(AUTOMAIL_RE, md_instance) - inlinePatterns["linebreak"] = SubstituteTagPattern(LINE_BREAK_RE, 'br') - if md_instance.safeMode != 'escape': - inlinePatterns["html"] = HtmlPattern(HTML_RE, md_instance) - inlinePatterns["entity"] = HtmlPattern(ENTITY_RE, md_instance) - inlinePatterns["not_strong"] = SimpleTextPattern(NOT_STRONG_RE) - inlinePatterns["strong_em"] = DoubleTagPattern(STRONG_EM_RE, 'strong,em') - inlinePatterns["strong"] = SimpleTagPattern(STRONG_RE, 'strong') - inlinePatterns["emphasis"] = SimpleTagPattern(EMPHASIS_RE, 'em') - if md_instance.smart_emphasis: - inlinePatterns["emphasis2"] = SimpleTagPattern(SMART_EMPHASIS_RE, 'em') - else: - inlinePatterns["emphasis2"] = SimpleTagPattern(EMPHASIS_2_RE, 'em') - return inlinePatterns - -""" -The actual regular expressions for patterns ------------------------------------------------------------------------------ -""" - -NOBRACKET = r'[^\]\[]*' -BRK = ( r'\[(' - + (NOBRACKET + r'(\[')*6 - + (NOBRACKET+ r'\])*')*6 - + NOBRACKET + r')\]' ) -NOIMG = r'(?<!\!)' - -BACKTICK_RE = r'(?<!\\)(`+)(.+?)(?<!`)\2(?!`)' # `e=f()` or ``e=f("`")`` -ESCAPE_RE = r'\\(.)' # \< -EMPHASIS_RE = r'(\*)([^\*]+)\2' # *emphasis* -STRONG_RE = r'(\*{2}|_{2})(.+?)\2' # **strong** -STRONG_EM_RE = r'(\*{3}|_{3})(.+?)\2' # ***strong*** -SMART_EMPHASIS_RE = r'(?<!\w)(_)(?!_)(.+?)(?<!_)\2(?!\w)' # _smart_emphasis_ -EMPHASIS_2_RE = r'(_)(.+?)\2' # _emphasis_ -LINK_RE = NOIMG + BRK + \ -r'''\(\s*(<.*?>|((?:(?:\(.*?\))|[^\(\)]))*?)\s*((['"])(.*?)\12\s*)?\)''' -# [text](url) or [text](<url>) or [text](url "title") - -IMAGE_LINK_RE = r'\!' + BRK + r'\s*\((<.*?>|([^\)]*))\)' -# ![alttxt](http://x.com/) or ![alttxt](<http://x.com/>) -REFERENCE_RE = NOIMG + BRK+ r'\s?\[([^\]]*)\]' # [Google][3] -SHORT_REF_RE = NOIMG + r'\[([^\]]+)\]' # [Google] -IMAGE_REFERENCE_RE = r'\!' + BRK + '\s?\[([^\]]*)\]' # ![alt text][2] -NOT_STRONG_RE = r'((^| )(\*|_)( |$))' # stand-alone * or _ -AUTOLINK_RE = r'<((?:[Ff]|[Hh][Tt])[Tt][Pp][Ss]?://[^>]*)>' # <http://www.123.com> -AUTOMAIL_RE = r'<([^> \!]*@[^> ]*)>' # <me@example.com> - -HTML_RE = r'(\<([a-zA-Z/][^\>]*?|\!--.*?--)\>)' # <...> -ENTITY_RE = r'(&[\#a-zA-Z0-9]*;)' # & -LINE_BREAK_RE = r' \n' # two spaces at end of line - - -def dequote(string): - """Remove quotes from around a string.""" - if ( ( string.startswith('"') and string.endswith('"')) - or (string.startswith("'") and string.endswith("'")) ): - return string[1:-1] - else: - return string - -ATTR_RE = re.compile("\{@([^\}]*)=([^\}]*)}") # {@id=123} - -def handleAttributes(text, parent): - """Set values of an element based on attribute definitions ({@id=123}).""" - def attributeCallback(match): - parent.set(match.group(1), match.group(2).replace('\n', ' ')) - return ATTR_RE.sub(attributeCallback, text) - - -""" -The pattern classes ------------------------------------------------------------------------------ -""" - -class Pattern(object): - """Base class that inline patterns subclass. """ - - def __init__(self, pattern, markdown_instance=None): - """ - Create an instant of an inline pattern. - - Keyword arguments: - - * pattern: A regular expression that matches a pattern - - """ - self.pattern = pattern - self.compiled_re = re.compile("^(.*?)%s(.*?)$" % pattern, - re.DOTALL | re.UNICODE) - - # Api for Markdown to pass safe_mode into instance - self.safe_mode = False - if markdown_instance: - self.markdown = markdown_instance - - def getCompiledRegExp(self): - """ Return a compiled regular expression. """ - return self.compiled_re - - def handleMatch(self, m): - """Return a ElementTree element from the given match. - - Subclasses should override this method. - - Keyword arguments: - - * m: A re match object containing a match of the pattern. - - """ - pass - - def type(self): - """ Return class name, to define pattern type """ - return self.__class__.__name__ - - def unescape(self, text): - """ Return unescaped text given text with an inline placeholder. """ - try: - stash = self.markdown.treeprocessors['inline'].stashed_nodes - except KeyError: - return text - def itertext(el): - ' Reimplement Element.itertext for older python versions ' - tag = el.tag - if not isinstance(tag, util.string_type) and tag is not None: - return - if el.text: - yield el.text - for e in el: - for s in itertext(e): - yield s - if e.tail: - yield e.tail - def get_stash(m): - id = m.group(1) - if id in stash: - value = stash.get(id) - if isinstance(value, util.string_type): - return value - else: - # An etree Element - return text content only - return ''.join(itertext(value)) - return util.INLINE_PLACEHOLDER_RE.sub(get_stash, text) - - -class SimpleTextPattern(Pattern): - """ Return a simple text of group(2) of a Pattern. """ - def handleMatch(self, m): - text = m.group(2) - if text == util.INLINE_PLACEHOLDER_PREFIX: - return None - return text - - -class EscapePattern(Pattern): - """ Return an escaped character. """ - - def handleMatch(self, m): - char = m.group(2) - if char in self.markdown.ESCAPED_CHARS: - return '%s%s%s' % (util.STX, ord(char), util.ETX) - else: - return '\\%s' % char - - -class SimpleTagPattern(Pattern): - """ - Return element of type `tag` with a text attribute of group(3) - of a Pattern. - - """ - def __init__ (self, pattern, tag): - Pattern.__init__(self, pattern) - self.tag = tag - - def handleMatch(self, m): - el = util.etree.Element(self.tag) - el.text = m.group(3) - return el - - -class SubstituteTagPattern(SimpleTagPattern): - """ Return an element of type `tag` with no children. """ - def handleMatch (self, m): - return util.etree.Element(self.tag) - - -class BacktickPattern(Pattern): - """ Return a `<code>` element containing the matching text. """ - def __init__ (self, pattern): - Pattern.__init__(self, pattern) - self.tag = "code" - - def handleMatch(self, m): - el = util.etree.Element(self.tag) - el.text = util.AtomicString(m.group(3).strip()) - return el - - -class DoubleTagPattern(SimpleTagPattern): - """Return a ElementTree element nested in tag2 nested in tag1. - - Useful for strong emphasis etc. - - """ - def handleMatch(self, m): - tag1, tag2 = self.tag.split(",") - el1 = util.etree.Element(tag1) - el2 = util.etree.SubElement(el1, tag2) - el2.text = m.group(3) - return el1 - - -class HtmlPattern(Pattern): - """ Store raw inline html and return a placeholder. """ - def handleMatch (self, m): - rawhtml = self.unescape(m.group(2)) - place_holder = self.markdown.htmlStash.store(rawhtml) - return place_holder - - def unescape(self, text): - """ Return unescaped text given text with an inline placeholder. """ - try: - stash = self.markdown.treeprocessors['inline'].stashed_nodes - except KeyError: - return text - def get_stash(m): - id = m.group(1) - value = stash.get(id) - if value is not None: - try: - return self.markdown.serializer(value) - except: - return '\%s' % value - - return util.INLINE_PLACEHOLDER_RE.sub(get_stash, text) - - -class LinkPattern(Pattern): - """ Return a link element from the given match. """ - def handleMatch(self, m): - el = util.etree.Element("a") - el.text = m.group(2) - title = m.group(13) - href = m.group(9) - - if href: - if href[0] == "<": - href = href[1:-1] - el.set("href", self.sanitize_url(self.unescape(href.strip()))) - else: - el.set("href", "") - - if title: - title = dequote(self.unescape(title)) - el.set("title", title) - return el - - def sanitize_url(self, url): - """ - Sanitize a url against xss attacks in "safe_mode". - - Rather than specifically blacklisting `javascript:alert("XSS")` and all - its aliases (see <http://ha.ckers.org/xss.html>), we whitelist known - safe url formats. Most urls contain a network location, however some - are known not to (i.e.: mailto links). Script urls do not contain a - location. Additionally, for `javascript:...`, the scheme would be - "javascript" but some aliases will appear to `urlparse()` to have no - scheme. On top of that relative links (i.e.: "foo/bar.html") have no - scheme. Therefore we must check "path", "parameters", "query" and - "fragment" for any literal colons. We don't check "scheme" for colons - because it *should* never have any and "netloc" must allow the form: - `username:password@host:port`. - - """ - url = url.replace(' ', '%20') - if not self.markdown.safeMode: - # Return immediately bipassing parsing. - return url - - try: - scheme, netloc, path, params, query, fragment = url = urlparse(url) - except ValueError: - # Bad url - so bad it couldn't be parsed. - return '' - - locless_schemes = ['', 'mailto', 'news'] - allowed_schemes = locless_schemes + ['http', 'https', 'ftp', 'ftps'] - if scheme not in allowed_schemes: - # Not a known (allowed) scheme. Not safe. - return '' - - if netloc == '' and scheme not in locless_schemes: - # This should not happen. Treat as suspect. - return '' - - for part in url[2:]: - if ":" in part: - # A colon in "path", "parameters", "query" or "fragment" is suspect. - return '' - - # Url passes all tests. Return url as-is. - return urlunparse(url) - -class ImagePattern(LinkPattern): - """ Return a img element from the given match. """ - def handleMatch(self, m): - el = util.etree.Element("img") - src_parts = m.group(9).split() - if src_parts: - src = src_parts[0] - if src[0] == "<" and src[-1] == ">": - src = src[1:-1] - el.set('src', self.sanitize_url(self.unescape(src))) - else: - el.set('src', "") - if len(src_parts) > 1: - el.set('title', dequote(self.unescape(" ".join(src_parts[1:])))) - - if self.markdown.enable_attributes: - truealt = handleAttributes(m.group(2), el) - else: - truealt = m.group(2) - - el.set('alt', self.unescape(truealt)) - return el - -class ReferencePattern(LinkPattern): - """ Match to a stored reference and return link element. """ - - NEWLINE_CLEANUP_RE = re.compile(r'[ ]?\n', re.MULTILINE) - - def handleMatch(self, m): - try: - id = m.group(9).lower() - except IndexError: - id = None - if not id: - # if we got something like "[Google][]" or "[Goggle]" - # we'll use "google" as the id - id = m.group(2).lower() - - # Clean up linebreaks in id - id = self.NEWLINE_CLEANUP_RE.sub(' ', id) - if not id in self.markdown.references: # ignore undefined refs - return None - href, title = self.markdown.references[id] - - text = m.group(2) - return self.makeTag(href, title, text) - - def makeTag(self, href, title, text): - el = util.etree.Element('a') - - el.set('href', self.sanitize_url(href)) - if title: - el.set('title', title) - - el.text = text - return el - - -class ImageReferencePattern(ReferencePattern): - """ Match to a stored reference and return img element. """ - def makeTag(self, href, title, text): - el = util.etree.Element("img") - el.set("src", self.sanitize_url(href)) - if title: - el.set("title", title) - - if self.markdown.enable_attributes: - text = handleAttributes(text, el) - - el.set("alt", self.unescape(text)) - return el - - -class AutolinkPattern(Pattern): - """ Return a link Element given an autolink (`<http://example/com>`). """ - def handleMatch(self, m): - el = util.etree.Element("a") - el.set('href', self.unescape(m.group(2))) - el.text = util.AtomicString(m.group(2)) - return el - -class AutomailPattern(Pattern): - """ - Return a mailto link Element given an automail link (`<foo@example.com>`). - """ - def handleMatch(self, m): - el = util.etree.Element('a') - email = self.unescape(m.group(2)) - if email.startswith("mailto:"): - email = email[len("mailto:"):] - - def codepoint2name(code): - """Return entity definition by code, or the code if not defined.""" - entity = entities.codepoint2name.get(code) - if entity: - return "%s%s;" % (util.AMP_SUBSTITUTE, entity) - else: - return "%s#%d;" % (util.AMP_SUBSTITUTE, code) - - letters = [codepoint2name(ord(letter)) for letter in email] - el.text = util.AtomicString(''.join(letters)) - - mailto = "mailto:" + email - mailto = "".join([util.AMP_SUBSTITUTE + '#%d;' % - ord(letter) for letter in mailto]) - el.set('href', mailto) - return el - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/odict.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/odict.py deleted file mode 100644 index 8089ece..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/odict.py +++ /dev/null @@ -1,194 +0,0 @@ -from __future__ import unicode_literals -from __future__ import absolute_import -from . import util - -from copy import deepcopy - -def iteritems_compat(d): - """Return an iterator over the (key, value) pairs of a dictionary. - Copied from `six` module.""" - return iter(getattr(d, _iteritems)()) - -class OrderedDict(dict): - """ - A dictionary that keeps its keys in the order in which they're inserted. - - Copied from Django's SortedDict with some modifications. - - """ - def __new__(cls, *args, **kwargs): - instance = super(OrderedDict, cls).__new__(cls, *args, **kwargs) - instance.keyOrder = [] - return instance - - def __init__(self, data=None): - if data is None or isinstance(data, dict): - data = data or [] - super(OrderedDict, self).__init__(data) - self.keyOrder = list(data) if data else [] - else: - super(OrderedDict, self).__init__() - super_set = super(OrderedDict, self).__setitem__ - for key, value in data: - # Take the ordering from first key - if key not in self: - self.keyOrder.append(key) - # But override with last value in data (dict() does this) - super_set(key, value) - - def __deepcopy__(self, memo): - return self.__class__([(key, deepcopy(value, memo)) - for key, value in self.items()]) - - def __copy__(self): - # The Python's default copy implementation will alter the state - # of self. The reason for this seems complex but is likely related to - # subclassing dict. - return self.copy() - - def __setitem__(self, key, value): - if key not in self: - self.keyOrder.append(key) - super(OrderedDict, self).__setitem__(key, value) - - def __delitem__(self, key): - super(OrderedDict, self).__delitem__(key) - self.keyOrder.remove(key) - - def __iter__(self): - return iter(self.keyOrder) - - def __reversed__(self): - return reversed(self.keyOrder) - - def pop(self, k, *args): - result = super(OrderedDict, self).pop(k, *args) - try: - self.keyOrder.remove(k) - except ValueError: - # Key wasn't in the dictionary in the first place. No problem. - pass - return result - - def popitem(self): - result = super(OrderedDict, self).popitem() - self.keyOrder.remove(result[0]) - return result - - def _iteritems(self): - for key in self.keyOrder: - yield key, self[key] - - def _iterkeys(self): - for key in self.keyOrder: - yield key - - def _itervalues(self): - for key in self.keyOrder: - yield self[key] - - if util.PY3: - items = _iteritems - keys = _iterkeys - values = _itervalues - else: - iteritems = _iteritems - iterkeys = _iterkeys - itervalues = _itervalues - - def items(self): - return [(k, self[k]) for k in self.keyOrder] - - def keys(self): - return self.keyOrder[:] - - def values(self): - return [self[k] for k in self.keyOrder] - - def update(self, dict_): - for k, v in iteritems_compat(dict_): - self[k] = v - - def setdefault(self, key, default): - if key not in self: - self.keyOrder.append(key) - return super(OrderedDict, self).setdefault(key, default) - - def value_for_index(self, index): - """Returns the value of the item at the given zero-based index.""" - return self[self.keyOrder[index]] - - def insert(self, index, key, value): - """Inserts the key, value pair before the item with the given index.""" - if key in self.keyOrder: - n = self.keyOrder.index(key) - del self.keyOrder[n] - if n < index: - index -= 1 - self.keyOrder.insert(index, key) - super(OrderedDict, self).__setitem__(key, value) - - def copy(self): - """Returns a copy of this object.""" - # This way of initializing the copy means it works for subclasses, too. - return self.__class__(self) - - def __repr__(self): - """ - Replaces the normal dict.__repr__ with a version that returns the keys - in their Ordered order. - """ - return '{%s}' % ', '.join(['%r: %r' % (k, v) for k, v in iteritems_compat(self)]) - - def clear(self): - super(OrderedDict, self).clear() - self.keyOrder = [] - - def index(self, key): - """ Return the index of a given key. """ - try: - return self.keyOrder.index(key) - except ValueError: - raise ValueError("Element '%s' was not found in OrderedDict" % key) - - def index_for_location(self, location): - """ Return index or None for a given location. """ - if location == '_begin': - i = 0 - elif location == '_end': - i = None - elif location.startswith('<') or location.startswith('>'): - i = self.index(location[1:]) - if location.startswith('>'): - if i >= len(self): - # last item - i = None - else: - i += 1 - else: - raise ValueError('Not a valid location: "%s". Location key ' - 'must start with a ">" or "<".' % location) - return i - - def add(self, key, value, location): - """ Insert by key location. """ - i = self.index_for_location(location) - if i is not None: - self.insert(i, key, value) - else: - self.__setitem__(key, value) - - def link(self, key, location): - """ Change location of an existing item. """ - n = self.keyOrder.index(key) - del self.keyOrder[n] - try: - i = self.index_for_location(location) - if i is not None: - self.keyOrder.insert(i, key) - else: - self.keyOrder.append(key) - except Exception as e: - # restore to prevent data loss and reraise - self.keyOrder.insert(n, key) - raise e diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/postprocessors.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/postprocessors.py deleted file mode 100644 index 5f3f032..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/postprocessors.py +++ /dev/null @@ -1,104 +0,0 @@ -""" -POST-PROCESSORS -============================================================================= - -Markdown also allows post-processors, which are similar to preprocessors in -that they need to implement a "run" method. However, they are run after core -processing. - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import util -from . import odict -import re - - -def build_postprocessors(md_instance, **kwargs): - """ Build the default postprocessors for Markdown. """ - postprocessors = odict.OrderedDict() - postprocessors["raw_html"] = RawHtmlPostprocessor(md_instance) - postprocessors["amp_substitute"] = AndSubstitutePostprocessor() - postprocessors["unescape"] = UnescapePostprocessor() - return postprocessors - - -class Postprocessor(util.Processor): - """ - Postprocessors are run after the ElementTree it converted back into text. - - Each Postprocessor implements a "run" method that takes a pointer to a - text string, modifies it as necessary and returns a text string. - - Postprocessors must extend markdown.Postprocessor. - - """ - - def run(self, text): - """ - Subclasses of Postprocessor should implement a `run` method, which - takes the html document as a single text string and returns a - (possibly modified) string. - - """ - pass - - -class RawHtmlPostprocessor(Postprocessor): - """ Restore raw html to the document. """ - - def run(self, text): - """ Iterate over html stash and restore "safe" html. """ - for i in range(self.markdown.htmlStash.html_counter): - html, safe = self.markdown.htmlStash.rawHtmlBlocks[i] - if self.markdown.safeMode and not safe: - if str(self.markdown.safeMode).lower() == 'escape': - html = self.escape(html) - elif str(self.markdown.safeMode).lower() == 'remove': - html = '' - else: - html = self.markdown.html_replacement_text - if self.isblocklevel(html) and (safe or not self.markdown.safeMode): - text = text.replace("<p>%s</p>" % - (self.markdown.htmlStash.get_placeholder(i)), - html + "\n") - text = text.replace(self.markdown.htmlStash.get_placeholder(i), - html) - return text - - def escape(self, html): - """ Basic html escaping """ - html = html.replace('&', '&') - html = html.replace('<', '<') - html = html.replace('>', '>') - return html.replace('"', '"') - - def isblocklevel(self, html): - m = re.match(r'^\<\/?([^ >]+)', html) - if m: - if m.group(1)[0] in ('!', '?', '@', '%'): - # Comment, php etc... - return True - return util.isBlockLevel(m.group(1)) - return False - - -class AndSubstitutePostprocessor(Postprocessor): - """ Restore valid entities """ - - def run(self, text): - text = text.replace(util.AMP_SUBSTITUTE, "&") - return text - - -class UnescapePostprocessor(Postprocessor): - """ Restore escaped chars """ - - RE = re.compile('%s(\d+)%s' % (util.STX, util.ETX)) - - def unescape(self, m): - return util.int2str(int(m.group(1))) - - def run(self, text): - return self.RE.sub(self.unescape, text) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/preprocessors.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/preprocessors.py deleted file mode 100644 index 72b2ed6..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/preprocessors.py +++ /dev/null @@ -1,298 +0,0 @@ -""" -PRE-PROCESSORS -============================================================================= - -Preprocessors work on source text before we start doing anything too -complicated. -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import util -from . import odict -import re - - -def build_preprocessors(md_instance, **kwargs): - """ Build the default set of preprocessors used by Markdown. """ - preprocessors = odict.OrderedDict() - preprocessors['normalize_whitespace'] = NormalizeWhitespace(md_instance) - if md_instance.safeMode != 'escape': - preprocessors["html_block"] = HtmlBlockPreprocessor(md_instance) - preprocessors["reference"] = ReferencePreprocessor(md_instance) - return preprocessors - - -class Preprocessor(util.Processor): - """ - Preprocessors are run after the text is broken into lines. - - Each preprocessor implements a "run" method that takes a pointer to a - list of lines of the document, modifies it as necessary and returns - either the same pointer or a pointer to a new list. - - Preprocessors must extend markdown.Preprocessor. - - """ - def run(self, lines): - """ - Each subclass of Preprocessor should override the `run` method, which - takes the document as a list of strings split by newlines and returns - the (possibly modified) list of lines. - - """ - pass - - -class NormalizeWhitespace(Preprocessor): - """ Normalize whitespace for consistant parsing. """ - - def run(self, lines): - source = '\n'.join(lines) - source = source.replace(util.STX, "").replace(util.ETX, "") - source = source.replace("\r\n", "\n").replace("\r", "\n") + "\n\n" - source = source.expandtabs(self.markdown.tab_length) - source = re.sub(r'(?<=\n) +\n', '\n', source) - return source.split('\n') - - -class HtmlBlockPreprocessor(Preprocessor): - """Remove html blocks from the text and store them for later retrieval.""" - - right_tag_patterns = ["</%s>", "%s>"] - attrs_pattern = r""" - \s+(?P<attr>[^>"'/= ]+)=(?P<q>['"])(?P<value>.*?)(?P=q) # attr="value" - | # OR - \s+(?P<attr1>[^>"'/= ]+)=(?P<value1>[^> ]+) # attr=value - | # OR - \s+(?P<attr2>[^>"'/= ]+) # attr - """ - left_tag_pattern = r'^\<(?P<tag>[^> ]+)(?P<attrs>(%s)*)\s*\/?\>?' % attrs_pattern - attrs_re = re.compile(attrs_pattern, re.VERBOSE) - left_tag_re = re.compile(left_tag_pattern, re.VERBOSE) - markdown_in_raw = False - - def _get_left_tag(self, block): - m = self.left_tag_re.match(block) - if m: - tag = m.group('tag') - raw_attrs = m.group('attrs') - attrs = {} - if raw_attrs: - for ma in self.attrs_re.finditer(raw_attrs): - if ma.group('attr'): - if ma.group('value'): - attrs[ma.group('attr').strip()] = ma.group('value') - else: - attrs[ma.group('attr').strip()] = "" - elif ma.group('attr1'): - if ma.group('value1'): - attrs[ma.group('attr1').strip()] = ma.group('value1') - else: - attrs[ma.group('attr1').strip()] = "" - elif ma.group('attr2'): - attrs[ma.group('attr2').strip()] = "" - return tag, len(m.group(0)), attrs - else: - tag = block[1:].split(">", 1)[0].lower() - return tag, len(tag)+2, {} - - def _recursive_tagfind(self, ltag, rtag, start_index, block): - while 1: - i = block.find(rtag, start_index) - if i == -1: - return -1 - j = block.find(ltag, start_index) - # if no ltag, or rtag found before another ltag, return index - if (j > i or j == -1): - return i + len(rtag) - # another ltag found before rtag, use end of ltag as starting - # point and search again - j = block.find('>', j) - start_index = self._recursive_tagfind(ltag, rtag, j + 1, block) - if start_index == -1: - # HTML potentially malformed- ltag has no corresponding - # rtag - return -1 - - def _get_right_tag(self, left_tag, left_index, block): - for p in self.right_tag_patterns: - tag = p % left_tag - i = self._recursive_tagfind("<%s" % left_tag, tag, left_index, block) - if i > 2: - return tag.lstrip("<").rstrip(">"), i - return block.rstrip()[-left_index:-1].lower(), len(block) - - def _equal_tags(self, left_tag, right_tag): - if left_tag[0] in ['?', '@', '%']: # handle PHP, etc. - return True - if ("/" + left_tag) == right_tag: - return True - if (right_tag == "--" and left_tag == "--"): - return True - elif left_tag == right_tag[1:] \ - and right_tag[0] == "/": - return True - else: - return False - - def _is_oneliner(self, tag): - return (tag in ['hr', 'hr/']) - - def run(self, lines): - text = "\n".join(lines) - new_blocks = [] - text = text.rsplit("\n\n") - items = [] - left_tag = '' - right_tag = '' - in_tag = False # flag - - while text: - block = text[0] - if block.startswith("\n"): - block = block[1:] - text = text[1:] - - if block.startswith("\n"): - block = block[1:] - - if not in_tag: - if block.startswith("<") and len(block.strip()) > 1: - - if block[1] == "!": - # is a comment block - left_tag, left_index, attrs = "--", 2, {} - else: - left_tag, left_index, attrs = self._get_left_tag(block) - right_tag, data_index = self._get_right_tag(left_tag, - left_index, - block) - # keep checking conditions below and maybe just append - - if data_index < len(block) \ - and (util.isBlockLevel(left_tag) - or left_tag == '--'): - text.insert(0, block[data_index:]) - block = block[:data_index] - - if not (util.isBlockLevel(left_tag) \ - or block[1] in ["!", "?", "@", "%"]): - new_blocks.append(block) - continue - - if self._is_oneliner(left_tag): - new_blocks.append(block.strip()) - continue - - if block.rstrip().endswith(">") \ - and self._equal_tags(left_tag, right_tag): - if self.markdown_in_raw and 'markdown' in attrs.keys(): - start = re.sub(r'\smarkdown(=[\'"]?[^> ]*[\'"]?)?', - '', block[:left_index]) - end = block[-len(right_tag)-2:] - block = block[left_index:-len(right_tag)-2] - new_blocks.append( - self.markdown.htmlStash.store(start)) - new_blocks.append(block) - new_blocks.append( - self.markdown.htmlStash.store(end)) - else: - new_blocks.append( - self.markdown.htmlStash.store(block.strip())) - continue - else: - # if is block level tag and is not complete - - if util.isBlockLevel(left_tag) or left_tag == "--" \ - and not block.rstrip().endswith(">"): - items.append(block.strip()) - in_tag = True - else: - new_blocks.append( - self.markdown.htmlStash.store(block.strip())) - - continue - - new_blocks.append(block) - - else: - items.append(block) - - right_tag, data_index = self._get_right_tag(left_tag, 0, block) - - if self._equal_tags(left_tag, right_tag): - # if find closing tag - - if data_index < len(block): - # we have more text after right_tag - items[-1] = block[:data_index] - text.insert(0, block[data_index:]) - - in_tag = False - if self.markdown_in_raw and 'markdown' in attrs.keys(): - start = re.sub(r'\smarkdown(=[\'"]?[^> ]*[\'"]?)?', - '', items[0][:left_index]) - items[0] = items[0][left_index:] - end = items[-1][-len(right_tag)-2:] - items[-1] = items[-1][:-len(right_tag)-2] - new_blocks.append( - self.markdown.htmlStash.store(start)) - new_blocks.extend(items) - new_blocks.append( - self.markdown.htmlStash.store(end)) - else: - new_blocks.append( - self.markdown.htmlStash.store('\n\n'.join(items))) - items = [] - - if items: - if self.markdown_in_raw and 'markdown' in attrs.keys(): - start = re.sub(r'\smarkdown(=[\'"]?[^> ]*[\'"]?)?', - '', items[0][:left_index]) - items[0] = items[0][left_index:] - end = items[-1][-len(right_tag)-2:] - items[-1] = items[-1][:-len(right_tag)-2] - new_blocks.append( - self.markdown.htmlStash.store(start)) - new_blocks.extend(items) - if end.strip(): - new_blocks.append( - self.markdown.htmlStash.store(end)) - else: - new_blocks.append( - self.markdown.htmlStash.store('\n\n'.join(items))) - #new_blocks.append(self.markdown.htmlStash.store('\n\n'.join(items))) - new_blocks.append('\n') - - new_text = "\n\n".join(new_blocks) - return new_text.split("\n") - - -class ReferencePreprocessor(Preprocessor): - """ Remove reference definitions from text and store for later use. """ - - TITLE = r'[ ]*(\"(.*)\"|\'(.*)\'|\((.*)\))[ ]*' - RE = re.compile(r'^[ ]{0,3}\[([^\]]*)\]:\s*([^ ]*)[ ]*(%s)?$' % TITLE, re.DOTALL) - TITLE_RE = re.compile(r'^%s$' % TITLE) - - def run (self, lines): - new_text = []; - while lines: - line = lines.pop(0) - m = self.RE.match(line) - if m: - id = m.group(1).strip().lower() - link = m.group(2).lstrip('<').rstrip('>') - t = m.group(5) or m.group(6) or m.group(7) - if not t: - # Check next line for title - tm = self.TITLE_RE.match(lines[0]) - if tm: - lines.pop(0) - t = tm.group(2) or tm.group(3) or tm.group(4) - self.markdown.references[id] = (link, t) - else: - new_text.append(line) - - return new_text #+ "\n" diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/serializers.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/serializers.py deleted file mode 100644 index b19d61c..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/serializers.py +++ /dev/null @@ -1,277 +0,0 @@ -# markdown/searializers.py -# -# Add x/html serialization to Elementree -# Taken from ElementTree 1.3 preview with slight modifications -# -# Copyright (c) 1999-2007 by Fredrik Lundh. All rights reserved. -# -# fredrik@pythonware.com -# http://www.pythonware.com -# -# -------------------------------------------------------------------- -# The ElementTree toolkit is -# -# Copyright (c) 1999-2007 by Fredrik Lundh -# -# By obtaining, using, and/or copying this software and/or its -# associated documentation, you agree that you have read, understood, -# and will comply with the following terms and conditions: -# -# Permission to use, copy, modify, and distribute this software and -# its associated documentation for any purpose and without fee is -# hereby granted, provided that the above copyright notice appears in -# all copies, and that both that copyright notice and this permission -# notice appear in supporting documentation, and that the name of -# Secret Labs AB or the author not be used in advertising or publicity -# pertaining to distribution of the software without specific, written -# prior permission. -# -# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD -# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- -# ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR -# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY -# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS -# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE -# OF THIS SOFTWARE. -# -------------------------------------------------------------------- - - -from __future__ import absolute_import -from __future__ import unicode_literals -from . import util -ElementTree = util.etree.ElementTree -QName = util.etree.QName -if hasattr(util.etree, 'test_comment'): - Comment = util.etree.test_comment -else: - Comment = util.etree.Comment -PI = util.etree.PI -ProcessingInstruction = util.etree.ProcessingInstruction - -__all__ = ['to_html_string', 'to_xhtml_string'] - -HTML_EMPTY = ("area", "base", "basefont", "br", "col", "frame", "hr", - "img", "input", "isindex", "link", "meta" "param") - -try: - HTML_EMPTY = set(HTML_EMPTY) -except NameError: - pass - -_namespace_map = { - # "well-known" namespace prefixes - "http://www.w3.org/XML/1998/namespace": "xml", - "http://www.w3.org/1999/xhtml": "html", - "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf", - "http://schemas.xmlsoap.org/wsdl/": "wsdl", - # xml schema - "http://www.w3.org/2001/XMLSchema": "xs", - "http://www.w3.org/2001/XMLSchema-instance": "xsi", - # dublic core - "http://purl.org/dc/elements/1.1/": "dc", -} - - -def _raise_serialization_error(text): - raise TypeError( - "cannot serialize %r (type %s)" % (text, type(text).__name__) - ) - -def _encode(text, encoding): - try: - return text.encode(encoding, "xmlcharrefreplace") - except (TypeError, AttributeError): - _raise_serialization_error(text) - -def _escape_cdata(text): - # escape character data - try: - # it's worth avoiding do-nothing calls for strings that are - # shorter than 500 character, or so. assume that's, by far, - # the most common case in most applications. - if "&" in text: - text = text.replace("&", "&") - if "<" in text: - text = text.replace("<", "<") - if ">" in text: - text = text.replace(">", ">") - return text - except (TypeError, AttributeError): - _raise_serialization_error(text) - - -def _escape_attrib(text): - # escape attribute value - try: - if "&" in text: - text = text.replace("&", "&") - if "<" in text: - text = text.replace("<", "<") - if ">" in text: - text = text.replace(">", ">") - if "\"" in text: - text = text.replace("\"", """) - if "\n" in text: - text = text.replace("\n", " ") - return text - except (TypeError, AttributeError): - _raise_serialization_error(text) - -def _escape_attrib_html(text): - # escape attribute value - try: - if "&" in text: - text = text.replace("&", "&") - if "<" in text: - text = text.replace("<", "<") - if ">" in text: - text = text.replace(">", ">") - if "\"" in text: - text = text.replace("\"", """) - return text - except (TypeError, AttributeError): - _raise_serialization_error(text) - - -def _serialize_html(write, elem, qnames, namespaces, format): - tag = elem.tag - text = elem.text - if tag is Comment: - write("<!--%s-->" % _escape_cdata(text)) - elif tag is ProcessingInstruction: - write("<?%s?>" % _escape_cdata(text)) - else: - tag = qnames[tag] - if tag is None: - if text: - write(_escape_cdata(text)) - for e in elem: - _serialize_html(write, e, qnames, None, format) - else: - write("<" + tag) - items = elem.items() - if items or namespaces: - items.sort() # lexical order - for k, v in items: - if isinstance(k, QName): - k = k.text - if isinstance(v, QName): - v = qnames[v.text] - else: - v = _escape_attrib_html(v) - if qnames[k] == v and format == 'html': - # handle boolean attributes - write(" %s" % v) - else: - write(" %s=\"%s\"" % (qnames[k], v)) - if namespaces: - items = namespaces.items() - items.sort(key=lambda x: x[1]) # sort on prefix - for v, k in items: - if k: - k = ":" + k - write(" xmlns%s=\"%s\"" % (k, _escape_attrib(v))) - if format == "xhtml" and tag in HTML_EMPTY: - write(" />") - else: - write(">") - tag = tag.lower() - if text: - if tag == "script" or tag == "style": - write(text) - else: - write(_escape_cdata(text)) - for e in elem: - _serialize_html(write, e, qnames, None, format) - if tag not in HTML_EMPTY: - write("</" + tag + ">") - if elem.tail: - write(_escape_cdata(elem.tail)) - -def _write_html(root, - encoding=None, - default_namespace=None, - format="html"): - assert root is not None - data = [] - write = data.append - qnames, namespaces = _namespaces(root, default_namespace) - _serialize_html(write, root, qnames, namespaces, format) - if encoding is None: - return "".join(data) - else: - return _encode("".join(data)) - - -# -------------------------------------------------------------------- -# serialization support - -def _namespaces(elem, default_namespace=None): - # identify namespaces used in this tree - - # maps qnames to *encoded* prefix:local names - qnames = {None: None} - - # maps uri:s to prefixes - namespaces = {} - if default_namespace: - namespaces[default_namespace] = "" - - def add_qname(qname): - # calculate serialized qname representation - try: - if qname[:1] == "{": - uri, tag = qname[1:].split("}", 1) - prefix = namespaces.get(uri) - if prefix is None: - prefix = _namespace_map.get(uri) - if prefix is None: - prefix = "ns%d" % len(namespaces) - if prefix != "xml": - namespaces[uri] = prefix - if prefix: - qnames[qname] = "%s:%s" % (prefix, tag) - else: - qnames[qname] = tag # default element - else: - if default_namespace: - raise ValueError( - "cannot use non-qualified names with " - "default_namespace option" - ) - qnames[qname] = qname - except TypeError: - _raise_serialization_error(qname) - - # populate qname and namespaces table - try: - iterate = elem.iter - except AttributeError: - iterate = elem.getiterator # cET compatibility - for elem in iterate(): - tag = elem.tag - if isinstance(tag, QName) and tag.text not in qnames: - add_qname(tag.text) - elif isinstance(tag, util.string_type): - if tag not in qnames: - add_qname(tag) - elif tag is not None and tag is not Comment and tag is not PI: - _raise_serialization_error(tag) - for key, value in elem.items(): - if isinstance(key, QName): - key = key.text - if key not in qnames: - add_qname(key) - if isinstance(value, QName) and value.text not in qnames: - add_qname(value.text) - text = elem.text - if isinstance(text, QName) and text.text not in qnames: - add_qname(text.text) - return qnames, namespaces - -def to_html_string(element): - return _write_html(ElementTree(element).getroot(), format="html") - -def to_xhtml_string(element): - return _write_html(ElementTree(element).getroot(), format="xhtml") diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/treeprocessors.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/treeprocessors.py deleted file mode 100644 index e6d3dc9..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/treeprocessors.py +++ /dev/null @@ -1,360 +0,0 @@ -from __future__ import unicode_literals -from __future__ import absolute_import -from . import util -from . import odict -from . import inlinepatterns - - -def build_treeprocessors(md_instance, **kwargs): - """ Build the default treeprocessors for Markdown. """ - treeprocessors = odict.OrderedDict() - treeprocessors["inline"] = InlineProcessor(md_instance) - treeprocessors["prettify"] = PrettifyTreeprocessor(md_instance) - return treeprocessors - - -def isString(s): - """ Check if it's string """ - if not isinstance(s, util.AtomicString): - return isinstance(s, util.string_type) - return False - - -class Treeprocessor(util.Processor): - """ - Treeprocessors are run on the ElementTree object before serialization. - - Each Treeprocessor implements a "run" method that takes a pointer to an - ElementTree, modifies it as necessary and returns an ElementTree - object. - - Treeprocessors must extend markdown.Treeprocessor. - - """ - def run(self, root): - """ - Subclasses of Treeprocessor should implement a `run` method, which - takes a root ElementTree. This method can return another ElementTree - object, and the existing root ElementTree will be replaced, or it can - modify the current tree and return None. - """ - pass - - -class InlineProcessor(Treeprocessor): - """ - A Treeprocessor that traverses a tree, applying inline patterns. - """ - - def __init__(self, md): - self.__placeholder_prefix = util.INLINE_PLACEHOLDER_PREFIX - self.__placeholder_suffix = util.ETX - self.__placeholder_length = 4 + len(self.__placeholder_prefix) \ - + len(self.__placeholder_suffix) - self.__placeholder_re = util.INLINE_PLACEHOLDER_RE - self.markdown = md - - def __makePlaceholder(self, type): - """ Generate a placeholder """ - id = "%04d" % len(self.stashed_nodes) - hash = util.INLINE_PLACEHOLDER % id - return hash, id - - def __findPlaceholder(self, data, index): - """ - Extract id from data string, start from index - - Keyword arguments: - - * data: string - * index: index, from which we start search - - Returns: placeholder id and string index, after the found placeholder. - - """ - m = self.__placeholder_re.search(data, index) - if m: - return m.group(1), m.end() - else: - return None, index + 1 - - def __stashNode(self, node, type): - """ Add node to stash """ - placeholder, id = self.__makePlaceholder(type) - self.stashed_nodes[id] = node - return placeholder - - def __handleInline(self, data, patternIndex=0): - """ - Process string with inline patterns and replace it - with placeholders - - Keyword arguments: - - * data: A line of Markdown text - * patternIndex: The index of the inlinePattern to start with - - Returns: String with placeholders. - - """ - if not isinstance(data, util.AtomicString): - startIndex = 0 - while patternIndex < len(self.markdown.inlinePatterns): - data, matched, startIndex = self.__applyPattern( - self.markdown.inlinePatterns.value_for_index(patternIndex), - data, patternIndex, startIndex) - if not matched: - patternIndex += 1 - return data - - def __processElementText(self, node, subnode, isText=True): - """ - Process placeholders in Element.text or Element.tail - of Elements popped from self.stashed_nodes. - - Keywords arguments: - - * node: parent node - * subnode: processing node - * isText: bool variable, True - it's text, False - it's tail - - Returns: None - - """ - if isText: - text = subnode.text - subnode.text = None - else: - text = subnode.tail - subnode.tail = None - - childResult = self.__processPlaceholders(text, subnode) - - if not isText and node is not subnode: - pos = node.getchildren().index(subnode) - node.remove(subnode) - else: - pos = 0 - - childResult.reverse() - for newChild in childResult: - node.insert(pos, newChild) - - def __processPlaceholders(self, data, parent): - """ - Process string with placeholders and generate ElementTree tree. - - Keyword arguments: - - * data: string with placeholders instead of ElementTree elements. - * parent: Element, which contains processing inline data - - Returns: list with ElementTree elements with applied inline patterns. - - """ - def linkText(text): - if text: - if result: - if result[-1].tail: - result[-1].tail += text - else: - result[-1].tail = text - else: - if parent.text: - parent.text += text - else: - parent.text = text - result = [] - strartIndex = 0 - while data: - index = data.find(self.__placeholder_prefix, strartIndex) - if index != -1: - id, phEndIndex = self.__findPlaceholder(data, index) - - if id in self.stashed_nodes: - node = self.stashed_nodes.get(id) - - if index > 0: - text = data[strartIndex:index] - linkText(text) - - if not isString(node): # it's Element - for child in [node] + node.getchildren(): - if child.tail: - if child.tail.strip(): - self.__processElementText(node, child,False) - if child.text: - if child.text.strip(): - self.__processElementText(child, child) - else: # it's just a string - linkText(node) - strartIndex = phEndIndex - continue - - strartIndex = phEndIndex - result.append(node) - - else: # wrong placeholder - end = index + len(self.__placeholder_prefix) - linkText(data[strartIndex:end]) - strartIndex = end - else: - text = data[strartIndex:] - if isinstance(data, util.AtomicString): - # We don't want to loose the AtomicString - text = util.AtomicString(text) - linkText(text) - data = "" - - return result - - def __applyPattern(self, pattern, data, patternIndex, startIndex=0): - """ - Check if the line fits the pattern, create the necessary - elements, add it to stashed_nodes. - - Keyword arguments: - - * data: the text to be processed - * pattern: the pattern to be checked - * patternIndex: index of current pattern - * startIndex: string index, from which we start searching - - Returns: String with placeholders instead of ElementTree elements. - - """ - match = pattern.getCompiledRegExp().match(data[startIndex:]) - leftData = data[:startIndex] - - if not match: - return data, False, 0 - - node = pattern.handleMatch(match) - - if node is None: - return data, True, len(leftData)+match.span(len(match.groups()))[0] - - if not isString(node): - if not isinstance(node.text, util.AtomicString): - # We need to process current node too - for child in [node] + node.getchildren(): - if not isString(node): - if child.text: - child.text = self.__handleInline(child.text, - patternIndex + 1) - if child.tail: - child.tail = self.__handleInline(child.tail, - patternIndex) - - placeholder = self.__stashNode(node, pattern.type()) - - return "%s%s%s%s" % (leftData, - match.group(1), - placeholder, match.groups()[-1]), True, 0 - - def run(self, tree): - """Apply inline patterns to a parsed Markdown tree. - - Iterate over ElementTree, find elements with inline tag, apply inline - patterns and append newly created Elements to tree. If you don't - want to process your data with inline paterns, instead of normal string, - use subclass AtomicString: - - node.text = markdown.AtomicString("This will not be processed.") - - Arguments: - - * tree: ElementTree object, representing Markdown tree. - - Returns: ElementTree object with applied inline patterns. - - """ - self.stashed_nodes = {} - - stack = [tree] - - while stack: - currElement = stack.pop() - insertQueue = [] - for child in currElement.getchildren(): - if child.text and not isinstance(child.text, util.AtomicString): - text = child.text - child.text = None - lst = self.__processPlaceholders(self.__handleInline( - text), child) - stack += lst - insertQueue.append((child, lst)) - if child.tail: - tail = self.__handleInline(child.tail) - dumby = util.etree.Element('d') - tailResult = self.__processPlaceholders(tail, dumby) - if dumby.text: - child.tail = dumby.text - else: - child.tail = None - pos = currElement.getchildren().index(child) + 1 - tailResult.reverse() - for newChild in tailResult: - currElement.insert(pos, newChild) - if child.getchildren(): - stack.append(child) - - for element, lst in insertQueue: - if self.markdown.enable_attributes: - if element.text and isString(element.text): - element.text = \ - inlinepatterns.handleAttributes(element.text, - element) - i = 0 - for newChild in lst: - if self.markdown.enable_attributes: - # Processing attributes - if newChild.tail and isString(newChild.tail): - newChild.tail = \ - inlinepatterns.handleAttributes(newChild.tail, - element) - if newChild.text and isString(newChild.text): - newChild.text = \ - inlinepatterns.handleAttributes(newChild.text, - newChild) - element.insert(i, newChild) - i += 1 - return tree - - -class PrettifyTreeprocessor(Treeprocessor): - """ Add linebreaks to the html document. """ - - def _prettifyETree(self, elem): - """ Recursively add linebreaks to ElementTree children. """ - - i = "\n" - if util.isBlockLevel(elem.tag) and elem.tag not in ['code', 'pre']: - if (not elem.text or not elem.text.strip()) \ - and len(elem) and util.isBlockLevel(elem[0].tag): - elem.text = i - for e in elem: - if util.isBlockLevel(e.tag): - self._prettifyETree(e) - if not elem.tail or not elem.tail.strip(): - elem.tail = i - if not elem.tail or not elem.tail.strip(): - elem.tail = i - - def run(self, root): - """ Add linebreaks to ElementTree root object. """ - - self._prettifyETree(root) - # Do <br />'s seperately as they are often in the middle of - # inline content and missed by _prettifyETree. - brs = root.getiterator('br') - for br in brs: - if not br.tail or not br.tail.strip(): - br.tail = '\n' - else: - br.tail = '\n%s' % br.tail - # Clean up extra empty lines at end of code blocks. - pres = root.getiterator('pre') - for pre in pres: - if len(pre) and pre[0].tag == 'code': - pre[0].text = pre[0].text.rstrip() + '\n' diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/util.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/util.py deleted file mode 100644 index 1036197..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown/util.py +++ /dev/null @@ -1,136 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals -import re -import sys - - -""" -Python 3 Stuff -============================================================================= -""" -PY3 = sys.version_info[0] == 3 - -if PY3: - string_type = str - text_type = str - int2str = chr -else: - string_type = basestring - text_type = unicode - int2str = unichr - - -""" -Constants you might want to modify ------------------------------------------------------------------------------ -""" - -BLOCK_LEVEL_ELEMENTS = re.compile("^(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul" - "|script|noscript|form|fieldset|iframe|math" - "|hr|hr/|style|li|dt|dd|thead|tbody" - "|tr|th|td|section|footer|header|group|figure" - "|figcaption|aside|article|canvas|output" - "|progress|video)$", re.IGNORECASE) -# Placeholders -STX = '\u0002' # Use STX ("Start of text") for start-of-placeholder -ETX = '\u0003' # Use ETX ("End of text") for end-of-placeholder -INLINE_PLACEHOLDER_PREFIX = STX+"klzzwxh:" -INLINE_PLACEHOLDER = INLINE_PLACEHOLDER_PREFIX + "%s" + ETX -INLINE_PLACEHOLDER_RE = re.compile(INLINE_PLACEHOLDER % r'([0-9]{4})') -AMP_SUBSTITUTE = STX+"amp"+ETX - -""" -Constants you probably do not need to change ------------------------------------------------------------------------------ -""" - -RTL_BIDI_RANGES = ( ('\u0590', '\u07FF'), - # Hebrew (0590-05FF), Arabic (0600-06FF), - # Syriac (0700-074F), Arabic supplement (0750-077F), - # Thaana (0780-07BF), Nko (07C0-07FF). - ('\u2D30', '\u2D7F'), # Tifinagh - ) - -# Extensions should use "markdown.util.etree" instead of "etree" (or do `from -# markdown.util import etree`). Do not import it by yourself. - -try: # Is the C implemenation of ElementTree available? - import xml.etree.cElementTree as etree - from xml.etree.ElementTree import Comment - # Serializers (including ours) test with non-c Comment - etree.test_comment = Comment - if etree.VERSION < "1.0.5": - raise RuntimeError("cElementTree version 1.0.5 or higher is required.") -except (ImportError, RuntimeError): - # Use the Python implementation of ElementTree? - import xml.etree.ElementTree as etree - if etree.VERSION < "1.1": - raise RuntimeError("ElementTree version 1.1 or higher is required") - - -""" -AUXILIARY GLOBAL FUNCTIONS -============================================================================= -""" - - -def isBlockLevel(tag): - """Check if the tag is a block level HTML tag.""" - if isinstance(tag, string_type): - return BLOCK_LEVEL_ELEMENTS.match(tag) - # Some ElementTree tags are not strings, so return False. - return False - -""" -MISC AUXILIARY CLASSES -============================================================================= -""" - -class AtomicString(text_type): - """A string which should not be further processed.""" - pass - - -class Processor(object): - def __init__(self, markdown_instance=None): - if markdown_instance: - self.markdown = markdown_instance - - -class HtmlStash(object): - """ - This class is used for stashing HTML objects that we extract - in the beginning and replace with place-holders. - """ - - def __init__ (self): - """ Create a HtmlStash. """ - self.html_counter = 0 # for counting inline html segments - self.rawHtmlBlocks=[] - - def store(self, html, safe=False): - """ - Saves an HTML segment for later reinsertion. Returns a - placeholder string that needs to be inserted into the - document. - - Keyword arguments: - - * html: an html segment - * safe: label an html segment as safe for safemode - - Returns : a placeholder string - - """ - self.rawHtmlBlocks.append((html, safe)) - placeholder = self.get_placeholder(self.html_counter) - self.html_counter += 1 - return placeholder - - def reset(self): - self.html_counter = 0 - self.rawHtmlBlocks = [] - - def get_placeholder(self, key): - return "%swzxhzdk:%d%s" % (STX, key, ETX) - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown2.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown2.py deleted file mode 100644 index 3bad0c5..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/markdown2.py +++ /dev/null @@ -1,2322 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2012 Trent Mick. -# Copyright (c) 2007-2008 ActiveState Corp. -# License: MIT (http://www.opensource.org/licenses/mit-license.php) - -from __future__ import generators - -r"""A fast and complete Python implementation of Markdown. - -[from http://daringfireball.net/projects/markdown/] -> Markdown is a text-to-HTML filter; it translates an easy-to-read / -> easy-to-write structured text format into HTML. Markdown's text -> format is most similar to that of plain text email, and supports -> features such as headers, *emphasis*, code blocks, blockquotes, and -> links. -> -> Markdown's syntax is designed not as a generic markup language, but -> specifically to serve as a front-end to (X)HTML. You can use span-level -> HTML tags anywhere in a Markdown document, and you can use block level -> HTML tags (like <div> and <table> as well). - -Module usage: - - >>> import markdown2 - >>> markdown2.markdown("*boo!*") # or use `html = markdown_path(PATH)` - u'<p><em>boo!</em></p>\n' - - >>> markdowner = Markdown() - >>> markdowner.convert("*boo!*") - u'<p><em>boo!</em></p>\n' - >>> markdowner.convert("**boom!**") - u'<p><strong>boom!</strong></p>\n' - -This implementation of Markdown implements the full "core" syntax plus a -number of extras (e.g., code syntax coloring, footnotes) as described on -<https://github.com/trentm/python-markdown2/wiki/Extras>. -""" - -cmdln_desc = """A fast and complete Python implementation of Markdown, a -text-to-HTML conversion tool for web writers. - -Supported extra syntax options (see -x|--extras option below and -see <https://github.com/trentm/python-markdown2/wiki/Extras> for details): - -* code-friendly: Disable _ and __ for em and strong. -* cuddled-lists: Allow lists to be cuddled to the preceding paragraph. -* fenced-code-blocks: Allows a code block to not have to be indented - by fencing it with '```' on a line before and after. Based on - <http://github.github.com/github-flavored-markdown/> with support for - syntax highlighting. -* footnotes: Support footnotes as in use on daringfireball.net and - implemented in other Markdown processors (tho not in Markdown.pl v1.0.1). -* header-ids: Adds "id" attributes to headers. The id value is a slug of - the header text. -* html-classes: Takes a dict mapping html tag names (lowercase) to a - string to use for a "class" tag attribute. Currently only supports - "pre" and "code" tags. Add an issue if you require this for other tags. -* markdown-in-html: Allow the use of `markdown="1"` in a block HTML tag to - have markdown processing be done on its contents. Similar to - <http://michelf.com/projects/php-markdown/extra/#markdown-attr> but with - some limitations. -* metadata: Extract metadata from a leading '---'-fenced block. - See <https://github.com/trentm/python-markdown2/issues/77> for details. -* nofollow: Add `rel="nofollow"` to add `<a>` tags with an href. See - <http://en.wikipedia.org/wiki/Nofollow>. -* pyshell: Treats unindented Python interactive shell sessions as <code> - blocks. -* link-patterns: Auto-link given regex patterns in text (e.g. bug number - references, revision number references). -* smarty-pants: Replaces ' and " with curly quotation marks or curly - apostrophes. Replaces --, ---, ..., and . . . with en dashes, em dashes, - and ellipses. -* toc: The returned HTML string gets a new "toc_html" attribute which is - a Table of Contents for the document. (experimental) -* xml: Passes one-liner processing instructions and namespaced XML tags. -* wiki-tables: Google Code Wiki-style tables. See - <http://code.google.com/p/support/wiki/WikiSyntax#Tables>. -""" - -# Dev Notes: -# - Python's regex syntax doesn't have '\z', so I'm using '\Z'. I'm -# not yet sure if there implications with this. Compare 'pydoc sre' -# and 'perldoc perlre'. - -__version_info__ = (2, 1, 1) -__version__ = '.'.join(map(str, __version_info__)) -__author__ = "Trent Mick" - -import os -import sys -from pprint import pprint -import re -import logging -try: - from hashlib import md5 -except ImportError: - from md5 import md5 -import optparse -from random import random, randint -import codecs - - -#---- Python version compat - -try: - from urllib.parse import quote # python3 -except ImportError: - from urllib import quote # python2 - -if sys.version_info[:2] < (2,4): - from sets import Set as set - def reversed(sequence): - for i in sequence[::-1]: - yield i - -# Use `bytes` for byte strings and `unicode` for unicode strings (str in Py3). -if sys.version_info[0] <= 2: - py3 = False - try: - bytes - except NameError: - bytes = str - base_string_type = basestring -elif sys.version_info[0] >= 3: - py3 = True - unicode = str - base_string_type = str - - - -#---- globals - -DEBUG = False -log = logging.getLogger("markdown") - -DEFAULT_TAB_WIDTH = 4 - - -SECRET_SALT = bytes(randint(0, 1000000)) -def _hash_text(s): - return 'md5-' + md5(SECRET_SALT + s.encode("utf-8")).hexdigest() - -# Table of hash values for escaped characters: -g_escape_table = dict([(ch, _hash_text(ch)) - for ch in '\\`*_{}[]()>#+-.!']) - - - -#---- exceptions - -class MarkdownError(Exception): - pass - - - -#---- public api - -def markdown_path(path, encoding="utf-8", - html4tags=False, tab_width=DEFAULT_TAB_WIDTH, - safe_mode=None, extras=None, link_patterns=None, - use_file_vars=False): - fp = codecs.open(path, 'r', encoding) - text = fp.read() - fp.close() - return Markdown(html4tags=html4tags, tab_width=tab_width, - safe_mode=safe_mode, extras=extras, - link_patterns=link_patterns, - use_file_vars=use_file_vars).convert(text) - -def markdown(text, html4tags=False, tab_width=DEFAULT_TAB_WIDTH, - safe_mode=None, extras=None, link_patterns=None, - use_file_vars=False): - return Markdown(html4tags=html4tags, tab_width=tab_width, - safe_mode=safe_mode, extras=extras, - link_patterns=link_patterns, - use_file_vars=use_file_vars).convert(text) - -class Markdown(object): - # The dict of "extras" to enable in processing -- a mapping of - # extra name to argument for the extra. Most extras do not have an - # argument, in which case the value is None. - # - # This can be set via (a) subclassing and (b) the constructor - # "extras" argument. - extras = None - - urls = None - titles = None - html_blocks = None - html_spans = None - html_removed_text = "[HTML_REMOVED]" # for compat with markdown.py - - # Used to track when we're inside an ordered or unordered list - # (see _ProcessListItems() for details): - list_level = 0 - - _ws_only_line_re = re.compile(r"^[ \t]+$", re.M) - - def __init__(self, html4tags=False, tab_width=4, safe_mode=None, - extras=None, link_patterns=None, use_file_vars=False): - if html4tags: - self.empty_element_suffix = ">" - else: - self.empty_element_suffix = " />" - self.tab_width = tab_width - - # For compatibility with earlier markdown2.py and with - # markdown.py's safe_mode being a boolean, - # safe_mode == True -> "replace" - if safe_mode is True: - self.safe_mode = "replace" - else: - self.safe_mode = safe_mode - - # Massaging and building the "extras" info. - if self.extras is None: - self.extras = {} - elif not isinstance(self.extras, dict): - self.extras = dict([(e, None) for e in self.extras]) - if extras: - if not isinstance(extras, dict): - extras = dict([(e, None) for e in extras]) - self.extras.update(extras) - assert isinstance(self.extras, dict) - if "toc" in self.extras and not "header-ids" in self.extras: - self.extras["header-ids"] = None # "toc" implies "header-ids" - self._instance_extras = self.extras.copy() - - self.link_patterns = link_patterns - self.use_file_vars = use_file_vars - self._outdent_re = re.compile(r'^(\t|[ ]{1,%d})' % tab_width, re.M) - - self._escape_table = g_escape_table.copy() - if "smarty-pants" in self.extras: - self._escape_table['"'] = _hash_text('"') - self._escape_table["'"] = _hash_text("'") - - def reset(self): - self.urls = {} - self.titles = {} - self.html_blocks = {} - self.html_spans = {} - self.list_level = 0 - self.extras = self._instance_extras.copy() - if "footnotes" in self.extras: - self.footnotes = {} - self.footnote_ids = [] - if "header-ids" in self.extras: - self._count_from_header_id = {} # no `defaultdict` in Python 2.4 - if "metadata" in self.extras: - self.metadata = {} - - # Per <https://developer.mozilla.org/en-US/docs/HTML/Element/a> "rel" - # should only be used in <a> tags with an "href" attribute. - _a_nofollow = re.compile(r"<(a)([^>]*href=)", re.IGNORECASE) - - def convert(self, text): - """Convert the given text.""" - # Main function. The order in which other subs are called here is - # essential. Link and image substitutions need to happen before - # _EscapeSpecialChars(), so that any *'s or _'s in the <a> - # and <img> tags get encoded. - - # Clear the global hashes. If we don't clear these, you get conflicts - # from other articles when generating a page which contains more than - # one article (e.g. an index page that shows the N most recent - # articles): - self.reset() - - if not isinstance(text, unicode): - #TODO: perhaps shouldn't presume UTF-8 for string input? - text = unicode(text, 'utf-8') - - if self.use_file_vars: - # Look for emacs-style file variable hints. - emacs_vars = self._get_emacs_vars(text) - if "markdown-extras" in emacs_vars: - splitter = re.compile("[ ,]+") - for e in splitter.split(emacs_vars["markdown-extras"]): - if '=' in e: - ename, earg = e.split('=', 1) - try: - earg = int(earg) - except ValueError: - pass - else: - ename, earg = e, None - self.extras[ename] = earg - - # Standardize line endings: - text = re.sub("\r\n|\r", "\n", text) - - # Make sure $text ends with a couple of newlines: - text += "\n\n" - - # Convert all tabs to spaces. - text = self._detab(text) - - # Strip any lines consisting only of spaces and tabs. - # This makes subsequent regexen easier to write, because we can - # match consecutive blank lines with /\n+/ instead of something - # contorted like /[ \t]*\n+/ . - text = self._ws_only_line_re.sub("", text) - - # strip metadata from head and extract - if "metadata" in self.extras: - text = self._extract_metadata(text) - - text = self.preprocess(text) - - if self.safe_mode: - text = self._hash_html_spans(text) - - # Turn block-level HTML blocks into hash entries - text = self._hash_html_blocks(text, raw=True) - - # Strip link definitions, store in hashes. - if "footnotes" in self.extras: - # Must do footnotes first because an unlucky footnote defn - # looks like a link defn: - # [^4]: this "looks like a link defn" - text = self._strip_footnote_definitions(text) - text = self._strip_link_definitions(text) - - text = self._run_block_gamut(text) - - if "footnotes" in self.extras: - text = self._add_footnotes(text) - - text = self.postprocess(text) - - text = self._unescape_special_chars(text) - - if self.safe_mode: - text = self._unhash_html_spans(text) - - if "nofollow" in self.extras: - text = self._a_nofollow.sub(r'<\1 rel="nofollow"\2', text) - - text += "\n" - - rv = UnicodeWithAttrs(text) - if "toc" in self.extras: - rv._toc = self._toc - if "metadata" in self.extras: - rv.metadata = self.metadata - return rv - - def postprocess(self, text): - """A hook for subclasses to do some postprocessing of the html, if - desired. This is called before unescaping of special chars and - unhashing of raw HTML spans. - """ - return text - - def preprocess(self, text): - """A hook for subclasses to do some preprocessing of the Markdown, if - desired. This is called after basic formatting of the text, but prior - to any extras, safe mode, etc. processing. - """ - return text - - # Is metadata if the content starts with '---'-fenced `key: value` - # pairs. E.g. (indented for presentation): - # --- - # foo: bar - # another-var: blah blah - # --- - _metadata_pat = re.compile("""^---[ \t]*\n((?:[ \t]*[^ \t:]+[ \t]*:[^\n]*\n)+)---[ \t]*\n""") - - def _extract_metadata(self, text): - # fast test - if not text.startswith("---"): - return text - match = self._metadata_pat.match(text) - if not match: - return text - - tail = text[len(match.group(0)):] - metadata_str = match.group(1).strip() - for line in metadata_str.split('\n'): - key, value = line.split(':', 1) - self.metadata[key.strip()] = value.strip() - - return tail - - - _emacs_oneliner_vars_pat = re.compile(r"-\*-\s*([^\r\n]*?)\s*-\*-", re.UNICODE) - # This regular expression is intended to match blocks like this: - # PREFIX Local Variables: SUFFIX - # PREFIX mode: Tcl SUFFIX - # PREFIX End: SUFFIX - # Some notes: - # - "[ \t]" is used instead of "\s" to specifically exclude newlines - # - "(\r\n|\n|\r)" is used instead of "$" because the sre engine does - # not like anything other than Unix-style line terminators. - _emacs_local_vars_pat = re.compile(r"""^ - (?P<prefix>(?:[^\r\n|\n|\r])*?) - [\ \t]*Local\ Variables:[\ \t]* - (?P<suffix>.*?)(?:\r\n|\n|\r) - (?P<content>.*?\1End:) - """, re.IGNORECASE | re.MULTILINE | re.DOTALL | re.VERBOSE) - - def _get_emacs_vars(self, text): - """Return a dictionary of emacs-style local variables. - - Parsing is done loosely according to this spec (and according to - some in-practice deviations from this): - http://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables - """ - emacs_vars = {} - SIZE = pow(2, 13) # 8kB - - # Search near the start for a '-*-'-style one-liner of variables. - head = text[:SIZE] - if "-*-" in head: - match = self._emacs_oneliner_vars_pat.search(head) - if match: - emacs_vars_str = match.group(1) - assert '\n' not in emacs_vars_str - emacs_var_strs = [s.strip() for s in emacs_vars_str.split(';') - if s.strip()] - if len(emacs_var_strs) == 1 and ':' not in emacs_var_strs[0]: - # While not in the spec, this form is allowed by emacs: - # -*- Tcl -*- - # where the implied "variable" is "mode". This form - # is only allowed if there are no other variables. - emacs_vars["mode"] = emacs_var_strs[0].strip() - else: - for emacs_var_str in emacs_var_strs: - try: - variable, value = emacs_var_str.strip().split(':', 1) - except ValueError: - log.debug("emacs variables error: malformed -*- " - "line: %r", emacs_var_str) - continue - # Lowercase the variable name because Emacs allows "Mode" - # or "mode" or "MoDe", etc. - emacs_vars[variable.lower()] = value.strip() - - tail = text[-SIZE:] - if "Local Variables" in tail: - match = self._emacs_local_vars_pat.search(tail) - if match: - prefix = match.group("prefix") - suffix = match.group("suffix") - lines = match.group("content").splitlines(0) - #print "prefix=%r, suffix=%r, content=%r, lines: %s"\ - # % (prefix, suffix, match.group("content"), lines) - - # Validate the Local Variables block: proper prefix and suffix - # usage. - for i, line in enumerate(lines): - if not line.startswith(prefix): - log.debug("emacs variables error: line '%s' " - "does not use proper prefix '%s'" - % (line, prefix)) - return {} - # Don't validate suffix on last line. Emacs doesn't care, - # neither should we. - if i != len(lines)-1 and not line.endswith(suffix): - log.debug("emacs variables error: line '%s' " - "does not use proper suffix '%s'" - % (line, suffix)) - return {} - - # Parse out one emacs var per line. - continued_for = None - for line in lines[:-1]: # no var on the last line ("PREFIX End:") - if prefix: line = line[len(prefix):] # strip prefix - if suffix: line = line[:-len(suffix)] # strip suffix - line = line.strip() - if continued_for: - variable = continued_for - if line.endswith('\\'): - line = line[:-1].rstrip() - else: - continued_for = None - emacs_vars[variable] += ' ' + line - else: - try: - variable, value = line.split(':', 1) - except ValueError: - log.debug("local variables error: missing colon " - "in local variables entry: '%s'" % line) - continue - # Do NOT lowercase the variable name, because Emacs only - # allows "mode" (and not "Mode", "MoDe", etc.) in this block. - value = value.strip() - if value.endswith('\\'): - value = value[:-1].rstrip() - continued_for = variable - else: - continued_for = None - emacs_vars[variable] = value - - # Unquote values. - for var, val in list(emacs_vars.items()): - if len(val) > 1 and (val.startswith('"') and val.endswith('"') - or val.startswith('"') and val.endswith('"')): - emacs_vars[var] = val[1:-1] - - return emacs_vars - - # Cribbed from a post by Bart Lateur: - # <http://www.nntp.perl.org/group/perl.macperl.anyperl/154> - _detab_re = re.compile(r'(.*?)\t', re.M) - def _detab_sub(self, match): - g1 = match.group(1) - return g1 + (' ' * (self.tab_width - len(g1) % self.tab_width)) - def _detab(self, text): - r"""Remove (leading?) tabs from a file. - - >>> m = Markdown() - >>> m._detab("\tfoo") - ' foo' - >>> m._detab(" \tfoo") - ' foo' - >>> m._detab("\t foo") - ' foo' - >>> m._detab(" foo") - ' foo' - >>> m._detab(" foo\n\tbar\tblam") - ' foo\n bar blam' - """ - if '\t' not in text: - return text - return self._detab_re.subn(self._detab_sub, text)[0] - - # I broke out the html5 tags here and add them to _block_tags_a and - # _block_tags_b. This way html5 tags are easy to keep track of. - _html5tags = '|article|aside|header|hgroup|footer|nav|section|figure|figcaption' - - _block_tags_a = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del' - _block_tags_a += _html5tags - - _strict_tag_block_re = re.compile(r""" - ( # save in \1 - ^ # start of line (with re.M) - <(%s) # start tag = \2 - \b # word break - (.*\n)*? # any number of lines, minimally matching - </\2> # the matching end tag - [ \t]* # trailing spaces/tabs - (?=\n+|\Z) # followed by a newline or end of document - ) - """ % _block_tags_a, - re.X | re.M) - - _block_tags_b = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math' - _block_tags_b += _html5tags - - _liberal_tag_block_re = re.compile(r""" - ( # save in \1 - ^ # start of line (with re.M) - <(%s) # start tag = \2 - \b # word break - (.*\n)*? # any number of lines, minimally matching - .*</\2> # the matching end tag - [ \t]* # trailing spaces/tabs - (?=\n+|\Z) # followed by a newline or end of document - ) - """ % _block_tags_b, - re.X | re.M) - - _html_markdown_attr_re = re.compile( - r'''\s+markdown=("1"|'1')''') - def _hash_html_block_sub(self, match, raw=False): - html = match.group(1) - if raw and self.safe_mode: - html = self._sanitize_html(html) - elif 'markdown-in-html' in self.extras and 'markdown=' in html: - first_line = html.split('\n', 1)[0] - m = self._html_markdown_attr_re.search(first_line) - if m: - lines = html.split('\n') - middle = '\n'.join(lines[1:-1]) - last_line = lines[-1] - first_line = first_line[:m.start()] + first_line[m.end():] - f_key = _hash_text(first_line) - self.html_blocks[f_key] = first_line - l_key = _hash_text(last_line) - self.html_blocks[l_key] = last_line - return ''.join(["\n\n", f_key, - "\n\n", middle, "\n\n", - l_key, "\n\n"]) - key = _hash_text(html) - self.html_blocks[key] = html - return "\n\n" + key + "\n\n" - - def _hash_html_blocks(self, text, raw=False): - """Hashify HTML blocks - - We only want to do this for block-level HTML tags, such as headers, - lists, and tables. That's because we still want to wrap <p>s around - "paragraphs" that are wrapped in non-block-level tags, such as anchors, - phrase emphasis, and spans. The list of tags we're looking for is - hard-coded. - - @param raw {boolean} indicates if these are raw HTML blocks in - the original source. It makes a difference in "safe" mode. - """ - if '<' not in text: - return text - - # Pass `raw` value into our calls to self._hash_html_block_sub. - hash_html_block_sub = _curry(self._hash_html_block_sub, raw=raw) - - # First, look for nested blocks, e.g.: - # <div> - # <div> - # tags for inner block must be indented. - # </div> - # </div> - # - # The outermost tags must start at the left margin for this to match, and - # the inner nested divs must be indented. - # We need to do this before the next, more liberal match, because the next - # match will start at the first `<div>` and stop at the first `</div>`. - text = self._strict_tag_block_re.sub(hash_html_block_sub, text) - - # Now match more liberally, simply from `\n<tag>` to `</tag>\n` - text = self._liberal_tag_block_re.sub(hash_html_block_sub, text) - - # Special case just for <hr />. It was easier to make a special - # case than to make the other regex more complicated. - if "<hr" in text: - _hr_tag_re = _hr_tag_re_from_tab_width(self.tab_width) - text = _hr_tag_re.sub(hash_html_block_sub, text) - - # Special case for standalone HTML comments: - if "<!--" in text: - start = 0 - while True: - # Delimiters for next comment block. - try: - start_idx = text.index("<!--", start) - except ValueError: - break - try: - end_idx = text.index("-->", start_idx) + 3 - except ValueError: - break - - # Start position for next comment block search. - start = end_idx - - # Validate whitespace before comment. - if start_idx: - # - Up to `tab_width - 1` spaces before start_idx. - for i in range(self.tab_width - 1): - if text[start_idx - 1] != ' ': - break - start_idx -= 1 - if start_idx == 0: - break - # - Must be preceded by 2 newlines or hit the start of - # the document. - if start_idx == 0: - pass - elif start_idx == 1 and text[0] == '\n': - start_idx = 0 # to match minute detail of Markdown.pl regex - elif text[start_idx-2:start_idx] == '\n\n': - pass - else: - break - - # Validate whitespace after comment. - # - Any number of spaces and tabs. - while end_idx < len(text): - if text[end_idx] not in ' \t': - break - end_idx += 1 - # - Must be following by 2 newlines or hit end of text. - if text[end_idx:end_idx+2] not in ('', '\n', '\n\n'): - continue - - # Escape and hash (must match `_hash_html_block_sub`). - html = text[start_idx:end_idx] - if raw and self.safe_mode: - html = self._sanitize_html(html) - key = _hash_text(html) - self.html_blocks[key] = html - text = text[:start_idx] + "\n\n" + key + "\n\n" + text[end_idx:] - - if "xml" in self.extras: - # Treat XML processing instructions and namespaced one-liner - # tags as if they were block HTML tags. E.g., if standalone - # (i.e. are their own paragraph), the following do not get - # wrapped in a <p> tag: - # <?foo bar?> - # - # <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter_1.md"/> - _xml_oneliner_re = _xml_oneliner_re_from_tab_width(self.tab_width) - text = _xml_oneliner_re.sub(hash_html_block_sub, text) - - return text - - def _strip_link_definitions(self, text): - # Strips link definitions from text, stores the URLs and titles in - # hash references. - less_than_tab = self.tab_width - 1 - - # Link defs are in the form: - # [id]: url "optional title" - _link_def_re = re.compile(r""" - ^[ ]{0,%d}\[(.+)\]: # id = \1 - [ \t]* - \n? # maybe *one* newline - [ \t]* - <?(.+?)>? # url = \2 - [ \t]* - (?: - \n? # maybe one newline - [ \t]* - (?<=\s) # lookbehind for whitespace - ['"(] - ([^\n]*) # title = \3 - ['")] - [ \t]* - )? # title is optional - (?:\n+|\Z) - """ % less_than_tab, re.X | re.M | re.U) - return _link_def_re.sub(self._extract_link_def_sub, text) - - def _extract_link_def_sub(self, match): - id, url, title = match.groups() - key = id.lower() # Link IDs are case-insensitive - self.urls[key] = self._encode_amps_and_angles(url) - if title: - self.titles[key] = title - return "" - - def _extract_footnote_def_sub(self, match): - id, text = match.groups() - text = _dedent(text, skip_first_line=not text.startswith('\n')).strip() - normed_id = re.sub(r'\W', '-', id) - # Ensure footnote text ends with a couple newlines (for some - # block gamut matches). - self.footnotes[normed_id] = text + "\n\n" - return "" - - def _strip_footnote_definitions(self, text): - """A footnote definition looks like this: - - [^note-id]: Text of the note. - - May include one or more indented paragraphs. - - Where, - - The 'note-id' can be pretty much anything, though typically it - is the number of the footnote. - - The first paragraph may start on the next line, like so: - - [^note-id]: - Text of the note. - """ - less_than_tab = self.tab_width - 1 - footnote_def_re = re.compile(r''' - ^[ ]{0,%d}\[\^(.+)\]: # id = \1 - [ \t]* - ( # footnote text = \2 - # First line need not start with the spaces. - (?:\s*.*\n+) - (?: - (?:[ ]{%d} | \t) # Subsequent lines must be indented. - .*\n+ - )* - ) - # Lookahead for non-space at line-start, or end of doc. - (?:(?=^[ ]{0,%d}\S)|\Z) - ''' % (less_than_tab, self.tab_width, self.tab_width), - re.X | re.M) - return footnote_def_re.sub(self._extract_footnote_def_sub, text) - - - _hr_data = [ - ('*', re.compile(r"^[ ]{0,3}\*(.*?)$", re.M)), - ('-', re.compile(r"^[ ]{0,3}\-(.*?)$", re.M)), - ('_', re.compile(r"^[ ]{0,3}\_(.*?)$", re.M)), - ] - - def _run_block_gamut(self, text): - # These are all the transformations that form block-level - # tags like paragraphs, headers, and list items. - - if "fenced-code-blocks" in self.extras: - text = self._do_fenced_code_blocks(text) - - text = self._do_headers(text) - - # Do Horizontal Rules: - # On the number of spaces in horizontal rules: The spec is fuzzy: "If - # you wish, you may use spaces between the hyphens or asterisks." - # Markdown.pl 1.0.1's hr regexes limit the number of spaces between the - # hr chars to one or two. We'll reproduce that limit here. - hr = "\n<hr"+self.empty_element_suffix+"\n" - for ch, regex in self._hr_data: - if ch in text: - for m in reversed(list(regex.finditer(text))): - tail = m.group(1).rstrip() - if not tail.strip(ch + ' ') and tail.count(" ") == 0: - start, end = m.span() - text = text[:start] + hr + text[end:] - - text = self._do_lists(text) - - if "pyshell" in self.extras: - text = self._prepare_pyshell_blocks(text) - if "wiki-tables" in self.extras: - text = self._do_wiki_tables(text) - - text = self._do_code_blocks(text) - - text = self._do_block_quotes(text) - - # We already ran _HashHTMLBlocks() before, in Markdown(), but that - # was to escape raw HTML in the original Markdown source. This time, - # we're escaping the markup we've just created, so that we don't wrap - # <p> tags around block-level tags. - text = self._hash_html_blocks(text) - - text = self._form_paragraphs(text) - - return text - - def _pyshell_block_sub(self, match): - lines = match.group(0).splitlines(0) - _dedentlines(lines) - indent = ' ' * self.tab_width - s = ('\n' # separate from possible cuddled paragraph - + indent + ('\n'+indent).join(lines) - + '\n\n') - return s - - def _prepare_pyshell_blocks(self, text): - """Ensure that Python interactive shell sessions are put in - code blocks -- even if not properly indented. - """ - if ">>>" not in text: - return text - - less_than_tab = self.tab_width - 1 - _pyshell_block_re = re.compile(r""" - ^([ ]{0,%d})>>>[ ].*\n # first line - ^(\1.*\S+.*\n)* # any number of subsequent lines - ^\n # ends with a blank line - """ % less_than_tab, re.M | re.X) - - return _pyshell_block_re.sub(self._pyshell_block_sub, text) - - def _wiki_table_sub(self, match): - ttext = match.group(0).strip() - #print 'wiki table: %r' % match.group(0) - rows = [] - for line in ttext.splitlines(0): - line = line.strip()[2:-2].strip() - row = [c.strip() for c in re.split(r'(?<!\\)\|\|', line)] - rows.append(row) - #pprint(rows) - hlines = ['<table>', '<tbody>'] - for row in rows: - hrow = ['<tr>'] - for cell in row: - hrow.append('<td>') - hrow.append(self._run_span_gamut(cell)) - hrow.append('</td>') - hrow.append('</tr>') - hlines.append(''.join(hrow)) - hlines += ['</tbody>', '</table>'] - return '\n'.join(hlines) + '\n' - - def _do_wiki_tables(self, text): - # Optimization. - if "||" not in text: - return text - - less_than_tab = self.tab_width - 1 - wiki_table_re = re.compile(r''' - (?:(?<=\n\n)|\A\n?) # leading blank line - ^([ ]{0,%d})\|\|.+?\|\|[ ]*\n # first line - (^\1\|\|.+?\|\|\n)* # any number of subsequent lines - ''' % less_than_tab, re.M | re.X) - return wiki_table_re.sub(self._wiki_table_sub, text) - - def _run_span_gamut(self, text): - # These are all the transformations that occur *within* block-level - # tags like paragraphs, headers, and list items. - - text = self._do_code_spans(text) - - text = self._escape_special_chars(text) - - # Process anchor and image tags. - text = self._do_links(text) - - # Make links out of things like `<http://example.com/>` - # Must come after _do_links(), because you can use < and > - # delimiters in inline links like [this](<url>). - text = self._do_auto_links(text) - - if "link-patterns" in self.extras: - text = self._do_link_patterns(text) - - text = self._encode_amps_and_angles(text) - - text = self._do_italics_and_bold(text) - - if "smarty-pants" in self.extras: - text = self._do_smart_punctuation(text) - - # Do hard breaks: - text = re.sub(r" {2,}\n", " <br%s\n" % self.empty_element_suffix, text) - - return text - - # "Sorta" because auto-links are identified as "tag" tokens. - _sorta_html_tokenize_re = re.compile(r""" - ( - # tag - </? - (?:\w+) # tag name - (?:\s+(?:[\w-]+:)?[\w-]+=(?:".*?"|'.*?'))* # attributes - \s*/?> - | - # auto-link (e.g., <http://www.activestate.com/>) - <\w+[^>]*> - | - <!--.*?--> # comment - | - <\?.*?\?> # processing instruction - ) - """, re.X) - - def _escape_special_chars(self, text): - # Python markdown note: the HTML tokenization here differs from - # that in Markdown.pl, hence the behaviour for subtle cases can - # differ (I believe the tokenizer here does a better job because - # it isn't susceptible to unmatched '<' and '>' in HTML tags). - # Note, however, that '>' is not allowed in an auto-link URL - # here. - escaped = [] - is_html_markup = False - for token in self._sorta_html_tokenize_re.split(text): - if is_html_markup: - # Within tags/HTML-comments/auto-links, encode * and _ - # so they don't conflict with their use in Markdown for - # italics and strong. We're replacing each such - # character with its corresponding MD5 checksum value; - # this is likely overkill, but it should prevent us from - # colliding with the escape values by accident. - escaped.append(token.replace('*', self._escape_table['*']) - .replace('_', self._escape_table['_'])) - else: - escaped.append(self._encode_backslash_escapes(token)) - is_html_markup = not is_html_markup - return ''.join(escaped) - - def _hash_html_spans(self, text): - # Used for safe_mode. - - def _is_auto_link(s): - if ':' in s and self._auto_link_re.match(s): - return True - elif '@' in s and self._auto_email_link_re.match(s): - return True - return False - - tokens = [] - is_html_markup = False - for token in self._sorta_html_tokenize_re.split(text): - if is_html_markup and not _is_auto_link(token): - sanitized = self._sanitize_html(token) - key = _hash_text(sanitized) - self.html_spans[key] = sanitized - tokens.append(key) - else: - tokens.append(token) - is_html_markup = not is_html_markup - return ''.join(tokens) - - def _unhash_html_spans(self, text): - for key, sanitized in list(self.html_spans.items()): - text = text.replace(key, sanitized) - return text - - def _sanitize_html(self, s): - if self.safe_mode == "replace": - return self.html_removed_text - elif self.safe_mode == "escape": - replacements = [ - ('&', '&'), - ('<', '<'), - ('>', '>'), - ] - for before, after in replacements: - s = s.replace(before, after) - return s - else: - raise MarkdownError("invalid value for 'safe_mode': %r (must be " - "'escape' or 'replace')" % self.safe_mode) - - _tail_of_inline_link_re = re.compile(r''' - # Match tail of: [text](/url/) or [text](/url/ "title") - \( # literal paren - [ \t]* - (?P<url> # \1 - <.*?> - | - .*? - ) - [ \t]* - ( # \2 - (['"]) # quote char = \3 - (?P<title>.*?) - \3 # matching quote - )? # title is optional - \) - ''', re.X | re.S) - _tail_of_reference_link_re = re.compile(r''' - # Match tail of: [text][id] - [ ]? # one optional space - (?:\n[ ]*)? # one optional newline followed by spaces - \[ - (?P<id>.*?) - \] - ''', re.X | re.S) - - def _do_links(self, text): - """Turn Markdown link shortcuts into XHTML <a> and <img> tags. - - This is a combination of Markdown.pl's _DoAnchors() and - _DoImages(). They are done together because that simplified the - approach. It was necessary to use a different approach than - Markdown.pl because of the lack of atomic matching support in - Python's regex engine used in $g_nested_brackets. - """ - MAX_LINK_TEXT_SENTINEL = 3000 # markdown2 issue 24 - - # `anchor_allowed_pos` is used to support img links inside - # anchors, but not anchors inside anchors. An anchor's start - # pos must be `>= anchor_allowed_pos`. - anchor_allowed_pos = 0 - - curr_pos = 0 - while True: # Handle the next link. - # The next '[' is the start of: - # - an inline anchor: [text](url "title") - # - a reference anchor: [text][id] - # - an inline img: ![text](url "title") - # - a reference img: ![text][id] - # - a footnote ref: [^id] - # (Only if 'footnotes' extra enabled) - # - a footnote defn: [^id]: ... - # (Only if 'footnotes' extra enabled) These have already - # been stripped in _strip_footnote_definitions() so no - # need to watch for them. - # - a link definition: [id]: url "title" - # These have already been stripped in - # _strip_link_definitions() so no need to watch for them. - # - not markup: [...anything else... - try: - start_idx = text.index('[', curr_pos) - except ValueError: - break - text_length = len(text) - - # Find the matching closing ']'. - # Markdown.pl allows *matching* brackets in link text so we - # will here too. Markdown.pl *doesn't* currently allow - # matching brackets in img alt text -- we'll differ in that - # regard. - bracket_depth = 0 - for p in range(start_idx+1, min(start_idx+MAX_LINK_TEXT_SENTINEL, - text_length)): - ch = text[p] - if ch == ']': - bracket_depth -= 1 - if bracket_depth < 0: - break - elif ch == '[': - bracket_depth += 1 - else: - # Closing bracket not found within sentinel length. - # This isn't markup. - curr_pos = start_idx + 1 - continue - link_text = text[start_idx+1:p] - - # Possibly a footnote ref? - if "footnotes" in self.extras and link_text.startswith("^"): - normed_id = re.sub(r'\W', '-', link_text[1:]) - if normed_id in self.footnotes: - self.footnote_ids.append(normed_id) - result = '<sup class="footnote-ref" id="fnref-%s">' \ - '<a href="#fn-%s">%s</a></sup>' \ - % (normed_id, normed_id, len(self.footnote_ids)) - text = text[:start_idx] + result + text[p+1:] - else: - # This id isn't defined, leave the markup alone. - curr_pos = p+1 - continue - - # Now determine what this is by the remainder. - p += 1 - if p == text_length: - return text - - # Inline anchor or img? - if text[p] == '(': # attempt at perf improvement - match = self._tail_of_inline_link_re.match(text, p) - if match: - # Handle an inline anchor or img. - is_img = start_idx > 0 and text[start_idx-1] == "!" - if is_img: - start_idx -= 1 - - url, title = match.group("url"), match.group("title") - if url and url[0] == '<': - url = url[1:-1] # '<url>' -> 'url' - # We've got to encode these to avoid conflicting - # with italics/bold. - url = url.replace('*', self._escape_table['*']) \ - .replace('_', self._escape_table['_']) - if title: - title_str = ' title="%s"' % ( - _xml_escape_attr(title) - .replace('*', self._escape_table['*']) - .replace('_', self._escape_table['_'])) - else: - title_str = '' - if is_img: - result = '<img src="%s" alt="%s"%s%s' \ - % (url.replace('"', '"'), - _xml_escape_attr(link_text), - title_str, self.empty_element_suffix) - if "smarty-pants" in self.extras: - result = result.replace('"', self._escape_table['"']) - curr_pos = start_idx + len(result) - text = text[:start_idx] + result + text[match.end():] - elif start_idx >= anchor_allowed_pos: - result_head = '<a href="%s"%s>' % (url, title_str) - result = '%s%s</a>' % (result_head, link_text) - if "smarty-pants" in self.extras: - result = result.replace('"', self._escape_table['"']) - # <img> allowed from curr_pos on, <a> from - # anchor_allowed_pos on. - curr_pos = start_idx + len(result_head) - anchor_allowed_pos = start_idx + len(result) - text = text[:start_idx] + result + text[match.end():] - else: - # Anchor not allowed here. - curr_pos = start_idx + 1 - continue - - # Reference anchor or img? - else: - match = self._tail_of_reference_link_re.match(text, p) - if match: - # Handle a reference-style anchor or img. - is_img = start_idx > 0 and text[start_idx-1] == "!" - if is_img: - start_idx -= 1 - link_id = match.group("id").lower() - if not link_id: - link_id = link_text.lower() # for links like [this][] - if link_id in self.urls: - url = self.urls[link_id] - # We've got to encode these to avoid conflicting - # with italics/bold. - url = url.replace('*', self._escape_table['*']) \ - .replace('_', self._escape_table['_']) - title = self.titles.get(link_id) - if title: - before = title - title = _xml_escape_attr(title) \ - .replace('*', self._escape_table['*']) \ - .replace('_', self._escape_table['_']) - title_str = ' title="%s"' % title - else: - title_str = '' - if is_img: - result = '<img src="%s" alt="%s"%s%s' \ - % (url.replace('"', '"'), - link_text.replace('"', '"'), - title_str, self.empty_element_suffix) - if "smarty-pants" in self.extras: - result = result.replace('"', self._escape_table['"']) - curr_pos = start_idx + len(result) - text = text[:start_idx] + result + text[match.end():] - elif start_idx >= anchor_allowed_pos: - result = '<a href="%s"%s>%s</a>' \ - % (url, title_str, link_text) - result_head = '<a href="%s"%s>' % (url, title_str) - result = '%s%s</a>' % (result_head, link_text) - if "smarty-pants" in self.extras: - result = result.replace('"', self._escape_table['"']) - # <img> allowed from curr_pos on, <a> from - # anchor_allowed_pos on. - curr_pos = start_idx + len(result_head) - anchor_allowed_pos = start_idx + len(result) - text = text[:start_idx] + result + text[match.end():] - else: - # Anchor not allowed here. - curr_pos = start_idx + 1 - else: - # This id isn't defined, leave the markup alone. - curr_pos = match.end() - continue - - # Otherwise, it isn't markup. - curr_pos = start_idx + 1 - - return text - - def header_id_from_text(self, text, prefix, n): - """Generate a header id attribute value from the given header - HTML content. - - This is only called if the "header-ids" extra is enabled. - Subclasses may override this for different header ids. - - @param text {str} The text of the header tag - @param prefix {str} The requested prefix for header ids. This is the - value of the "header-ids" extra key, if any. Otherwise, None. - @param n {int} The <hN> tag number, i.e. `1` for an <h1> tag. - @returns {str} The value for the header tag's "id" attribute. Return - None to not have an id attribute and to exclude this header from - the TOC (if the "toc" extra is specified). - """ - header_id = _slugify(text) - if prefix and isinstance(prefix, base_string_type): - header_id = prefix + '-' + header_id - if header_id in self._count_from_header_id: - self._count_from_header_id[header_id] += 1 - header_id += '-%s' % self._count_from_header_id[header_id] - else: - self._count_from_header_id[header_id] = 1 - return header_id - - _toc = None - def _toc_add_entry(self, level, id, name): - if self._toc is None: - self._toc = [] - self._toc.append((level, id, self._unescape_special_chars(name))) - - _setext_h_re = re.compile(r'^(.+)[ \t]*\n(=+|-+)[ \t]*\n+', re.M) - def _setext_h_sub(self, match): - n = {"=": 1, "-": 2}[match.group(2)[0]] - demote_headers = self.extras.get("demote-headers") - if demote_headers: - n = min(n + demote_headers, 6) - header_id_attr = "" - if "header-ids" in self.extras: - header_id = self.header_id_from_text(match.group(1), - self.extras["header-ids"], n) - if header_id: - header_id_attr = ' id="%s"' % header_id - html = self._run_span_gamut(match.group(1)) - if "toc" in self.extras and header_id: - self._toc_add_entry(n, header_id, html) - return "<h%d%s>%s</h%d>\n\n" % (n, header_id_attr, html, n) - - _atx_h_re = re.compile(r''' - ^(\#{1,6}) # \1 = string of #'s - [ \t]+ - (.+?) # \2 = Header text - [ \t]* - (?<!\\) # ensure not an escaped trailing '#' - \#* # optional closing #'s (not counted) - \n+ - ''', re.X | re.M) - def _atx_h_sub(self, match): - n = len(match.group(1)) - demote_headers = self.extras.get("demote-headers") - if demote_headers: - n = min(n + demote_headers, 6) - header_id_attr = "" - if "header-ids" in self.extras: - header_id = self.header_id_from_text(match.group(2), - self.extras["header-ids"], n) - if header_id: - header_id_attr = ' id="%s"' % header_id - html = self._run_span_gamut(match.group(2)) - if "toc" in self.extras and header_id: - self._toc_add_entry(n, header_id, html) - return "<h%d%s>%s</h%d>\n\n" % (n, header_id_attr, html, n) - - def _do_headers(self, text): - # Setext-style headers: - # Header 1 - # ======== - # - # Header 2 - # -------- - text = self._setext_h_re.sub(self._setext_h_sub, text) - - # atx-style headers: - # # Header 1 - # ## Header 2 - # ## Header 2 with closing hashes ## - # ... - # ###### Header 6 - text = self._atx_h_re.sub(self._atx_h_sub, text) - - return text - - - _marker_ul_chars = '*+-' - _marker_any = r'(?:[%s]|\d+\.)' % _marker_ul_chars - _marker_ul = '(?:[%s])' % _marker_ul_chars - _marker_ol = r'(?:\d+\.)' - - def _list_sub(self, match): - lst = match.group(1) - lst_type = match.group(3) in self._marker_ul_chars and "ul" or "ol" - result = self._process_list_items(lst) - if self.list_level: - return "<%s>\n%s</%s>\n" % (lst_type, result, lst_type) - else: - return "<%s>\n%s</%s>\n\n" % (lst_type, result, lst_type) - - def _do_lists(self, text): - # Form HTML ordered (numbered) and unordered (bulleted) lists. - - # Iterate over each *non-overlapping* list match. - pos = 0 - while True: - # Find the *first* hit for either list style (ul or ol). We - # match ul and ol separately to avoid adjacent lists of different - # types running into each other (see issue #16). - hits = [] - for marker_pat in (self._marker_ul, self._marker_ol): - less_than_tab = self.tab_width - 1 - whole_list = r''' - ( # \1 = whole list - ( # \2 - [ ]{0,%d} - (%s) # \3 = first list item marker - [ \t]+ - (?!\ *\3\ ) # '- - - ...' isn't a list. See 'not_quite_a_list' test case. - ) - (?:.+?) - ( # \4 - \Z - | - \n{2,} - (?=\S) - (?! # Negative lookahead for another list item marker - [ \t]* - %s[ \t]+ - ) - ) - ) - ''' % (less_than_tab, marker_pat, marker_pat) - if self.list_level: # sub-list - list_re = re.compile("^"+whole_list, re.X | re.M | re.S) - else: - list_re = re.compile(r"(?:(?<=\n\n)|\A\n?)"+whole_list, - re.X | re.M | re.S) - match = list_re.search(text, pos) - if match: - hits.append((match.start(), match)) - if not hits: - break - hits.sort() - match = hits[0][1] - start, end = match.span() - text = text[:start] + self._list_sub(match) + text[end:] - pos = end - - return text - - _list_item_re = re.compile(r''' - (\n)? # leading line = \1 - (^[ \t]*) # leading whitespace = \2 - (?P<marker>%s) [ \t]+ # list marker = \3 - ((?:.+?) # list item text = \4 - (\n{1,2})) # eols = \5 - (?= \n* (\Z | \2 (?P<next_marker>%s) [ \t]+)) - ''' % (_marker_any, _marker_any), - re.M | re.X | re.S) - - _last_li_endswith_two_eols = False - def _list_item_sub(self, match): - item = match.group(4) - leading_line = match.group(1) - leading_space = match.group(2) - if leading_line or "\n\n" in item or self._last_li_endswith_two_eols: - item = self._run_block_gamut(self._outdent(item)) - else: - # Recursion for sub-lists: - item = self._do_lists(self._outdent(item)) - if item.endswith('\n'): - item = item[:-1] - item = self._run_span_gamut(item) - self._last_li_endswith_two_eols = (len(match.group(5)) == 2) - return "<li>%s</li>\n" % item - - def _process_list_items(self, list_str): - # Process the contents of a single ordered or unordered list, - # splitting it into individual list items. - - # The $g_list_level global keeps track of when we're inside a list. - # Each time we enter a list, we increment it; when we leave a list, - # we decrement. If it's zero, we're not in a list anymore. - # - # We do this because when we're not inside a list, we want to treat - # something like this: - # - # I recommend upgrading to version - # 8. Oops, now this line is treated - # as a sub-list. - # - # As a single paragraph, despite the fact that the second line starts - # with a digit-period-space sequence. - # - # Whereas when we're inside a list (or sub-list), that line will be - # treated as the start of a sub-list. What a kludge, huh? This is - # an aspect of Markdown's syntax that's hard to parse perfectly - # without resorting to mind-reading. Perhaps the solution is to - # change the syntax rules such that sub-lists must start with a - # starting cardinal number; e.g. "1." or "a.". - self.list_level += 1 - self._last_li_endswith_two_eols = False - list_str = list_str.rstrip('\n') + '\n' - list_str = self._list_item_re.sub(self._list_item_sub, list_str) - self.list_level -= 1 - return list_str - - def _get_pygments_lexer(self, lexer_name): - try: - from pygments import lexers, util - except ImportError: - return None - try: - return lexers.get_lexer_by_name(lexer_name) - except util.ClassNotFound: - return None - - def _color_with_pygments(self, codeblock, lexer, **formatter_opts): - import pygments - import pygments.formatters - - class HtmlCodeFormatter(pygments.formatters.HtmlFormatter): - def _wrap_code(self, inner): - """A function for use in a Pygments Formatter which - wraps in <code> tags. - """ - yield 0, "<code>" - for tup in inner: - yield tup - yield 0, "</code>" - - def wrap(self, source, outfile): - """Return the source with a code, pre, and div.""" - return self._wrap_div(self._wrap_pre(self._wrap_code(source))) - - formatter_opts.setdefault("cssclass", "codehilite") - formatter = HtmlCodeFormatter(**formatter_opts) - return pygments.highlight(codeblock, lexer, formatter) - - def _code_block_sub(self, match, is_fenced_code_block=False): - lexer_name = None - if is_fenced_code_block: - lexer_name = match.group(1) - if lexer_name: - formatter_opts = self.extras['fenced-code-blocks'] or {} - codeblock = match.group(2) - codeblock = codeblock[:-1] # drop one trailing newline - else: - codeblock = match.group(1) - codeblock = self._outdent(codeblock) - codeblock = self._detab(codeblock) - codeblock = codeblock.lstrip('\n') # trim leading newlines - codeblock = codeblock.rstrip() # trim trailing whitespace - - # Note: "code-color" extra is DEPRECATED. - if "code-color" in self.extras and codeblock.startswith(":::"): - lexer_name, rest = codeblock.split('\n', 1) - lexer_name = lexer_name[3:].strip() - codeblock = rest.lstrip("\n") # Remove lexer declaration line. - formatter_opts = self.extras['code-color'] or {} - - if lexer_name: - lexer = self._get_pygments_lexer(lexer_name) - if lexer: - colored = self._color_with_pygments(codeblock, lexer, - **formatter_opts) - return "\n\n%s\n\n" % colored - - codeblock = self._encode_code(codeblock) - pre_class_str = self._html_class_str_from_tag("pre") - code_class_str = self._html_class_str_from_tag("code") - return "\n\n<pre%s><code%s>%s\n</code></pre>\n\n" % ( - pre_class_str, code_class_str, codeblock) - - def _html_class_str_from_tag(self, tag): - """Get the appropriate ' class="..."' string (note the leading - space), if any, for the given tag. - """ - if "html-classes" not in self.extras: - return "" - try: - html_classes_from_tag = self.extras["html-classes"] - except TypeError: - return "" - else: - if tag in html_classes_from_tag: - return ' class="%s"' % html_classes_from_tag[tag] - return "" - - def _do_code_blocks(self, text): - """Process Markdown `<pre><code>` blocks.""" - code_block_re = re.compile(r''' - (?:\n\n|\A\n?) - ( # $1 = the code block -- one or more lines, starting with a space/tab - (?: - (?:[ ]{%d} | \t) # Lines must start with a tab or a tab-width of spaces - .*\n+ - )+ - ) - ((?=^[ ]{0,%d}\S)|\Z) # Lookahead for non-space at line-start, or end of doc - ''' % (self.tab_width, self.tab_width), - re.M | re.X) - return code_block_re.sub(self._code_block_sub, text) - - _fenced_code_block_re = re.compile(r''' - (?:\n\n|\A\n?) - ^```([\w+-]+)?[ \t]*\n # opening fence, $1 = optional lang - (.*?) # $2 = code block content - ^```[ \t]*\n # closing fence - ''', re.M | re.X | re.S) - - def _fenced_code_block_sub(self, match): - return self._code_block_sub(match, is_fenced_code_block=True); - - def _do_fenced_code_blocks(self, text): - """Process ```-fenced unindented code blocks ('fenced-code-blocks' extra).""" - return self._fenced_code_block_re.sub(self._fenced_code_block_sub, text) - - # Rules for a code span: - # - backslash escapes are not interpreted in a code span - # - to include one or or a run of more backticks the delimiters must - # be a longer run of backticks - # - cannot start or end a code span with a backtick; pad with a - # space and that space will be removed in the emitted HTML - # See `test/tm-cases/escapes.text` for a number of edge-case - # examples. - _code_span_re = re.compile(r''' - (?<!\\) - (`+) # \1 = Opening run of ` - (?!`) # See Note A test/tm-cases/escapes.text - (.+?) # \2 = The code block - (?<!`) - \1 # Matching closer - (?!`) - ''', re.X | re.S) - - def _code_span_sub(self, match): - c = match.group(2).strip(" \t") - c = self._encode_code(c) - return "<code>%s</code>" % c - - def _do_code_spans(self, text): - # * Backtick quotes are used for <code></code> spans. - # - # * You can use multiple backticks as the delimiters if you want to - # include literal backticks in the code span. So, this input: - # - # Just type ``foo `bar` baz`` at the prompt. - # - # Will translate to: - # - # <p>Just type <code>foo `bar` baz</code> at the prompt.</p> - # - # There's no arbitrary limit to the number of backticks you - # can use as delimters. If you need three consecutive backticks - # in your code, use four for delimiters, etc. - # - # * You can use spaces to get literal backticks at the edges: - # - # ... type `` `bar` `` ... - # - # Turns to: - # - # ... type <code>`bar`</code> ... - return self._code_span_re.sub(self._code_span_sub, text) - - def _encode_code(self, text): - """Encode/escape certain characters inside Markdown code runs. - The point is that in code, these characters are literals, - and lose their special Markdown meanings. - """ - replacements = [ - # Encode all ampersands; HTML entities are not - # entities within a Markdown code span. - ('&', '&'), - # Do the angle bracket song and dance: - ('<', '<'), - ('>', '>'), - ] - for before, after in replacements: - text = text.replace(before, after) - hashed = _hash_text(text) - self._escape_table[text] = hashed - return hashed - - _strong_re = re.compile(r"(\*\*|__)(?=\S)(.+?[*_]*)(?<=\S)\1", re.S) - _em_re = re.compile(r"(\*|_)(?=\S)(.+?)(?<=\S)\1", re.S) - _code_friendly_strong_re = re.compile(r"\*\*(?=\S)(.+?[*_]*)(?<=\S)\*\*", re.S) - _code_friendly_em_re = re.compile(r"\*(?=\S)(.+?)(?<=\S)\*", re.S) - def _do_italics_and_bold(self, text): - # <strong> must go first: - if "code-friendly" in self.extras: - text = self._code_friendly_strong_re.sub(r"<strong>\1</strong>", text) - text = self._code_friendly_em_re.sub(r"<em>\1</em>", text) - else: - text = self._strong_re.sub(r"<strong>\2</strong>", text) - text = self._em_re.sub(r"<em>\2</em>", text) - return text - - # "smarty-pants" extra: Very liberal in interpreting a single prime as an - # apostrophe; e.g. ignores the fact that "round", "bout", "twer", and - # "twixt" can be written without an initial apostrophe. This is fine because - # using scare quotes (single quotation marks) is rare. - _apostrophe_year_re = re.compile(r"'(\d\d)(?=(\s|,|;|\.|\?|!|$))") - _contractions = ["tis", "twas", "twer", "neath", "o", "n", - "round", "bout", "twixt", "nuff", "fraid", "sup"] - def _do_smart_contractions(self, text): - text = self._apostrophe_year_re.sub(r"’\1", text) - for c in self._contractions: - text = text.replace("'%s" % c, "’%s" % c) - text = text.replace("'%s" % c.capitalize(), - "’%s" % c.capitalize()) - return text - - # Substitute double-quotes before single-quotes. - _opening_single_quote_re = re.compile(r"(?<!\S)'(?=\S)") - _opening_double_quote_re = re.compile(r'(?<!\S)"(?=\S)') - _closing_single_quote_re = re.compile(r"(?<=\S)'") - _closing_double_quote_re = re.compile(r'(?<=\S)"(?=(\s|,|;|\.|\?|!|$))') - def _do_smart_punctuation(self, text): - """Fancifies 'single quotes', "double quotes", and apostrophes. - Converts --, ---, and ... into en dashes, em dashes, and ellipses. - - Inspiration is: <http://daringfireball.net/projects/smartypants/> - See "test/tm-cases/smarty_pants.text" for a full discussion of the - support here and - <http://code.google.com/p/python-markdown2/issues/detail?id=42> for a - discussion of some diversion from the original SmartyPants. - """ - if "'" in text: # guard for perf - text = self._do_smart_contractions(text) - text = self._opening_single_quote_re.sub("‘", text) - text = self._closing_single_quote_re.sub("’", text) - - if '"' in text: # guard for perf - text = self._opening_double_quote_re.sub("“", text) - text = self._closing_double_quote_re.sub("”", text) - - text = text.replace("---", "—") - text = text.replace("--", "–") - text = text.replace("...", "…") - text = text.replace(" . . . ", "…") - text = text.replace(". . .", "…") - return text - - _block_quote_re = re.compile(r''' - ( # Wrap whole match in \1 - ( - ^[ \t]*>[ \t]? # '>' at the start of a line - .+\n # rest of the first line - (.+\n)* # subsequent consecutive lines - \n* # blanks - )+ - ) - ''', re.M | re.X) - _bq_one_level_re = re.compile('^[ \t]*>[ \t]?', re.M); - - _html_pre_block_re = re.compile(r'(\s*<pre>.+?</pre>)', re.S) - def _dedent_two_spaces_sub(self, match): - return re.sub(r'(?m)^ ', '', match.group(1)) - - def _block_quote_sub(self, match): - bq = match.group(1) - bq = self._bq_one_level_re.sub('', bq) # trim one level of quoting - bq = self._ws_only_line_re.sub('', bq) # trim whitespace-only lines - bq = self._run_block_gamut(bq) # recurse - - bq = re.sub('(?m)^', ' ', bq) - # These leading spaces screw with <pre> content, so we need to fix that: - bq = self._html_pre_block_re.sub(self._dedent_two_spaces_sub, bq) - - return "<blockquote>\n%s\n</blockquote>\n\n" % bq - - def _do_block_quotes(self, text): - if '>' not in text: - return text - return self._block_quote_re.sub(self._block_quote_sub, text) - - def _form_paragraphs(self, text): - # Strip leading and trailing lines: - text = text.strip('\n') - - # Wrap <p> tags. - grafs = [] - for i, graf in enumerate(re.split(r"\n{2,}", text)): - if graf in self.html_blocks: - # Unhashify HTML blocks - grafs.append(self.html_blocks[graf]) - else: - cuddled_list = None - if "cuddled-lists" in self.extras: - # Need to put back trailing '\n' for `_list_item_re` - # match at the end of the paragraph. - li = self._list_item_re.search(graf + '\n') - # Two of the same list marker in this paragraph: a likely - # candidate for a list cuddled to preceding paragraph - # text (issue 33). Note the `[-1]` is a quick way to - # consider numeric bullets (e.g. "1." and "2.") to be - # equal. - if (li and len(li.group(2)) <= 3 and li.group("next_marker") - and li.group("marker")[-1] == li.group("next_marker")[-1]): - start = li.start() - cuddled_list = self._do_lists(graf[start:]).rstrip("\n") - assert cuddled_list.startswith("<ul>") or cuddled_list.startswith("<ol>") - graf = graf[:start] - - # Wrap <p> tags. - graf = self._run_span_gamut(graf) - grafs.append("<p>" + graf.lstrip(" \t") + "</p>") - - if cuddled_list: - grafs.append(cuddled_list) - - return "\n\n".join(grafs) - - def _add_footnotes(self, text): - if self.footnotes: - footer = [ - '<div class="footnotes">', - '<hr' + self.empty_element_suffix, - '<ol>', - ] - for i, id in enumerate(self.footnote_ids): - if i != 0: - footer.append('') - footer.append('<li id="fn-%s">' % id) - footer.append(self._run_block_gamut(self.footnotes[id])) - backlink = ('<a href="#fnref-%s" ' - 'class="footnoteBackLink" ' - 'title="Jump back to footnote %d in the text.">' - '↩</a>' % (id, i+1)) - if footer[-1].endswith("</p>"): - footer[-1] = footer[-1][:-len("</p>")] \ - + ' ' + backlink + "</p>" - else: - footer.append("\n<p>%s</p>" % backlink) - footer.append('</li>') - footer.append('</ol>') - footer.append('</div>') - return text + '\n\n' + '\n'.join(footer) - else: - return text - - # Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin: - # http://bumppo.net/projects/amputator/ - _ampersand_re = re.compile(r'&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)') - _naked_lt_re = re.compile(r'<(?![a-z/?\$!])', re.I) - _naked_gt_re = re.compile(r'''(?<![a-z0-9?!/'"-])>''', re.I) - - def _encode_amps_and_angles(self, text): - # Smart processing for ampersands and angle brackets that need - # to be encoded. - text = self._ampersand_re.sub('&', text) - - # Encode naked <'s - text = self._naked_lt_re.sub('<', text) - - # Encode naked >'s - # Note: Other markdown implementations (e.g. Markdown.pl, PHP - # Markdown) don't do this. - text = self._naked_gt_re.sub('>', text) - return text - - def _encode_backslash_escapes(self, text): - for ch, escape in list(self._escape_table.items()): - text = text.replace("\\"+ch, escape) - return text - - _auto_link_re = re.compile(r'<((https?|ftp):[^\'">\s]+)>', re.I) - def _auto_link_sub(self, match): - g1 = match.group(1) - return '<a href="%s">%s</a>' % (g1, g1) - - _auto_email_link_re = re.compile(r""" - < - (?:mailto:)? - ( - [-.\w]+ - \@ - [-\w]+(\.[-\w]+)*\.[a-z]+ - ) - > - """, re.I | re.X | re.U) - def _auto_email_link_sub(self, match): - return self._encode_email_address( - self._unescape_special_chars(match.group(1))) - - def _do_auto_links(self, text): - text = self._auto_link_re.sub(self._auto_link_sub, text) - text = self._auto_email_link_re.sub(self._auto_email_link_sub, text) - return text - - def _encode_email_address(self, addr): - # Input: an email address, e.g. "foo@example.com" - # - # Output: the email address as a mailto link, with each character - # of the address encoded as either a decimal or hex entity, in - # the hopes of foiling most address harvesting spam bots. E.g.: - # - # <a href="mailto:foo@e - # xample.com">foo - # @example.com</a> - # - # Based on a filter by Matthew Wickline, posted to the BBEdit-Talk - # mailing list: <http://tinyurl.com/yu7ue> - chars = [_xml_encode_email_char_at_random(ch) - for ch in "mailto:" + addr] - # Strip the mailto: from the visible part. - addr = '<a href="%s">%s</a>' \ - % (''.join(chars), ''.join(chars[7:])) - return addr - - def _do_link_patterns(self, text): - """Caveat emptor: there isn't much guarding against link - patterns being formed inside other standard Markdown links, e.g. - inside a [link def][like this]. - - Dev Notes: *Could* consider prefixing regexes with a negative - lookbehind assertion to attempt to guard against this. - """ - link_from_hash = {} - for regex, repl in self.link_patterns: - replacements = [] - for match in regex.finditer(text): - if hasattr(repl, "__call__"): - href = repl(match) - else: - href = match.expand(repl) - replacements.append((match.span(), href)) - for (start, end), href in reversed(replacements): - escaped_href = ( - href.replace('"', '"') # b/c of attr quote - # To avoid markdown <em> and <strong>: - .replace('*', self._escape_table['*']) - .replace('_', self._escape_table['_'])) - link = '<a href="%s">%s</a>' % (escaped_href, text[start:end]) - hash = _hash_text(link) - link_from_hash[hash] = link - text = text[:start] + hash + text[end:] - for hash, link in list(link_from_hash.items()): - text = text.replace(hash, link) - return text - - def _unescape_special_chars(self, text): - # Swap back in all the special characters we've hidden. - for ch, hash in list(self._escape_table.items()): - text = text.replace(hash, ch) - return text - - def _outdent(self, text): - # Remove one level of line-leading tabs or spaces - return self._outdent_re.sub('', text) - - -class MarkdownWithExtras(Markdown): - """A markdowner class that enables most extras: - - - footnotes - - code-color (only has effect if 'pygments' Python module on path) - - These are not included: - - pyshell (specific to Python-related documenting) - - code-friendly (because it *disables* part of the syntax) - - link-patterns (because you need to specify some actual - link-patterns anyway) - """ - extras = ["footnotes", "code-color"] - - -#---- internal support functions - -class UnicodeWithAttrs(unicode): - """A subclass of unicode used for the return value of conversion to - possibly attach some attributes. E.g. the "toc_html" attribute when - the "toc" extra is used. - """ - metadata = None - _toc = None - def toc_html(self): - """Return the HTML for the current TOC. - - This expects the `_toc` attribute to have been set on this instance. - """ - if self._toc is None: - return None - - def indent(): - return ' ' * (len(h_stack) - 1) - lines = [] - h_stack = [0] # stack of header-level numbers - for level, id, name in self._toc: - if level > h_stack[-1]: - lines.append("%s<ul>" % indent()) - h_stack.append(level) - elif level == h_stack[-1]: - lines[-1] += "</li>" - else: - while level < h_stack[-1]: - h_stack.pop() - if not lines[-1].endswith("</li>"): - lines[-1] += "</li>" - lines.append("%s</ul></li>" % indent()) - lines.append('%s<li><a href="#%s">%s</a>' % ( - indent(), id, name)) - while len(h_stack) > 1: - h_stack.pop() - if not lines[-1].endswith("</li>"): - lines[-1] += "</li>" - lines.append("%s</ul>" % indent()) - return '\n'.join(lines) + '\n' - toc_html = property(toc_html) - -## {{{ http://code.activestate.com/recipes/577257/ (r1) -_slugify_strip_re = re.compile(r'[^\w\s-]') -_slugify_hyphenate_re = re.compile(r'[-\s]+') -def _slugify(value): - """ - Normalizes string, converts to lowercase, removes non-alpha characters, - and converts spaces to hyphens. - - From Django's "django/template/defaultfilters.py". - """ - - try: - import unicodedata - value = unicodedata.normalize('NFKD', value) - except ImportError: - pass - value = value.encode('ascii', 'ignore').decode() - value = _slugify_strip_re.sub('', value).strip().lower() - return _slugify_hyphenate_re.sub('-', value) -## end of http://code.activestate.com/recipes/577257/ }}} - - -# From http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52549 -def _curry(*args, **kwargs): - function, args = args[0], args[1:] - def result(*rest, **kwrest): - combined = kwargs.copy() - combined.update(kwrest) - return function(*args + rest, **combined) - return result - -# Recipe: regex_from_encoded_pattern (1.0) -def _regex_from_encoded_pattern(s): - """'foo' -> re.compile(re.escape('foo')) - '/foo/' -> re.compile('foo') - '/foo/i' -> re.compile('foo', re.I) - """ - if s.startswith('/') and s.rfind('/') != 0: - # Parse it: /PATTERN/FLAGS - idx = s.rfind('/') - pattern, flags_str = s[1:idx], s[idx+1:] - flag_from_char = { - "i": re.IGNORECASE, - "l": re.LOCALE, - "s": re.DOTALL, - "m": re.MULTILINE, - "u": re.UNICODE, - } - flags = 0 - for char in flags_str: - try: - flags |= flag_from_char[char] - except KeyError: - raise ValueError("unsupported regex flag: '%s' in '%s' " - "(must be one of '%s')" - % (char, s, ''.join(list(flag_from_char.keys())))) - return re.compile(s[1:idx], flags) - else: # not an encoded regex - return re.compile(re.escape(s)) - -# Recipe: dedent (0.1.2) -def _dedentlines(lines, tabsize=8, skip_first_line=False): - """_dedentlines(lines, tabsize=8, skip_first_line=False) -> dedented lines - - "lines" is a list of lines to dedent. - "tabsize" is the tab width to use for indent width calculations. - "skip_first_line" is a boolean indicating if the first line should - be skipped for calculating the indent width and for dedenting. - This is sometimes useful for docstrings and similar. - - Same as dedent() except operates on a sequence of lines. Note: the - lines list is modified **in-place**. - """ - DEBUG = False - if DEBUG: - print("dedent: dedent(..., tabsize=%d, skip_first_line=%r)"\ - % (tabsize, skip_first_line)) - indents = [] - margin = None - for i, line in enumerate(lines): - if i == 0 and skip_first_line: continue - indent = 0 - for ch in line: - if ch == ' ': - indent += 1 - elif ch == '\t': - indent += tabsize - (indent % tabsize) - elif ch in '\r\n': - continue # skip all-whitespace lines - else: - break - else: - continue # skip all-whitespace lines - if DEBUG: print("dedent: indent=%d: %r" % (indent, line)) - if margin is None: - margin = indent - else: - margin = min(margin, indent) - if DEBUG: print("dedent: margin=%r" % margin) - - if margin is not None and margin > 0: - for i, line in enumerate(lines): - if i == 0 and skip_first_line: continue - removed = 0 - for j, ch in enumerate(line): - if ch == ' ': - removed += 1 - elif ch == '\t': - removed += tabsize - (removed % tabsize) - elif ch in '\r\n': - if DEBUG: print("dedent: %r: EOL -> strip up to EOL" % line) - lines[i] = lines[i][j:] - break - else: - raise ValueError("unexpected non-whitespace char %r in " - "line %r while removing %d-space margin" - % (ch, line, margin)) - if DEBUG: - print("dedent: %r: %r -> removed %d/%d"\ - % (line, ch, removed, margin)) - if removed == margin: - lines[i] = lines[i][j+1:] - break - elif removed > margin: - lines[i] = ' '*(removed-margin) + lines[i][j+1:] - break - else: - if removed: - lines[i] = lines[i][removed:] - return lines - -def _dedent(text, tabsize=8, skip_first_line=False): - """_dedent(text, tabsize=8, skip_first_line=False) -> dedented text - - "text" is the text to dedent. - "tabsize" is the tab width to use for indent width calculations. - "skip_first_line" is a boolean indicating if the first line should - be skipped for calculating the indent width and for dedenting. - This is sometimes useful for docstrings and similar. - - textwrap.dedent(s), but don't expand tabs to spaces - """ - lines = text.splitlines(1) - _dedentlines(lines, tabsize=tabsize, skip_first_line=skip_first_line) - return ''.join(lines) - - -class _memoized(object): - """Decorator that caches a function's return value each time it is called. - If called later with the same arguments, the cached value is returned, and - not re-evaluated. - - http://wiki.python.org/moin/PythonDecoratorLibrary - """ - def __init__(self, func): - self.func = func - self.cache = {} - def __call__(self, *args): - try: - return self.cache[args] - except KeyError: - self.cache[args] = value = self.func(*args) - return value - except TypeError: - # uncachable -- for instance, passing a list as an argument. - # Better to not cache than to blow up entirely. - return self.func(*args) - def __repr__(self): - """Return the function's docstring.""" - return self.func.__doc__ - - -def _xml_oneliner_re_from_tab_width(tab_width): - """Standalone XML processing instruction regex.""" - return re.compile(r""" - (?: - (?<=\n\n) # Starting after a blank line - | # or - \A\n? # the beginning of the doc - ) - ( # save in $1 - [ ]{0,%d} - (?: - <\?\w+\b\s+.*?\?> # XML processing instruction - | - <\w+:\w+\b\s+.*?/> # namespaced single tag - ) - [ \t]* - (?=\n{2,}|\Z) # followed by a blank line or end of document - ) - """ % (tab_width - 1), re.X) -_xml_oneliner_re_from_tab_width = _memoized(_xml_oneliner_re_from_tab_width) - -def _hr_tag_re_from_tab_width(tab_width): - return re.compile(r""" - (?: - (?<=\n\n) # Starting after a blank line - | # or - \A\n? # the beginning of the doc - ) - ( # save in \1 - [ ]{0,%d} - <(hr) # start tag = \2 - \b # word break - ([^<>])*? # - /?> # the matching end tag - [ \t]* - (?=\n{2,}|\Z) # followed by a blank line or end of document - ) - """ % (tab_width - 1), re.X) -_hr_tag_re_from_tab_width = _memoized(_hr_tag_re_from_tab_width) - - -def _xml_escape_attr(attr, skip_single_quote=True): - """Escape the given string for use in an HTML/XML tag attribute. - - By default this doesn't bother with escaping `'` to `'`, presuming that - the tag attribute is surrounded by double quotes. - """ - escaped = (attr - .replace('&', '&') - .replace('"', '"') - .replace('<', '<') - .replace('>', '>')) - if not skip_single_quote: - escaped = escaped.replace("'", "'") - return escaped - - -def _xml_encode_email_char_at_random(ch): - r = random() - # Roughly 10% raw, 45% hex, 45% dec. - # '@' *must* be encoded. I [John Gruber] insist. - # Issue 26: '_' must be encoded. - if r > 0.9 and ch not in "@_": - return ch - elif r < 0.45: - # The [1:] is to drop leading '0': 0x63 -> x63 - return '&#%s;' % hex(ord(ch))[1:] - else: - return '&#%s;' % ord(ch) - - - -#---- mainline - -class _NoReflowFormatter(optparse.IndentedHelpFormatter): - """An optparse formatter that does NOT reflow the description.""" - def format_description(self, description): - return description or "" - -def _test(): - import doctest - doctest.testmod() - -def main(argv=None): - if argv is None: - argv = sys.argv - if not logging.root.handlers: - logging.basicConfig() - - usage = "usage: %prog [PATHS...]" - version = "%prog "+__version__ - parser = optparse.OptionParser(prog="markdown2", usage=usage, - version=version, description=cmdln_desc, - formatter=_NoReflowFormatter()) - parser.add_option("-v", "--verbose", dest="log_level", - action="store_const", const=logging.DEBUG, - help="more verbose output") - parser.add_option("--encoding", - help="specify encoding of text content") - parser.add_option("--html4tags", action="store_true", default=False, - help="use HTML 4 style for empty element tags") - parser.add_option("-s", "--safe", metavar="MODE", dest="safe_mode", - help="sanitize literal HTML: 'escape' escapes " - "HTML meta chars, 'replace' replaces with an " - "[HTML_REMOVED] note") - parser.add_option("-x", "--extras", action="append", - help="Turn on specific extra features (not part of " - "the core Markdown spec). See above.") - parser.add_option("--use-file-vars", - help="Look for and use Emacs-style 'markdown-extras' " - "file var to turn on extras. See " - "<https://github.com/trentm/python-markdown2/wiki/Extras>") - parser.add_option("--link-patterns-file", - help="path to a link pattern file") - parser.add_option("--self-test", action="store_true", - help="run internal self-tests (some doctests)") - parser.add_option("--compare", action="store_true", - help="run against Markdown.pl as well (for testing)") - parser.set_defaults(log_level=logging.INFO, compare=False, - encoding="utf-8", safe_mode=None, use_file_vars=False) - opts, paths = parser.parse_args() - log.setLevel(opts.log_level) - - if opts.self_test: - return _test() - - if opts.extras: - extras = {} - for s in opts.extras: - splitter = re.compile("[,;: ]+") - for e in splitter.split(s): - if '=' in e: - ename, earg = e.split('=', 1) - try: - earg = int(earg) - except ValueError: - pass - else: - ename, earg = e, None - extras[ename] = earg - else: - extras = None - - if opts.link_patterns_file: - link_patterns = [] - f = open(opts.link_patterns_file) - try: - for i, line in enumerate(f.readlines()): - if not line.strip(): continue - if line.lstrip().startswith("#"): continue - try: - pat, href = line.rstrip().rsplit(None, 1) - except ValueError: - raise MarkdownError("%s:%d: invalid link pattern line: %r" - % (opts.link_patterns_file, i+1, line)) - link_patterns.append( - (_regex_from_encoded_pattern(pat), href)) - finally: - f.close() - else: - link_patterns = None - - from os.path import join, dirname, abspath, exists - markdown_pl = join(dirname(dirname(abspath(__file__))), "test", - "Markdown.pl") - if not paths: - paths = ['-'] - for path in paths: - if path == '-': - text = sys.stdin.read() - else: - fp = codecs.open(path, 'r', opts.encoding) - text = fp.read() - fp.close() - if opts.compare: - from subprocess import Popen, PIPE - print("==== Markdown.pl ====") - p = Popen('perl %s' % markdown_pl, shell=True, stdin=PIPE, stdout=PIPE, close_fds=True) - p.stdin.write(text.encode('utf-8')) - p.stdin.close() - perl_html = p.stdout.read().decode('utf-8') - if py3: - sys.stdout.write(perl_html) - else: - sys.stdout.write(perl_html.encode( - sys.stdout.encoding or "utf-8", 'xmlcharrefreplace')) - print("==== markdown2.py ====") - html = markdown(text, - html4tags=opts.html4tags, - safe_mode=opts.safe_mode, - extras=extras, link_patterns=link_patterns, - use_file_vars=opts.use_file_vars) - if py3: - sys.stdout.write(html) - else: - sys.stdout.write(html.encode( - sys.stdout.encoding or "utf-8", 'xmlcharrefreplace')) - if extras and "toc" in extras: - log.debug("toc_html: " + - html.toc_html.encode(sys.stdout.encoding or "utf-8", 'xmlcharrefreplace')) - if opts.compare: - test_dir = join(dirname(dirname(abspath(__file__))), "test") - if exists(join(test_dir, "test_markdown2.py")): - sys.path.insert(0, test_dir) - from test_markdown2 import norm_html_from_html - norm_html = norm_html_from_html(html) - norm_perl_html = norm_html_from_html(perl_html) - else: - norm_html = html - norm_perl_html = perl_html - print("==== match? %r ====" % (norm_perl_html == norm_html)) - - -if __name__ == "__main__": - sys.exit( main(sys.argv) ) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/mathjax.html b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/mathjax.html deleted file mode 100644 index cefec1c..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/mathjax.html +++ /dev/null @@ -1,26 +0,0 @@ -<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> -<script> -MathJax.Hub.Config({ - config: ["MMLorHTML.js"], - extensions: ["tex2jax.js"], - jax: ["input/TeX"], - tex2jax: { - inlineMath: [ ['$','$'], ["\\(","\\)"] ], - displayMath: [ ['$$','$$'], ["\\[","\\]"] ], - processEscapes: false - }, - TeX: { - extensions: ["AMSmath.js", "AMSsymbols.js"], - TagSide: "right", - TagIndent: ".8em", - MultLineWidth: "85%", - equationNumbers: { - autoNumber: "AMS", - }, - unicode: { - fonts: "STIXGeneral,'Arial Unicode MS'" - } - }, - showProcessingMessages: false -}); -</script> diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/messages.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/messages.json deleted file mode 100644 index 9e8458b..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/messages.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "install": "README.md", - "1.0.2": "CHANGES.md" -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/package-metadata.json deleted file mode 100644 index 83265a8..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://github.com/revolunet/sublimetext-markdown-preview", "version": "1.0.3", "description": "markdown preview and build plugin for sublime text 2/3"} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/sample.html b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/sample.html deleted file mode 100644 index afe1c51..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/sample.html +++ /dev/null @@ -1,272 +0,0 @@ -<h1 id="sample-markdown-cheat-sheet">Sample Markdown Cheat Sheet</h1> -<p>This is a sample markdown file to help you write Markdown quickly :)</p> -<p>If you use the fabulous <a href="http://sublimetext.com">Sublime Text 2/3 editor</a> along with the <a href="https://github.com/revolunet/sublimetext-markdown-preview">Markdown Preview plugin</a>, open your ST2 Palette with <code>CMD+P</code> then choose <code>Markdown Preview in browser</code> to see the result in your browser.</p> -<h2 id="text-basics">Text basics</h2> -<p>this is <em>italic</em> and this is <strong>bold</strong> . another <em>italic</em> and another <strong>bold</strong></p> -<p>this is <code>important</code> text. and percentage signs : % and <code>%</code></p> -<p>This is a paragraph with a footnote (builtin parser only). <sup id="fnref:note-id"><a class="footnote-ref" href="#fn:note-id" rel="footnote">1</a></sup></p> -<p>Insert <code>[ toc ]</code> without spaces to generate a table of contents (builtin parsers only).</p> -<h2 id="indentation">Indentation</h2> -<blockquote> -<p>Here is some indented text</p> -<blockquote> -<p>even more indented</p> -</blockquote> -</blockquote> -<h2 id="titles">Titles</h2> -<h1 id="big-title-h1">Big title (h1)</h1> -<h2 id="middle-title-h2">Middle title (h2)</h2> -<h3 id="smaller-title-h3">Smaller title (h3)</h3> -<h4 id="and-so-on-hx">and so on (hX)</h4> -<h5 id="and-so-on-hx_1">and so on (hX)</h5> -<h6 id="and-so-on-hx_2">and so on (hX)</h6> -<h2 id="example-lists-1">Example lists (1)</h2> -<ul> -<li>bullets can be <code>-</code>, <code>+</code>, or <code>*</code></li> -<li>bullet list 1</li> -<li> -<p>bullet list 2</p> -<ul> -<li>sub item 1</li> -<li> -<p>sub item 2</p> -<p>with indented text inside</p> -</li> -</ul> -</li> -<li> -<p>bullet list 3</p> -</li> -<li>bullet list 4</li> -<li>bullet list 5</li> -</ul> -<h2 id="links">Links</h2> -<p>This is an <a href="http://lmgtfy.com/">example inline link</a> and <a href="http://lmgtfy.com/" title="Hello, world">another one with a title</a>.</p> -<p>Links can also be reference based : <a href="http://revolunet.com">reference 1</a> or <a href="http://revolunet.com" title="rich web apps">reference 2 with title</a>.</p> -<p>References are usually placed at the bottom of the document</p> -<h2 id="images">Images</h2> -<p>A sample image :</p> -<p><img alt="revolunet logo" src="http://www.revolunet.com/static/parisjs8/img/logo-revolunet-carre.jpg" title="revolunet logo" /></p> -<p>As links, images can also use references instead of inline links :</p> -<p><img alt="revolunet logo" src="http://www.revolunet.com/static/parisjs8/img/logo-revolunet-carre.jpg" title="revolunet logo" /></p> -<h2 id="code">Code</h2> -<p>It's quite easy to show code in markdown files.</p> -<p>Backticks can be used to <code>highlight</code> some words.</p> -<p>Also, any indented block is considered a code block. If <code>enable_highlight</code> is <code>true</code>, syntax highlighting will be included (for the builtin parser - the github parser does this automatically).</p> -<pre><code><script> - document.location = 'http://lmgtfy.com/?q=markdown+cheat+sheet'; -</script> -</code></pre> -<h2 id="math">Math</h2> -<p>When <code>enable_mathjax</code> is <code>true</code>, inline math can be included \(\frac{\pi}{2}\) $\pi$</p> -<p>Alternatively, math can be written on its own line:</p> -<p>$$F(\omega) = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{\infty} f(t) \, e^{ - i \omega t}dt$$</p> -<p>\[\int_0^1 f(t) \mathrm{d}t\]</p> -<p>\[\sum_j \gamma_j^2/d_j\]</p> -<h2 id="github-flavored-markdown">GitHub Flavored Markdown</h2> -<p>If you use the Github parser, you can use some of <a href="http://github.github.com/github-flavored-markdown/">Github Flavored Markdown</a> syntax :</p> -<ul> -<li>User/Project@SHA: revolunet/sublimetext-markdown-preview@7da61badeda468b5019869d11000307e07e07401</li> -<li>User/Project#Issue: revolunet/sublimetext-markdown-preview#1</li> -<li>User : @revolunet</li> -</ul> -<p>Some Python code :</p> -<pre><code class="python">import random - -class CardGame(object): - """ a sample python class """ - NB_CARDS = 32 - def __init__(self, cards=5): - self.cards = random.sample(range(self.NB_CARDS), 5) - print 'ready to play' -</code></pre> - -<p>Some Javascript code :</p> -<pre><code class="js">var config = { - duration: 5, - comment: 'WTF' -} -// callbacks beauty un action -async_call('/path/to/api', function(json) { - another_call(json, function(result2) { - another_another_call(result2, function(result3) { - another_another_another_call(result3, function(result4) { - alert('And if all went well, i got my result :)'); - }); - }); - }); -}) -</code></pre> - -<p>The Github Markdown also brings some <a href="http://www.emoji-cheat-sheet.com/">nice Emoji support</a> : :+1: :heart: :beer:</p> -<h2 id="parsers-and-extensions">Parsers and Extensions</h2> -<p>Markdown Preview comes with <strong>Python-Markdown</strong> and <strong>Markdown2</strong> preloaded.</p> -<h3 id="python-markdown"><em>Python-Markdown</em></h3> -<p>The <a href="https://github.com/waylan/Python-Markdown">Python-Markdown Parser</a> provides support for several extensions.</p> -<h4 id="extra-extensions">Extra Extensions</h4> -<ul> -<li><code>abbr</code> -- <a href="http://pythonhosted.org/Markdown/extensions/abbreviations.html">Abbreviations</a></li> -<li><code>attr_list</code> -- <a href="http://pythonhosted.org/Markdown/extensions/attr_list.html">Attribute Lists</a></li> -<li><code>def_list</code> -- <a href="http://pythonhosted.org/Markdown/extensions/definition_lists.html">Definition Lists</a></li> -<li><code>fenced_code</code> -- <a href="http://pythonhosted.org/Markdown/extensions/fenced_code_blocks.html">Fenced Code Blocks</a></li> -<li><code>footnotes</code> -- <a href="http://pythonhosted.org/Markdown/extensions/footnotes.html">Footnotes</a></li> -<li><code>tables</code> -- <a href="http://pythonhosted.org/Markdown/extensions/tables.html">Tables</a></li> -<li><code>smart_strong</code> -- <a href="http://pythonhosted.org/Markdown/extensions/smart_strong.html">Smart Strong</a></li> -</ul> -<p>You can enable them all at once using the <code>extra</code> keyword.</p> -<pre><code>extensions: [ 'extra' ] -</code></pre> -<p>If you want all the extras plus the <code>toc</code> extension, -your settings would look like this:</p> -<pre><code>{ - ... - parser: 'markdown', - extensions: ['extra', 'toc'], - ... -} -</code></pre> -<h4 id="other-extensions">Other Extensions</h4> -<p>There are also some extensions that are not included in Markdown Extra -but come in the standard Python-Markdown library.</p> -<ul> -<li><code>code-hilite</code> -- <a href="http://pythonhosted.org/Markdown/extensions/code_hilite.html">CodeHilite</a></li> -<li><code>html-tidy</code> -- <a href="http://pythonhosted.org/Markdown/extensions/html_tidy.html">HTML Tidy</a></li> -<li><code>header-id</code> -- <a href="http://pythonhosted.org/Markdown/extensions/header_id.html">HeaderId</a></li> -<li><code>meta_data</code> -- <a href="http://pythonhosted.org/Markdown/extensions/meta_data.html">Meta-Data</a></li> -<li><code>nl2br</code> -- <a href="http://pythonhosted.org/Markdown/extensions/nl2br.html">New Line to Break</a></li> -<li><code>rss</code> -- <a href="http://pythonhosted.org/Markdown/extensions/rss.html">RSS</a></li> -<li><code>sane_lists</code> -- <a href="http://pythonhosted.org/Markdown/extensions/sane_lists.html">Sane Lists</a></li> -<li><code>toc</code> -- <a href="http://pythonhosted.org/Markdown/extensions/toc.html">Table of Contents</a></li> -<li><code>wikilinks</code> -- <a href="http://pythonhosted.org/Markdown/extensions/wikilinks.html">WikiLinks</a></li> -</ul> -<h4 id="3rd-party-extensions">3rd Party Extensions</h4> -<p><em>Python-Markdown</em> is designed to be extended. -Just fork this repo and add your extensions inside the <code>.../Packages/Markdown Preview/markdown/extensions/</code> folder.</p> -<p>Check out the list of <a href="https://github.com/waylan/Python-Markdown/wiki/Third-Party-Extensions">3rd Party extensions</a>.</p> -<h4 id="default-extensions">Default Extensions</h4> -<p>The default extensions are:</p> -<ul> -<li><code>footnotes</code> -- <a href="http://pythonhosted.org/Markdown/extensions/footnotes.html">Footnotes</a></li> -<li><code>toc</code> -- <a href="http://pythonhosted.org/Markdown/extensions/toc.html">Table of Contents</a></li> -<li><code>fenced_code</code> -- <a href="http://pythonhosted.org/Markdown/extensions/fenced_code_blocks.html">Fenced Code Blocks</a> </li> -<li><code>tables</code> -- <a href="http://pythonhosted.org/Markdown/extensions/tables.html">Tables</a></li> -</ul> -<p>Use the <code>default</code> keyword, to select them all. -If you want all the defaults plus the <code>definition_lists</code> extension, -your settings would look like this:</p> -<pre><code>{ - ... - parser: 'markdown', - extensions: ['default', 'definition_lists'], - ... -} -</code></pre> -<h3 id="markdown2"><em>Markdown2</em></h3> -<p>The <a href="https://github.com/trentm/python-markdown2">Markdown2 Parser</a> also provides support for extensions, known as <a href="https://github.com/trentm/python-markdown2/wiki/Extras">Extras</a>. <br /> -You can configure the list of extras you want to use inside the package settings.</p> -<h4 id="default-extras">Default Extras</h4> -<p>The default extras are:</p> -<ul> -<li><code>footnotes</code> -- <a href="https://github.com/trentm/python-markdown2/wiki/footnotes">Footnotes</a></li> -<li><code>toc</code> -- Table of Contents</li> -<li><code>fenced-code-blocks</code> -- <a href="https://github.com/trentm/python-markdown2/wiki/fenced-code-blocks">Fenced CodeBlocks</a></li> -<li><code>cuddled-lists</code> -- <a href="https://github.com/trentm/python-markdown2/wiki/cuddled-lists">Cuddled Lists</a></li> -</ul> -<p>You can enable all default extras at once using the <code>default</code> keyword. -If you want all the default extras plus the 'wiki-table' extra, -your settings would look like this:</p> -<pre><code>{ - ... - parser: 'markdown2', - extensions: ['default', 'wiki-table'], - ... -} -</code></pre> -<h4 id="other-extras">Other Extras</h4> -<p>For a complete list of extras please checkout the <a href="https://github.com/trentm/python-markdown2/wiki/Extras">Extras Wiki Page</a>.</p> -<h2 id="examples">Examples</h2> -<h3 id="tables">Tables</h3> -<p>The <code>tables</code> extension of the <em>Python-Markdown</em> parser is activated by default, -but is currently <strong>not</strong> available in <em>Markdown2</em>.</p> -<p>The syntax was adopted from the <a href="http://michelf.ca/projects/php-markdown/extra/#table">php markdown project</a>, -and is also used in github flavoured markdown.</p> -<table> -<thead> -<tr> -<th>Year</th> -<th>Temperature (low)</th> -<th>Temperature (high)</th> -</tr> -</thead> -<tbody> -<tr> -<td>1900</td> -<td>-10</td> -<td>25</td> -</tr> -<tr> -<td>1910</td> -<td>-15</td> -<td>30</td> -</tr> -<tr> -<td>1920</td> -<td>-10</td> -<td>32</td> -</tr> -</tbody> -</table> -<h3 id="wiki-tables">Wiki Tables</h3> -<p>If you are using <em>Markdown2</em> with the <code>wiki-tables</code> extra activated you should see a table below:</p> -<table> -<thead> -<tr> -<th></th> -<th><em>Year</em></th> -<th></th> -<th><em>Temperature (low)</em></th> -<th></th> -<th><em>Temperature (high)</em></th> -<th></th> -</tr> -</thead> -<tbody> -<tr> -<td></td> -<td>1910</td> -<td></td> -<td>-15</td> -<td></td> -<td>30</td> -<td></td> -</tr> -<tr> -<td></td> -<td>1920</td> -<td></td> -<td>-10</td> -<td></td> -<td>32</td> -<td></td> -</tr> -</tbody> -</table> -<h3 id="definition-lists">Definition Lists</h3> -<p>This example requires <em>Python Markdown</em>'s <code>def_list</code> extension.</p> -<dl> -<dt>Apple</dt> -<dd>Pomaceous fruit of plants of the genus Malus in -the family Rosaceae.</dd> -<dt>Orange</dt> -<dd>The fruit of an evergreen tree of the genus Citrus.</dd> -</dl> -<h2 id="about">About</h2> -<p>This plugin and this sample file is proudly brought to you by the <a href="http://revolunet.com">revolunet team</a></p> -<div class="footnote"> -<hr /> -<ol> -<li id="fn:note-id"> -<p>This is the text of the note.  <a class="footnote-backref" href="#fnref:note-id" rev="footnote" title="Jump back to footnote 1 in the text">↩</a></p> -</li> -</ol> -</div> \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/sample.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/sample.md deleted file mode 100644 index f3fafc4..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Markdown Preview/sample.md +++ /dev/null @@ -1,327 +0,0 @@ -Sample Markdown Cheat Sheet -=========================== - -This is a sample markdown file to help you write Markdown quickly :) - -If you use the fabulous [Sublime Text 2/3 editor][ST] along with the [Markdown Preview plugin][MarkdownPreview], open your ST2 Palette with `CMD+P` then choose `Markdown Preview in browser` to see the result in your browser. - -## Text basics -this is *italic* and this is **bold** . another _italic_ and another __bold__ - -this is `important` text. and percentage signs : % and `%` - -This is a paragraph with a footnote (builtin parser only). [^note-id] - -Insert `[ toc ]` without spaces to generate a table of contents (builtin parsers only). - -## Indentation -> Here is some indented text ->> even more indented - -## Titles -# Big title (h1) -## Middle title (h2) -### Smaller title (h3) -#### and so on (hX) -##### and so on (hX) -###### and so on (hX) - -## Example lists (1) - - - bullets can be `-`, `+`, or `*` - - bullet list 1 - - bullet list 2 - - sub item 1 - - sub item 2 - - with indented text inside - - - bullet list 3 - + bullet list 4 - * bullet list 5 - -## Links - -This is an [example inline link](http://lmgtfy.com/) and [another one with a title](http://lmgtfy.com/ "Hello, world"). - -Links can also be reference based : [reference 1][ref1] or [reference 2 with title][ref2]. - -References are usually placed at the bottom of the document - -## Images - -A sample image : - -![revolunet logo](http://www.revolunet.com/static/parisjs8/img/logo-revolunet-carre.jpg "revolunet logo") - -As links, images can also use references instead of inline links : - -![revolunet logo][revolunet-logo] - - -## Code - -It's quite easy to show code in markdown files. - -Backticks can be used to `highlight` some words. - -Also, any indented block is considered a code block. If `enable_highlight` is `true`, syntax highlighting will be included (for the builtin parser - the github parser does this automatically). - - <script> - document.location = 'http://lmgtfy.com/?q=markdown+cheat+sheet'; - </script> - -## Math - -When `enable_mathjax` is `true`, inline math can be included \\(\frac{\pi}{2}\\) $\pi$ - -Alternatively, math can be written on its own line: - -$$F(\omega) = \frac{1}{\sqrt{2\pi}} \int_{-\infty}^{\infty} f(t) \, e^{ - i \omega t}dt$$ - -\\[\int_0^1 f(t) \mathrm{d}t\\] - -\\[\sum_j \gamma_j^2/d_j\\] - - - -## GitHub Flavored Markdown - -If you use the Github parser, you can use some of [Github Flavored Markdown][gfm] syntax : - - * User/Project@SHA: revolunet/sublimetext-markdown-preview@7da61badeda468b5019869d11000307e07e07401 - * User/Project#Issue: revolunet/sublimetext-markdown-preview#1 - * User : @revolunet - -Some Python code : - -```python -import random - -class CardGame(object): - """ a sample python class """ - NB_CARDS = 32 - def __init__(self, cards=5): - self.cards = random.sample(range(self.NB_CARDS), 5) - print 'ready to play' -``` - -Some Javascript code : - -```js -var config = { - duration: 5, - comment: 'WTF' -} -// callbacks beauty un action -async_call('/path/to/api', function(json) { - another_call(json, function(result2) { - another_another_call(result2, function(result3) { - another_another_another_call(result3, function(result4) { - alert('And if all went well, i got my result :)'); - }); - }); - }); -}) -``` - -The Github Markdown also brings some [nice Emoji support][emoji] : :+1: :heart: :beer: - -[^note-id]: This is the text of the note. - -## Parsers and Extensions - -Markdown Preview comes with **Python-Markdown** and **Markdown2** preloaded. - -### *Python-Markdown* - -The [Python-Markdown Parser][] provides support for several extensions. - -[Python-Markdown Parser]: https://github.com/waylan/Python-Markdown - -#### Extra Extensions - -* `abbr` -- [Abbreviations][] -* `attr_list` -- [Attribute Lists][] -* `def_list` -- [Definition Lists][] -* `fenced_code` -- [Fenced Code Blocks][] -* `footnotes` -- [Footnotes][] -* `tables` -- [Tables][] -* `smart_strong` -- [Smart Strong][] - -[Abbreviations]: http://pythonhosted.org/Markdown/extensions/abbreviations.html -[Attribute Lists]: http://pythonhosted.org/Markdown/extensions/attr_list.html -[Definition Lists]: http://pythonhosted.org/Markdown/extensions/definition_lists.html -[Fenced Code Blocks]: http://pythonhosted.org/Markdown/extensions/fenced_code_blocks.html -[Footnotes]: http://pythonhosted.org/Markdown/extensions/footnotes.html -[Tables]: http://pythonhosted.org/Markdown/extensions/tables.html -[Smart Strong]: http://pythonhosted.org/Markdown/extensions/smart_strong.html - - -You can enable them all at once using the `extra` keyword. - - extensions: [ 'extra' ] - -If you want all the extras plus the `toc` extension, -your settings would look like this: - - { - ... - parser: 'markdown', - extensions: ['extra', 'toc'], - ... - } - - -#### Other Extensions - -There are also some extensions that are not included in Markdown Extra -but come in the standard Python-Markdown library. - -* `code-hilite` -- [CodeHilite][] -* `html-tidy` -- [HTML Tidy][] -* `header-id` -- [HeaderId][] -* `meta_data` -- [Meta-Data][] -* `nl2br` -- [New Line to Break][] -* `rss` -- [RSS][] -* `sane_lists` -- [Sane Lists][] -* `toc` -- [Table of Contents][] -* `wikilinks` -- [WikiLinks][] - -[CodeHilite]: http://pythonhosted.org/Markdown/extensions/code_hilite.html -[HTML Tidy]: http://pythonhosted.org/Markdown/extensions/html_tidy.html -[HeaderId]: http://pythonhosted.org/Markdown/extensions/header_id.html -[Meta-Data]: http://pythonhosted.org/Markdown/extensions/meta_data.html -[New Line to Break]: http://pythonhosted.org/Markdown/extensions/nl2br.html -[RSS]: http://pythonhosted.org/Markdown/extensions/rss.html -[Sane Lists]: http://pythonhosted.org/Markdown/extensions/sane_lists.html -[Table of Contents]: http://pythonhosted.org/Markdown/extensions/toc.html -[WikiLinks]: http://pythonhosted.org/Markdown/extensions/wikilinks.html - -#### 3rd Party Extensions - - -*Python-Markdown* is designed to be extended. -Just fork this repo and add your extensions inside the `.../Packages/Markdown Preview/markdown/extensions/` folder. - -Check out the list of [3rd Party extensions]( -https://github.com/waylan/Python-Markdown/wiki/Third-Party-Extensions). - - -#### Default Extensions - -The default extensions are: - -* `footnotes` -- [Footnotes] -* `toc` -- [Table of Contents] -* `fenced_code` -- [Fenced Code Blocks] -* `tables` -- [Tables] - -Use the `default` keyword, to select them all. -If you want all the defaults plus the `definition_lists` extension, -your settings would look like this: - - { - ... - parser: 'markdown', - extensions: ['default', 'definition_lists'], - ... - } - - -### *Markdown2* - -The [Markdown2 Parser][] also provides support for extensions, known as [Extras][]. -You can configure the list of extras you want to use inside the package settings. - -[Markdown2 Parser]: https://github.com/trentm/python-markdown2 - - -#### Default Extras - -The default extras are: - -* `footnotes` -- [Footnotes][Footnotes Extra] -* `toc` -- Table of Contents -* `fenced-code-blocks` -- [Fenced CodeBlocks][] -* `cuddled-lists` -- [Cuddled Lists][] - -[Footnotes Extra]: https://github.com/trentm/python-markdown2/wiki/footnotes -[Fenced CodeBlocks]: https://github.com/trentm/python-markdown2/wiki/fenced-code-blocks -[Cuddled Lists]: https://github.com/trentm/python-markdown2/wiki/cuddled-lists - - -You can enable all default extras at once using the `default` keyword. -If you want all the default extras plus the 'wiki-table' extra, -your settings would look like this: - - { - ... - parser: 'markdown2', - extensions: ['default', 'wiki-table'], - ... - } - - -#### Other Extras - -For a complete list of extras please checkout the [Extras Wiki Page][Extras]. - -[Extras]: https://github.com/trentm/python-markdown2/wiki/Extras - - -## Examples - - -### Tables - -The `tables` extension of the *Python-Markdown* parser is activated by default, -but is currently **not** available in *Markdown2*. - -The syntax was adopted from the [php markdown project](http://michelf.ca/projects/php-markdown/extra/#table), -and is also used in github flavoured markdown. - -| Year | Temperature (low) | Temperature (high) | -| ---- | ----------------- | -------------------| -| 1900 | -10 | 25 | -| 1910 | -15 | 30 | -| 1920 | -10 | 32 | - - -### Wiki Tables - -If you are using *Markdown2* with the `wiki-tables` extra activated you should see a table below: - -|| *Year* || *Temperature (low)* || *Temperature (high)* || -|| 1900 || -10 || 25 || -|| 1910 || -15 || 30 || -|| 1920 || -10 || 32 || - - -### Definition Lists - -This example requires *Python Markdown*'s `def_list` extension. - -Apple -: Pomaceous fruit of plants of the genus Malus in - the family Rosaceae. - -Orange -: The fruit of an evergreen tree of the genus Citrus. - - -## About - -This plugin and this sample file is proudly brought to you by the [revolunet team][revolunet] - - [ref1]: http://revolunet.com - [ref2]: http://revolunet.com "rich web apps" - [MarkdownREF]: http://daringfireball.net/projects/markdown/basics - [MarkdownPreview]: https://github.com/revolunet/sublimetext-markdown-preview - [ST]: http://sublimetext.com - [revolunet]: http://revolunet.com - [revolunet-logo]: http://www.revolunet.com/static/parisjs8/img/logo-revolunet-carre.jpg "revolunet logo" - [gfm]: http://github.github.com/github-flavored-markdown/ - [emoji]: http://www.emoji-cheat-sheet.com/ - - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Missing Palette Commands/Missing.sublime-commands b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Missing Palette Commands/Missing.sublime-commands deleted file mode 100644 index 0477d93..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Missing Palette Commands/Missing.sublime-commands +++ /dev/null @@ -1,122 +0,0 @@ -[ - // File Menu - { "caption": "Exit Sublime Text 2", "command": "exit" }, - { "caption": "New Window", "command": "new_window"}, - { "caption": "Close Window", "command": "close_window" }, - { "caption": "File: Save As", "command": "prompt_save_as" }, - { "caption": "File: Close", "command": "close" }, - { "caption": "File: Reopen Closed File", "command": "reopen_last_file" }, - - // Edit Menu - { "caption": "Code Folding: Fold All", "command": "fold_by_level", "args": {"level": 1} }, - - { "caption": "Permute Lines: Reverse", "command": "permute_lines", "args": {"operation": "reverse"} }, - { "caption": "Permute Lines: Unique", "command": "permute_lines", "args": {"operation": "unique"} }, - { "caption": "Permute Lines: Shuffle", "command": "permute_lines", "args": {"operation": "shuffle"} }, - - { "caption": "Permute Selections: Sort", "command": "sort_selection", "args": {"case_sensitive": false} }, - { "caption": "Permute Selections: Sort (Case Sensitive)", "command": "sort_selection", "args": {"case_sensitive": true} }, - { "caption": "Permute Selections: Reverse", "command": "permute_selection", "args": {"operation": "reverse"} }, - { "caption": "Permute Selections: Unique", "command": "permute_selection", "args": {"operation": "unique"} }, - { "caption": "Permute Selections: Shuffle", "command": "permute_selection", "args": {"operation": "shuffle"} }, - - // Find Menu - { "caption": "Find", "command": "show_panel", "args": {"panel": "find"} }, - { "caption": "Find in Files", "command": "show_panel", "args": {"panel": "find_in_files"} }, - { "caption": "Replace", "command": "show_panel", "args": {"panel": "replace"} }, - { "caption": "Show Find Results Panel", "command": "show_panel", "args": {"panel": "output.find_results"} }, - - { "caption": "Next Result", "command": "next_result" }, - { "caption": "Previous Result", "command": "previous_result" }, - - // View Menu - { "caption": "View: Toggle Fullscreen", "command": "toggle_full_screen" }, - { "caption": "View: Toggle Distraction Free mode", "command": "toggle_distraction_free" }, - { "caption": "View: Toggle Console", "command": "show_panel", "args": {"panel": "console", "toggle": true} }, - - { "caption": "Indentation: Indent Using Spaces", "command": "toggle_setting", "args": {"setting": "translate_tabs_to_spaces"} }, - { "caption": "Indentation: Tab Width: 1", "command": "set_setting", "args": {"setting": "tab_size", "value": 1} }, - { "caption": "Indentation: Tab Width: 2", "command": "set_setting", "args": {"setting": "tab_size", "value": 2} }, - { "caption": "Indentation: Tab Width: 3", "command": "set_setting", "args": {"setting": "tab_size", "value": 3} }, - { "caption": "Indentation: Tab Width: 4", "command": "set_setting", "args": {"setting": "tab_size", "value": 4} }, - { "caption": "Indentation: Tab Width: 5", "command": "set_setting", "args": {"setting": "tab_size", "value": 5} }, - { "caption": "Indentation: Tab Width: 6", "command": "set_setting", "args": {"setting": "tab_size", "value": 6} }, - { "caption": "Indentation: Tab Width: 7", "command": "set_setting", "args": {"setting": "tab_size", "value": 7} }, - { "caption": "Indentation: Tab Width: 8", "command": "set_setting", "args": {"setting": "tab_size", "value": 8} }, - { "caption": "Indentation: Guess Settings From Buffer", "command": "detect_indentation" }, - - { "caption": "Line Endings: Windows", "command": "set_line_ending", "args": {"type": "windows"} }, - { "caption": "Line Endings: Unix", "command": "set_line_ending", "args": {"type": "unix"} }, - { "caption": "Line Endings: Mac OS 9", "command": "set_line_ending", "args": {"type": "cr"} }, - - { "caption": "View: Toggle Spell Check", "command": "toggle_setting", "args": {"setting": "spell_check"} }, - { "caption": "Spell Check: Next Misspelling", "command": "next_misspelling" }, - { "caption": "Spell Check: Previous Misspelling", "command": "previous_misspelling" }, - - { "caption": "Ruler: None", "command": "set_setting", "args": {"setting": "rulers", "value": []}}, - { "caption": "Ruler: Column 70", "command": "set_setting", "args": {"setting": "rulers", "value": [70]}}, - { "caption": "Ruler: Column 78", "command": "set_setting", "args": {"setting": "rulers", "value": [78]}}, - { "caption": "Ruler: Column 80", "command": "set_setting", "args": {"setting": "rulers", "value": [80]}}, - { "caption": "Ruler: Column 100", "command": "set_setting", "args": {"setting": "rulers", "value": [100]}}, - { "caption": "Ruler: Column 120", "command": "set_setting", "args": {"setting": "rulers", "value": [120]}}, - - { "caption": "Word Wrap: Automatic Column", "command": "set_setting", "args": {"setting": "wrap_width", "value": 0}}, - { "caption": "Word Wrap: Column 70", "command": "set_setting", "args": {"setting": "wrap_width", "value": 70}}, - { "caption": "Word Wrap: Column 78", "command": "set_setting", "args": {"setting": "wrap_width", "value": 78}}, - { "caption": "Word Wrap: Column 80", "command": "set_setting", "args": {"setting": "wrap_width", "value": 80}}, - { "caption": "Word Wrap: Column 100", "command": "set_setting", "args": {"setting": "wrap_width", "value": 100}}, - { "caption": "Word Wrap: Column 120", "command": "set_setting", "args": {"setting": "wrap_width", "value": 120}}, - - { "caption": "Layout: Single", - "command": "set_layout", - "args": {"cols": [0.0, 1.0], "rows": [0.0, 1.0], "cells": [[0, 0, 1, 1]]} - }, - { "caption": "Layout: Columns: 2", - "command": "set_layout", - "args": {"cols": [0.0, 0.5, 1.0], "rows": [0.0, 1.0], "cells": [[0, 0, 1, 1], [1, 0, 2, 1]]} - }, - { "caption": "Layout: Columns: 3", - "command": "set_layout", - "args": {"cols": [0.0, 0.33, 0.66, 1.0], "rows": [0.0, 1.0], "cells": [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1]]} - }, - { "caption": "Layout: Columns: 4", - "command": "set_layout", - "args": {"cols": [0.0, 0.25, 0.5, 0.75, 1.0], "rows": [0.0, 1.0], "cells": [[0, 0, 1, 1], [1, 0, 2, 1], [2, 0, 3, 1], [3, 0, 4, 1]]} - }, - { "caption": "Layout: Rows: 2", - "command": "set_layout", - "args": {"cols": [0.0, 1.0], "rows": [0.0, 0.5, 1.0], "cells": [[0, 0, 1, 1], [0, 1, 1, 2]]} - }, - { "caption": "Layout: Rows: 3", - "command": "set_layout", - "args": {"cols": [0.0, 1.0], "rows": [0.0, 0.33, 0.66, 1.0], "cells": [[0, 0, 1, 1], [0, 1, 1, 2], [0, 2, 1, 3]]} - }, - { "caption": "Layout: Grid: 4", - "command": "set_layout", - "args": {"cols": [0.0, 0.5, 1.0], "rows": [0.0, 0.5, 1.0], "cells": [[0, 0, 1, 1], [1, 0, 2, 1], [0, 1, 1, 2], [1, 1, 2, 2]]} - }, - - // Tools Menu - { "caption": "Cancel Build", "command": "exec", "args": {"kill": true} }, - { "caption": "Show Build Results Panel", "command": "show_panel", "args": {"panel": "output.exec"} }, - { "caption": "Tools: New Snippet", "command": "new_snippet" }, - - // Project Menu - { "caption": "Switch Project in Window", "command": "prompt_select_project" }, - { "caption": "Project: Open Project", "command": "prompt_open_project" }, - { "caption": "Project: Edit Project", "command": "open_file", "args": {"file": "${project}"} }, - { "caption": "Project: Remove all Folders", "command": "close_folder_list" }, - { "caption": "Project: Refresh Folders", "command": "refresh_folder_list" }, - - // Preferences Menu - { "caption": "Preferences: Syntax Specific – User", "command": "open_file_settings" }, - { "caption": "Font: Increase Font Size", "command": "increase_font_size" }, - { "caption": "Font: Decrease Font Size", "command": "decrease_font_size" }, - { "caption": "Font: Reset Font Size", "command": "reset_font_size" }, - - // Misc (not in menu) - { "caption": "View: Toggle Gutter", "command": "toggle_setting", "args": {"setting": "gutter"} }, - { "caption": "View: Toggle Line Numbers", "command": "toggle_setting", "args": {"setting": "line_numbers"} }, - { "caption": "Check for Updates", "command": "update_check" }, - { "caption": "Reveal Current File in Side Bar", "command": "reveal_in_side_bar" } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Missing Palette Commands/README.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Missing Palette Commands/README.md deleted file mode 100644 index 09f1d1b..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Missing Palette Commands/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Missing Palette Commands - -I really like the _Command Palette_ feature of Sublime Text 2. -The only problem I have with it is that some useful commands -have been omitted and are only available through the main menu. - -This package provides a `.sublime-commands` file that contains -the missing commands. diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Missing Palette Commands/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Missing Palette Commands/package-metadata.json deleted file mode 100644 index 3035f07..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Missing Palette Commands/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://github.com/fjl/Sublime-Missing-Palette-Commands", "version": "2013.08.26.09.50.09", "description": "Menu Commands that are missing from the Sublime Text 2 Command Palette"} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/.gitignore b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/.gitignore deleted file mode 100644 index 0d20b64..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.pyc diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/Default.sublime-commands b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/Default.sublime-commands deleted file mode 100644 index d55e1e1..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/Default.sublime-commands +++ /dev/null @@ -1,3 +0,0 @@ -[ - { "caption": "Related Files", "command": "related_files" } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/Default.sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/Default.sublime-keymap deleted file mode 100644 index 9b0a2d1..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/Default.sublime-keymap +++ /dev/null @@ -1,3 +0,0 @@ -[ - { "keys": ["ctrl+super+p"], "command": "related_files"} -] \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/Main.sublime-menu b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/Main.sublime-menu deleted file mode 100644 index b9ddbed..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/Main.sublime-menu +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "caption": "Preferences", - "mnemonic": "n", - "id": "preferences", - "children": - [ - { - "caption": "Package Settings", - "mnemonic": "P", - "id": "package-settings", - "children": - [ - { - "caption": "RelatedFiles", - "children": - [ - { "command": "open_file", "args": {"file": "${packages}/Related Files/RelatedFiles.sublime-settings"}, "caption": "Settings – Default" }, - { "command": "open_file", "args": {"file": "${packages}/User/RelatedFiles.sublime-settings"}, "caption": "Settings – User" }, - { "caption": "-" } - ] - } - ] - } - ] - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/README.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/README.md deleted file mode 100644 index f2fc0f2..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Sublime Text 2 - Related Files - -![Screenshot](https://raw.github.com/fabiokr/sublime-related-files/master/screenshots/list.png) - -This plugin provides a quick list of related files to the currently open file. - -My main use case is to list related files under a Ruby on Rails project. For example, for an opened "app/controllers/examples_controller.rb", related files would be "app/helpers/examples_helper.rb", "app/views/examples/**", and "spec/controllers/examples_controller_spec.rb". - -This plugin was inspired by the existing [Open Related](https://github.com/vojtajina/sublime-OpenRelated) and [Rails Related Files](https://github.com/luqman/SublimeText2RailsRelatedFiles). - -I wanted something between the two of them (a quick list of results that could be setup for any kinds of projects, not only Rails), so I created my own. - -# Key Shortcut - -The default shortcut is mapped to "ctrl+super+p". To change it to something more suitable for your needs, you can easily change that by copying the following and replacing the "keys" to your desired key combination: - -```json -{ "keys": ["ctrl+super+p"], "command": "related_files"} -``` - -# Configuration - -The plugins comes configured to lookup Rails related files, but you can add your own setups. Let's see an existing example: - -```json -// Test/specs for ruby files -".+\/(app|lib)\/(.+).rb": - [ - "spec/$2_spec.rb", - "test/$2_test.rb" - ] -``` - -The configuration has two parts: the key, which is a regular expression to match against the currently open file, and a list of globs to map the related files. - -You can use the $1, $2, etc. on the glob strings to be replace by the extracted parts from the regex. \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/RelatedFiles.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/RelatedFiles.sublime-settings deleted file mode 100644 index eb9502c..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/RelatedFiles.sublime-settings +++ /dev/null @@ -1,84 +0,0 @@ -{ - "patterns": { - // Test/specs for ruby files - ".+\/(app|lib)\/(.+).rb": - [ - "spec/$2_spec.rb", - "test/$2_test.rb" - ], - - // Ruby files for test/specs - ".+\/(test|spec)\/(.+)_(test|spec).rb": - [ - "app/$2.rb", - "lib/$2.rb" - ], - - // Rails controllers - ".+\/app\/controllers\/(.+)_controller.rb": - [ - "app/views/$1/**", - "app/helpers/$1_helper.rb", - "config/routes.rb", - "spec/requests/$1_spec.rb", - "spec/routing/$1_routing_spec.rb" - ], - - // Rails helpers - ".+\/app\/helpers\/(.+)_helper.rb": - [ - "app/views/$1/**", - "app/controllers/$1_controller.rb", - "config/routes.rb", - "spec/requests/$1_spec.rb" - ], - - // Rails views - ".+\/app\/views\/(.+)\/[^\/].+": - [ - "app/views/$1/**", - "app/controllers/$1_controller.rb", - "app/helpers/$1_helper.rb", - "config/routes.rb", - "spec/controllers/$1_spec.rb", - "spec/requests/$1_spec.rb" - ], - - // Rails routes - ".+\/config\/routes.rb": - [ - "spec/routing/**" - ], - - // Rails libs - ".+\/(lib)\/(.+).rb": - [ - "spec/lib/$2_spec.rb", - "test/lib/$2_test.rb" - ], - - // Rails controllers specs - ".+/spec/controllers/(.+)_controller_spec.rb": - [ - "app/controllers/$1_controller.rb", - "app/helpers/$1_helper.rb", - "app/views/$1/**", - "config/routes.rb" - ], - - // Rails request specs - ".+/spec/requests/(.+)_spec.rb": - [ - "app/controllers/$1_controller.rb", - "app/helpers/$1_helper.rb", - "app/views/$1/**", - "config/routes.rb" - ], - - // Rails libs specs - ".+/spec/lib/(.+)_spec.rb": - [ - "lib/$1.rb" - ] - } -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example1/app/controllers/examples_controller.rb b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example1/app/controllers/examples_controller.rb deleted file mode 100644 index f712c1a..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example1/app/controllers/examples_controller.rb +++ /dev/null @@ -1,3 +0,0 @@ -class ExamplesController < ApplicationController - -end \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example1/app/helpers/examples_helper.rb b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example1/app/helpers/examples_helper.rb deleted file mode 100644 index e69de29..0000000 diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example1/app/views/examples/index.html b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example1/app/views/examples/index.html deleted file mode 100644 index e69de29..0000000 diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example1/app/views/examples/show.html b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example1/app/views/examples/show.html deleted file mode 100644 index e69de29..0000000 diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example1/test/controllers/examples_controller_test.rb b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example1/test/controllers/examples_controller_test.rb deleted file mode 100644 index e69de29..0000000 diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example2/app/controllers/examples_controller.rb b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example2/app/controllers/examples_controller.rb deleted file mode 100644 index e69de29..0000000 diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example2/app/views/examples/index.html b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example2/app/views/examples/index.html deleted file mode 100644 index e69de29..0000000 diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example2/app/views/examples/show.html b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example2/app/views/examples/show.html deleted file mode 100644 index e69de29..0000000 diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example2/test/controllers/examples_controller_test.rb b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/fixtures/example2/test/controllers/examples_controller_test.rb deleted file mode 100644 index e69de29..0000000 diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/package-metadata.json deleted file mode 100644 index ba1647e..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://github.com/fabiokr/sublime-related-files", "version": "2013.03.15.12.29.58", "description": "A Sublime Text 2 plugin to list related files"} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/related.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/related.py deleted file mode 100644 index a1c6007..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/related.py +++ /dev/null @@ -1,86 +0,0 @@ -import os -import re -import glob -import itertools - - -class Related(object): - # Initializes the RelatedFiles object. - # - # file_path - the file to look related files for - # patterns - a dictionary of patterns in the following format: - # {"(.+)_controller.rb": ["*/the/paths/$1/**", "*/test/$1_controller_test.rb"]} - # - # The glob paths will have their $i replaced by the matched groups within the file name - # matcher. - def __init__(self, file_path, patterns, folders): - self.__file_path = file_path - self.__patterns = patterns - self.__root = self.__root(folders) - self.__files = [] - self.__descriptions = [] - self.__build() - - # # Retrieves a list of all related descriptions. - def descriptions(self): - return self.__descriptions - - # # Retrieves a list of all related files paths. - def files(self): - return self.__files - - # Builds a list with all related files and sets self.descriptions and - # self.files. - def __build(self): - files = set() - - file_path = self.__to_posixpath(self.__file_path) - - # for each matching pattern - for regex, paths in self.__patterns.iteritems(): - match = re.compile(regex).match(file_path) - if match: - # returns a flattened file list - files.update(self.__files_for_paths(regex, match, paths)) - - # sorts items - files = list(files) - files.sort() - - self.__files = files - self.__descriptions = [self.__file_without_root(file) for file in files] - - # Returns the root folder for the given file and folders - def __root(self, folders): - for folder in folders: - if self.__file_path.startswith(os.path.join(folder, "")): - return folder - - # Retrieves a list of files fot the given match and paths - def __files_for_paths(self, regex, match, paths): - paths = [self.__replaced_path(match, path) for path in paths] - - files = [glob.glob(os.path.join(self.__root, path)) for path in paths] - flattened = [self.__to_posixpath(path) for path in list(itertools.chain.from_iterable(files))] - - # Ignores current file - if self.__file_path in flattened: - flattened.remove(unicode(self.__file_path)) - - return flattened - - # Retrieves the file name without the root part. - def __file_without_root(self, file): - return os.path.basename(self.__root) + file[len(self.__root):] - - # Retrieves a path with its interpolation vars replaces by the found groups - # on match. - def __replaced_path(self, match, path): - replaced_path = path - for i, group in enumerate(match.groups()): - replaced_path = replaced_path.replace("$%s" % (i + 1), group) - return replaced_path - - # Converts paths to posixpaths. - def __to_posixpath(self, path): - return re.sub("\\\\", "/", path) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/related_files.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/related_files.py deleted file mode 100644 index ef289f1..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/related_files.py +++ /dev/null @@ -1,39 +0,0 @@ -import sublime -import sublime_plugin -from related import * - - -class RelatedFilesCommand(sublime_plugin.WindowCommand): - def run(self, index=None): - active_file_path = self.__active_file_path() - - if active_file_path: - # Builds a list of related files for the current open file. - self.__related = Related(active_file_path, self.__patterns(), sublime.active_window().folders()) - - self.window.show_quick_panel(self.__related.descriptions(), self.__open_file) - else: - self.__status_msg("No open files") - - # Opens the file in path. - def __open_file(self, index): - if index >= 0: - self.window.open_file(self.__related.files()[index]) - else: - self.__status_msg("No related files found") - - # Retrieves the patterns from settings. - def __patterns(self): - return sublime.load_settings("RelatedFiles.sublime-settings").get('patterns') - - # Returns the activelly open file path from sublime. - def __active_file_path(self): - if self.window.active_view(): - file_path = self.window.active_view().file_name() - - if file_path and len(file_path) > 0: - return file_path - - # Displays a status message on sublime. - def __status_msg(self, message): - sublime.status_message(message) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/related_test.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/related_test.py deleted file mode 100644 index a47b52a..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/related_test.py +++ /dev/null @@ -1,52 +0,0 @@ -import unittest -import os -from related import * - - -class RelatedTest(unittest.TestCase): - - def test_descriptions_with_matches(self): - self.assertEqual(self.__related().descriptions(), [ - "example1/app/helpers/examples_helper.rb", - "example1/app/views/examples/index.html", - "example1/app/views/examples/show.html", - "example1/test/controllers/examples_controller_test.rb" - ]) - - def test_descriptions_without_matches(self): - self.assertEqual(self.__related_without_match().descriptions(), []) - - def test_files_with_matches(self): - self.assertEqual(self.__related().files(), [ - self.__expand("fixtures/example1/app/helpers/examples_helper.rb"), - self.__expand("fixtures/example1/app/views/examples/index.html"), - self.__expand("fixtures/example1/app/views/examples/show.html"), - self.__expand("fixtures/example1/test/controllers/examples_controller_test.rb") - ]) - - def test_files_without_matches(self): - self.assertEqual(self.__related_without_match().files(), []) - - def __patterns(self): - return { - ".+\/app\/controllers\/(.+)_controller.rb": ["app/views/$1/**", "app/helpers/$1_helper.rb"], - ".+\/app\/(.+).rb": ["test/$1_test.rb"] - } - - def __file(self): - return self.__expand("fixtures/example1/app/controllers/examples_controller.rb") - - def __folders(self): - return [self.__expand("fixtures/example1"), self.__expand("fixtures/example2")] - - def __expand(self, path): - return os.path.join(os.path.dirname(os.path.realpath(__file__)), path) - - def __related(self): - return Related(self.__file(), self.__patterns(), self.__folders()) - - def __related_without_match(self): - return Related("/should/not/match", self.__patterns(), self.__folders()) - -if __name__ == '__main__': - unittest.main() diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/screenshots/list.png b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/screenshots/list.png deleted file mode 100644 index 933c9ab..0000000 Binary files a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Related Files/screenshots/list.png and /dev/null differ diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/.gitignore b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/.gitignore deleted file mode 100644 index 4a8e770..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -*.pyc -SmartMarkdown.sublime-project -SmartMarkdown.sublime-workspace -release.sh -test/* -.ropeproject diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Default (Linux).sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Default (Linux).sublime-keymap deleted file mode 100644 index 0e09a91..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Default (Linux).sublime-keymap +++ /dev/null @@ -1,31 +0,0 @@ -[ - { "keys": ["ctrl+;", "ctrl+n"], "command": "headline_move", - "args": {"forward": true, "same_level": false}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" } - ] - }, - { "keys": ["ctrl+;", "ctrl+p"], "command": "headline_move", - "args": {"forward": false, "same_level": false}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" } - ] - }, - { "keys": ["ctrl+;", "ctrl+f"], "command": "headline_move", - "args": {"forward": true, "same_level": true}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" } - ] - }, - { "keys": ["ctrl+;", "ctrl+b"], "command": "headline_move", - "args": {"forward": false, "same_level": true}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" } - ] - }, - { "keys": ["ctrl+enter"], "command": "smart_new_line", "context": - [ - { "key": "selector", "operator": "equal", "operand": "markup.heading.markdown" } - ] - } -] \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Default (OSX).sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Default (OSX).sublime-keymap deleted file mode 100644 index 8d78de9..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Default (OSX).sublime-keymap +++ /dev/null @@ -1,31 +0,0 @@ -[ - { "keys": ["ctrl+c", "ctrl+n"], "command": "headline_move", - "args": {"forward": true, "same_level": false}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" } - ] - }, - { "keys": ["ctrl+c", "ctrl+p"], "command": "headline_move", - "args": {"forward": false, "same_level": false}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" } - ] - }, - { "keys": ["ctrl+c", "ctrl+f"], "command": "headline_move", - "args": {"forward": true, "same_level": true}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" } - ] - }, - { "keys": ["ctrl+c", "ctrl+b"], "command": "headline_move", - "args": {"forward": false, "same_level": true}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" } - ] - }, - { "keys": ["ctrl+enter"], "command": "smart_new_line", "context": - [ - { "key": "selector", "operator": "equal", "operand": "markup.heading.markdown" } - ] - } -] \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Default (Windows).sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Default (Windows).sublime-keymap deleted file mode 100644 index 0e09a91..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Default (Windows).sublime-keymap +++ /dev/null @@ -1,31 +0,0 @@ -[ - { "keys": ["ctrl+;", "ctrl+n"], "command": "headline_move", - "args": {"forward": true, "same_level": false}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" } - ] - }, - { "keys": ["ctrl+;", "ctrl+p"], "command": "headline_move", - "args": {"forward": false, "same_level": false}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" } - ] - }, - { "keys": ["ctrl+;", "ctrl+f"], "command": "headline_move", - "args": {"forward": true, "same_level": true}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" } - ] - }, - { "keys": ["ctrl+;", "ctrl+b"], "command": "headline_move", - "args": {"forward": false, "same_level": true}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" } - ] - }, - { "keys": ["ctrl+enter"], "command": "smart_new_line", "context": - [ - { "key": "selector", "operator": "equal", "operand": "markup.heading.markdown" } - ] - } -] \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Default.sublime-commands b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Default.sublime-commands deleted file mode 100644 index 90028e7..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Default.sublime-commands +++ /dev/null @@ -1,27 +0,0 @@ -[ - { - "caption": "Pandoc: Render Markdown to temp PDF and View", - "command": "pandoc_render", - "args":{"open_after":true, "target":"pdf", "save_result":false} - }, - { - "caption": "Pandoc: Render Markdown to temp HTML and View", - "command": "pandoc_render", - "args":{"open_after":true, "target":"html", "save_result":false} - }, - { - "caption": "Pandoc: Render Markdown to HTML", - "command": "pandoc_render", - "args":{"open_after":false, "target":"html", "save_result":true} - }, - { - "caption": "Pandoc: Render Markdown to PDF", - "command": "pandoc_render", - "args":{"open_after":false, "target":"pdf", "save_result":true} - }, - { - "caption": "Pandoc: Render Markdown DocX", - "command": "pandoc_render", - "args":{"open_after":false, "target":"docx", "save_result":true} - } -] \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Default.sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Default.sublime-keymap deleted file mode 100644 index 28a78b4..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Default.sublime-keymap +++ /dev/null @@ -1,72 +0,0 @@ -[ - { "keys": ["tab"], "command": "smart_folding", "context": - [ - { "key": "selector", "operator": "equal", "operand": "markup.heading.markdown" } - ] - }, - { "keys": ["shift+tab"], "command": "global_folding", "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" } - ] - }, - { "keys": ["enter"], "command": "smart_list", "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*([-+\\**]|\\d+\\.+)\\s+" } - ] - }, - { "keys": ["enter"], "command": "smart_list", "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "selector", "operator": "equal", "operand": "markup.list" } - ] - }, - { "keys": ["tab"], "command": "smart_table", - "args": {"forward": true}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\\||\\+[-=])", - "match_all": true} - ] - }, - { "keys": ["tab"], "command": "smart_table", - "args": {"forward": true}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*" }, - { "key": "following_text", "operator": "regex_contains", "operand": "\\s*(\\||\\+[-=])", - "match_all": true} - ] - }, - { "keys": ["shift+tab"], "command": "smart_table", - "args": {"forward": false}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\\||\\+[-=])", - "match_all": true} - ] - }, - { "keys": ["shift+tab"], "command": "smart_table", - "args": {"forward": false}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*" }, - { "key": "following_text", "operator": "regex_contains", "operand": "\\s*(\\||\\+[-=])", - "match_all": true} - ] - }, - { - "keys": ["super+shift+."], "command": "change_heading_level", - "args": {"up": true}, "context": - [ - {"key": "selector", "operator": "equal", "operand": "text.html.markdown"} - ] - }, - { - "keys": ["super+shift+,"], "command": "change_heading_level", - "args": {"up": false}, "context": - [ - {"key": "selector", "operator": "equal", "operand": "text.html.markdown"} - ] - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Main.sublime-menu b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Main.sublime-menu deleted file mode 100644 index 91bce87..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/Main.sublime-menu +++ /dev/null @@ -1,70 +0,0 @@ -[ - { - "caption": "Preferences", - "mnemonic": "n", - "id": "preferences", - "children": - [ - { - "caption": "Package Settings", - "mnemonic": "P", - "id": "package-settings", - "children": - [ - { - "caption": "SmartMarkdown", - "children": - [ - { - "command": "open_file", "args": - { - "file": "${packages}/SmartMarkdown/SmartMarkdown.sublime-settings" - }, - "caption": "Settings – Default" - }, - { - "command": "open_file", "args": - { - "file": "${packages}/User/SmartMarkdown.sublime-settings" - }, - "caption": "Settings – User" - }, - { "caption": "-" }, - { - "command": "open_file", "args": - { - "file": "${packages}/SmartMarkdown/Default.sublime-keymap" - }, - "caption": "Key Bindings – Default" - }, - { - "command": "open_file", "args": - { - "file": "${packages}/User/Default (OSX).sublime-keymap", - "platform": "OSX" - }, - "caption": "Key Bindings – User" - }, - { - "command": "open_file", "args": - { - "file": "${packages}/User/Default (Linux).sublime-keymap", - "platform": "Linux" - }, - "caption": "Key Bindings – User" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/User/Default (Windows).sublime-keymap", - "platform": "Windows" - }, - "caption": "Key Bindings – User" - } - ] - } - ] - } - ] - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/SmartMarkdown.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/SmartMarkdown.sublime-settings deleted file mode 100644 index 69d1fb2..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/SmartMarkdown.sublime-settings +++ /dev/null @@ -1,11 +0,0 @@ -{ - /* Please specify the PATH of pdflatex if you wanna generate PDF */ - "tex_path": ["/usr/local/texlive/2011/bin/x86_64-darwin", - "/usr/local/texlive/2012/bin/x86_64-darwin"], - /* Provide your arguments here as a list e.g.: ["--latex-engine=xelatex", "--toc"] - arguments that are separated by space must be in separate slots. e.g. ["-H", "template.tex"] */ - "pandoc_args": [], - "pandoc_args_pdf": [], - "pandoc_args_html": [], - "pandoc_args_docx": [] -} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/headline.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/headline.py deleted file mode 100644 index 91dce43..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/headline.py +++ /dev/null @@ -1,263 +0,0 @@ -"""Some utility functions for working with headline of Markdown. - -Terminologies -- Headline :: The headline entity OR the text of the headline -- Content :: The content under the current headline. It stops after - encountering a headline with the same or higher level OR EOF. -""" -# Author: Muchenxuan Tong <demon386@gmail.com> - -import re -import sublime - -try: - from .utilities import is_region_void -except ValueError: - from utilities import is_region_void - -MATCH_PARENT = 1 # Match headlines at the same or higher level -MATCH_CHILD = 2 # Match headlines at the same or lower level -MATCH_SILBING = 3 # Only Match headlines at the same level. -MATCH_ANY = 4 # Any headlines would be matched. -ANY_LEVEL = -1 # level used when MATCH_ANY is used as match type - - -def region_of_content_of_headline_at_point(view, from_point): - """Extract the region of the content of under current headline.""" - _, level = headline_and_level_at_point(view, from_point) - if level == None: - return None - - if is_content_empty_at_point(view, from_point): - return None - - line_num, _ = view.rowcol(from_point) - content_line_start_point = view.text_point(line_num + 1, 0) - - next_headline, _ = find_headline(view, \ - content_line_start_point, \ - level, \ - True, \ - MATCH_PARENT) - if not is_region_void(next_headline): - end_pos = next_headline.a - 1 - else: - end_pos = view.size() - return sublime.Region(content_line_start_point, end_pos) - - -def headline_and_level_at_point(view, from_point, search_above_and_down=False): - """Return the current headline and level. - - If from_point is inside a headline, then return the headline and level. - Otherwise depends on the argument it might search above and down. - """ - line_region = view.line(from_point) - line_content = view.substr(line_region) - # Update the level in case it's headline.ANY_LEVEL - level = _extract_level_from_headline(line_content) - - # Search above and down - if level is None and search_above_and_down: - # Search above - headline_region, _ = find_headline(view,\ - from_point,\ - ANY_LEVEL, - False, - skip_folded=True) - if not is_region_void(headline_region): - line_content, level = headline_and_level_at_point(view,\ - headline_region.a) - # Search down - if level is None: - headline_region, _ = find_headline(view,\ - from_point,\ - ANY_LEVEL, - True, - skip_folded=True) - if not is_region_void(headline_region): - line_content, level = headline_and_level_at_point(view, headline_region.a) - - return line_content, level - - -def _extract_level_from_headline(headline): - """Extract the level of headline, None if not found. - - """ - re_string = _get_re_string(ANY_LEVEL, MATCH_ANY) - match = re.match(re_string, headline) - - if match: - return len(match.group(1)) - else: - return None - - -def is_content_empty_at_point(view, from_point): - """Check if the content under the current headline is empty. - - For implementation, check if next line is a headline a the same - or higher level. - - """ - _, level = headline_and_level_at_point(view, from_point) - if level is None: - raise ValueError("from_point must be inside a valid headline.") - - line_num, _ = view.rowcol(from_point) - next_line_region = view.line(view.text_point(line_num + 1, 0)) - next_line_content = view.substr(next_line_region) - next_line_level = _extract_level_from_headline(next_line_content) - - # Note that EOF works too in this case. - if next_line_level and next_line_level <= level: - return True - else: - return False - - -def find_headline(view, from_point, level, forward=True, \ - match_type=MATCH_ANY, skip_headline_at_point=False, \ - skip_folded=False): - """Return the region of the next headline or EOF. - - Parameters - ---------- - view: sublime.view - - from_point: int - From which to find. - - level: int - The headline level to match. - - forward: boolean - Search forward or backward - - match_type: int - MATCH_SILBING, MATCH_PARENT, MATCH_CHILD or MATCH_ANY. - - skip_headline_at_point: boolean - When searching whether skip the headline at point - - skip_folded: boolean - Whether to skip the folded region - - Returns - ------- - match_region: int - Matched region, or None if not found. - - match_level: int - The level of matched headline, or None if not found. - - """ - if skip_headline_at_point: - # Move the point to the next line if we are - # current in a headline already. - from_point = _get_new_point_if_already_in_headline(view, from_point, - forward) - - re_string = _get_re_string(level, match_type) - if forward: - match_region = view.find(re_string, from_point) - else: - all_match_regions = view.find_all(re_string) - match_region = _nearest_region_among_matches_from_point(view, \ - all_match_regions, \ - from_point, \ - False, \ - skip_folded) - - if skip_folded: - while (_is_region_folded(match_region, view)): - from_point = match_region.b - match_region = view.find(re_string, from_point) - - if not is_region_void(match_region): - if not is_scope_headline(view, match_region.a): - return find_headline(view, match_region.a, level, forward, \ - match_type, True, skip_folded) - else: - ## Extract the level of matched headlines according to the region - headline = view.substr(match_region) - match_level = _extract_level_from_headline(headline) - else: - match_level = None - return (match_region, match_level) - -def _get_re_string(level, match_type=MATCH_ANY): - """Get regular expression string according to match type. - - Return regular expression string, rather than compiled string. Since - sublime's view.find function needs string. - - Parameters - ---------- - match_type: int - MATCH_SILBING, MATCH_PARENT, MATCH_CHILD or ANY_LEVEL. - - """ - if match_type == MATCH_ANY: - re_string = r'^(#+)\s.*' - else: - try: - if match_type == MATCH_PARENT: - re_string = r'^(#{1,%d})\s.*' % level - elif match_type == MATCH_CHILD: - re_string = r'^(#{%d,})\s.*' % level - elif match_type == MATCH_SILBING: - re_string = r'^(#{%d,%d})\s.*' % (level, level) - except ValueError: - print("match_type has to be specified if level isn't ANY_LEVE") - return re_string - - -def _get_new_point_if_already_in_headline(view, from_point, forward=True): - line_content = view.substr(view.line(from_point)) - if _extract_level_from_headline(line_content): - line_num, _ = view.rowcol(from_point) - if forward: - return view.text_point(line_num + 1, 0) - else: - return view.text_point(line_num, 0) - 1 - else: - return from_point - - -def is_scope_headline(view, from_point): - return view.score_selector(from_point, "markup.heading") > 0 or \ - view.score_selector(from_point, "meta.block-level.markdown") > 0 - - -def _nearest_region_among_matches_from_point(view, all_match_regions, \ - from_point, forward=False, - skip_folded=True): - """Find the nearest matched region among all matched regions. - - None if not found. - - """ - nearest_region = None - - for r in all_match_regions: - if not forward and r.b <= from_point and \ - (not nearest_region or r.a > nearest_region.a): - candidate = r - elif forward and r.a >= from_point and \ - (not nearest_region or r.b < nearest_region.b): - candidate = r - else: - continue - if skip_folded and not _is_region_folded(candidate, view): - nearest_region = candidate - - return nearest_region - - -def _is_region_folded(region, view): - for i in view.folded_regions(): - if i.contains(region): - return True - return False diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/headline_level.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/headline_level.py deleted file mode 100644 index 3ad56b9..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/headline_level.py +++ /dev/null @@ -1,21 +0,0 @@ -"""This file is contributed by [David Smith](https://github.com/djs070) -""" -import sublime -import sublime_plugin - - -class ChangeHeadingLevelCommand(sublime_plugin.TextCommand): - def run(self, edit, up=True): - for region in self.view.sel(): - line = self.view.line(region) - if up: - # Increase heading level - if not self.view.substr(line)[0] in ['#', ' ']: - self.view.insert(edit, line.begin(), " ") - self.view.insert(edit, line.begin(), "#") - else: - # Decrease heading level - if self.view.substr(line)[0] == '#': - self.view.erase(edit, sublime.Region(line.begin(), line.begin() + 1)) - if self.view.substr(line)[0] == ' ': - self.view.erase(edit, sublime.Region(line.begin(), line.begin() + 1)) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/headline_move.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/headline_move.py deleted file mode 100644 index 824d6a9..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/headline_move.py +++ /dev/null @@ -1,61 +0,0 @@ -"""This module provides commands for easily moving between headilnes. - -The feature is borrowed from [Org-mode](http://org-mode.org). - -""" -# Author: Muchenxuan Tong <demon386@gmail.com> - -import sublime -import sublime_plugin - -try: - from . import headline - from .utilities import is_region_void -except ValueError: - import headline - from utilities import is_region_void - - -class HeadlineMoveCommand(sublime_plugin.TextCommand): - def run(self, edit, forward=True, same_level=True): - """Move between headlines, forward or backward. - - If same_level is true, only move to headline with the same level - or higher level. - - """ - new_sel = [] - if same_level: - level_type = headline.MATCH_PARENT - else: - level_type = headline.MATCH_ANY - - for region in self.view.sel(): - if same_level: - _, level = headline.headline_and_level_at_point(self.view,\ - region.a, - search_above_and_down=True) - if level is None: - return - else: - level = headline.ANY_LEVEL - - match_region, _ = headline.find_headline(self.view, \ - region.a, \ - level, \ - forward, \ - level_type, \ - skip_headline_at_point=True,\ - skip_folded=True) - - if is_region_void(match_region): - return - new_sel.append(sublime.Region(match_region.a, match_region.a)) - - self.adjust_view(new_sel) - - def adjust_view(self, new_sel): - self.view.sel().clear() - for region in new_sel: - self.view.sel().add(region) - self.view.show(region) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/license.txt b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/license.txt deleted file mode 100644 index d71c44d..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/license.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (C) <2012> Muchenxuan Tong <demon386@gmail.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/package-metadata.json deleted file mode 100644 index 7273997..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://github.com/demon386/SmartMarkdown", "version": "2013.06.16.12.00.50", "description": "A plugin for facilitating editing markdown in Sublime Text 2. Features are borrowed from Org mode of Emacs."} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/pandoc_render.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/pandoc_render.py deleted file mode 100644 index 67f7320..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/pandoc_render.py +++ /dev/null @@ -1,124 +0,0 @@ -"""This file is initially forked from -[SublimePandoc](https://github.com/jclement/SublimePandoc) -by [DanielMe](https://github.com/DanielMe/) - -@todo naming convention should be foo_bar rather than fooBar. -@bug PDF export doesn't work in my Mac, gonna check it later. - -2012-07-02: Muchenxuan Tong changed some stylical errors (with SublimeLinter) -""" - -import sublime -import sublime_plugin -import webbrowser -import tempfile -import os -import os.path -import sys -import subprocess -from subprocess import PIPE - - -class PandocRenderCommand(sublime_plugin.TextCommand): - def is_enabled(self): - return self.view.score_selector(0, "text.html.markdown") > 0 - - def is_visible(self): - return True - - def run(self, edit, target="pdf", open_after=True, save_result=False): - if target not in ["html", "docx", "pdf"]: - raise Exception("Format %s currently unsopported" % target) - - self.setting = sublime.load_settings("SmartMarkdown.sublime-settings") - - encoding = self.view.encoding() - if encoding == 'Undefined': - encoding = 'UTF-8' - elif encoding == 'Western (Windows 1252)': - encoding = 'windows-1252' - contents = self.view.substr(sublime.Region(0, self.view.size())) - contents = contents.encode(encoding) - - file_name = self.view.file_name() - if file_name: - os.chdir(os.path.dirname(file_name)) - - # write buffer to temporary file - # This is useful because it means we don't need to save the buffer - tmp_md = tempfile.NamedTemporaryFile(delete=False, suffix=".md") - tmp_md.write(contents) - tmp_md.close() - - # output file... - suffix = "." + target - if save_result: - output_name = os.path.splitext(self.view.file_name())[0] + suffix - if not self.view.file_name(): - raise Exception("Please safe the buffer before trying to export with pandoc.") - else: - output = tempfile.NamedTemporaryFile(delete=False, suffix=suffix) - output.close() - output_name = output.name - - args = self.pandoc_args(target) - self.run_pandoc(tmp_md.name, output_name, args) - - if open_after: - self.open_result(output_name, target) - #os.unlink(tmp_md.name) - - def run_pandoc(self, infile, outfile, args): - cmd = ['pandoc'] + args - cmd += [infile, "-o", outfile] - - # Merge the path in settings - setting_path = self.setting.get("tex_path", []) - for p in setting_path: - if p not in os.environ["PATH"]: - os.environ["PATH"] += ":" + p - - try: - # Use the current directory as working dir whenever possible - file_name = self.view.file_name() - if file_name: - working_dir = os.path.dirname(file_name) - p = subprocess.Popen(cmd, stdout=PIPE, stderr=PIPE, - cwd=working_dir) - - else: - p = subprocess.Popen(cmd, stdout=PIPE, stderr=PIPE) - p.wait() - out, err = p.communicate() - if err: - raise Exception("Command: %s\n" % " ".join(cmd) + "\nErrors: " + err) - except Exception as e: - sublime.error_message("Fail to generate output.\n{0}".format(e)) - - def pandoc_args(self, target): - """ - Create a list of arguments for the pandoc command - depending on the target. - TODO: Actually do something sensible here - """ - # Merge the args in settings - args = self.setting.get("pandoc_args", []) - - if target == "pdf": - args += self.setting.get("pandoc_args_pdf", []) - if target == "html": - args += self.setting.get("pandoc_args_html", []) + ['-t', 'html5'] - if target == "docx": - args += self.setting.get("pandoc_args_docx", []) + ['-t', 'docx'] - return args - - def open_result(self, outfile, target): - if target == "html": - webbrowser.open_new_tab(outfile) - elif sys.platform == "win32": - os.startfile(outfile) - elif "mac" in sys.platform or "darwin" in sys.platform: - os.system("open %s" % outfile) - print(outfile) - elif "posix" in sys.platform or "linux" in sys.platform: - os.system("xdg-open %s" % outfile) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/readme.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/readme.md deleted file mode 100644 index f4b3769..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/readme.md +++ /dev/null @@ -1,61 +0,0 @@ -# SmartMarkdown for Sublime Text 2 & 3 - -Author: Muchenxuan Tong (demon386@gmail.com) - -## Introduction -The plugin is aimed at making editing Markdown in Sublime Text 2 easier and more powerful. Ideally, I hope we can bring several amazing features of [Org-mode](http://org-mode.org) of Emacs into Sublime Text. - -## What's new -### v0.3: Adjust the position of folding mark to the end of headline. (added by [vovkkk](https://github.com/vovkkk) and [alehandrof](https://github.com/alehandrof)) -### v0.2: Support for Sublime Text 3 (added by [UNOwen](https://github.com/UNOwen).) -### v0.1.6: Add support and bindings for headline level changing. (added by [David Smith](https://github.com/djs070).) The key bindings are: **Super+Shift+,** for decreasing and **Super+Shift+.** for increasing. -### v0.1.5: Basic smart table (grid table) support added. Basic Pandoc intergration (added by [DanielMe](https://github.com/DanielMe/).) -### v0.1.3: Add support for global headling folding / unfolding. -### v0.1.2: Move between headlines supported! -- Use **Ctrl+c Ctrl+n** to move to the next headline (any level); **Ctrl+c Ctrl+p** to the previous one. -- Use **Ctrl+c Ctrl+f** to move to the next headline (same level or higher level); **Ctrl+c Ctrl+b** to the previous one. -- Fixed a bug on bullet list. Thanks to quodlibet (fixed in v0.1.1). - -### v0.1.0: Created! -- Smart Headline folding / unfolding is supported. -- Smart Lists is supported. - -## Done -- **Smart Headline folding / unfolding**. Right now you can fold / unfold headlines by pressing **TAB** on it. I assume you use the following formats: # Section; ## Subsection; ### Subsubsection ... -- **Global Headline Folding / unfolding**. **Shift+Tab** to Fold / Unfold all at any position. -- **Smart Order / Unordered list**. When editing lists, you can just press **ENTER** and this plugin will automatically continue the list. Once the content of the list becomes empty it will stop. -- **Move between headlines**. - - Use **Ctrl+c Ctrl+n** to move to the next headline (any level); **Ctrl+c Ctrl+p** to the previous one, for Mac. (**Ctrl+; Ctrl+n** and **Ctrl+; Ctrl+p** for Windows and Linux) - - Use **Ctrl+c Ctrl+f** to move to the next headline (same level or higher level); **Ctrl+c Ctrl+b** to the previous one, for Mac. (**Ctrl+; Ctrlf** and **Ctrl+; Ctrl+b** for Windows and Linux) -- **Adjust headline level** Added by [David Smith](https://github.com/djs070). - - **Super+Shift+,** for decreasing and **Super+Shift+.** for increasing headline levels. -- **Smart table** - - Currently, the smart table suppose only the Grid table format of [Pandoc](http://johnmacfarlane.net/pandoc/README.html). Use monospaced fonts, otherwise it would appear bizarre. - - The behavior is like the table in Org-mode. If you are unfamiliar with Org-mode, just use | (vertical line) to separate the column (e.g. | header1 | header 2 |), and use the **TAB** to reformat the table at point. Everything would fall into the place. Add +- and then press TAB for adding separator between rows. Add += and then press TAB for adding separator between header and the table body. Read the Grid tables section of [Pandoc Userg's Guide](http://johnmacfarlane.net/pandoc/README.html#tables) for more information. - - Use **TAB** to move forward a cell in table, **Shift+TAB** to move backward. - - Personally I plan to use grid table as a basis and add command for converting to other table formats if necessary. -- **Basic Pandoc integration with Pandoc** By integrating [SublimePandoc](https://github.com/jclement/SublimePandoc). Added by [DanielMe](https://github.com/DanielMe/). - - **Note**: If you need to generate PDF output, please make sure you have pdflatex available ([MacTeX](http://www.tug.org/mactex/2012/) for Mac, or TeX Live for other OS). Please also specify "tex_path" in the package settings (Preference - Package Settings - SmartMarkdown - Settings - User (see Settings - Default as an example.)) - -## Todo -- **Embeded R & Python Code for reproducible research** -- **Better Pandoc integration** Actual support for different Pandoc command line options etc. -- ... - - -## For Developers -- Whenever possible, please obey the [PEP 8](http://www.python.org/dev/peps/pep-0008/) style guide. This can be checked easily with the plugin SublimeLinter. -- git-flow is recommended (but not enforced) as a development work flow. For instruction please read [Why aren't you using git-flow?](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/). To adapt it, a command line tool [gitflow](https://github.com/nvie/gitflow/) is highly recommended. -- Please work on the develop branch, it's newer than master. the master branch is for users. - -# License -The plugin is licensed under the MIT license. - - -Copyright (C) <2012> Muchenxuan Tong <demon386@gmail.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/smart_folding.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/smart_folding.py deleted file mode 100644 index 466eae3..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/smart_folding.py +++ /dev/null @@ -1,214 +0,0 @@ -"""Smart folding is a feature borrowed from [Org-mode](http://org-mode.org). - -It enables folding / unfolding the headlines by simply pressing TAB on headlines. - -Global headline folding / unfolding is recommended to be trigged by Shift + TAB, -at anywhere. - -""" -# Author: Muchenxuan Tong <demon386@gmail.com> - -import re - -import sublime -import sublime_plugin - -try: - from . import headline - from .utilities import is_region_void -except ValueError: - import headline - from utilities import is_region_void - - -HEADLINE_PATTERN = re.compile(r'^(#+)\s.*') - - -class SmartNewLineCommand(sublime_plugin.TextCommand): - """Changes behavior of default 'insert line after' - Puts new line after folding mark if any. - """ - def run(self, edit): - points = [] - for s in self.view.sel(): - r = self.view.full_line(s) - if headline._is_region_folded(r.b + 1, self.view): - i = headline.region_of_content_of_headline_at_point(self.view, s.b) - else: - i = sublime.Region(r.a, r.b - 1) - points.append(i) - self.view.insert(edit, i.b, '\n') - self.view.sel().clear() - for p in points: - self.view.sel().add(p.b + 1) - - -class SmartFoldingCommand(sublime_plugin.TextCommand): - """Smart folding is used to fold / unfold headline at the point. - - It's designed to bind to TAB key, and if the current line is not - a headline, a \t would be inserted. - - """ - def run(self, edit): - ever_matched = False - for region in self.view.sel(): - matched = self.fold_or_unfold_headline_at_point(region.a) - if matched: - ever_matched = True - if not ever_matched: - for r in self.view.sel(): - self.view.insert(edit, r.a, '\t') - self.view.show(r) - - def fold_or_unfold_headline_at_point(self, from_point): - """Smart folding of the current headline. - - Unfold only when it's totally folded. Otherwise fold it. - - """ - _, level = headline.headline_and_level_at_point(self.view, - from_point) - # Not a headline, cancel - if level is None or not headline.is_scope_headline(self.view, from_point): - return False - - content_region = headline.region_of_content_of_headline_at_point(self.view, - from_point) - # If the content is empty, Nothing needs to be done. - if content_region is None: - # Return True because there is a headline anyway. - return True - - # Check if content region is folded to decide the action. - if self.is_region_totally_folded(content_region): - self.unfold_yet_fold_subheads(content_region, level) - else: - self.view.fold(sublime.Region(content_region.a - 1, content_region.b)) - return True - - def is_region_totally_folded(self, region): - """Decide if the region is folded. Treat empty region as folded.""" - if (region is None) or (region.a == region.b): - return True - - for i in self.view.folded_regions(): - if i.contains(region): - return True - return False - - def unfold_yet_fold_subheads(self, region, level): - """Unfold the region while keeping the subheadlines folded.""" - ## First unfold all - self.view.unfold(region) - ## Fold subheads - child_headline_region, _ = headline.find_headline(self.view, region.a, level, True, \ - headline.MATCH_CHILD) - - while (not is_region_void(child_headline_region) and child_headline_region.b <= region.b): - child_content_region = headline.region_of_content_of_headline_at_point(self.view, - child_headline_region.a) - if child_content_region is not None: - self.view.fold(sublime.Region(child_content_region.a - 1, child_content_region.b)) - search_start_point = child_content_region.b - else: - search_start_point = child_headline_region.b - - child_headline_region, _ = headline.find_headline(self.view, \ - search_start_point, level, True, \ - headline.MATCH_CHILD, - skip_headline_at_point=True) - - -class GlobalFoldingCommand(SmartFoldingCommand): - """Global folding / unfolding headlines at any point. - - Unfold only when top-level headlines are totally folded. - Otherwise fold. - - """ - def run(self, edit): - if self.is_global_folded(): - # Unfold all - self.unfold_all() - else: - self.fold_all() - - def is_global_folded(self): - """Check if all headlines are folded. - """ - region, level = headline.find_headline(self.view, 0, \ - headline.ANY_LEVEL, True) - # Treating no heeadline as folded, since unfolded all makes - # no harm in this situation. - if is_region_void(region): - return True - - point = region.a - # point can be zero - while (point is not None and region): - region = headline.region_of_content_of_headline_at_point(self.view, \ - point) - if not is_region_void(region): - point = region.b - if not self.is_region_totally_folded(region): - return False - else: - region, level = headline.find_headline(self.view, point, \ - headline.ANY_LEVEL, \ - True, - skip_headline_at_point=True) - if not is_region_void(region): - point = region.a - return True - - def unfold_all(self): - self.view.unfold(sublime.Region(0, self.view.size())) - self.view.show(self.view.sel()[0]) - - def fold_all(self): - region, level = headline.find_headline(self.view, \ - 0, \ - headline.ANY_LEVEL, \ - True) - - # At this point, headline region is sure to exist, otherwise it would be - # treated as gobal folded. (self.is_global_folded() would return True) - point = region.a - # point can be zero - while (point is not None and region): - region = headline.region_of_content_of_headline_at_point(self.view, \ - point) - if not is_region_void(region): - point = region.b - self.view.fold(sublime.Region(region.a - 1, region.b)) - region, level = headline.find_headline(self.view, point, \ - headline.ANY_LEVEL, - True, \ - skip_headline_at_point=True) - if not is_region_void(region): - point = region.a - self.adjust_cursors_and_view() - - def adjust_cursors_and_view(self): - """After folder, adjust cursors and view. - - If the current point is inside the folded region, move it move - otherwise it's easy to perform some unintentional editing. - - """ - folded_regions = self.view.folded_regions() - new_sel = [] - - for r in self.view.sel(): - for folded in folded_regions: - if folded.contains(r): - new_sel.append(sublime.Region(folded.b, folded.b)) - break - else: - new_sel.append(r) - - self.view.sel().clear() - for r in new_sel: - self.view.sel().add(r) - self.view.show(r) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/smart_list.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/smart_list.py deleted file mode 100644 index c1e229f..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/smart_list.py +++ /dev/null @@ -1,57 +0,0 @@ -"""Smart list is used to automatially continue the current list.""" -# Author: Muchenxuan Tong <demon386@gmail.com> - -import re - -import sublime -import sublime_plugin - - -ORDER_LIST_PATTERN = re.compile(r"(\s*)(\d+)(\.\s+)\S+") -UNORDER_LIST_PATTERN = re.compile(r"(\s*[-+\**]+)(\s+)\S+") -EMPTY_LIST_PATTERN = re.compile(r"(\s*([-+\**]|\d+\.+))\s+$") - - -class SmartListCommand(sublime_plugin.TextCommand): - def run(self, edit): - for region in self.view.sel(): - line_region = self.view.line(region) - # the content before point at the current line. - before_point_region = sublime.Region(line_region.a, - region.a) - before_point_content = self.view.substr(before_point_region) - - # Disable smart list when folded. - folded = False - for i in self.view.folded_regions(): - if i.contains(before_point_region): - self.view.insert(edit, region.a, '\n') - folded = True - if folded: - break - - match = EMPTY_LIST_PATTERN.match(before_point_content) - if match: - self.view.erase(edit, before_point_region) - break - - match = ORDER_LIST_PATTERN.match(before_point_content) - if match: - insert_text = match.group(1) + \ - str(int(match.group(2)) + 1) + \ - match.group(3) - self.view.insert(edit, region.a, "\n" + insert_text) - break - - match = UNORDER_LIST_PATTERN.match(before_point_content) - if match: - insert_text = match.group(1) + match.group(2) - self.view.insert(edit, region.a, "\n" + insert_text) - break - - self.view.insert(edit, region.a, '\n') - self.adjust_view() - - def adjust_view(self): - for region in self.view.sel(): - self.view.show(region) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/smart_table.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/smart_table.py deleted file mode 100644 index 51c6677..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/smart_table.py +++ /dev/null @@ -1,87 +0,0 @@ -"""Smart is inspired by the Table behavior of Org-mode. - -Markdown itself doesn't support grid table, yet pandoc does. - -@todo: add a key binding for converting grid table to the simple one -""" -# Author: Muchenxuan Tong <demon386@gmail.com> -# LICENSE: MIT - -import sublime -import sublime_plugin - -try: - from . import table -except ValueError: - import table - - -class SmartTable(sublime_plugin.TextCommand): - def run(self, edit, forward=True): - new_sel = [] - for r in self.view.sel(): - point = r.a - - for i in self.view.folded_regions(): - if i.contains(sublime.Region(point, point)): - return - t = table.convert_table_at_point_as_list(self.view, point) - t = table.reformat_table_list(t) - t_str = table.convert_table_list_to_str(t) - - # Both are 0-based - cur_row_num, cur_col_num = table.get_point_row_and_col(self.view, point) - table_row_num = len(t) - line_num, _ = self.view.rowcol(point) - start_line_num = line_num - cur_row_num - start_point = self.view.text_point(line_num - cur_row_num, 0) - end_line_num = line_num + table_row_num - cur_row_num - 1 - end_line_start_point = self.view.text_point(end_line_num, 0) - end_point = self.view.line(end_line_start_point).b - - # Erase the previous table region, use the new one for substitution. - self.view.erase(edit, sublime.Region(start_point, end_point)) - self.view.insert(edit, start_point, t_str) - - if forward: - if cur_col_num is None or cur_col_num >= len(t[0]) - 1: - line_num += 1 - while(table.is_line_separator(self.view, line_num)): - line_num += 1 - cur_col_num = 0 - else: - cur_col_num += 1 - else: - if cur_col_num is None or cur_col_num <= 0: - line_num -= 1 - while(table.is_line_separator(self.view, line_num)): - line_num -= 1 - cur_col_num = len(t[0]) - 1 - else: - cur_col_num -= 1 - - # Add a new line when at the end of the table. - if line_num < start_line_num or line_num > end_line_num: - col_pos = 0 - if line_num > end_line_num: - self.view.insert(edit, self.view.text_point(line_num, 0), "\n") - else: - col_pos = self.calculate_col_point(t, cur_col_num) - - new_sel.append(self.view.text_point(line_num, col_pos)) - - self.view.sel().clear() - for r in new_sel: - self.view.sel().add(r) - self.view.show(r) - - def calculate_col_point(self, formatted_table, col_num): - i = 0 - while table.SEPARATOR_PATTERN.match(formatted_table[i][0]): - i += 1 - - cols_length = [len(j) for j in formatted_table[i]] - point = 2 - for i in range(col_num): - point += cols_length[i] + 3 - return point diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/table.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/table.py deleted file mode 100644 index 41348c4..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/table.py +++ /dev/null @@ -1,207 +0,0 @@ -"""Utilities function for working with grid table of Pandoc - -Terminologies - -- Table list :: This is not a list of tables, but rather converting the table as -a nested python list. Each row is a sub-list in the table list. - -""" -# Author: Muchenxuan Tong <demon386@gmail.com> -# LICENSE: MIT - -import re -import copy - -import sublime - -try: - from . import utilities -except ValueError: - import utilities - -TABLE_PATTERN = re.compile(r"\s*\|") -SEPARATOR_PATTERN = re.compile(r"\s*(\+[=-])") - - -def convert_table_at_point_as_list(view, from_point): - """Get the table at the point. - Transform the table to python list. - - Returns - ------- - table: list - A nested list representing the table. - indent: "str" (@todo not impelmented yet) - String of indentation, used in every row. - - """ - table_above = convert_table_above_or_below_as_list(view, from_point, above=True) - table_below = convert_table_above_or_below_as_list(view, from_point, above=False) - row_at_point = convert_row_at_point_as_list(view, from_point) - - table = table_above + [row_at_point] + table_below - return table - - -def convert_table_above_or_below_as_list(view, from_point, above): - """Convert the table above the point as python list. - - Returns - ------- - table: list - A nested list representing the table. - - """ - line_num, _ = view.rowcol(from_point) - line_num += - 1 if above else 1 - - line_text = utilities.text_at_line(view, line_num) - table = [] - - while line_text and (TABLE_PATTERN.match(line_text) or - SEPARATOR_PATTERN.match(line_text)): - table.append(_convert_row_text_as_list(line_text)) - line_num += -1 if above else 1 - line_text = utilities.text_at_line(view, line_num) - - if above: - table = table[::-1] - - return table - - -def convert_row_at_point_as_list(view, from_point): - """Convert the row at point as a python list. - """ - line_num, _ = view.rowcol(from_point) - line_text = utilities.text_at_line(view, line_num) - - return _convert_row_text_as_list(line_text) - - -def _convert_row_text_as_list(row_text): - """Convert the text of a row into a python list. - - Paramters - --------- - row_text: str - The text of the row. - - Returns - ------- - lst: list - The converted list. - - """ - split_row = row_text.split("|") - - if len(split_row) > 2 and split_row[-1].strip() == "": - lst = split_row[1:-1] - else: - lst = split_row[1:] - - match = SEPARATOR_PATTERN.match(row_text) - if match: - lst = [match.group(1)] - - return [i.strip() for i in lst] - - -def reformat_table_list(table): - """Reformat & align the table list. - - After this, every column is of the same length, - and every row is of the same number of column. - - """ - cols_num = max([len(row) for row in table]) - cols_length = _get_cols_length(table, cols_num) - - new_table = [] - for row in table: - new_row = [] - if not SEPARATOR_PATTERN.match(row[0]): - for i in range(cols_num): - try: - col = row[i] - new_row.append(col + " " * (cols_length[i] - len(col))) - except: - new_row.append(" " * cols_length[i]) - else: - marker = row[0][1] - for i in range(cols_num): - new_row.append(marker * (cols_length[i] + 2)) - # Add a mark for recognization - new_row[0] = "+" + new_row[0] - new_table.append(new_row) - return new_table - - -def convert_table_list_to_str(table): - """Convert the python list to str for outputing. - - """ - table_str = "" - table = copy.deepcopy(table) - for row in table: - if SEPARATOR_PATTERN.match(row[0]): - row[0] = row[0][1:] # Remove the mark added in reformat_table_list - row_str = "+" - for col_str in row: - row_str += col_str + "+" - else: - row_str = "|" - for col_str in row: - row_str += " " + col_str + " " + "|" - table_str += row_str + "\n" - return table_str[:-1] - - -def _get_cols_length(table, cols_num): - """Return the max length of every columns. - """ - cols_length = [0] * cols_num - for row in table: - for (i, col) in enumerate(row): - col_len = len(col) - if col_len > cols_length[i]: - cols_length[i] = col_len - return cols_length - - -def get_point_row_and_col(view, from_point): - """Return the row and col the current point is in the table. - """ - line_num, _ = view.rowcol(from_point) - line_num -= 1 - - line_text = utilities.text_at_line(view, line_num) - row_num = 0 - while line_text and (TABLE_PATTERN.match(line_text) or - SEPARATOR_PATTERN.match(line_text)): - row_num += 1 - line_num -= 1 - line_text = utilities.text_at_line(view, line_num) - - line_start_point = view.line(from_point) - region = sublime.Region(line_start_point.a, from_point) - precedding_text = view.substr(region) - - split_row = precedding_text.split("|") - if len(split_row) >= 2: - col_num = len(split_row) - 2 - elif split_row[0].strip() == "": - col_num = -1 - else: - col_num = None - return (row_num, col_num) - - -def is_line_separator(view, line_num): - """Check if the current line is a separator. - """ - text = utilities.text_at_line(view, line_num) - if text and SEPARATOR_PATTERN.match(text): - return True - else: - return False diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/utilities.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/utilities.py deleted file mode 100644 index 2510143..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SmartMarkdown/utilities.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Some utility functions for working with sublime. -""" - - -def text_at_line(view, line_num): - """Return the content at line. None if out of boundary.""" - if line_num < 0: - return None - - max_line_num, _ = view.rowcol(view.size()) - if line_num > max_line_num: - return None - - point = view.text_point(line_num, 0) - line_region = view.line(point) - return view.substr(line_region) - -def is_region_void(region): - if region == None: - return True - if region.a == -1 and region.b == -1: - return True - return False \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/README.mkd b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/README.mkd deleted file mode 100644 index a0d0f05..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/README.mkd +++ /dev/null @@ -1,80 +0,0 @@ -Solarized Colorscheme for Sublime Text -============================= - -See the [Solarized homepage](http://ethanschoonover.com/solarized) for screenshots, -details and colorscheme versions for Vim, Mutt, popular terminal emulators and -other applications. - - -Downloads ---------- - -If you have come across this page via github please visit the main [Solarized homepage](http://ethanschoonover.com/solarized). The original [Solarized repository] has many more themes and a number of [test files]. - -[Solarized homepage]: http://ethanschoonover.com/solarized -[Solarized repository]: https://github.com/altercation/solarized -[test files]: https://github.com/altercation/solarized/tree/master/utils/tests - - -Sublime Text Support ---------- - -This theme is fully compatible with [Sublime Text][Sublime]! - -To install it, ensure that you have installed Sublime Package Control following [these instructions][SublimePackage] - -Open the Sublime command palette with `Ctrl + Shift + P`, type / select `Package Control: Install Package`, -then from the package control list, type / select `Solarized Color Scheme (TextMate)` - -Note that packages are auto-updating, so as new modifications are made they will automatically be installed. - -[Sublime]: http://www.sublimetext.com/dev -[SublimePackage]: http://wbond.net/sublime_packages/package_control/installation - - -Contribute ---------- - -The goal is to get as-close-as-possible to the rendering of the same file in Vim. If you would like to help, here's how to get involved. - - -1. Fork this repo and checkout your own copy. -2. Download the [sample documents](https://github.com/altercation/solarized/tree/master/utils/tests). -3. Checkout this guide to [TextMate theme development](http://manual.macromates.com/en/themes). -4. Check the [issues](https://github.com/deplorableword/textmate-solarized/issues) to see what needs working on. - -Contributors ---------- -* [deplorableword](https://github.com/deplorableword) -* [fentie](https://github.com/fentie) -* [bmthykm](https://github.com/bmthykm) -* [Zegnat](https://github.com/zegnat) -* [markstory](https://github.com/markstory) -* [rays](https://github.com/rays) -* [joshcarr](https://github.com/joshcarr) -* [thatRD](https://github.com/thatRD) -* [oesmith](https://github.com/oesmith) -* [evanmoran](https://github.com/evanmoran) -* [iristyle](https://github.com/iristyle) -* [braver](https://github.com/braver) - -License -------- - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/Solarized (dark).tmTheme b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/Solarized (dark).tmTheme deleted file mode 100644 index 5e88a48..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/Solarized (dark).tmTheme +++ /dev/null @@ -1,2036 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>name</key> - <string>Solarized (dark)</string> - <key>settings</key> - <array> - <dict> - <key>settings</key> - <dict> - <key>background</key> - <string>#002B36</string> - <key>caret</key> - <string>#839496</string> - <key>foreground</key> - <string>#839496</string> - <key>invisibles</key> - <string>#073642</string> - <key>lineHighlight</key> - <string>#073642</string> - <key>selection</key> - <string>#EEE8D5</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Comment</string> - <key>scope</key> - <string>comment</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>String</string> - <key>scope</key> - <string>string</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>StringNumber</string> - <key>scope</key> - <string>string</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Regexp</string> - <key>scope</key> - <string>string.regexp</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Number</string> - <key>scope</key> - <string>constant.numeric</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#D33682</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Variable</string> - <key>scope</key> - <string>variable.language, variable.other</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Keyword</string> - <key>scope</key> - <string>keyword</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Storage</string> - <key>scope</key> - <string>storage</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Class name</string> - <key>scope</key> - <string>entity.name.class, entity.name.type.class</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Function name</string> - <key>scope</key> - <string>entity.name.function</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Variable start</string> - <key>scope</key> - <string>punctuation.definition.variable</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Embedded code markers</string> - <key>scope</key> - <string>punctuation.section.embedded.begin, punctuation.section.embedded.end</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Built-in constant</string> - <key>scope</key> - <string>constant.language, meta.preprocessor</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Support.construct</string> - <key>scope</key> - <string>support.function.construct, keyword.other.new</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>User-defined constant</string> - <key>scope</key> - <string>constant.character, constant.other</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Inherited class</string> - <key>scope</key> - <string>entity.other.inherited-class</string> - <key>settings</key> - <dict/> - </dict> - <dict> - <key>name</key> - <string>Function argument</string> - <key>scope</key> - <string>variable.parameter</string> - <key>settings</key> - <dict/> - </dict> - <dict> - <key>name</key> - <string>Tag name</string> - <key>scope</key> - <string>entity.name.tag</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>bold</string> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tag start/end</string> - <key>scope</key> - <string>punctuation.definition.tag.html, punctuation.definition.tag.begin, punctuation.definition.tag.end</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tag attribute</string> - <key>scope</key> - <string>entity.other.attribute-name</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#93A1A1</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Library function</string> - <key>scope</key> - <string>support.function</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Continuation</string> - <key>scope</key> - <string>punctuation.separator.continuation</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Library constant</string> - <key>scope</key> - <string>support.constant</string> - <key>settings</key> - <dict/> - </dict> - <dict> - <key>name</key> - <string>Library class/type</string> - <key>scope</key> - <string>support.type, support.class</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Library Exception</string> - <key>scope</key> - <string>support.type.exception</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Special</string> - <key>scope</key> - <string>keyword.other.special-method</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Library variable</string> - <key>scope</key> - <string>support.other.variable</string> - <key>settings</key> - <dict/> - </dict> - <dict> - <key>name</key> - <string>Invalid</string> - <key>scope</key> - <string>invalid</string> - <key>settings</key> - <dict/> - </dict> - <dict> - <key>name</key> - <string>Quoted String</string> - <key>scope</key> - <string>string.quoted.double, string.quoted.single</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Quotes</string> - <key>scope</key> - <string>punctuation.definition.string.begin, punctuation.definition.string.end</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: Property name (body)</string> - <key>scope</key> - <string>entity.name.tag.css, support.type.property-name.css, meta.property-name.css, support.type.property-name.scss</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: @ rules (purple)</string> - <key>scope</key> - <string>punctuation.definition.keyword.scss, punctuation.definition.keyword.css, keyword.control.at-rule.charset.css, keyword.control.at-rule.charset.scss, keyword.control.each.css, keyword.control.each.scss, keyword.control.else.css, keyword.control.else.scss, keyword.control.at-rule.import.css, keyword.control.at-rule.import.scss, keyword.control.at-rule.fontface.css, keyword.control.at-rule.fontface.scss, keyword.control.for.css, keyword.control.for.scss, keyword.control.at-rule.function.css, keyword.control.at-rule.function.scss, keyword.control.if.css, keyword.control.if.scss, keyword.control.at-rule.include.scss, keyword.control.at-rule.media.css, keyword.control.at-rule.media.scss, keyword.control.at-rule.font-face.css, keyword.control.at-rule.font-face.scss, meta.at-rule.import.css, variable.other.less, variable.declaration.less, variable.interpolation.less, meta.at-rule.media.scss</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#6C71c4</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: Numeric Value (blue)</string> - <key>scope</key> - <string>constant.numeric.css, keyword.other.unit.css, keyword.unit.css, constant.other.color.rgb-value.css, constant.numeric.scss, constant.other.color.rgb-value.scss, keyword.other.unit.scss, punctuation.definition.constant.scss, punctuation.definition.constant.css, constant.other.rgb-value.css</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: String, value and constants (azure)</string> - <key>scope</key> - <string>variable.parameter.url.scss, meta.property-value.css, meta.property-value.scss, support.constant.property-value.scss, support.constant.font-name.scss, string.quoted.single.css, string.quoted.double.css, constant.character.escaped.css, string.quoted.variable.parameter.url, punctuation.definition.string.begin.scss, punctuation.definition.string.begin.css, punctuation.definition.string.end.scss, punctuation.definition.string.end.css, support.constant.property-value.css</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: !Important (red)</string> - <key>scope</key> - <string>keyword.other.important.css</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: Standard color value (orange)</string> - <key>scope</key> - <string>support.constant.color, invalid.deprecated.color.w3c-non-standard-color-name.scss</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4b16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: : , () (body)</string> - <key>scope</key> - <string>punctuation.terminator.rule.css, punctuation.section.function.css, punctuation.section.function.scss, punctuation.separator.key-value.csspunctuation.scss, punctuation.css, keyword.operator.less, entity.name.tag.wildcard.scss, entity.name.tag.wildcard.css, entity.name.tag.reference.scss</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#657B83</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: Selector > [] and non-spec tags (body)</string> - <key>scope</key> - <string>meta.selector.css</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#657B83</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: Tag (green)</string> - <key>scope</key> - <string>entity.name.tag.css, entity.name.tag.scss</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS .class (yellow)</string> - <key>scope</key> - <string>entity.other.attribute-name.class.css, entity.other.less.mixin</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: #id (yellow)</string> - <key>scope</key> - <string>source.css entity.other.attribute-name.id</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>bold</string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS :pseudo (orange)</string> - <key>scope</key> - <string>entity.other.attribute-name.pseudo-element.css, entity.other.attribute-name.pseudo-class.css</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SCSS: Variables (pink)</string> - <key>scope</key> - <string>variable, variable.scss</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#D33682</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>JS: Function Name</string> - <key>scope</key> - <string>meta.function.js, entity.name.function.js, support.function.dom.js</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>JS: Source</string> - <key>scope</key> - <string>text.html.basic source.js.embedded.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>JS: Function</string> - <key>scope</key> - <string>storage.type.function.js</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>JS: Numeric Constant</string> - <key>scope</key> - <string>constant.numeric.js</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>JS: []</string> - <key>scope</key> - <string>meta.brace.square.js</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>JS: Storage Type</string> - <key>scope</key> - <string>storage.type.js</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>()</string> - <key>scope</key> - <string>meta.brace.round, punctuation.definition.parameters.begin.js, punctuation.definition.parameters.end.js</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#93A1A1</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>{}</string> - <key>scope</key> - <string>meta.brace.curly.js</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: Doctype</string> - <key>scope</key> - <string>entity.name.tag.doctype.html, meta.tag.sgml.html, string.quoted.double.doctype.identifiers-and-DTDs.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: Comment Block</string> - <key>scope</key> - <string>comment.block.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: Script</string> - <key>scope</key> - <string>entity.name.tag.script.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: Style</string> - <key>scope</key> - <string>source.css.embedded.html string.quoted.double.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: Text</string> - <key>scope</key> - <string>text.html.ruby</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>bold</string> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: =</string> - <key>scope</key> - <string>text.html.basic meta.tag.other.html, text.html.basic meta.tag.any.html, text.html.basic meta.tag.block.any, text.html.basic meta.tag.inline.any, text.html.basic meta.tag.structure.any.html, text.html.basic source.js.embedded.html, punctuation.separator.key-value.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#657B83</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: something=</string> - <key>scope</key> - <string>text.html.basic entity.other.attribute-name.html</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#657B83</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: "</string> - <key>scope</key> - <string>text.html.basic meta.tag.structure.any.html punctuation.definition.string.begin.html, punctuation.definition.string.begin.html, punctuation.definition.string.end.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: <tag></string> - <key>scope</key> - <string>entity.name.tag.block.any.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>bold</string> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: style</string> - <key>scope</key> - <string>source.css.embedded.html entity.name.tag.style.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: <style></string> - <key>scope</key> - <string>entity.name.tag.style.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: {}</string> - <key>scope</key> - <string>text.html.basic, punctuation.section.property-list.css</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: Embeddable</string> - <key>scope</key> - <string>source.css.embedded.html, comment.block.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Variable definition</string> - <key>scope</key> - <string>punctuation.definition.variable.ruby</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Function Name</string> - <key>scope</key> - <string>meta.function.method.with-arguments.ruby</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#657B83</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Variable</string> - <key>scope</key> - <string>variable.language.ruby</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Function</string> - <key>scope</key> - <string>entity.name.function.ruby</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Keyword Control</string> - <key>scope</key> - <string>keyword.control.ruby, keyword.control.def.ruby</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>bold</string> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Class</string> - <key>scope</key> - <string>keyword.control.class.ruby, meta.class.ruby</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Class Name</string> - <key>scope</key> - <string>entity.name.type.class.ruby</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Keyword</string> - <key>scope</key> - <string>keyword.control.ruby</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Support Class</string> - <key>scope</key> - <string>support.class.ruby</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Special Method</string> - <key>scope</key> - <string>keyword.other.special-method.ruby</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Constant</string> - <key>scope</key> - <string>constant.language.ruby, constant.numeric.ruby</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Constant Other</string> - <key>scope</key> - <string>variable.other.constant.ruby</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: :symbol</string> - <key>scope</key> - <string>constant.other.symbol.ruby</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Punctuation Section ''</string> - <key>scope</key> - <string>punctuation.section.embedded.ruby, punctuation.definition.string.begin.ruby, punctuation.definition.string.end.ruby</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Special Method</string> - <key>scope</key> - <string>keyword.other.special-method.ruby</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Include</string> - <key>scope</key> - <string>keyword.control.import.include.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: erb =</string> - <key>scope</key> - <string>text.html.ruby meta.tag.inline.any.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: erb ""</string> - <key>scope</key> - <string>text.html.ruby punctuation.definition.string.begin, text.html.ruby punctuation.definition.string.end</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Quoted Single</string> - <key>scope</key> - <string>punctuation.definition.string.begin, punctuation.definition.string.end</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Class Names</string> - <key>scope</key> - <string>support.class.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#93A1A1</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: []</string> - <key>scope</key> - <string>keyword.operator.index-start.php, keyword.operator.index-end.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Array</string> - <key>scope</key> - <string>meta.array.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Array()</string> - <key>scope</key> - <string>meta.array.php support.function.construct.php, meta.array.empty.php support.function.construct.php</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Array Construct</string> - <key>scope</key> - <string>support.function.construct.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Array Begin</string> - <key>scope</key> - <string>punctuation.definition.array.begin, punctuation.definition.array.end</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Numeric Constant</string> - <key>scope</key> - <string>constant.numeric.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: New</string> - <key>scope</key> - <string>keyword.other.new.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: ::</string> - <key>scope</key> - <string>keyword.operator.class</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#93A1A1</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Other Property</string> - <key>scope</key> - <string>variable.other.property.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Class</string> - <key>scope</key> - <string>storage.modifier.extends.php, storage.type.class.php, keyword.operator.class.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Semicolon</string> - <key>scope</key> - <string>punctuation.terminator.expression.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Inherited Class</string> - <key>scope</key> - <string>meta.other.inherited-class.php</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Storage Type</string> - <key>scope</key> - <string>storage.type.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Function</string> - <key>scope</key> - <string>entity.name.function.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Function Construct</string> - <key>scope</key> - <string>support.function.construct.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Function Call</string> - <key>scope</key> - <string>entity.name.type.class.php, meta.function-call.php, meta.function-call.static.php, meta.function-call.object.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Comment</string> - <key>scope</key> - <string>keyword.other.phpdoc</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Source Emebedded</string> - <key>scope</key> - <string>source.php.embedded.block.html</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Storage Type Function</string> - <key>scope</key> - <string>storage.type.function.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>C: constant</string> - <key>scope</key> - <string>constant.numeric.c</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>C: Meta Preprocessor</string> - <key>scope</key> - <string>meta.preprocessor.c.include, meta.preprocessor.macro.c</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>C: Keyword</string> - <key>scope</key> - <string>keyword.control.import.define.c, keyword.control.import.include.c</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>C: Function Preprocessor</string> - <key>scope</key> - <string>entity.name.function.preprocessor.c</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>C: include <something.c></string> - <key>scope</key> - <string>meta.preprocessor.c.include string.quoted.other.lt-gt.include.c, meta.preprocessor.c.include punctuation.definition.string.begin.c, meta.preprocessor.c.include punctuation.definition.string.end.c</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>C: Function</string> - <key>scope</key> - <string>support.function.C99.c, support.function.any-method.c, entity.name.function.c</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#93A1A1</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>C: "</string> - <key>scope</key> - <string>punctuation.definition.string.begin.c, punctuation.definition.string.end.c</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>C: Storage Type</string> - <key>scope</key> - <string>storage.type.c</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>diff: header</string> - <key>scope</key> - <string>meta.diff, meta.diff.header</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#B58900</string> - <key>fontStyle</key> - <string>italic</string> - <key>foreground</key> - <string>#EEE8D5</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>diff: deleted</string> - <key>scope</key> - <string>markup.deleted</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#EEE8D5</string> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>diff: changed</string> - <key>scope</key> - <string>markup.changed</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#EEE8D5</string> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>diff: inserted</string> - <key>scope</key> - <string>markup.inserted</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#EEE8D5</string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>reST raw</string> - <key>scope</key> - <string>text.restructuredtext markup.raw</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Other: Removal</string> - <key>scope</key> - <string>other.package.exclude, other.remove</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Other: Add</string> - <key>scope</key> - <string>other.add</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: {}</string> - <key>scope</key> - <string>punctuation.section.group.tex , punctuation.definition.arguments.begin.latex, punctuation.definition.arguments.end.latex, punctuation.definition.arguments.latex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: {text}</string> - <key>scope</key> - <string>meta.group.braces.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Other Math</string> - <key>scope</key> - <string>string.other.math.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: {var}</string> - <key>scope</key> - <string>variable.parameter.function.latex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Math \\</string> - <key>scope</key> - <string>punctuation.definition.constant.math.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Constant Math</string> - <key>scope</key> - <string>text.tex.latex constant.other.math.tex, constant.other.general.math.tex, constant.other.general.math.tex, constant.character.math.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Other Math String</string> - <key>scope</key> - <string>string.other.math.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: $</string> - <key>scope</key> - <string>punctuation.definition.string.begin.tex, punctuation.definition.string.end.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: \label</string> - <key>scope</key> - <string>keyword.control.label.latex, text.tex.latex constant.other.general.math.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: \label { }</string> - <key>scope</key> - <string>variable.parameter.definition.label.latex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Function</string> - <key>scope</key> - <string>support.function.be.latex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Support Function Section</string> - <key>scope</key> - <string>support.function.section.latex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Support Function</string> - <key>scope</key> - <string>support.function.general.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Comment</string> - <key>scope</key> - <string>punctuation.definition.comment.tex, comment.line.percentage.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Reference Label</string> - <key>scope</key> - <string>keyword.control.ref.latex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Python: storage</string> - <key>scope</key> - <string>storage.type.class.python, storage.type.function.python, storage.modifier.global.python</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Python: import</string> - <key>scope</key> - <string>keyword.control.import.python, keyword.control.import.from.python</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Python: Support.exception</string> - <key>scope</key> - <string>support.type.exception.python</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Shell: builtin</string> - <key>scope</key> - <string>support.function.builtin.shell</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Shell: variable</string> - <key>scope</key> - <string>variable.other.normal.shell</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Shell: DOT_FILES</string> - <key>scope</key> - <string>source.shell</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Shell: meta scope in loop</string> - <key>scope</key> - <string>meta.scope.for-in-loop.shell, variable.other.loop.shell</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Shell: ""</string> - <key>scope</key> - <string>punctuation.definition.string.end.shell, punctuation.definition.string.begin.shell</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Shell: Meta Block</string> - <key>scope</key> - <string>meta.scope.case-block.shell, meta.scope.case-body.shell</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Shell: []</string> - <key>scope</key> - <string>punctuation.definition.logical-expression.shell</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Shell: Comment</string> - <key>scope</key> - <string>comment.line.number-sign.shell</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Java: import</string> - <key>scope</key> - <string>keyword.other.import.java</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Java: meta-import</string> - <key>scope</key> - <string>storage.modifier.import.java</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Java: Class</string> - <key>scope</key> - <string>meta.class.java storage.modifier.java</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Java: /* comment */</string> - <key>scope</key> - <string>source.java comment.block</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Java: /* @param */</string> - <key>scope</key> - <string>comment.block meta.documentation.tag.param.javadoc keyword.other.documentation.param.javadoc</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Perl: variables</string> - <key>scope</key> - <string>punctuation.definition.variable.perl, variable.other.readwrite.global.perl, variable.other.predefined.perl, keyword.operator.comparison.perl</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Perl: functions</string> - <key>scope</key> - <string>support.function.perl</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Perl: comments</string> - <key>scope</key> - <string>comment.line.number-sign.perl</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Perl: quotes</string> - <key>scope</key> - <string>punctuation.definition.string.begin.perl, punctuation.definition.string.end.perl</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Perl: \char</string> - <key>scope</key> - <string>constant.character.escape.perl</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>Name</key> - <string>Markdown punctuation</string> - <key>scope</key> - <string>markup.list, text.html.markdown punctuation.definition, meta.separator.markdown</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4b16</string> - </dict> - </dict> - <dict> - <key>Name</key> - <string>Markdown heading</string> - <key>scope</key> - <string>markup.heading</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>Name</key> - <string>Markdown text inside some block element</string> - <key>scope</key> - <string>markup.quote, meta.paragraph.list</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>Name</key> - <string>Markdown em</string> - <key>scope</key> - <string>markup.italic</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - </dict> - </dict> - <dict> - <key>Name</key> - <string>Markdown strong</string> - <key>scope</key> - <string>markup.bold</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>bold</string> - </dict> - </dict> - <dict> - <key>Name</key> - <string>Markdown reference</string> - <key>scope</key> - <string>markup.underline.link.markdown, meta.link.inline punctuation.definition.metadata, meta.link.reference.markdown punctuation.definition.constant, meta.link.reference.markdown constant.other.reference</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>Name</key> - <string>Markdown linebreak</string> - <key>scope</key> - <string>meta.paragraph.markdown meta.dummy.line-break</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#6C71c4</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SublimeLinter Annotations</string> - <key>scope</key> - <string>sublimelinter.notes</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#eee8d5</string> - <key>foreground</key> - <string>#eee8d5</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SublimeLinter Error Outline</string> - <key>scope</key> - <string>sublimelinter.outline.illegal</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#93a1a1</string> - <key>foreground</key> - <string>#93a1a1</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SublimeLinter Error Underline</string> - <key>scope</key> - <string>sublimelinter.underline.illegal</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#dc322f</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SublimeLinter Warning Outline</string> - <key>scope</key> - <string>sublimelinter.outline.warning</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#839496</string> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SublimeLinter Warning Underline</string> - <key>scope</key> - <string>sublimelinter.underline.warning</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#b58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SublimeLinter Violation Outline</string> - <key>scope</key> - <string>sublimelinter.outline.violation</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#657b83</string> - <key>foreground</key> - <string>#657b83</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SublimeLinter Violation Underline</string> - <key>scope</key> - <string>sublimelinter.underline.violation</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#cb4b16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SublimeBracketHighlighter</string> - <key>scope</key> - <string>brackethighlighter.all</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#002b36</string> - <key>foreground</key> - <string>#cb4b16</string> - </dict> - </dict> - </array> - <key>uuid</key> - <string>A4299D9B-1DE5-4BC4-87F6-A757E71B1597</string> -</dict> -</plist> diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/Solarized (light).tmTheme b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/Solarized (light).tmTheme deleted file mode 100644 index 3123aa1..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/Solarized (light).tmTheme +++ /dev/null @@ -1,2036 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>name</key> - <string>Solarized (light)</string> - <key>settings</key> - <array> - <dict> - <key>settings</key> - <dict> - <key>background</key> - <string>#FDF6E3</string> - <key>caret</key> - <string>#657B83</string> - <key>foreground</key> - <string>#657B83</string> - <key>invisibles</key> - <string>#EEE8D5</string> - <key>lineHighlight</key> - <string>#EEE8D5</string> - <key>selection</key> - <string>#073642</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Comment</string> - <key>scope</key> - <string>comment</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#93A1A1</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>String</string> - <key>scope</key> - <string>string</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>StringNumber</string> - <key>scope</key> - <string>string</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Regexp</string> - <key>scope</key> - <string>string.regexp</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Number</string> - <key>scope</key> - <string>constant.numeric</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#D33682</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Variable</string> - <key>scope</key> - <string>variable.language, variable.other</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Keyword</string> - <key>scope</key> - <string>keyword</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Storage</string> - <key>scope</key> - <string>storage</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Class name</string> - <key>scope</key> - <string>entity.name.class, entity.name.type.class</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Function name</string> - <key>scope</key> - <string>entity.name.function</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Variable start</string> - <key>scope</key> - <string>punctuation.definition.variable</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Embedded code markers</string> - <key>scope</key> - <string>punctuation.section.embedded.begin, punctuation.section.embedded.end</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Built-in constant</string> - <key>scope</key> - <string>constant.language, meta.preprocessor</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Support.construct</string> - <key>scope</key> - <string>support.function.construct, keyword.other.new</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>User-defined constant</string> - <key>scope</key> - <string>constant.character, constant.other</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Inherited class</string> - <key>scope</key> - <string>entity.other.inherited-class</string> - <key>settings</key> - <dict/> - </dict> - <dict> - <key>name</key> - <string>Function argument</string> - <key>scope</key> - <string>variable.parameter</string> - <key>settings</key> - <dict/> - </dict> - <dict> - <key>name</key> - <string>Tag name</string> - <key>scope</key> - <string>entity.name.tag</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>bold</string> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tag start/end</string> - <key>scope</key> - <string>punctuation.definition.tag.html, punctuation.definition.tag.begin, punctuation.definition.tag.end</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#93A1A1</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tag attribute</string> - <key>scope</key> - <string>entity.other.attribute-name</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#93A1A1</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Library function</string> - <key>scope</key> - <string>support.function</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Continuation</string> - <key>scope</key> - <string>punctuation.separator.continuation</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Library constant</string> - <key>scope</key> - <string>support.constant</string> - <key>settings</key> - <dict/> - </dict> - <dict> - <key>name</key> - <string>Library class/type</string> - <key>scope</key> - <string>support.type, support.class</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Library Exception</string> - <key>scope</key> - <string>support.type.exception</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Special</string> - <key>scope</key> - <string>keyword.other.special-method</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Library variable</string> - <key>scope</key> - <string>support.other.variable</string> - <key>settings</key> - <dict/> - </dict> - <dict> - <key>name</key> - <string>Invalid</string> - <key>scope</key> - <string>invalid</string> - <key>settings</key> - <dict/> - </dict> - <dict> - <key>name</key> - <string>Quoted String</string> - <key>scope</key> - <string>string.quoted.double, string.quoted.single</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Quotes</string> - <key>scope</key> - <string>punctuation.definition.string.begin, punctuation.definition.string.end</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: Property name (body)</string> - <key>scope</key> - <string>entity.name.tag.css, support.type.property-name.css, meta.property-name.css, support.type.property-name.scss</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#657B83</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: @ rules (purple)</string> - <key>scope</key> - <string>punctuation.definition.keyword.scss, punctuation.definition.keyword.css, keyword.control.at-rule.charset.css, keyword.control.at-rule.charset.scss, keyword.control.each.css, keyword.control.each.scss, keyword.control.else.css, keyword.control.else.scss, keyword.control.at-rule.import.css, keyword.control.at-rule.import.scss, keyword.control.at-rule.fontface.css, keyword.control.at-rule.fontface.scss, keyword.control.for.css, keyword.control.for.scss, keyword.control.at-rule.function.css, keyword.control.at-rule.function.scss, keyword.control.if.css, keyword.control.if.scss, keyword.control.at-rule.include.scss, keyword.control.at-rule.media.css, keyword.control.at-rule.media.scss, keyword.control.at-rule.font-face.css, keyword.control.at-rule.font-face.scss, meta.at-rule.import.css, variable.other.less, variable.declaration.less, variable.interpolation.less, meta.at-rule.media.scss</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#6C71c4</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: Numeric Value (blue)</string> - <key>scope</key> - <string>constant.numeric.css, keyword.other.unit.css, keyword.unit.css, constant.other.color.rgb-value.css, constant.numeric.scss, constant.other.color.rgb-value.scss, keyword.other.unit.scss, punctuation.definition.constant.scss, punctuation.definition.constant.css, constant.other.rgb-value.css</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: String, value and constants (azure)</string> - <key>scope</key> - <string>variable.parameter.url.scss, meta.property-value.css, meta.property-value.scss, support.constant.property-value.scss, support.constant.font-name.scss, string.quoted.single.css, string.quoted.double.css, constant.character.escaped.css, string.quoted.variable.parameter.url, punctuation.definition.string.begin.scss, punctuation.definition.string.begin.css, punctuation.definition.string.end.scss, punctuation.definition.string.end.css, support.constant.property-value.css</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: !Important (red)</string> - <key>scope</key> - <string>keyword.other.important.css</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: Standard color value (orange)</string> - <key>scope</key> - <string>support.constant.color, invalid.deprecated.color.w3c-non-standard-color-name.scss</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4b16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: : , () (body)</string> - <key>scope</key> - <string>punctuation.terminator.rule.css, punctuation.section.function.css, punctuation.section.function.scss, punctuation.separator.key-value.csspunctuation.scss, punctuation.css, keyword.operator.less, entity.name.tag.wildcard.scss, entity.name.tag.wildcard.css, entity.name.tag.reference.scss</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#657B83</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: Selector > [] and non-spec tags (body)</string> - <key>scope</key> - <string>meta.selector.css</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#657B83</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: Tag (green)</string> - <key>scope</key> - <string>entity.name.tag.css, entity.name.tag.scss</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS .class (yellow)</string> - <key>scope</key> - <string>entity.other.attribute-name.class.css, entity.other.less.mixin</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS: #id (yellow)</string> - <key>scope</key> - <string>source.css entity.other.attribute-name.id</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>bold</string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>CSS :pseudo (orange)</string> - <key>scope</key> - <string>entity.other.attribute-name.pseudo-element.css, entity.other.attribute-name.pseudo-class.css</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SCSS: Variables (pink)</string> - <key>scope</key> - <string>variable, variable.scss</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#D33682</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>JS: Function Name</string> - <key>scope</key> - <string>meta.function.js, entity.name.function.js, support.function.dom.js</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>JS: Source</string> - <key>scope</key> - <string>text.html.basic source.js.embedded.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>JS: Function</string> - <key>scope</key> - <string>storage.type.function.js</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>JS: Numeric Constant</string> - <key>scope</key> - <string>constant.numeric.js</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>JS: []</string> - <key>scope</key> - <string>meta.brace.square.js</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>JS: Storage Type</string> - <key>scope</key> - <string>storage.type.js</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>()</string> - <key>scope</key> - <string>meta.brace.round, punctuation.definition.parameters.begin.js, punctuation.definition.parameters.end.js</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#93A1A1</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>{}</string> - <key>scope</key> - <string>meta.brace.curly.js</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#657B83</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: Doctype</string> - <key>scope</key> - <string>entity.name.tag.doctype.html, meta.tag.sgml.html, string.quoted.double.doctype.identifiers-and-DTDs.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: Comment Block</string> - <key>scope</key> - <string>comment.block.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: Script</string> - <key>scope</key> - <string>entity.name.tag.script.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: Style</string> - <key>scope</key> - <string>source.css.embedded.html string.quoted.double.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: Text</string> - <key>scope</key> - <string>text.html.ruby</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>bold</string> - <key>foreground</key> - <string>#657b83</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: =</string> - <key>scope</key> - <string>text.html.basic meta.tag.other.html, text.html.basic meta.tag.any.html, text.html.basic meta.tag.block.any, text.html.basic meta.tag.inline.any, text.html.basic meta.tag.structure.any.html, text.html.basic source.js.embedded.html, punctuation.separator.key-value.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#657B83</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: something=</string> - <key>scope</key> - <string>text.html.basic entity.other.attribute-name.html</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#657B83</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: "</string> - <key>scope</key> - <string>text.html.basic meta.tag.structure.any.html punctuation.definition.string.begin.html, punctuation.definition.string.begin.html, punctuation.definition.string.end.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: <tag></string> - <key>scope</key> - <string>entity.name.tag.block.any.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>bold</string> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: style</string> - <key>scope</key> - <string>source.css.embedded.html entity.name.tag.style.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: <style></string> - <key>scope</key> - <string>entity.name.tag.style.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: {}</string> - <key>scope</key> - <string>text.html.basic, punctuation.section.property-list.css</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - </dict> - </dict> - <dict> - <key>name</key> - <string>HTML: Embeddable</string> - <key>scope</key> - <string>source.css.embedded.html, comment.block.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Variable definition</string> - <key>scope</key> - <string>punctuation.definition.variable.ruby</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Function Name</string> - <key>scope</key> - <string>meta.function.method.with-arguments.ruby</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#657B83</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Variable</string> - <key>scope</key> - <string>variable.language.ruby</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Function</string> - <key>scope</key> - <string>entity.name.function.ruby</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Keyword Control</string> - <key>scope</key> - <string>keyword.control.ruby, keyword.control.def.ruby</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>bold</string> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Class</string> - <key>scope</key> - <string>keyword.control.class.ruby, meta.class.ruby</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Class Name</string> - <key>scope</key> - <string>entity.name.type.class.ruby</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Keyword</string> - <key>scope</key> - <string>keyword.control.ruby</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Support Class</string> - <key>scope</key> - <string>support.class.ruby</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Special Method</string> - <key>scope</key> - <string>keyword.other.special-method.ruby</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Constant</string> - <key>scope</key> - <string>constant.language.ruby, constant.numeric.ruby</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Constant Other</string> - <key>scope</key> - <string>variable.other.constant.ruby</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: :symbol</string> - <key>scope</key> - <string>constant.other.symbol.ruby</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Punctuation Section ''</string> - <key>scope</key> - <string>punctuation.section.embedded.ruby, punctuation.definition.string.begin.ruby, punctuation.definition.string.end.ruby</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: Special Method</string> - <key>scope</key> - <string>keyword.other.special-method.ruby</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Include</string> - <key>scope</key> - <string>keyword.control.import.include.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: erb =</string> - <key>scope</key> - <string>text.html.ruby meta.tag.inline.any.html</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Ruby: erb ""</string> - <key>scope</key> - <string>text.html.ruby punctuation.definition.string.begin, text.html.ruby punctuation.definition.string.end</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Quoted Single</string> - <key>scope</key> - <string>punctuation.definition.string.begin, punctuation.definition.string.end</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Class Names</string> - <key>scope</key> - <string>support.class.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: []</string> - <key>scope</key> - <string>keyword.operator.index-start.php, keyword.operator.index-end.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Array</string> - <key>scope</key> - <string>meta.array.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Array()</string> - <key>scope</key> - <string>meta.array.php support.function.construct.php, meta.array.empty.php support.function.construct.php</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Array Construct</string> - <key>scope</key> - <string>support.function.construct.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Array Begin</string> - <key>scope</key> - <string>punctuation.definition.array.begin, punctuation.definition.array.end</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Numeric Constant</string> - <key>scope</key> - <string>constant.numeric.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: New</string> - <key>scope</key> - <string>keyword.other.new.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: ::</string> - <key>scope</key> - <string>keyword.operator.class</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Other Property</string> - <key>scope</key> - <string>variable.other.property.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Class</string> - <key>scope</key> - <string>storage.modifier.extends.php, storage.type.class.php, keyword.operator.class.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Semicolon</string> - <key>scope</key> - <string>punctuation.terminator.expression.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#657B83</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Inherited Class</string> - <key>scope</key> - <string>meta.other.inherited-class.php</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Storage Type</string> - <key>scope</key> - <string>storage.type.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Function</string> - <key>scope</key> - <string>entity.name.function.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Function Construct</string> - <key>scope</key> - <string>support.function.construct.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Function Call</string> - <key>scope</key> - <string>entity.name.type.class.php, meta.function-call.php, meta.function-call.static.php, meta.function-call.object.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Comment</string> - <key>scope</key> - <string>keyword.other.phpdoc</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Source Emebedded</string> - <key>scope</key> - <string>source.php.embedded.block.html</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>PHP: Storage Type Function</string> - <key>scope</key> - <string>storage.type.function.php</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>C: constant</string> - <key>scope</key> - <string>constant.numeric.c</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>C: Meta Preprocessor</string> - <key>scope</key> - <string>meta.preprocessor.c.include, meta.preprocessor.macro.c</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>C: Keyword</string> - <key>scope</key> - <string>keyword.control.import.define.c, keyword.control.import.include.c</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>C: Function Preprocessor</string> - <key>scope</key> - <string>entity.name.function.preprocessor.c</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>C: include <something.c></string> - <key>scope</key> - <string>meta.preprocessor.c.include string.quoted.other.lt-gt.include.c, meta.preprocessor.c.include punctuation.definition.string.begin.c, meta.preprocessor.c.include punctuation.definition.string.end.c</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>C: Function</string> - <key>scope</key> - <string>support.function.C99.c, support.function.any-method.c, entity.name.function.c</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>C: "</string> - <key>scope</key> - <string>punctuation.definition.string.begin.c, punctuation.definition.string.end.c</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>C: Storage Type</string> - <key>scope</key> - <string>storage.type.c</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>diff: header</string> - <key>scope</key> - <string>meta.diff, meta.diff.header</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#B58900</string> - <key>fontStyle</key> - <string>italic</string> - <key>foreground</key> - <string>#EEE8D5</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>diff: deleted</string> - <key>scope</key> - <string>markup.deleted</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#EEE8D5</string> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>diff: changed</string> - <key>scope</key> - <string>markup.changed</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#EEE8D5</string> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>diff: inserted</string> - <key>scope</key> - <string>markup.inserted</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#EEE8D5</string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>reST raw</string> - <key>scope</key> - <string>text.restructuredtext markup.raw</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Other: Removal</string> - <key>scope</key> - <string>other.package.exclude, other.remove</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Other: Add</string> - <key>scope</key> - <string>other.add</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: {}</string> - <key>scope</key> - <string>punctuation.section.group.tex , punctuation.definition.arguments.begin.latex, punctuation.definition.arguments.end.latex, punctuation.definition.arguments.latex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: {text}</string> - <key>scope</key> - <string>meta.group.braces.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Other Math</string> - <key>scope</key> - <string>string.other.math.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: {var}</string> - <key>scope</key> - <string>variable.parameter.function.latex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Math \\</string> - <key>scope</key> - <string>punctuation.definition.constant.math.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Constant Math</string> - <key>scope</key> - <string>text.tex.latex constant.other.math.tex, constant.other.general.math.tex, constant.other.general.math.tex, constant.character.math.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Other Math String</string> - <key>scope</key> - <string>string.other.math.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: $</string> - <key>scope</key> - <string>punctuation.definition.string.begin.tex, punctuation.definition.string.end.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: \label</string> - <key>scope</key> - <string>keyword.control.label.latex, text.tex.latex constant.other.general.math.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: \label { }</string> - <key>scope</key> - <string>variable.parameter.definition.label.latex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Function</string> - <key>scope</key> - <string>support.function.be.latex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Support Function Section</string> - <key>scope</key> - <string>support.function.section.latex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Support Function</string> - <key>scope</key> - <string>support.function.general.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Comment</string> - <key>scope</key> - <string>punctuation.definition.comment.tex, comment.line.percentage.tex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Tex: Reference Label</string> - <key>scope</key> - <string>keyword.control.ref.latex</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Python: storage</string> - <key>scope</key> - <string>storage.type.class.python, storage.type.function.python, storage.modifier.global.python</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Python: import</string> - <key>scope</key> - <string>keyword.control.import.python, keyword.control.import.from.python</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Python: Support.exception</string> - <key>scope</key> - <string>support.type.exception.python</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Shell: builtin</string> - <key>scope</key> - <string>support.function.builtin.shell</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Shell: variable</string> - <key>scope</key> - <string>variable.other.normal.shell</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Shell: DOT_FILES</string> - <key>scope</key> - <string>source.shell</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Shell: meta scope in loop</string> - <key>scope</key> - <string>meta.scope.for-in-loop.shell, variable.other.loop.shell</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Shell: ""</string> - <key>scope</key> - <string>punctuation.definition.string.end.shell, punctuation.definition.string.begin.shell</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Shell: Meta Block</string> - <key>scope</key> - <string>meta.scope.case-block.shell, meta.scope.case-body.shell</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Shell: []</string> - <key>scope</key> - <string>punctuation.definition.logical-expression.shell</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Shell: Comment</string> - <key>scope</key> - <string>comment.line.number-sign.shell</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Java: import</string> - <key>scope</key> - <string>keyword.other.import.java</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#CB4B16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Java: meta-import</string> - <key>scope</key> - <string>storage.modifier.import.java</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Java: Class</string> - <key>scope</key> - <string>meta.class.java storage.modifier.java</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Java: /* comment */</string> - <key>scope</key> - <string>source.java comment.block</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Java: /* @param */</string> - <key>scope</key> - <string>comment.block meta.documentation.tag.param.javadoc keyword.other.documentation.param.javadoc</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string></string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Perl: variables</string> - <key>scope</key> - <string>punctuation.definition.variable.perl, variable.other.readwrite.global.perl, variable.other.predefined.perl, keyword.operator.comparison.perl</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Perl: functions</string> - <key>scope</key> - <string>support.function.perl</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#859900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Perl: comments</string> - <key>scope</key> - <string>comment.line.number-sign.perl</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - <key>foreground</key> - <string>#586E75</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Perl: quotes</string> - <key>scope</key> - <string>punctuation.definition.string.begin.perl, punctuation.definition.string.end.perl</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>Perl: \char</string> - <key>scope</key> - <string>constant.character.escape.perl</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#DC322F</string> - </dict> - </dict> - <dict> - <key>Name</key> - <string>Markdown punctuation</string> - <key>scope</key> - <string>markup.list, text.html.markdown punctuation.definition, meta.separator.markdown</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#CB4b16</string> - </dict> - </dict> - <dict> - <key>Name</key> - <string>Markdown heading</string> - <key>scope</key> - <string>markup.heading</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#268BD2</string> - </dict> - </dict> - <dict> - <key>Name</key> - <string>Markdown text inside some block element</string> - <key>scope</key> - <string>markup.quote, meta.paragraph.list</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#2AA198</string> - </dict> - </dict> - <dict> - <key>Name</key> - <string>Markdown em</string> - <key>scope</key> - <string>markup.italic</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>italic</string> - </dict> - </dict> - <dict> - <key>Name</key> - <string>Markdown strong</string> - <key>scope</key> - <string>markup.bold</string> - <key>settings</key> - <dict> - <key>fontStyle</key> - <string>bold</string> - </dict> - </dict> - <dict> - <key>Name</key> - <string>Markdown reference</string> - <key>scope</key> - <string>markup.underline.link.markdown, meta.link.inline punctuation.definition.metadata, meta.link.reference.markdown punctuation.definition.constant, meta.link.reference.markdown constant.other.reference</string> - <key>settings</key> - <dict> - <key>foreground</key> - <string>#B58900</string> - </dict> - </dict> - <dict> - <key>Name</key> - <string>Markdown linebreak</string> - <key>scope</key> - <string>meta.paragraph.markdown meta.dummy.line-break</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#6C71c4</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SublimeLinter Annotations</string> - <key>scope</key> - <string>sublimelinter.notes</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#eee8d5</string> - <key>foreground</key> - <string>#eee8d5</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SublimeLinter Error Outline</string> - <key>scope</key> - <string>sublimelinter.outline.illegal</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#93a1a1</string> - <key>foreground</key> - <string>#93a1a1</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SublimeLinter Error Underline</string> - <key>scope</key> - <string>sublimelinter.underline.illegal</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#dc322f</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SublimeLinter Warning Outline</string> - <key>scope</key> - <string>sublimelinter.outline.warning</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#839496</string> - <key>foreground</key> - <string>#839496</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SublimeLinter Warning Underline</string> - <key>scope</key> - <string>sublimelinter.underline.warning</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#b58900</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SublimeLinter Violation Outline</string> - <key>scope</key> - <string>sublimelinter.outline.violation</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#657b83</string> - <key>foreground</key> - <string>#657b83</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SublimeLinter Violation Underline</string> - <key>scope</key> - <string>sublimelinter.underline.violation</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#cb4b16</string> - </dict> - </dict> - <dict> - <key>name</key> - <string>SublimeBracketHighlighter</string> - <key>scope</key> - <string>brackethighlighter.all</string> - <key>settings</key> - <dict> - <key>background</key> - <string>#FDF6E3</string> - <key>foreground</key> - <string>#cb4b16</string> - </dict> - </dict> - </array> - <key>uuid</key> - <string>38E819D9-AE02-452F-9231-ECC3B204AFD7</string> -</dict> -</plist> diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/package-metadata.json deleted file mode 100644 index e725fe4..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://github.com/SublimeColors/Solarized", "version": "2013.05.31.15.52.59", "description": "A port of the popular Solarized Theme for Sublime Text 2"} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/README.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/README.md deleted file mode 100644 index 7f2c162..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/README.md +++ /dev/null @@ -1,2 +0,0 @@ -Included here are a number of samples that can be used to verify -the color scheme. diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.c b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.c deleted file mode 100644 index 7e88404..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.c +++ /dev/null @@ -1,26 +0,0 @@ -#define UNICODE -#include <windows.h> - -int main(int argc, char **argv) { - int speed = 0, speed1 = 0, speed2 = 0; // 1-20 - printf("Set Mouse Speed by Maverick\n"); - - SystemParametersInfo(SPI_GETMOUSESPEED, 0, &speed, 0); - printf("Current speed: %2d\n", speed); - - if (argc == 1) return 0; - if (argc >= 2) sscanf(argv[1], "%d", &speed1); - if (argc >= 3) sscanf(argv[2], "%d", &speed2); - - if (argc == 2) // set speed to first value - speed = speed1; - else if (speed == speed1 || speed == speed2) // alternate - speed = speed1 + speed2 - speed; - else - speed = speed1; // start with first value - - SystemParametersInfo(SPI_SETMOUSESPEED, 0, speed, 0); - SystemParametersInfo(SPI_GETMOUSESPEED, 0, &speed, 0); - printf("New speed: %2d\n", speed); - return 0; -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.coffee b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.coffee deleted file mode 100644 index 9dbe6cb..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.coffee +++ /dev/null @@ -1,23 +0,0 @@ -undefined -xui -window = this -string = new String('string') -document = window.document -simpleExpr = /^#?([\w-]+)$/ -idExpr = /^#/ -tagExpr = /<([\w:]+)/ - -slice = (e) -> - [].slice.call(e, 0) - -try - a = slice(document.documentElement.childNodes)[0].nodeType -catch e - slice = (e) -> - ret = [] - for i in e[i] - ret.push(e[i]) - return ret - -window.x$ = window.xui = xui = (q, context) -> - new xui.fn.find(q, context) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.html b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.html deleted file mode 100644 index e4d5f3b..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.html +++ /dev/null @@ -1,20 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html><head> -<title>A Tiny Page - - - -

abc

-

def

-

Testing page

- diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.js b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.js deleted file mode 100644 index 49d110a..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.js +++ /dev/null @@ -1,42 +0,0 @@ -// Generated by CoffeeScript 1.4.0 -var a, document, idExpr, simpleExpr, slice, string, tagExpr, window, xui; - -void 0; - -xui; - - -window = this; - -string = new String('string'); - -document = window.document; - -simpleExpr = /^#?([\w-]+)$/; - -idExpr = /^#/; - -tagExpr = /<([\w:]+)/; - -slice = function(e) { - return [].slice.call(e, 0); -}; - -try { - a = slice(document.documentElement.childNodes)[0].nodeType; -} catch (e) { - slice = function(e) { - var i, ret, _i, _len, _ref; - ret = []; - _ref = e[i]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - i = _ref[_i]; - ret.push(e[i]); - } - return ret; - }; -} - -window.x$ = window.xui = xui = function(q, context) { - return new xui.fn.find(q, context); -}; diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.md deleted file mode 100644 index d24fb37..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.md +++ /dev/null @@ -1,26 +0,0 @@ -% Pandoc Test File -% Ethan Schoonover -% March 22, 2011 - -%% format: markdown+lhs - -> import Hakyll -> main :: IO () -> main = hakyll $ do -> compile "css/*" $ byExtension (error "Not a (S)CSS file") - -Using *Pandoc* -============= - -In this document the technical terms `water` and `ice` will be replaced by -H~2~O.^[a contrived footnote] - -## Heading styles can be mixed - -And matched, and they still fold **properly** - -* * * * - -Some code: - - a verbatim or "code" block diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.py deleted file mode 100644 index 92a68e0..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python -# encoding: utf-8 -""" -""" - -import string - -module_variable = 0 - - -def functionName(self, int): - local = 5 + 5 - module_variable = 5*5 - return module_variable - - -class my_class(object): - - def __init__(self, arg1, string): - self.value = True - return - - def method1(self, str): - self.s = str - return self.value - - def method2(self): - return - print 'How did we get here?' - - def method1(self): - return self.value + 1 - method2 = method1 - -class my_subclass(my_class): - - def __init__(self, arg1, string): - self.value = arg1 - return diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.rb b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.rb deleted file mode 100644 index 2658f37..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/Solarized Color Scheme/samples/test.rb +++ /dev/null @@ -1,49 +0,0 @@ -# ruby test file ruby.rb - -include Enumerable - -def initialize(rbconfig) -@rbconfig = rbconfig -@no_harm = false -end - -def load_savefile -begin - File.foreach(savefile()) do |line| - k, v = *line.split(/=//, 2) - self[k] = v.strip - end -rescue Errno::ENOENT - setup_rb_error $!.message + "\n#{File.basename($0)} config first" -end -end - -if c['rubylibdir'] - # V > 1.6.3 - libruby = "#{c['prefix']}/lib/ruby" - siterubyverarch = c['sitearchdir'] -end -parameterize = lambda {|path| - path.sub(/\A#{Regexp.quote(c['prefix'])}/, '$prefix') -} - -if arg = c['configure_args'].split.detect {|arg| /--with-make-prog=/ =~ arg } - makeprog = arg.sub(/'/, '').split(/=//, 2)[1] -else - makeprog = 'make' -end - -def setup_rb_error(msg) - raise SetupError, msg -end - -if $0 == __FILE__ - begin - ToplevelInstaller.invoke - rescue SetupError - raise if $DEBUG - $stderr.puts $!.message - $stderr.puts "Try 'ruby #{$0} --help' for detailed usage." - exit 1 - end -end diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/Default.sublime-commands b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/Default.sublime-commands deleted file mode 100644 index 1b65db2..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/Default.sublime-commands +++ /dev/null @@ -1,74 +0,0 @@ -[ - { - "caption": "StringEncode: HTML Entitize", - "command": "html_entitize" - }, - { - "caption": "StringEncode: HTML Deentitize", - "command": "html_deentitize" - }, - { - "caption": "StringEncode: XML Entitize", - "command": "xml_entitize" - }, - { - "caption": "StringEncode: XML Deentitize", - "command": "xml_deentitize" - }, - { - "caption": "StringEncode: Safe HTML Entitize", - "command": "safe_html_entitize" - }, - { - "caption": "StringEncode: Safe HTML Deentitize", - "command": "safe_html_deentitize" - }, - { - "caption": "StringEncode: JSON Escape", - "command": "json_escape" - }, - { - "caption": "StringEncode: JSON Unescape", - "command": "json_unescape" - }, - { - "caption": "StringEncode: URL Encode", - "command": "url_encode" - }, - { - "caption": "StringEncode: URL Decode", - "command": "url_decode" - }, - { - "caption": "StringEncode: Base64 Encode", - "command": "base64_encode" - }, - { - "caption": "StringEncode: Base64 Decode", - "command": "base64_decode" - }, - { - "caption": "StringEncode: Escape regex", - "command": "escape_regex" - }, - { - "caption": "StringEncode: Escape LIKE", - "command": "escape_like" - }, - { - "caption": "StringEncode: Decimal to Hexadecimal", - "command": "dec_hex" - }, - { - "caption": "StringEncode: Hexadecimal to Decimal", - "command": "hex_dec" - }, - { - "caption": "StringEncode: Unicode to Hexadecimal", - "command": "unicode_hex" - }, - { - "caption": "StringEncode: Hexadecimal to Unicode", - "command": "hex_unicode" - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/Example.sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/Example.sublime-keymap deleted file mode 100644 index 84dce04..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/Example.sublime-keymap +++ /dev/null @@ -1,14 +0,0 @@ -[ - { "keys": ["super+shift+7"], "command": "xml_entitize", "scope": "text.xml" }, - { "keys": ["super+ctrl+7"], "command": "xml_deentitize", "scope": "text.xml" }, - { "keys": ["super+shift+7"], "command": "html_entitize" }, - { "keys": ["super+ctrl+7"], "command": "html_deentitize" }, - { "keys": ["super+shift+8"], "command": "json_escape" }, - { "keys": ["super+ctrl+8"], "command": "json_unescape" }, - { "keys": ["super+shift+6"], "command": "base64_encode" }, - { "keys": ["super+ctrl+6"], "command": "base64_decode" }, - { "keys": ["super+shift+5"], "command": "url_encode" }, - { "keys": ["super+ctrl+5"], "command": "url_decode" }, - { "keys": ["ctrl+shift+r"], "command": "escape_regex" }, - { "keys": ["super+ctrl+3"], "command": "hex_dec" } -] \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/LICENSE b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/LICENSE deleted file mode 100644 index 8da8c54..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2012, Colin T.A. Gray -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those -of the authors and should not be interpreted as representing official policies, -either expressed or implied, of this project. diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/README.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/README.md deleted file mode 100644 index 71ae8bb..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/README.md +++ /dev/null @@ -1,61 +0,0 @@ -StringEncode -============ - -Converts characters from one "encoding" to another using a transformation (think HTML entities, not character encodings). - -Installation ------------- - -1. Using Package Control, install "StringEncode" - -Or: - -1. Open the Sublime Text Packages folder - - - OS X: ~/Library/Application Support/Sublime Text 3/Packages/ - - Windows: %APPDATA%/Sublime Text 3/Packages/ - - Linux: ~/.Sublime Text 3/Packages/ - -2. clone this repo -3. Install keymaps for the commands (see Example.sublime-keymap for my preferred keys) - -### Sublime Text 2 - -1. Open the Sublime Text 2 Packages folder -2. clone this repo, but use the `st2` branch - - git clone -b st2 git@github.com:colinta/SublimeStringEncode - -Commands --------- - -`html_entitize`: Converts characters to their HTML entity - -`html_deentitize`: Converts HTML entities to a character - -`url_encode`: Uses urllib.quote to escape special URL characters - -`url_decode`: Uses urllib.unquote to convert escaped URL characters - -`json_escape`: Escapes a string and surrounds it in quotes, according to the JSON encoding. - -`json_unescape`: Unescapes a string (include the quotes!) according to JSON encoding. - -`base64_encode`: Uses base64 to encode into base64 - -`base64_decode`: Uses base64 to decode from base64 - -`escape_regex`: Escapes regex meta characters - -`escape_like`: Escapes SQL-LIKE meta characters - -`safe_html_entitize`: Converts characters to their HTML entity, but preserves HTML reserved characters - -`safe_html_deentitize`: Converts HTML entities to a character, but preserves HTML reserved characters - -TODO ----- - -`xml_entitize`: Converts characters to their XML entity - -`xml_deentitize`: Converts XML entities to a character diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/package-metadata.json deleted file mode 100644 index 667df99..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://github.com/colinta/SublimeStringEncode", "version": "2013.08.20.19.57.08", "description": "Converts characters from one encoding to another using a transformation (think HTML entities, not character encodings)."} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/package.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/package.json deleted file mode 100644 index 96ab65f..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "StringEncode", - "description": "Converts characters from one encoding to another using a transformation (think HTML entities, not character encodings).", - "author": "Colin T.A. Gray (colinta)", - "details": "https://github.com/colinta/SublimeStringEncode", - "labels": ["text manipulation"], - "releases": [ - { - "details": "https://github.com/colinta/SublimeStringEncode/tree/master", - "sublime_text": "<3000" - }, - { - "details": "https://github.com/colinta/SublimeStringEncode/tags", - "sublime_text": ">=3000" - } - ] -} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/string_encode.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/string_encode.py deleted file mode 100644 index ca753e7..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/StringEncode/string_encode.py +++ /dev/null @@ -1,290 +0,0 @@ -# coding: utf8 -import urllib -import base64 -import re -import json -import sys - -import sublime_plugin - - -class StringEncode(sublime_plugin.TextCommand): - def run(self, edit): - for region in self.view.sel(): - if region.empty(): - continue - text = self.view.substr(region) - replacement = self.encode(text) - self.view.replace(edit, region, replacement) - - -html_escape_table = { - u"\"": """, u"'": "'", u"<": "<", u">": ">", u"¡": "¡", u"¢": "¢", u"£": "£", u"¤": "¤", u"¥": "¥", u"¦": "¦", u"§": "§", u"¨": "¨", u"©": "©", u"ª": "ª", u"«": "«", u"¬": "¬", u"®": "®", u"¯": "¯", u"°": "°", u"±": "±", u"²": "²", u"³": "³", u"´": "´", u"µ": "µ", u"¶": "¶", u"·": "·", u"¸": "¸", u"¹": "¹", u"º": "º", u"»": "»", u"¼": "¼", u"½": "½", u"¾": "¾", u"¿": "¿", u"À": "À", u"Á": "Á", u"Â": "Â", u"Ã": "Ã", u"Ä": "Ä", u"Å": "Å", u"Æ": "Æ", u"Ç": "Ç", u"È": "È", u"É": "É", u"Ê": "Ê", u"Ë": "Ë", u"Ì": "Ì", u"Í": "Í", u"Î": "Î", u"Ï": "Ï", u"Ð": "Ð", u"Ñ": "Ñ", u"Ò": "Ò", u"Ó": "Ó", u"Ô": "Ô", u"Õ": "Õ", u"Ö": "Ö", u"×": "×", u"Ø": "Ø", u"Ù": "Ù", u"Ú": "Ú", u"Û": "Û", u"Ü": "Ü", u"Ý": "Ý", u"Þ": "Þ", u"ß": "ß", u"à": "à", u"á": "á", u"â": "â", u"ã": "ã", u"ä": "ä", u"å": "å", u"æ": "æ", u"ç": "ç", u"è": "è", u"é": "é", u"ê": "ê", u"ë": "ë", u"ì": "ì", u"í": "í", u"î": "î", u"ï": "ï", u"ð": "ð", u"ñ": "ñ", u"ò": "ò", u"ó": "ó", u"ô": "ô", u"õ": "õ", u"ö": "ö", u"÷": "÷", u"ø": "ø", u"ù": "ù", u"ú": "ú", u"û": "û", u"ü": "ü", u"ý": "ý", u"þ": "þ", u"ÿ": "ÿ", u"Œ": "Œ", u"œ": "œ", u"Š": "Š", u"š": "š", u"Ÿ": "Ÿ", u"ƒ": "ƒ", u"ˆ": "ˆ", u"˜": "˜", u"Α": "Α", u"Β": "Β", u"Γ": "Γ", u"Δ": "Δ", u"Ε": "Ε", u"Ζ": "Ζ", u"Η": "Η", u"Θ": "Θ", u"Ι": "Ι", u"Κ": "Κ", u"Λ": "Λ", u"Μ": "Μ", u"Ν": "Ν", u"Ξ": "Ξ", u"Ο": "Ο", u"Π": "Π", u"Ρ": "Ρ", u"Σ": "Σ", u"Τ": "Τ", u"Υ": "Υ", u"Φ": "Φ", u"Χ": "Χ", u"Ψ": "Ψ", u"Ω": "Ω", u"α": "α", u"β": "β", u"γ": "γ", u"δ": "δ", u"ε": "ε", u"ζ": "ζ", u"η": "η", u"θ": "θ", u"ι": "ι", u"κ": "κ", u"λ": "λ", u"μ": "μ", u"ν": "ν", u"ξ": "ξ", u"ο": "ο", u"π": "π", u"ρ": "ρ", u"ς": "ς", u"σ": "σ", u"τ": "τ", u"υ": "υ", u"φ": "φ", u"χ": "χ", u"ψ": "ψ", u"ω": "ω", u"ϑ": "ϑ", u"ϒ": "ϒ", u"ϖ": "ϖ", u"–": "–", u"—": "—", u"‘": "‘", u"’": "’", u"‚": "‚", u"“": "“", u"”": "”", u"„": "„", u"†": "†", u"‡": "‡", u"•": "•", u"…": "…", u"‰": "‰", u"′": "′", u"″": "″", u"‹": "‹", u"›": "›", u"‾": "‾", u"⁄": "⁄", u"€": "€", u"ℑ": "ℑ", u"℘": "℘", u"ℜ": "ℜ", u"™": "™", u"ℵ": "ℵ", u"←": "←", u"↑": "↑", u"→": "→", u"↓": "↓", u"↔": "↔", u"↵": "↵", u"⇐": "⇐", u"⇑": "⇑", u"⇒": "⇒", u"⇓": "⇓", u"⇔": "⇔", u"∀": "∀", u"∂": "∂", u"∃": "∃", u"∅": "∅", u"∇": "∇", u"∈": "∈", u"∉": "∉", u"∋": "∋", u"∏": "∏", u"∑": "∑", u"−": "−", u"∗": "∗", u"√": "√", u"∝": "∝", u"∞": "∞", u"∠": "∠", u"∧": "∧", u"∨": "∨", u"∩": "∩", u"∪": "∪", u"∫": "∫", u"∴": "∴", u"∼": "∼", u"≅": "≅", u"≈": "≈", u"≠": "≠", u"≡": "≡", u"≤": "≤", u"≥": "≥", u"⊂": "⊂", u"⊃": "⊃", u"⊄": "⊄", u"⊆": "⊆", u"⊇": "⊇", u"⊕": "⊕", u"⊗": "⊗", u"⊥": "⊥", u"⋅": "⋅", u"⌈": "⌈", u"⌉": "⌉", u"⌊": "⌊", u"⌋": "⌋", u"〈": "⟨", u"〉": "⟩", u"◊": "◊", u"♠": "♠", u"♣": "♣", u"♥": "♥", u"♦": "♦", u"\xa0": " ", -} -xml_escape_table = { - u"\"": """, u"'": "'", u"<": "<", u">": ">" -} -html_reserved_list = (u"\"", u"'", u"<", u">", u"&") - - -class HtmlEntitizeCommand(StringEncode): - def encode(self, text): - text = text.replace('&', '&') - for k in html_escape_table: - v = html_escape_table[k] - text = text.replace(k, v) - ret = '' - for i, c in enumerate(text): - if ord(c) > 127: - ret += hex(ord(c)).replace('0x', '&#x') + ';' - else: - ret += c - return ret - - -class HtmlDeentitizeCommand(StringEncode): - def encode(self, text): - for k in html_escape_table: - v = html_escape_table[k] - text = text.replace(v, k) - while re.search('&#[xX][a-fA-F0-9]+;', text): - match = re.search('&#[xX]([a-fA-F0-9]+);', text) - text = text.replace(match.group(0), unichr(int('0x' + match.group(1), 16))) - text = text.replace('&', '&') - return text - - -class SafeHtmlEntitizeCommand(StringEncode): - def encode(self, text): - for k in html_escape_table: - # skip HTML reserved characters - if k in html_reserved_list: - continue - v = html_escape_table[k] - text = text.replace(k, v) - ret = '' - for i, c in enumerate(text): - if ord(c) > 127: - ret += hex(ord(c)).replace('0x', '&#x') + ';' - else: - ret += c - return ret - - -class SafeHtmlDeentitizeCommand(StringEncode): - def encode(self, text): - for k in html_escape_table: - # skip HTML reserved characters - if k in html_reserved_list: - continue - v = html_escape_table[k] - text = text.replace(v, k) - while re.search('&#[xX][a-fA-F0-9]+;', text): - match = re.search('&#[xX]([a-fA-F0-9]+);', text) - text = text.replace(match.group(0), unichr(int('0x' + match.group(1), 16))) - text = text.replace('&', '&') - return text - - -class XmlEntitizeCommand(StringEncode): - def encode(self, text): - text = text.replace('&', '&') - for k in xml_escape_table: - v = xml_escape_table[k] - text = text.replace(k, v) - ret = '' - for i, c in enumerate(text): - if ord(c) > 127: - ret += hex(ord(c)).replace('0x', '&#x') + ';' - else: - ret += c - return ret - - -class XmlDeentitizeCommand(StringEncode): - def encode(self, text): - for k in xml_escape_table: - v = xml_escape_table[k] - text = text.replace(v, k) - text = text.replace('&', '&') - return text - - -class JsonEscapeCommand(StringEncode): - def encode(self, text): - return json.dumps(text) - - -class JsonUnescapeCommand(StringEncode): - def encode(self, text): - return json.loads(text) - - -class UrlEncodeCommand(StringEncode): - def encode(self, text): - return urllib.parse.quote(text) - - -class UrlDecodeCommand(StringEncode): - def encode(self, text): - return urllib.parse.unquote(text) - - -class Base64EncodeCommand(StringEncode): - def encode(self, text): - return base64.b64encode(text) - - -class Base64DecodeCommand(StringEncode): - def encode(self, text): - return base64.b64decode(text) - - -class Escaper(StringEncode): - def encode(self, text): - return re.sub(r'(?= 0xd800 and tmp <= 0xdbff: - char_index += 1 - else: - hex_text += '\\u' + '{0:04x}'.format(tmp) - char_index = 0 - elif char_index == 2: - c3 = c - char_index += 1 - elif char_index == 3: - c4 = c - if endian == 'little': - c3, c4 = c4, c3 - tmp1 = ((c1 << 8) + c2) - 0xd800 - tmp2 = ((c3 << 8) + c4) - 0xdc00 - tmp = (tmp1 * 0x400) + tmp2 + 0x10000 - hex_text += '\\U' + '{0:08x}'.format(tmp) - char_index = 0 - return hex_text - - -class HexUnicodeCommand(StringEncode): - def encode(self, text): - uni_text = text - - endian = sys.byteorder - - r = re.compile(r'\\u([0-9a-fA-F]{2})([0-9a-fA-F]{2})') - rr = r.search(uni_text) - while rr: - first_byte = int(rr.group(1), 16) - - if first_byte >= 0xd8 and first_byte <= 0xdf: - # Surrogate pair - pass - else: - if endian == 'little': - b1 = int(rr.group(2), 16) - b2 = int(rr.group(1), 16) - else: - b1 = int(rr.group(1), 16) - b2 = int(rr.group(2), 16) - - ch = bytes([b1, b2]).decode('utf-16') - - uni_text = uni_text.replace(rr.group(0), ch) - rr = r.search(uni_text, rr.start(0)+1) - - # Surrogate pair (2 bytes + 2 bytes) - r = re.compile(r'\\u([0-9a-fA-F]{2})([0-9a-fA-F]{2})\\u([0-9a-fA-F]{2})([0-9a-fA-F]{2})') - rr = r.search(uni_text) - while rr: - if endian == 'little': - b1 = int(rr.group(2), 16) - b2 = int(rr.group(1), 16) - b3 = int(rr.group(4), 16) - b4 = int(rr.group(3), 16) - else: - b1 = int(rr.group(1), 16) - b2 = int(rr.group(2), 16) - b3 = int(rr.group(3), 16) - b4 = int(rr.group(4), 16) - - ch = bytes([b1, b2, b3, b4]).decode('utf-16') - - uni_text = uni_text.replace(rr.group(0), ch) - rr = r.search(uni_text) - - # Surrogate pair (4 bytes) - r = re.compile(r'\\U([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})') - rr = r.search(uni_text) - while rr: - tmp = (int(rr.group(1), 16) << 24) \ - + (int(rr.group(2), 16) << 16) \ - + (int(rr.group(3), 16) << 8) \ - + (int(rr.group(4), 16)) - - if (tmp <= 0xffff): - ch = chr(tmp) - else: - tmp -= 0x10000 - c1 = 0xd800 + int(tmp / 0x400) - c2 = 0xdc00 + int(tmp % 0x400) - if endian == 'little': - b1 = c1 & 0xff - b2 = c1 >> 8 - b3 = c2 & 0xff - b4 = c2 >> 8 - else: - b1 = c1 >> 8 - b2 = c1 & 0xff - b3 = c2 >> 8 - b4 = c2 & 0xff - - ch = bytes([b1, b2, b3, b4]).decode('utf-16') - - uni_text = uni_text.replace(rr.group(0), ch) - rr = r.search(uni_text) - - return uni_text - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (Linux).sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (Linux).sublime-keymap deleted file mode 100644 index d050399..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (Linux).sublime-keymap +++ /dev/null @@ -1,80 +0,0 @@ -[ - - // { - // "keys": ["n"], "command": "goto_next_result", - // "context": [ - // { "key": "setting.todo_results", "operator": "equal", "operand": true } - // ] - // } - - { - "keys": ["n"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ], - "args": {"direction": "forward"} - }, - - { - "keys": ["down"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ], - "args": {"direction": "forward"} - }, - - { - "keys": ["j"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ], - "args": {"direction": "forward"} - }, - - { - "keys": ["p"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ], - "args": {"direction": "backward"} - }, - - { - "keys": ["up"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - //{"key": "setting.todo_results"} - ], - "args": {"direction": "backward"} - }, - - { - "keys": ["k"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - //{"key": "setting.todo_results"} - ], - "args": {"direction": "backward"} - }, - - { - "keys": ["c"], "command": "clear_selection", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ] - }, - - { - "keys": ["enter"], "command": "goto_comment", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ] - } - -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (Linux).sublime-mousemap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (Linux).sublime-mousemap deleted file mode 100644 index f3868a5..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (Linux).sublime-mousemap +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "button": "button1", "count": 2, "modifiers": ["shift"], - "command": "mouse_goto_comment" - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (OSX).sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (OSX).sublime-keymap deleted file mode 100644 index d050399..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (OSX).sublime-keymap +++ /dev/null @@ -1,80 +0,0 @@ -[ - - // { - // "keys": ["n"], "command": "goto_next_result", - // "context": [ - // { "key": "setting.todo_results", "operator": "equal", "operand": true } - // ] - // } - - { - "keys": ["n"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ], - "args": {"direction": "forward"} - }, - - { - "keys": ["down"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ], - "args": {"direction": "forward"} - }, - - { - "keys": ["j"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ], - "args": {"direction": "forward"} - }, - - { - "keys": ["p"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ], - "args": {"direction": "backward"} - }, - - { - "keys": ["up"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - //{"key": "setting.todo_results"} - ], - "args": {"direction": "backward"} - }, - - { - "keys": ["k"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - //{"key": "setting.todo_results"} - ], - "args": {"direction": "backward"} - }, - - { - "keys": ["c"], "command": "clear_selection", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ] - }, - - { - "keys": ["enter"], "command": "goto_comment", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ] - } - -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (OSX).sublime-mousemap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (OSX).sublime-mousemap deleted file mode 100644 index 41485cf..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (OSX).sublime-mousemap +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "button": "button1", "count": 2, "modifiers": ["alt"], - "command": "mouse_goto_comment" - } -] \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (Windows).sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (Windows).sublime-keymap deleted file mode 100644 index d050399..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (Windows).sublime-keymap +++ /dev/null @@ -1,80 +0,0 @@ -[ - - // { - // "keys": ["n"], "command": "goto_next_result", - // "context": [ - // { "key": "setting.todo_results", "operator": "equal", "operand": true } - // ] - // } - - { - "keys": ["n"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ], - "args": {"direction": "forward"} - }, - - { - "keys": ["down"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ], - "args": {"direction": "forward"} - }, - - { - "keys": ["j"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ], - "args": {"direction": "forward"} - }, - - { - "keys": ["p"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ], - "args": {"direction": "backward"} - }, - - { - "keys": ["up"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - //{"key": "setting.todo_results"} - ], - "args": {"direction": "backward"} - }, - - { - "keys": ["k"], "command": "navigate_results", - "context": [ - {"key": "setting.command_mode", "operand": true} - //{"key": "setting.todo_results"} - ], - "args": {"direction": "backward"} - }, - - { - "keys": ["c"], "command": "clear_selection", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ] - }, - - { - "keys": ["enter"], "command": "goto_comment", - "context": [ - {"key": "setting.command_mode", "operand": true} - // {"key": "setting.todo_results"} - ] - } - -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (Windows).sublime-mousemap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (Windows).sublime-mousemap deleted file mode 100644 index 41485cf..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default (Windows).sublime-mousemap +++ /dev/null @@ -1,6 +0,0 @@ -[ - { - "button": "button1", "count": 2, "modifiers": ["alt"], - "command": "mouse_goto_comment" - } -] \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default.sublime-commands b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default.sublime-commands deleted file mode 100644 index 8e033e9..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/Default.sublime-commands +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "caption": "Show TODOs: Project and open files", - "command": "todo" - }, - { - "caption": "Show TODOs: Open files only", - "command": "todo", "args": {"open_files_only": true} - } -] \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/README.markdown b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/README.markdown deleted file mode 100644 index 509343b..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/README.markdown +++ /dev/null @@ -1,117 +0,0 @@ -# Sublime TODOs - -A Sublime Text 2 plugin to extract and list TODO comments from open files and -project folders. - -Take a look at [this screencast](http://webdesign.tutsplus.com/tutorials/applications/quick-tip-streamline-your-todo-lists-in-sublime-text-2/) (courtesy of Shannon Huffman) for an overview. - - -# Install - -The preferred method is to use the [Sublime Package Manager](http://wbond.net/sublime_packages/package_control). Alternatively, checkout from github: - -```sh -$ cd Sublime Text 2/Packages -$ git clone https://robcowie@github.com/robcowie/SublimeTODO.git -``` - -# Config - -All plugin configuration must be placed in user or project-specific settings inside a `todo` object, for example; - -```javascript -{ - // other user config ... - "todo": { - "patterns": {} - } -} -``` - -See an example user settings file [here](https://gist.github.com/2049887). - - -## Adding comment patterns - -Extraction uses regular expressions that return one match group -representing the message. Default patterns are provided for `TODO`, `NOTE`, `FIXME` -and `CHANGED` comments. -To override or provide more patterns, add `patterns` to user settings, e.g. - -```javascript -"patterns": { - "TODO": "TODO[\\s]*?:+(?P.*)$", - "NOTE": "NOTE[\\s]*?:+(?P.*)$", - "FIXME": "FIX ?ME[\\s]*?:+(?P\\S.*)$", - "CHANGED": "CHANGED[\\s]*?:+(?P\\S.*)$" -} -``` - -Note that the pattern _must_ provide at least one named group which will be used to group the comments in results. - -By default, searching is not case sensitive. You can change this behaviour by adding - - "case_sensitive": true - -to the todo settings object. - - -## Excluding files and folders - -Global settings `folder_exclude_patterns`, `file_exclude_patterns` and `binary_file_patterns` are excluded from search results. - -To exclude further directories, add directory names (not glob pattern or regexp) to `folder_exclude_patterns` in todo settings: - -```javascript -"todo": { - "folder_exclude_patterns": [ - "vendor", - "tmp" - ] -} -``` - -To add file excludes, add glob patterns to `file_exclude_patterns`: - -```javascript -"file_exclude_patterns": [ - "*.css" -] -``` - - -## Results title - -Override the results view title by setting `result_title` - -```javascript -"result_title": "TODO Results" -``` - -# Usage - -`Show TODOs: Project and open files` scans all files in your project -`Show TODOs: Open files only` scans only open, saved files -Both are triggered from the command palette. No default key bindings are provided. - -## Navigating results - -Results can be navigated by keyboard and mouse: - - * `n`ext, `p`revious, `c`lear, `enter` - * `alt-double click` (`shift-double click` in Linux) - - Note that due to the lack of support for context in mousemaps right now, - alt-double click will trigger in _any_ document, though it should be a no-op. - -# License - -All of SublimeTODO is licensed under the MIT license. - -Copyright (c) 2012 Rob Cowie - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/messages.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/messages.json deleted file mode 100644 index ce3c122..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/messages.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "1.1.0": "messages/1.1.0.txt" -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/messages/1.1.0.txt b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/messages/1.1.0.txt deleted file mode 100644 index 647fe56..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/messages/1.1.0.txt +++ /dev/null @@ -1,6 +0,0 @@ -SublimeTODO 1.1.0 Changelog: - - - Repo reorg to support explicit versioning and Package Control upgrade messages. - - - [LINUX] alt + dblclick is replaced by shift + dblclick to prevent clash - with common alt+click+drag method of moving windows. diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/package-metadata.json deleted file mode 100644 index 83e3860..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://github.com/robcowie/SublimeTODO", "version": "1.1.3", "description": "Extract TODO-type comments from open files and project folders"} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/packages.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/packages.json deleted file mode 100644 index 423b3cc..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/packages.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "schema_version": "1.2", - "packages": [ - { - "name": "SublimeTODO", - "description": "Extract TODO-type comments from open files and project folders", - "author": "Rob Cowie", - "homepage": "https://github.com/robcowie/SublimeTODO", - "last_modified": "2012-11-12 10:16:00", - "platforms": { - "*": [ - { - "version": "1.1.2", - "url": "https://nodeload.github.com/robcowie/SublimeTODO/zipball/1.1.2" - } - ] - } - } - ] -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/todo.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/todo.py deleted file mode 100644 index 40c15c0..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/todo.py +++ /dev/null @@ -1,441 +0,0 @@ -# -*- coding: utf-8 -*- - -## TODO: Implement TODO_IGNORE setting (http://mdeering.com/posts/004-get-your-textmate-todos-and-fixmes-under-control) -## TODO: Make the output clickable (å la find results) -## TODO: Occasional NoneType bug -## todo: Make the sections foldable (define them as regions?) - -"""""" - -from collections import namedtuple -from datetime import datetime -import functools -import fnmatch -from itertools import groupby -import logging -from os import path, walk -import re -import threading - -import sublime -import sublime_plugin - - -DEBUG = True - -DEFAULT_SETTINGS = { - 'result_title': 'TODO Results', - - 'core_patterns': { - 'TODO': r'TODO[\s]*?:+(?P.*)$', - 'NOTE': r'NOTE[\s]*?:+(?P.*)$', - 'FIXME': r'FIX ?ME[\s]*?:+(?P.*)$', - 'CHANGED': r'CHANGED[\s]*?:+(?P.*)$' - }, - - 'patterns': {} -} - -Message = namedtuple('Message', 'type, msg') - -## LOGGING SETUP -try: - from logging import NullHandler -except ImportError: - class NullHandler(logging.Handler): - def handle(self, record): - pass - - def emit(self, record): - pass - - def createLock(self): - self.lock = None - -log = logging.getLogger('SublimeTODO') -log.handlers = [] ## hack to prevent extraneous handlers on ST2 auto-reload -log.addHandler(NullHandler()) -log.setLevel(logging.INFO) -if DEBUG: - log.addHandler(logging.StreamHandler()) - log.setLevel(logging.DEBUG) - - -def do_when(conditional, callback, *args, **kwargs): - if conditional(): - return callback(*args, **kwargs) - sublime.set_timeout(functools.partial(do_when, conditional, callback, *args, **kwargs), 50) - - -class Settings(dict): - """Combine default and user settings""" - def __init__(self, user_settings): - settings = DEFAULT_SETTINGS.copy() - settings.update(user_settings) - ## Combine core_patterns and patterns - settings['core_patterns'].update(settings['patterns']) - settings['patterns'] = settings.pop('core_patterns') - super(Settings, self).__init__(settings) - - -class ThreadProgress(object): - def __init__(self, thread, message, success_message, file_counter): - self.thread = thread - self.message = message - self.success_message = success_message - self.file_counter = file_counter - self.addend = 1 - self.size = 8 - sublime.set_timeout(lambda: self.run(0), 100) - - def run(self, i): - if not self.thread.is_alive(): - if hasattr(self.thread, 'result') and not self.thread.result: - sublime.status_message('') - return - sublime.status_message(self.success_message) - return - - before = i % self.size - after = (self.size - 1) - before - sublime.status_message('%s [%s=%s] (%s files scanned)' % \ - (self.message, ' ' * before, ' ' * after, self.file_counter)) - if not after: - self.addend = -1 - if not before: - self.addend = 1 - i += self.addend - sublime.set_timeout(lambda: self.run(i), 100) - - - -class TodoExtractor(object): - def __init__(self, settings, filepaths, dirpaths, ignored_dirs, ignored_file_patterns, - file_counter): - self.filepaths = filepaths - self.dirpaths = dirpaths - self.patterns = settings['patterns'] - self.settings = settings - self.file_counter = file_counter - self.ignored_dirs = ignored_dirs - self.ignored_files = ignored_file_patterns - self.log = logging.getLogger('SublimeTODO.extractor') - - def iter_files(self): - """""" - seen_paths_ = [] - files = self.filepaths - dirs = self.dirpaths - exclude_dirs = self.ignored_dirs - - for filepath in files: - pth = path.realpath(path.abspath(filepath)) - if pth not in seen_paths_: - seen_paths_.append(pth) - yield pth - - for dirpath in dirs: - dirpath = path.abspath(dirpath) - for dirpath, dirnames, filenames in walk(dirpath): - ## remove excluded dirs - ## TODO: These are not patterns. Consider making them glob patterns - for dir in exclude_dirs: - if dir in dirnames: - self.log.debug(u'Ignoring dir: {0}'.format(dir)) - dirnames.remove(dir) - - for filepath in filenames: - pth = path.join(dirpath, filepath) - pth = path.realpath(path.abspath(pth)) - if pth not in seen_paths_: - seen_paths_.append(pth) - yield pth - - def filter_files(self, files): - """""" - exclude_patterns = [re.compile(patt) for patt in self.ignored_files] - for filepath in files: - if any(patt.match(filepath) for patt in exclude_patterns): - continue - yield filepath - - def search_targets(self): - """Yield filtered filepaths for message extraction""" - return self.filter_files(self.iter_files()) - - def extract(self): - """""" - message_patterns = '|'.join(self.patterns.values()) - case_sensitivity = 0 if self.settings.get('case_sensitive', False) else re.IGNORECASE - patt = re.compile(message_patterns, case_sensitivity) - for filepath in self.search_targets(): - try: - f = open(filepath) - self.log.debug(u'Scanning {0}'.format(filepath)) - for linenum, line in enumerate(f): - for mo in patt.finditer(line): - ## Remove the non-matched groups - matches = [Message(msg_type, msg) for msg_type, msg in mo.groupdict().iteritems() if msg] - for match in matches: - yield {'filepath': filepath, 'linenum': linenum + 1, 'match': match} - except IOError: - ## Probably a broken symlink - f = None - finally: - self.file_counter.increment() - if f is not None: - f.close() - - -class TodoRenderer(object): - def __init__(self, settings, window, file_counter): - self.window = window - self.settings = settings - self.file_counter = file_counter - - @property - def view_name(self): - """The name of the new results view. Defined in settings.""" - return self.settings['result_title'] - - @property - def header(self): - hr = u'+ {0} +'.format('-' * 76) - return u'{hr}\n| TODOS @ {0:<68} |\n| {1:<76} |\n{hr}\n'.format( - datetime.now().strftime('%A %d %B %Y %H:%M').decode("utf-8"), - u'{0} files scanned'.format(self.file_counter), - hr=hr) - - @property - def view(self): - existing_results = [v for v in self.window.views() - if v.name() == self.view_name and v.is_scratch()] - if existing_results: - v = existing_results[0] - else: - v = self.window.new_file() - v.set_name(self.view_name) - v.set_scratch(True) - v.settings().set('todo_results', True) - return v - - def format(self, messages): - """Yield lines for rendering into results view. Includes headers and - blank lines. - Lines are returned in the form (type, content, [data]) where type is either - 'header', 'whitespace' or 'result' - """ - key_func = lambda m: m['match'].type - messages = sorted(messages, key=key_func) - - for message_type, matches in groupby(messages, key=key_func): - matches = list(matches) - if matches: - yield ('header', u'\n## {0} ({1})'.format(message_type.upper().decode('utf8', 'ignore'), len(matches)), {}) - for idx, m in enumerate(matches, 1): - msg = m['match'].msg.decode('utf8', 'ignore') ## Don't know the file encoding - filepath = path.basename(m['filepath']) - line = u"{idx}. {filepath}:{linenum} {msg}".format( - idx=idx, filepath=filepath, linenum=m['linenum'], msg=msg) - yield ('result', line, m) - - def render_to_view(self, formatted_results): - """This blocks the main thread, so make it quick""" - ## Header - result_view = self.view - edit = result_view.begin_edit() - result_view.erase(edit, sublime.Region(0, result_view.size())) - result_view.insert(edit, result_view.size(), self.header) - result_view.end_edit(edit) - - ## Region : match_dicts - regions = {} - - ## Result sections - for linetype, line, data in formatted_results: - edit = result_view.begin_edit() - insert_point = result_view.size() - result_view.insert(edit, insert_point, line) - if linetype == 'result': - rgn = sublime.Region(insert_point, result_view.size()) - regions[rgn] = data - result_view.insert(edit, result_view.size(), u'\n') - result_view.end_edit(edit) - - result_view.add_regions('results', regions.keys(), '') - - ## Store {Region : data} map in settings - ## TODO: Abstract this out to a storage class Storage.get(region) ==> data dict - ## Region() cannot be stored in settings, so convert to a primitive type - # d_ = regions - d_ = dict(('{0},{1}'.format(k.a, k.b), v) for k, v in regions.iteritems()) - result_view.settings().set('result_regions', d_) - - ## Set syntax and settings - result_view.set_syntax_file('Packages/SublimeTODO/todo_results.hidden-tmLanguage') - result_view.settings().set('line_padding_bottom', 2) - result_view.settings().set('line_padding_top', 2) - result_view.settings().set('word_wrap', False) - result_view.settings().set('command_mode', True) - self.window.focus_view(result_view) - - -class WorkerThread(threading.Thread): - def __init__(self, extractor, renderer): - self.extractor = extractor - self.renderer = renderer - threading.Thread.__init__(self) - - def run(self): - ## Extract in this thread - todos = self.extractor.extract() - rendered = list(self.renderer.format(todos)) - - ## Render into new window in main thread - def render(): - self.renderer.render_to_view(rendered) - sublime.set_timeout(render, 10) - - -class FileScanCounter(object): - """Thread-safe counter used to update the status bar""" - def __init__(self): - self.ct = 0 - self.lock = threading.RLock() - self.log = logging.getLogger('SublimeTODO') - - def __call__(self, filepath): - self.log.debug(u'Scanning %s' % filepath) - self.increment() - - def __str__(self): - with self.lock: - return '%d' % self.ct - - def increment(self): - with self.lock: - self.ct += 1 - - def reset(self): - with self.lock: - self.ct = 0 - - -class TodoCommand(sublime_plugin.TextCommand): - - def search_paths(self, window, open_files_only=False): - """Return (filepaths, dirpaths)""" - return ( - [view.file_name() for view in window.views() if view.file_name()], - window.folders() if not open_files_only else [] - ) - - def run(self, edit, open_files_only=False): - window = self.view.window() - settings = Settings(self.view.settings().get('todo', {})) - - - ## TODO: Cleanup this init code. Maybe move it to the settings object - filepaths, dirpaths = self.search_paths(window, open_files_only=open_files_only) - - ignored_dirs = settings.get('folder_exclude_patterns', []) - ## Get exclude patterns from global settings - ## Is there really no better way to access global settings? - global_settings = sublime.load_settings('Global.sublime-settings') - ignored_dirs.extend(global_settings.get('folder_exclude_patterns', [])) - - exclude_file_patterns = settings.get('file_exclude_patterns', []) - exclude_file_patterns.extend(global_settings.get('file_exclude_patterns', [])) - exclude_file_patterns.extend(global_settings.get('binary_file_patterns', [])) - exclude_file_patterns = [fnmatch.translate(patt) for patt in exclude_file_patterns] - - file_counter = FileScanCounter() - extractor = TodoExtractor(settings, filepaths, dirpaths, ignored_dirs, - exclude_file_patterns, file_counter) - renderer = TodoRenderer(settings, window, file_counter) - - worker_thread = WorkerThread(extractor, renderer) - worker_thread.start() - ThreadProgress(worker_thread, 'Finding TODOs', '', file_counter) - - -class NavigateResults(sublime_plugin.TextCommand): - DIRECTION = {'forward': 1, 'backward': -1} - STARTING_POINT = {'forward': -1, 'backward': 0} - - def __init__(self, view): - super(NavigateResults, self).__init__(view) - - def run(self, edit, direction): - view = self.view - settings = view.settings() - results = self.view.get_regions('results') - if not results: - sublime.status_message('No results to navigate') - return - - ##NOTE: numbers stored in settings are coerced to floats or longs - selection = int(settings.get('selected_result', self.STARTING_POINT[direction])) - selection = selection + self.DIRECTION[direction] - try: - target = results[selection] - except IndexError: - target = results[0] - selection = 0 - - settings.set('selected_result', selection) - ## Create a new region for highlighting - target = target.cover(target) - view.add_regions('selection', [target], 'selected', 'dot') - view.show(target) - - -class ClearSelection(sublime_plugin.TextCommand): - def run(self, edit): - self.view.erase_regions('selection') - self.view.settings().erase('selected_result') - - -class GotoComment(sublime_plugin.TextCommand): - def __init__(self, *args): - self.log = logging.getLogger('SublimeTODO.nav') - super(GotoComment, self).__init__(*args) - - def run(self, edit): - ## Get the idx of selected result region - selection = int(self.view.settings().get('selected_result', -1)) - ## Get the region - selected_region = self.view.get_regions('results')[selection] - ## Convert region to key used in result_regions (this is tedious, but - ## there is no other way to store regions with associated data) - data = self.view.settings().get('result_regions')['{0},{1}'.format(selected_region.a, selected_region.b)] - self.log.debug(u'Goto comment at {filepath}:{linenum}'.format(**data)) - new_view = self.view.window().open_file(data['filepath']) - do_when(lambda: not new_view.is_loading(), lambda: new_view.run_command("goto_line", {"line": data['linenum']})) - - -class MouseGotoComment(sublime_plugin.TextCommand): - def __init__(self, *args): - self.log = logging.getLogger('SublimeTODO.nav') - super(MouseGotoComment, self).__init__(*args) - - def highlight(self, region): - target = region.cover(region) - self.view.add_regions('selection', [target], 'selected', 'dot') - self.view.show(target) - - def get_result_region(self, pos): - line = self.view.line(pos) - return line - - def run(self, edit): - if not self.view.settings().get('result_regions'): - return - ## get selected line - pos = self.view.sel()[0].end() - result = self.get_result_region(pos) - self.highlight(result) - data = self.view.settings().get('result_regions')['{0},{1}'.format(result.a, result.b)] - self.log.debug(u'Goto comment at {filepath}:{linenum}'.format(**data)) - new_view = self.view.window().open_file(data['filepath']) - do_when(lambda: not new_view.is_loading(), lambda: new_view.run_command("goto_line", {"line": data['linenum']})) diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/todo_results.hidden-tmLanguage b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/todo_results.hidden-tmLanguage deleted file mode 100644 index e0cd6b4..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/SublimeTODO/todo_results.hidden-tmLanguage +++ /dev/null @@ -1,49 +0,0 @@ - - - - - name - TODO Results - - patterns - - - match - - ^[\s]{0,2}([\d]+\.) ([^:]+)(:)([\d]+) (.*)$ - captures - - 1 - - name - constant.numeric.item-number.todo-list - - 2 - - name - entity.name.filename.todo-list - - 3 - - name - punctuation.definition.delimiter - - 4 - - name - constant.numeric.line-number.todo-list - - 5 - - name - entity.name.match.todo-list - - - - - scopeName - text.todo-list - uuid - 2ce8c28e-9c29-4f7f-bc65-7c5311732d29 - - diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/.gitignore b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/.gitignore deleted file mode 100644 index 3aa864b..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/.gitignore +++ /dev/null @@ -1 +0,0 @@ -TODO.md diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/Default.sublime-commands b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/Default.sublime-commands deleted file mode 100644 index dd4df34..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/Default.sublime-commands +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "caption": "Trailing Spaces: Toggle Trailing Spaces Highlighting", - "command": "toggle_trailing_spaces" - }, - { - "caption": "Trailing Spaces: Delete Trailing Spaces", - "command": "delete_trailing_spaces" - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/MIT-LICENSE b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/MIT-LICENSE deleted file mode 100644 index 7104d54..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/MIT-LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2010 Jean-Denis Vauguet - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/Main.sublime-menu b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/Main.sublime-menu deleted file mode 100644 index 3d966e3..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/Main.sublime-menu +++ /dev/null @@ -1,123 +0,0 @@ -[ - { - "id": "edit", - "children": - [ - { - "caption": "Trailing Spaces", - "id": "trailing-spaces", - "children": - [ - { - "command": "delete_trailing_spaces", - "caption": "Delete" - }, - { "caption": "-" }, - { - "command": "toggle_trailing_spaces_modified_lines_only", - "caption": "Modified Lines Only", - "checkbox": true - }, - { - "command": "toggle_trailing_spaces", - "caption": "Highlight Regions", - "checkbox": true - } - ] - } - ] - }, - { - "id": "preferences", - "children": - [ - { - "caption": "Package Settings", - "mnemonic": "P", - "id": "package-settings", - "children": - [ - { - "caption": "Trailing Spaces", - "children": - [ - { - "command": "open_file", - "args": { - "file": "${packages}/TrailingSpaces/README.md", - "platform": "Windows" - }, - "caption": "Help" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/TrailingSpaces/README.md", - "platform": "OSX" - }, - "caption": "Help" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/TrailingSpaces/README.md", - "platform": "Linux" - }, - "caption": "Help" - }, - { "caption": "-" }, - { - "command": "open_file", - "args": { - "file": "${packages}/TrailingSpaces/trailing_spaces.sublime-settings", - "platform": "Windows" - }, - "caption": "Settings - Default" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/TrailingSpaces/trailing_spaces.sublime-settings", - "platform": "OSX" - }, - "caption": "Settings - Default" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/TrailingSpaces/trailing_spaces.sublime-settings", - "platform": "Linux" - }, - "caption": "Settings - Default" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/User/trailing_spaces.sublime-settings", - "platform": "Windows" - }, - "caption": "Settings - User" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/User/trailing_spaces.sublime-settings", - "platform": "OSX" - }, - "caption": "Settings - User" - }, - { - "command": "open_file", - "args": { - "file": "${packages}/User/trailing_spaces.sublime-settings", - "platform": "Linux" - }, - "caption": "Settings - User" - } - ] - } - ] - } - ] - } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/README.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/README.md deleted file mode 100644 index b5fb775..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/README.md +++ /dev/null @@ -1,337 +0,0 @@ -Trailing Spaces -=============== - -A [Sublime Text 2](http://www.sublimetext.com/2) and -[3](http://www.sublimetext.com/3) plugin that allows you to… - -**highlight trailing spaces and delete them in a flash!** - ---- - -- [Synopsis](#synopsis) -- [Installation](#installation) - - [Alternative installation methods](#alternative-installation-methods) - - [From github](#from-github) - - [Manually](#manually) -- [Usage](#usage) - - [Deletion](#deletion) - - [Toggling highlighting](#toggling-highlighting) -- [Options](#options) - - [Changing the highlighting color](#changing-the-highlighting-color) - - [Keeping trailing spaces invisible](#keeping-trailing-spaces-invisible) - - [Include Current Line](#include-current-line) - - [Include Empty Lines](#include-empty-lines) - - [Modified Lines Only](#modified-lines-only) - - [Trim On Save](#trim-on-save) - - [Save After Trim](#save-after-trim) - - [Live Matching vs On-demand Matching](#live-matching-vs-on-demand-matching) - - [For power-users only!](#for-power-users-only) - - [Disabled for large files](#disabled-for-large-files) - - [The matching pattern](#the-matching-pattern) -- [About Sublime Text's built-in features](#about-sublime-texts-built-in-features) - -Synopsis --------- - -Sublime Text provides a way to automate deletion of trailing spaces *upon file -saving* (more on this at the end of this file). Depending on your settings, it -may be more handy to just highlight them and/or delete them by hand, at any -time. This plugin provides just that, and a *lot* of options to fine-tune the -way you want to decimate trailing spaces. - -Installation ------------- - -It is available through -[Sublime Package Contol](http://wbond.net/sublime_packages/package_control) and -this is the recommended way of installation (brings configuration instructions, -automatic updates with changelogs…). - -### Alternative installation methods - -#### From github - -You can install from github if you want, although Package Control automates -just that. Go to your `Packages` subdirectory under ST2's data directory: - -* Windows: `%APPDATA%\Sublime Text 2` -* OS X: `~/Library/Application Support/Sublime Text 2` -* Linux: `~/.config/sublime-text-2` -* Portable Installation: `Sublime Text 2/Data` - -Then clone this repository: - - git clone git://github.com/SublimeText/TrailingSpaces.git - -#### Manually - -[Download](https://github.com/SublimeText/TrailingSpaces/archive/master.zip) -the plugin as a zip. Copy the *Trailing Spaces* directory to its location -(see prior section). - -Usage ------ - -### Deletion - -The main feature you gain from using this plugin is that of deleting all -trailing spaces in the currently edited document. In order to use this -deletion feature, you may either: - -* click on "Edit / Trailing Spaces / Delete"; -* bind the deletion command to a keyboard shortcut: - -To add a key binding, open "Preferences / Key Bindings - User" and add: - -``` js -{ "keys": ["ctrl+shift+t"], "command": "delete_trailing_spaces" } -``` - -With this setting, pressing Ctrl + Shift + t will delete all -trailing spaces at once in the current file! For OSX users, quoting wbond: -"When porting a key binding across OSes, it is common for the ctrl key on -Windows and Linux to be swapped out for super on OS X" -(eg. use "super+ctrl+t" instead). - -*Beware*: the binding from this example overrides the default ST's mapping -for reopening last closed file. You can look at the default bindings in -"Preferences / Key Bindings - Default". - -### Toggling highlighting - -At any time, you can toggle highlighting on and off. You may either: - -- click on "Edit / Trailing Spaces / Highlight Regions" -- bind the toggling command to a keyboard shortcut: - -``` js -// I like "d", as in "detect" (overrides a default binding, though). -{ "keys": ["ctrl+shift+d"], "command": "toggle_trailing_spaces" } -``` - -Options -------- - -Several options are available to customize the plugin's behavior. Those -settings are stored in a configuration file, as JSON. You must use a specific -file: Go to "Preferences / Package Settings / Trailing Spaces / Settings -- User" to add you custom settings. You can look at the default values in -"Settings - Default", in the same menu. - -A few of them are also accessible through the "Edit / Trailing Spaces" menu. -Sometimes, editing a setting will require a fresh Sublime Text to be applied -properly, so try relaunching ST before reporting an issue ;) - -All settings are global (ie. applied to all opened documents). - -### Changing the highlighting color - -*Default: "invalid"* - -You may change the highlighting color, providing a color scope name such as - "error", "comment"… just like that: - -``` js -{ "trailing_spaces_highlight_color": "comment" } -``` - -The scope should be defined in your current theme file. Here is a dummy, -fully-fledged example (feel free to cut irrelevant pieces for your settings) -of such a custom color scope: - -``` xml - - name - Invalid - Illegal - scope - invalid.illegal - settings - - background - #F93232 - fontStyle - - foreground - #F9F2CE - - -``` - -You would then use the value of "invalid.illegal". - -### Keeping trailing spaces invisible - -You can make trailing spaces "invisible" yet still rely on the deletion -command. To do that, set the highlight scope to an empty string: - -``` js -{ "trailing_spaces_highlight_color": "" } -``` - -Beware: this is **not** the same as *disabling* the highlighting (see "On- -Demand Matching" below). With this setting, the plugin still runs when opening -a file, and in the background afterwards; you just won't see the trailing -spaces (they are being highlighted with a "transparent" color). - -### Include Current Line - -*Default: true* - -Highlighting of trailing spaces in the currently edited line can be annoying: -each time you are about to start a new word, the space you type is matched as -a trailing spaces. Currently edited line can thus be ignored: - -``` js -{ "trailing_spaces_include_current_line": false } -``` - -Even though the trailing spaces are not highlighted on this line, they are -still internally matched and will be delete when firing the deletion command. - -### Include Empty Lines - -*Default: true* - -When firing the deletion command, empty lines are matched as trailing regions, -and end up being deleted. You can specifically ignore them: - -``` js -{ "trailing_spaces_include_empty_lines": false } -``` - -They will not be highlighted either. - -### Modified Lines Only - -*Default: false (reopen ST to update)* - -When firing the deletion command, trailing regions *in the entire document* are -deleted. There are some use-cases when deleting trailing spaces *only on lines -you edited* is smarter; for instance when commiting changes to some third-party -source code. - -At any time, you can change which area is covered when deleting trailing -regions. You may either: - -- click on "Edit / Trailing Spaces / Modified Lines Only" -- specify as a setting: - -``` js -{ "trailing_spaces_modified_lines_only": true } -``` - -There is also a command to toggle this feature on and off. You may thus define -a key binding: - -``` js -{ "keys": ["pick+a+shortcut"], "command": "toggle_trailing_spaces_modified_lines_only" } -``` - -### Trim On Save - -*Default: false* - -Setting this to `true` will ensure trailing spaces are deleted when you save -your document. It abides by the other settings, such as *Modified Lines Only*. - -``` js -{ "trailing_spaces_trim_on_save": true } -``` - -### Save After Trim - -*Default: false* - -You may not want to always trim trailing spaces on save, but the other way -around could prove useful. Setting this to `true` will automatically save your -document after you fire the deletion command: - -``` js -{ "trailing_spaces_save_after_trim": true } -``` - -It is obviously ignored if *Trim On Save* is on. - -### Live Matching vs On-demand Matching - -*Default: true (reopen ST to update)* - -By default, trailing regions are matched every time you edit the document, and -when you open it. - -This feature is entirely optional and you may set it off: firing the deletion -command will cause the trailing spaces to be deleted as expected even though -they were not matched prior to your request. If you are afraid of the plugin -to cause slowness (for instance, you already installed several *heavy* -plugins), you can disable live matching: - -``` js -{ "trailing_spaces_enabled": false } -``` - -In this case, for no trailing regions are matched until you request them to be -deleted, no highlighting occurs—it is in fact disabled, regardless of your -"scope" setting. If you want to check the trailing spaces regions, you can -toggle highlighting on and off. In this case, it may come in handy to define -a binding for the toggling command. When "On-demand Matching" is on and some -trailing spaces are highlighted, added ones will obviously not be. Toggling -highlight off and on will refresh them. - -### For power-users only! - -#### Disabled for large files - -The plugin is disabled altogether for large files, for it may cause slowness. -The default threshold is around 1 million of characters. This is -configurable (in "File Settings - User") and the unit is number of chars: - -``` js -{ "trailing_spaces_file_max_size": 1000} -``` - -#### The matching pattern - -*Default: [ \t]+* - -Trailing spaces are line-ending regions containing at least one simple space, -tabs, or both. This pattern should be all you ever need, but if you *do* want -to abide by another definition to cover edge-cases, go ahead: - -``` js -// *danger* will match newline chars and many other folks -"trailing_spaces_regexp": "[\\s]+" -``` - -About Sublime Text's built-in features --------------------------------------- - -Trailing Spaces is designed to be a drop-in replacement of the limited -*Trim Whitespace On Save* built-in feature. ST is indeed able to delete -trailing spaces upon saving files, and maybe that's all you need! - -In order to enable this behavior, edit "Preferences / Settings - User" -to add the following: - -``` js -{ "trim_trailing_white_space_on_save": true } -``` - -As Trailing Spaces bypasses this setting, you will have to uninstall it to -benefit from this setting. - -Made a little less obvious in the documentation are settings to showcase -whitespaces (*not only trailing ones!*): - -``` js -{ "draw_white_space": "all" } -``` - -and to ensure a newline is kept at end of file upon saving: - -``` js -{ "ensure_newline_at_eof_on_save": true } -``` - -The former will display *all* whitespaces in your files. There is another value -of "selection" which display whitespaces under (you got it) your current text -selection. diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/messages.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/messages.json deleted file mode 100644 index efaff86..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/messages.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "install": "messages/install.txt", - "v1.0.0": "messages/v1.0.0.txt" -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/messages/install.txt b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/messages/install.txt deleted file mode 100644 index 141f30c..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/messages/install.txt +++ /dev/null @@ -1,40 +0,0 @@ - - - Thank you for installing Trailing Spaces - ---------------------------------------- - - You're now ready to give trailing spaces *a hard time*! - - Wait… I guess Package Control just introduced some of them :( - Why don't you try clicking "Edit / Trailing Spaces / Delete"? - - - -Documentation -============= - -Although the usage of this plugin is dead simple, it comes with several options. All -details are available in the documentation, and you can read it by clicking on -"Preferences / Package Settings / Trailing Spaces / Help", or in a prettier form, by -browsing https://github.com/SublimeText/TrailingSpaces. - -Key Binding -=========== - -This plugin does not come with a default key binding for the deletion command. You can -pick your own key binding and define it in "Preferences / Key Bindings - User", or just -stick to using the menu entry under "Edit". Check the help for advice on this. - -Upgrades & Issues -================= - -Package Control will automatically update all packages every time the editor is started, -so there is nothing for you to worry about. If you however do find the plugin not to work -as it used to, head to the issues tracker (see links below) to report the problem. - -Useful Links -============ - -* Documentation & Code: https://github.com/SublimeText/TrailingSpaces -* Report issues / Request New Features / Roadmap: https://github.com/SublimeText/TrailingSpaces/issues -* Follow me on twitter: @jdvauguet diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/messages/v1.0.0.txt b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/messages/v1.0.0.txt deleted file mode 100644 index adb1f3b..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/messages/v1.0.0.txt +++ /dev/null @@ -1,65 +0,0 @@ - - - Trailing Spaces update [v1.0.0] - ------------------------------- - - Hope you've been happy gaving trailin' a hard time so far. - - I added several features to help you in this honorable quest… - - All details accessible through: - - "Preferences / Package Settings / Trailing Spaces / Help" - - - -New feature: Modified Lines Only -================================ - -As proposed by a fellow user, it is now possible to target only the lines -modified by You and You Only when deleting trailing spaces. - -This feature will certainly please coders who edit third-party code filled -with trailing spaces but do not want to commit giant diffs, just their little -fix, while keeping it clean. - -New feature: Trim On Save -========================= - -This option allows for automatic deletion upon saving. No more lost trailing -spaces! A perfect combo to the "Modified Lines Only" setting I guess. - -New feature: Save After Trim -============================ - -A different kind of automation: many users just want those trailings out and -forget 'bout them. It is now made even easier with this auto-saving hook. Fire -the deletion command, and your document is clean on the hard drive! - -At the current time, "Trim On Save" and "Save After Trim" cannot be both -enabled (the former wins), but this is on the roadmap. - -New Menu -======== - -Some of the settings seemed a bit more important than the others. Along the -deletion command, the toggling command/state and the "Modified Lines Only" -setting have been elected first-class citizens of the new "Edit / Trailing -Spaces" menu. Any change made by click here is live, persistent and reflected -in the JSON settings file. Settings are global to all open documents. - -Improvements & Misc. -==================== - -- Support for custom matching patterns (danger!). -- Performance improvements (reduced overhead, with some room for further - improvements). -- Better documentation (both code & user doc). -- Lazy "On-demand" matching improved. - -Useful Links -============ - -* Documentation & Code: https://github.com/SublimeText/TrailingSpaces -* Report issues / Request New Features / Roadmap: https://github.com/SublimeText/TrailingSpaces/issues -* Follow me on twitter: @jdvauguet diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/package-metadata.json deleted file mode 100644 index 38e6ff6..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://github.com/SublimeText/TrailingSpaces", "version": "2013.07.31.14.53.02", "description": "Highlight trailing spaces and delete them in a flash."} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/packages.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/packages.json deleted file mode 100644 index f7bb205..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/packages.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "schema_version": "1.2", - "packages": [ - { - "name": "TrailingSpaces", - "description": "Highlight trailing spaces and delete them in a flash.", - "author": "Jean-Denis Vauguet", - "homepage": "https://github.com/SublimeText/TrailingSpaces/", - "last_modified": "2013-03-08 01:00:00", - "platforms": { - "*": [ - { - "version": "1.0.0", - "url": "https://nodeload.github.com/SublimeText/TrailingSpaces/zip/v1.0.0" - } - ] - } - } - ] -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/trailing_spaces.py b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/trailing_spaces.py deleted file mode 100644 index 57a8902..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/trailing_spaces.py +++ /dev/null @@ -1,453 +0,0 @@ -''' -Provides both a trailing spaces highlighter and a deletion command. - -See README.md for details. - -@author: Jean-Denis Vauguet , Oktay Acikalin -@license: MIT (http://www.opensource.org/licenses/mit-license.php) -@since: 2011-02-25 -''' - -import sublime -import sublime_plugin -import difflib -import codecs - -DEFAULT_MAX_FILE_SIZE = 1048576 -DEFAULT_IS_ENABLED = True -DEFAULT_MODIFIED_LINES_ONLY = False - -# Global settings object and flags. -# Flags duplicate some of the (core) JSON settings, in case the settings file has -# been corrupted or is empty (ST2 really dislikes that!) -ts_settings_filename = "trailing_spaces.sublime-settings" -ts_settings = None -trailing_spaces_live_matching = DEFAULT_IS_ENABLED -trim_modified_lines_only = DEFAULT_MODIFIED_LINES_ONLY -startup_queue = [] -on_disk = None - - -# Private: Loads settings and sets whether the plugin (live matching) is enabled. -# -# Returns nothing. -def plugin_loaded(): - global ts_settings_filename, ts_settings, trailing_spaces_live_matching - global current_highlighting_scope, trim_modified_lines_only, startup_queue - global DEFAULT_COLOR_SCOPE_NAME, on_disk - - ts_settings = sublime.load_settings(ts_settings_filename) - trailing_spaces_live_matching = bool(ts_settings.get("trailing_spaces_enabled", - DEFAULT_IS_ENABLED)) - current_highlighting_scope = ts_settings.get("trailing_spaces_highlight_color", - "invalid") - DEFAULT_COLOR_SCOPE_NAME = current_highlighting_scope - trim_modified_lines_only = bool(ts_settings.get("trailing_spaces_modified_lines_only", - DEFAULT_MODIFIED_LINES_ONLY)) - - if trailing_spaces_live_matching: - for view in startup_queue: - match_trailing_spaces(view) - else: - current_highlighting_scope = "" - if ts_settings.get("trailing_spaces_highlight_color") != current_highlighting_scope: - persist_settings() - - -# Private: Updates user's settings with in-memory values. -# -# Allows for persistent settings from the menu. -# -# Returns nothing. -def persist_settings(): - sublime.save_settings(ts_settings_filename) - - -# Private: Determine if the view is a "Find results" view. -# -# view - the view, you know -# -# Returns True or False. -def is_find_results(view): - return view.settings().get('syntax') and "Find Results" in view.settings().get('syntax') - - -# Private: Get the regions matching trailing spaces. -# -# As the core regexp matches lines, the regions are, well, "per lines". -# -# view - the view, you know -# -# Returns both the list of regions which map to trailing spaces and the list of -# regions which are to be highlighted, as a list [matched, highlightable]. -def find_trailing_spaces(view): - sel = view.sel()[0] - line = view.line(sel.b) - include_empty_lines = bool(ts_settings.get("trailing_spaces_include_empty_lines", - DEFAULT_IS_ENABLED)) - include_current_line = bool(ts_settings.get("trailing_spaces_include_current_line", - DEFAULT_IS_ENABLED)) - regexp = ts_settings.get("trailing_spaces_regexp") + "$" - no_empty_lines_regexp = "(?<=\S)%s$" % regexp - - offending_lines = view.find_all(regexp if include_empty_lines else no_empty_lines_regexp) - - if include_current_line: - return [offending_lines, offending_lines] - else: - current_offender = view.find(regexp if include_empty_lines else no_empty_lines_regexp, line.a) - removal = False if current_offender == None else line.intersects(current_offender) - highlightable = [i for i in offending_lines if i != current_offender] if removal else offending_lines - return [offending_lines, highlightable] - - -# Private: Find the fraking trailing spaces in the view and flags them as such! -# -# It will refresh highlighted regions as well. Does not execute if the -# document's size exceeds the file_max_size setting, or if the fired in a view -# which is not a legacy document (helper/build views and so on). -# -# view - the view, you know -# -# Returns nothing. -def match_trailing_spaces(view): - if ts_settings is None: - startup_queue.append(view) - return - - # Silently pass if file is too big. - if max_size_exceeded(view): - return - - if not is_find_results(view): - (matched, highlightable) = find_trailing_spaces(view) - add_trailing_spaces_regions(view, matched) - highlight_trailing_spaces_regions(view, highlightable) - - -# Private: Checks whether the document is bigger than the max_size setting. -# -# view - the view, you know -# -# Returns True or False. -def max_size_exceeded(view): - return view.size() > ts_settings.get('trailing_spaces_file_max_size', - DEFAULT_MAX_FILE_SIZE) - - -# Private: Marks specified regions as trailing spaces. -# -# view - the view, you know -# regions - regions qualified as trailing spaces -# -# Returns nothing. -def add_trailing_spaces_regions(view, regions): - view.erase_regions('TrailingSpacesMatchedRegions') - view.add_regions('TrailingSpacesMatchedRegions', - regions, - "", - "", - sublime.HIDE_ON_MINIMAP) - - -# Private: Highlights specified regions as trailing spaces. -# -# It will use the scope enforced by the state of the toggable highlighting. -# -# view - the view, you know -# regions - regions qualified as trailing spaces -# -# Returns nothing. -def highlight_trailing_spaces_regions(view, regions): - view.erase_regions("TrailingSpacesHighlightedRegions") - view.add_regions('TrailingSpacesHighlightedRegions', - regions, - current_highlighting_scope or "", - "", - sublime.HIDE_ON_MINIMAP) - - -# Private: Toggles highlighting of all trailing spaces in the view. -# -# It has no effect is the plugin is disabled. -# -# view - the view, you know -# -# Returns True (highlighting was turned on) or False (turned off). -def toggle_highlighting(view): - global current_highlighting_scope - - # If the scope is that of an invisible, there is nothing to toggle. - if DEFAULT_COLOR_SCOPE_NAME == "": - return "disabled!" - - # If performing live, highlighted trailing regions must be updated - # internally. - if not trailing_spaces_live_matching: - (matched, highlightable) = find_trailing_spaces(view) - highlight_trailing_spaces_regions(view, highlightable) - - scope = DEFAULT_COLOR_SCOPE_NAME if current_highlighting_scope == "" else "" - current_highlighting_scope = scope - highlight_trailing_spaces_regions(view, view.get_regions('TrailingSpacesHighlightedRegions')) - return "off" if current_highlighting_scope == "" else "on" - - -# Clear all the highlighted regions in all views. -# -# FIXME: this is not used! Delete? -# -# window - the window, you know -# -# Returns nothing. -def clear_trailing_spaces_highlight(window): - for view in window.views(): - view.erase_regions('TrailingSpacesMatchedRegions') - - -# Find edited lines since last save, as line numbers, based on diff. -# -# It uses a Differ object to compute the diff between the file as red on the -# disk, and the current buffer (which may differ from the disk's state). See -# http://docs.python.org/2/library/difflib.html for details about diff codes. -# -# It relies on a full diff, so it may be expensive computation for very large -# files (diff generation + looping through all lines). -# -# old - a buffer of lines, as in "old version" -# new - a buffer of lines, as in "new version" -# -# Returns the list of edited line numbers. -def modified_lines_as_numbers(old, new): - d = difflib.Differ() - diffs = d.compare(old, new) - - # Pretty Naive Algorithm (tm): - # - split off the "Differ code", to check whether: - # - the line is in either in both files or just b: increment the line number - # - the line is only in b: it qualifies as an edited line! - # Starting from -1 as ST2 is internally 0-based for lines. - lineNum = -1 - edited_lines = [] - for line in diffs: - code = line[:2] - # those lines with "? " are not real! watch out! - if code in (" ", "+ "): - lineNum += 1 - if code == "+ ": - edited_lines.append(lineNum) - - return False if not edited_lines else edited_lines - - -# Private: Find the dirty lines. -# -# view - the view, you know -# -# Returns the list of regions matching dirty lines. -def get_modified_lines(view): - try: - on_disk - on_buffer = view.substr(sublime.Region(0, view.size())).splitlines() - except UnicodeDecodeError: - sublime.status_message("File format incompatible with this feature (UTF-8 files only)") - return - - lines = [] - line_numbers = modified_lines_as_numbers(on_disk, on_buffer) - if line_numbers: - lines = [view.full_line(view.text_point(number,0)) for number in line_numbers] - return lines - - -# Private: Finds the trailing spaces regions to be deleted. -# -# It abides by the user settings: while in mode "Only Modified Lines", it returns -# the subset of trailing spaces regions which are within dirty lines; otherwise, it -# returns all trailing spaces regions for the document. -# -# view - the view, you know -# -# Returns a list of regions to be deleted. -def find_regions_to_delete(view): - # If the plugin has been running in the background, regions have been matched. - # Otherwise, we must find trailing spaces right now! - if trailing_spaces_live_matching: - regions = view.get_regions('TrailingSpacesMatchedRegions') - else: - (regions, highlightable) = find_trailing_spaces(view) - - # Filtering is required in case triming is restricted to dirty regions only. - if trim_modified_lines_only: - modified_lines = get_modified_lines(view) - - # If there are no dirty lines, don't do nothing. - if not modified_lines: - return - - # Super-private: filters trailing spaces regions to dirty lines only. - # - # As one cannot perform a smart find_all within arbitrary boundaries, we must do some - # extra work: - # - we want to loop through the modified lines set, not the whole trailing regions - # - but we need a way to match modified lines with trailings to those very regions - # - # Hence the reversed dict on regions: keys are the text_point of the begining of - # each region, values are the region's actual boundaries. As a Region is unhashable, - # trailing regions are being recreated later on from those two values. - # - # We loop then loop through the modified lines: for each line, we get its begining - # text_point, and check whether it matches a line with trailing spaces in the - # reversed dict. If so, this is a match (a modified line with trailing spaces), so - # we can re-create and store a Region for the relevant trailing spaces boundaries. - # - # Returns the filtered list of trailing spaces regions for the modified lines set. - def only_those_with_trailing_spaces(): - regions_by_begin = {} - matches = [] - for region in regions: - begin = view.line(region).begin() - regions_by_begin[begin] = (region.begin(), region.end()) - - for line in modified_lines: - text_point = line.begin() - if text_point in regions_by_begin: - matches.append(sublime.Region(regions_by_begin[text_point][0], regions_by_begin[text_point][1])) - - return matches - - regions = only_those_with_trailing_spaces() - - return regions - -# Private: Deletes the trailing spaces regions. -# -# view - the view, you know -# edit - the Edit object spawned by the deletion command -# -# Returns the number of deleted regions. -def delete_trailing_regions(view, edit): - regions = find_regions_to_delete(view) - - if regions: - # Trick: reversing the regions takes care of the growing offset while - # deleting the successive regions. - regions.reverse() - for r in regions: - view.erase(edit, r) - return len(regions) - else: - return 0 - - -# Public: Toggles the highlighting on or off. -class ToggleTrailingSpacesCommand(sublime_plugin.WindowCommand): - def run(self): - view = self.window.active_view() - if max_size_exceeded(view): - sublime.status_message("File is too big, trailing spaces handling disabled.") - return - - state = toggle_highlighting(view) - ts_settings.set("trailing_spaces_highlight_color", current_highlighting_scope) - persist_settings() - sublime.status_message('Highlighting of trailing spaces is %s' % state) - - def is_checked(self): - return current_highlighting_scope != "" - - -# Public: Toggles "Modified Lines Only" mode on or off. -class ToggleTrailingSpacesModifiedLinesOnlyCommand(sublime_plugin.WindowCommand): - def run(self): - global trim_modified_lines_only - - was_on = ts_settings.get("trailing_spaces_modified_lines_only") - ts_settings.set("trailing_spaces_modified_lines_only", not was_on) - persist_settings() - - # TODO: use ts_settings.add_on_change() when it lands in ST3 - trim_modified_lines_only = ts_settings.get('trailing_spaces_modified_lines_only') - message = "Let's trim trailing spaces everywhere" if was_on \ - else "Let's trim trailing spaces only on modified lines" - sublime.status_message(message) - - def is_checked(self): - return ts_settings.get("trailing_spaces_modified_lines_only") - - -# Public: Matches and highlights trailing spaces on key events, according to the -# current settings. -class TrailingSpacesListener(sublime_plugin.EventListener): - def on_modified(self, view): - if trailing_spaces_live_matching: - match_trailing_spaces(view) - - def on_activated(self, view): - if trailing_spaces_live_matching: - match_trailing_spaces(view) - - def on_selection_modified(self, view): - if trailing_spaces_live_matching: - match_trailing_spaces(view) - - def on_activated(self, view): - self.freeze_last_version(view) - if trailing_spaces_live_matching: - match_trailing_spaces(view) - - def on_pre_save(self, view): - self.freeze_last_version(view) - if ts_settings.get("trailing_spaces_trim_on_save"): - view.run_command("delete_trailing_spaces") - - # Toggling messes with what is red from the disk, and it breaks the diff - # used when modified_lines_only is true. Honestly, I don't know why (yet). - # Anyway, let's cache the persisted version of the document's buffer for - # later use on specific event, so that we always have a decent version of - # "what's on the disk" to work with. - def freeze_last_version(self, view): - global on_disk - - file_name = view.file_name() - # For some reasons, the on_activated hook gets fired on a ghost document - # from time to time. - if file_name: - on_disk = codecs.open(file_name, "r", "utf-8").read().splitlines() - - -# Public: Deletes the trailing spaces. -class DeleteTrailingSpacesCommand(sublime_plugin.TextCommand): - def run(self, edit): - if max_size_exceeded(self.view): - sublime.status_message("File is too big, trailing spaces handling disabled.") - return - - deleted = delete_trailing_regions(self.view, edit) - - if deleted: - if ts_settings.get("trailing_spaces_save_after_trim") \ - and not ts_settings.get("trailing_spaces_trim_on_save"): - sublime.set_timeout(lambda: self.save(self.view), 10) - - msg_parts = {"nbRegions": deleted, - "plural": 's' if deleted > 1 else ''} - message = "Deleted %(nbRegions)s trailing spaces region%(plural)s" % msg_parts - else: - message = "No trailing spaces to delete!" - - sublime.status_message(message) - - def save(self, view): - if view.file_name() is None: - view.run_command('prompt_save_as') - else: - view.run_command('save') - - -# ST3 features a plugin_loaded hook which is called when ST's API is ready. -# -# We must therefore call our init callback manually on ST2. It must be the last -# thing in this plugin (thanks, beloved contributors!). -if not int(sublime.version()) > 3000: - plugin_loaded() diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/trailing_spaces.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/trailing_spaces.sublime-settings deleted file mode 100644 index 235c739..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/TrailingSpaces/trailing_spaces.sublime-settings +++ /dev/null @@ -1,56 +0,0 @@ -// Trailing Spaces' default settings. -// -// In order to tweak the settings, you should NOT edit this file, but instead -// the user-specific, empty-by-default version under "Preferences / Package -// Settings / Trailing Spaces / Settings - User". -// -// See Trailing Spaces' README for detailled instructions. -{ - // By default, Trailing Spaces is "live". It means the trailing spaces - // regions will be matched in the background, and highlighted if a color - // scope is defined, when the document is opened and edited. - // Set to false to disable live matching and highlighting (the deletion - // command remains available, so-called "lazy matching"). - "trailing_spaces_enabled" : true, - - // Highlight color is specified as a scope. You may define and use a custom - // scope to better fit your colorscheme. - "trailing_spaces_highlight_color" : "invalid", - - // By default, empty lines are cleared as well when calling the deletion - // command. - // Set to false to ignore empty lines upon deletion. - "trailing_spaces_include_empty_lines" : true, - - // By default, the line being currently edited will have its trailing - // spaces highlighted. - // Set to false to ignore trailing spaces on the edited line. - "trailing_spaces_include_current_line" : true, - - // By default, trailing spaces are deleted within the whole document. - // Set to true to affect only the lines you edited since last save. - // Trailing spaces will still be searched for and highlighted in the whole - // document. - "trailing_spaces_modified_lines_only": false, - - // By default, nothing happens on save. - // Set to true to trim trailing spaces before saving, with respect to the - // other settings. - "trailing_spaces_trim_on_save": false, - - // By default, deleting trailing spaces does not cause the document to be - // saved. - // Set to true to force saving after trailing spaces have been deleted. - // This setting is irrelevant and will be ignored if trim_on_save is true. - "trailing_spaces_save_after_trim": false, - - // ---- NEXT SETTINGS ARE FOR POWER USERS ONLY! ---- - - // Highlighting will be disabled if the edited file's size is larger than - // this. - // Adjust the value (in number of chars) to whatever fits your performance. - "trailing_spaces_file_max_size" : 1048576, - - // By default, only simple spaces and tabs are matched as "trailing spaces". - "trailing_spaces_regexp": "[ \t]+" -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ZZZ.EthanBrown.SublimeKeyMap.Editor/Default (OSX).sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ZZZ.EthanBrown.SublimeKeyMap.Editor/Default (OSX).sublime-keymap deleted file mode 100644 index 54262bb..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ZZZ.EthanBrown.SublimeKeyMap.Editor/Default (OSX).sublime-keymap +++ /dev/null @@ -1,442 +0,0 @@ - [ - // since we assign super+Shift+V to clipboard manager, use paste / indent with default super+v - { "keys": ["super+v"], "command": "paste_and_indent" }, - - //HACK: override the vertical column selections to use Ctrl+Shift in RDP - { "keys": ["ctrl+shift+up"], "command": "select_lines", "args": {"forward": false} }, - { "keys": ["ctrl+shift+down"], "command": "select_lines", "args": {"forward": true} }, - - //HACK: restore default shift+tab keybindings because SmartMarkdown messes with them too much - { "keys": ["shift+tab"], "command": "insert", "args": {"characters": "\t"} }, - { "keys": ["shift+tab"], "command": "unindent", "context": - [ - { "key": "setting.shift_tab_unindent", "operator": "equal", "operand": true } - ] - }, - { "keys": ["shift+tab"], "command": "unindent", "context": - [ - { "key": "preceding_text", "operator": "regex_match", "operand": "^[\t ]*" } - ] - }, - { "keys": ["shift+tab"], "command": "unindent", "context": - [ - { "key": "text", "operator": "regex_contains", "operand": "\n" } - ] - }, - { "keys": ["shift+tab"], "command": "prev_field", "context": - [ - { "key": "has_prev_field", "operator": "equal", "operand": true } - ] - }, - - //Abacus - https://github.com/khiltd/Abacus - { "keys": ["ctrl+alt+\\"], "command": "abacus" }, - - // Bracketeer - https://github.com/colinta/SublimeBracketeer - { "keys": ["super+]"], "command": "bracketeer_indent" }, - { "keys": ["ctrl+shift+["], "command": "bracketeer_select" }, - { "keys": ["ctrl+["], "command": "bracketeer_goto", "args": { "goto": "left" } }, - { "keys": ["ctrl+]"], "command": "bracketeer_goto", "args": { "goto": "right" } }, - { "keys": ["ctrl+alt+["], "command": "bracketeer_goto", "args": { "goto": "both" } }, - { "keys": ["ctrl+alt+]"], "command": "bracketeer_goto", "args": { "goto": "both" } }, - //| - //| BRACKETEER - //| - { "keys": ["{"], "command": "bracketeer", "args": { "braces": "{}", "unindent": true } }, - { "keys": ["}"], "command": "bracketeer", "args": { "braces": "{}", "pressed": "}", "unindent": true } }, - { "keys": ["["], "command": "bracketeer", "args": { "braces": "[]" } }, - { "keys": ["]"], "command": "bracketeer", "args": { "braces": "[]", "pressed": "]" } }, - { "keys": ["("], "command": "bracketeer", "args": { "braces": "()" } }, - { "keys": [")"], "command": "bracketeer", "args": { "braces": "()", "pressed": ")" } }, - //| reStructured Text - { "keys": ["alt+`"], "command": "bracketeer", "args": { "braces": "````", "pressed": "``" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.restructuredtext" } - ] - }, - { "keys": ["*"], "command": "bracketeer", "args": { "braces": "**", "pressed": "*" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.restructuredtext" } - ] - }, - //| DJANGO CURLIES - // For django, liquid, jinja. All the grammars *I* have list 'source.smarty' as - // when the cursor is inside "{}"s - { "keys": ["{"], "command": "bracketeer", "args": { "braces": "{ }" }, "context": - [{ "key": "selector", "operator": "equal", "operand": "source.smarty" }] - }, - { "keys": ["{"], "command": "bracketeer", "args": { "braces": "{ }" }, "context": - [{ "key": "selector", "operator": "equal", "operand": "meta.brace.curly" }] - }, - { "keys": ["%"], "command": "bracketeer", "args": { "braces": "% %" }, "context": - [{ "key": "selector", "operator": "equal", "operand": "source.smarty" }] - }, - { "keys": ["%"], "command": "bracketeer", "args": { "braces": "% %" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "meta.brace.curly" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "<$", "match_all": true } - ] - }, - { "keys": ["%"], "command": "insert_snippet", "args": { "contents": " $1 %>$0" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "source.ruby" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "<%$", "match_all": true } - ] - }, - { "keys": [">"], "command": "insert_snippet", "args": { "contents": ">$1<% $0" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "source.ruby" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "%$", "match_all": true } - ] - }, - { "keys": ["="], "command": "insert_snippet", "args": { "contents": "= $1 %>$0" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "source.ruby" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "<%$", "match_all": true } - ] - }, - { "keys": ["-"], "command": "insert_snippet", "args": { "contents": "- $1 %>$0" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "source.ruby" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "<%$", "match_all": true } - ] - }, - { "keys": ["#"], "command": "bracketeer", "args": { "braces": "# #" }, "context": - [{ "key": "selector", "operator": "equal", "operand": "source.smarty" }] - }, - //| QUOTES - { "keys": ["\""], "command": "bracketeer", "args": { "braces": "\"\"", "pressed": "\"" } }, - { "keys": ["ctrl+'","ctrl+'"], "command": "bracketeer", "args": { "braces": "\"\"\"\n\n\"\"\"" } }, - { "keys": ["'"], "command": "bracketeer", "args": { "braces": "''", "pressed": "'" } }, - { "keys": ["ctrl+'","'"], "command": "bracketeer", "args": { "braces": "'''\n\n'''" } }, - { "keys": ["`"], "command": "bracketeer", "args": { "braces": "``", "pressed": "`" } }, - { "keys": ["ctrl+'","`"], "command": "insert_snippet", "args": { "contents": "```${1:syntax}\n$0\n```" } }, - { "keys": ["«"], "command": "bracketeer", "args": { "braces": "«»" } }, - { "keys": ["»"], "command": "bracketeer", "args": { "braces": "«»", "pressed": "»" } }, - { "keys": ["‹"], "command": "bracketeer", "args": { "braces": "‹›" } }, - { "keys": ["›"], "command": "bracketeer", "args": { "braces": "‹›", "pressed": "›" } }, - { "keys": ["“"], "command": "bracketeer", "args": { "braces": "“”" } }, - { "keys": ["”"], "command": "bracketeer", "args": { "braces": "“”", "pressed": "”" } }, - { "keys": ["‘"], "command": "bracketeer", "args": { "braces": "‘’" } }, - { "keys": ["’"], "command": "bracketeer", "args": { "braces": "‘’", "pressed": "’" } }, - //| - //| AUTO DELETE MATCHING '', "", [], etc. - //| - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "\"$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^\"" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "'$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^'" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "`$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^`" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "«$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^»" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "‹$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^›" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "“$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^”" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "‘$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^’" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.restructuredtext" }, - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "\\*$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^\\*" } - ] - }, - //| - //| Bracket and select - //| - { "keys": ["ctrl+alt+[", "backspace"], "command": "bracketeer", "args": { "braces": "", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "{"], "command": "bracketeer", "args": { "braces": "{}", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "{"], "command": "bracketeer", "args": { "braces": "{}", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", " "], "command": "bracketeer", "args": { "braces": " ", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", " "], "command": "bracketeer", "args": { "braces": " ", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "["], "command": "bracketeer", "args": { "braces": "[]", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "["], "command": "bracketeer", "args": { "braces": "[]", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "("], "command": "bracketeer", "args": { "braces": "()", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "("], "command": "bracketeer", "args": { "braces": "()", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "\""], "command": "bracketeer", "args": { "braces": "\"\"", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "\""], "command": "bracketeer", "args": { "braces": "\"\"", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "ctrl+shift+'"], "command": "bracketeer", "args": { "braces": "\"\"\"\"\"\"", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "ctrl+shift+'"], "command": "bracketeer", "args": { "braces": "\"\"\"\"\"\"", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "'"], "command": "bracketeer", "args": { "braces": "''", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "'"], "command": "bracketeer", "args": { "braces": "''", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "ctrl+'"], "command": "bracketeer", "args": { "braces": "''''''", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "ctrl+'"], "command": "bracketeer", "args": { "braces": "''''''", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "`"], "command": "bracketeer", "args": { "braces": "``", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "`"], "command": "bracketeer", "args": { "braces": "``", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "ctrl+`"], "command": "bracketeer", "args": { "braces": "``````", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "ctrl+`"], "command": "bracketeer", "args": { "braces": "``````", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "«"], "command": "bracketeer", "args": { "braces": "«»", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "«"], "command": "bracketeer", "args": { "braces": "«»", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "‹"], "command": "bracketeer", "args": { "braces": "‹›", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "‹"], "command": "bracketeer", "args": { "braces": "‹›", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "“"], "command": "bracketeer", "args": { "braces": "“”", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "“"], "command": "bracketeer", "args": { "braces": "“”", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "‘"], "command": "bracketeer", "args": { "braces": "‘’", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "‘"], "command": "bracketeer", "args": { "braces": "‘’", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "alt+`"], "command": "bracketeer", "args": { "braces": "````", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "alt+`"], "command": "bracketeer", "args": { "braces": "````", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "*"], "command": "bracketeer", "args": { "braces": "**", "select": true }, "context": - [ - { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, - { "key": "selector", "operator": "equal", "operand": "text.restructuredtext" } - ] - }, - { "keys": ["ctrl+alt+[", "*"], "command": "bracketeer", "args": { "braces": "**", "select": true, "replace": true }, "context": - [ - { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, - { "key": "selector", "operator": "equal", "operand": "text.restructuredtext" } - ] - }, - - //BracketHighlighter - https://github.com/facelessuser/BracketHighlighter/ - - // ClipboardManager - https://github.com/colinta/SublimeClipboardManager - { "keys": ["super+x"], "command": "clipboard_manager_cut" }, - { "keys": ["super+c"], "command": "clipboard_manager_copy" }, - { "keys": ["super+v"], "command": "clipboard_manager_paste", "args": { "indent": true } }, - { "keys": ["super+alt+v"], "command": "clipboard_manager_next_and_paste" }, - { "keys": ["super+shift+alt+v"], "command": "clipboard_manager_previous_and_paste" }, - //{ "keys": ["super+pageup"], "command": "clipboard_manager_next" }, - //{ "keys": ["super+pagedown"], "command": "clipboard_manager_previous" }, - //{ "keys": ["super+home"], "command": "clipboard_manager_show" }, - { "keys": ["super+shift+v"], "command": "clipboard_manager_choose_and_paste" }, - - // EasyMotion - https://github.com/tednaleid/sublime-EasyMotion - { - "keys": ["super+;", ""], - "command": "easy_motion", - "args": {"select_text": false} - }, - { - "keys": ["super+;", "enter"], - "command": "easy_motion", - "args": {"select_text": false, "character": "enter"} - }, - { - "keys": ["super+shift+;", ""], - "command": "easy_motion", - "args": {"select_text": true} - }, - { - "keys": ["super+shift+;", "enter"], - "command": "easy_motion", - "args": {"select_text": true, "character": "enter"} - } - - // ExportHTML - https://github.com/facelessuser/ExportHtml - // use defaults - - // FileDiffs - https://github.com/colinta/SublimeFileDiffs - { "keys": ["ctrl+shift+d"], "command": "file_diff_menu" }, - - // Smart Markdown - https://github.com/demon386/SmartMarkdown - // accept all the defaults for building lists and tables - { "keys": ["tab"], "command": "smart_folding", "context": - [{ "key": "selector", "operator": "equal", "operand": "markup.heading.markdown" }] - }, - { "keys": ["shift+tab"], "command": "global_folding", "context": - [{ "key": "selector", "operator": "equal", "operand": "text.html.markdown" }] - }, - { "keys": ["enter"], "command": "smart_list", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*([-+\\**]|\\d+\\.+)\\s+" } - ]}, - { "keys": ["enter"], "command": "smart_list", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "selector", "operator": "equal", "operand": "markup.list" } - ]}, - { "keys": ["tab"], "command": "smart_table", "args": {"forward": true}, "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\\||\\+[-=])", "match_all": true} - ]}, - { "keys": ["tab"], "command": "smart_table", "args": {"forward": true}, "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*" }, - { "key": "following_text", "operator": "regex_contains", "operand": "\\s*(\\||\\+[-=])", "match_all": true} - ]}, - { "keys": ["shift+tab"], "command": "smart_table", "args": {"forward": false}, "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\\||\\+[-=])", - "match_all": true} - ]}, - { "keys": ["shift+tab"], "command": "smart_table", "args": {"forward": false}, "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*" }, - { "key": "following_text", "operator": "regex_contains", "operand": "\\s*(\\||\\+[-=])", "match_all": true} - ]}, - { - "keys": ["super+shift+."], "command": "change_heading_level", "args": {"up": true}, "context": [ - {"key": "selector", "operator": "equal", "operand": "text.html.markdown"} - ]}, - { - "keys": ["super+shift+,"], "command": "change_heading_level", "args": {"up": false}, "context": [ - {"key": "selector", "operator": "equal", "operand": "text.html.markdown"} - ]}, - - //Sublime Text 2 - Related Files - https://github.com/fabiokr/sublime-related-files - { "keys": ["ctrl+alt+t"], "command": "related_files" }, - - //SublimeTODO - https://github.com/robcowie/SublimeTODO - // { - // "keys": ["n"], "command": "goto_next_result", - // "context": [{ "key": "setting.todo_results", "operator": "equal", "operand": true }] - // } - { - "keys": ["n"], "command": "navigate_results", - //// {"key": "setting.todo_results"} - "context": [ {"key": "setting.command_mode", "operand": true}], - "args": {"direction": "forward"} - }, - { - "keys": ["down"], "command": "navigate_results", - // {"key": "setting.todo_results"} - "context": [{"key": "setting.command_mode", "operand": true}], - "args": {"direction": "forward"} - }, - { - "keys": ["j"], "command": "navigate_results", - "context": [{"key": "setting.command_mode", "operand": true}], - // {"key": "setting.todo_results"} - "args": {"direction": "forward"} - }, - { - "keys": ["p"], "command": "navigate_results", - // {"key": "setting.todo_results"} - "context": [{"key": "setting.command_mode", "operand": true}], - "args": {"direction": "backward"} - }, - { - "keys": ["up"], "command": "navigate_results", - //{"key": "setting.todo_results"} - "context": [{"key": "setting.command_mode", "operand": true}], - "args": {"direction": "backward"} - }, - { - "keys": ["k"], "command": "navigate_results", - "context": [{"key": "setting.command_mode", "operand": true}], - //{"key": "setting.todo_results"} - "args": {"direction": "backward"} - }, - { - "keys": ["c"], "command": "clear_selection", - // {"key": "setting.todo_results"} - "context": [{"key": "setting.command_mode", "operand": true}] - }, - { - "keys": ["enter"], "command": "goto_comment", - // {"key": "setting.todo_results"} - "context": [{"key": "setting.command_mode", "operand": true}] - }, - - //Snippet Browsing Keybindings - { "keys": ["shift+f1"], "command": "show_overlay", - "args": {"overlay": "command_palette", "text": "snippet"} } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ZZZ.EthanBrown.SublimeKeyMap.Editor/Default (Windows).sublime-keymap b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ZZZ.EthanBrown.SublimeKeyMap.Editor/Default (Windows).sublime-keymap deleted file mode 100644 index 42196a3..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ZZZ.EthanBrown.SublimeKeyMap.Editor/Default (Windows).sublime-keymap +++ /dev/null @@ -1,438 +0,0 @@ - [ - // since we assign Ctrl+Shift+V to clipboard manager, use paste / indent with default Ctrl+v - { "keys": ["ctrl+v"], "command": "paste_and_indent" }, - - //HACK: override the vertical column selections to use Ctrl+Shift in RDP - { "keys": ["ctrl+shift+up"], "command": "select_lines", "args": {"forward": false} }, - { "keys": ["ctrl+shift+down"], "command": "select_lines", "args": {"forward": true} }, - - //HACK: restore default shift+tab keybindings because SmartMarkdown messes with them too much - { "keys": ["shift+tab"], "command": "insert", "args": {"characters": "\t"} }, - { "keys": ["shift+tab"], "command": "unindent", "context": - [ - { "key": "setting.shift_tab_unindent", "operator": "equal", "operand": true } - ] - }, - { "keys": ["shift+tab"], "command": "unindent", "context": - [ - { "key": "preceding_text", "operator": "regex_match", "operand": "^[\t ]*" } - ] - }, - { "keys": ["shift+tab"], "command": "unindent", "context": - [ - { "key": "text", "operator": "regex_contains", "operand": "\n" } - ] - }, - { "keys": ["shift+tab"], "command": "prev_field", "context": - [ - { "key": "has_prev_field", "operator": "equal", "operand": true } - ] - }, - - //Abacus - https://github.com/khiltd/Abacus - { "keys": ["ctrl+alt+\\"], "command": "abacus" }, - - // Bracketeer - https://github.com/colinta/SublimeBracketeer - { "keys": ["super+]"], "command": "bracketeer_indent" }, - { "keys": ["ctrl+shift+["], "command": "bracketeer_select" }, - { "keys": ["ctrl+["], "command": "bracketeer_goto", "args": { "goto": "left" } }, - { "keys": ["ctrl+]"], "command": "bracketeer_goto", "args": { "goto": "right" } }, - { "keys": ["ctrl+alt+["], "command": "bracketeer_goto", "args": { "goto": "both" } }, - { "keys": ["ctrl+alt+]"], "command": "bracketeer_goto", "args": { "goto": "both" } }, - //| - //| BRACKETEER - //| - { "keys": ["{"], "command": "bracketeer", "args": { "braces": "{}", "unindent": true } }, - { "keys": ["}"], "command": "bracketeer", "args": { "braces": "{}", "pressed": "}", "unindent": true } }, - { "keys": ["["], "command": "bracketeer", "args": { "braces": "[]" } }, - { "keys": ["]"], "command": "bracketeer", "args": { "braces": "[]", "pressed": "]" } }, - { "keys": ["("], "command": "bracketeer", "args": { "braces": "()" } }, - { "keys": [")"], "command": "bracketeer", "args": { "braces": "()", "pressed": ")" } }, - //| reStructured Text - { "keys": ["alt+`"], "command": "bracketeer", "args": { "braces": "````", "pressed": "``" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.restructuredtext" } - ] - }, - { "keys": ["*"], "command": "bracketeer", "args": { "braces": "**", "pressed": "*" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.restructuredtext" } - ] - }, - //| DJANGO CURLIES - // For django, liquid, jinja. All the grammars *I* have list 'source.smarty' as - // when the cursor is inside "{}"s - { "keys": ["{"], "command": "bracketeer", "args": { "braces": "{ }" }, "context": - [{ "key": "selector", "operator": "equal", "operand": "source.smarty" }] - }, - { "keys": ["{"], "command": "bracketeer", "args": { "braces": "{ }" }, "context": - [{ "key": "selector", "operator": "equal", "operand": "meta.brace.curly" }] - }, - { "keys": ["%"], "command": "bracketeer", "args": { "braces": "% %" }, "context": - [{ "key": "selector", "operator": "equal", "operand": "source.smarty" }] - }, - { "keys": ["%"], "command": "bracketeer", "args": { "braces": "% %" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "meta.brace.curly" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "<$", "match_all": true } - ] - }, - { "keys": ["%"], "command": "insert_snippet", "args": { "contents": " $1 %>$0" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "source.ruby" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "<%$", "match_all": true } - ] - }, - { "keys": [">"], "command": "insert_snippet", "args": { "contents": ">$1<% $0" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "source.ruby" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "%$", "match_all": true } - ] - }, - { "keys": ["="], "command": "insert_snippet", "args": { "contents": "= $1 %>$0" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "source.ruby" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "<%$", "match_all": true } - ] - }, - { "keys": ["-"], "command": "insert_snippet", "args": { "contents": "- $1 %>$0" }, "context": - [ - { "key": "selector", "operator": "equal", "operand": "source.ruby" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "<%$", "match_all": true } - ] - }, - { "keys": ["#"], "command": "bracketeer", "args": { "braces": "# #" }, "context": - [{ "key": "selector", "operator": "equal", "operand": "source.smarty" }] - }, - //| QUOTES - { "keys": ["\""], "command": "bracketeer", "args": { "braces": "\"\"", "pressed": "\"" } }, - { "keys": ["ctrl+'","ctrl+'"], "command": "bracketeer", "args": { "braces": "\"\"\"\n\n\"\"\"" } }, - { "keys": ["'"], "command": "bracketeer", "args": { "braces": "''", "pressed": "'" } }, - { "keys": ["ctrl+'","'"], "command": "bracketeer", "args": { "braces": "'''\n\n'''" } }, - { "keys": ["`"], "command": "bracketeer", "args": { "braces": "``", "pressed": "`" } }, - { "keys": ["ctrl+'","`"], "command": "insert_snippet", "args": { "contents": "```${1:syntax}\n$0\n```" } }, - { "keys": ["«"], "command": "bracketeer", "args": { "braces": "«»" } }, - { "keys": ["»"], "command": "bracketeer", "args": { "braces": "«»", "pressed": "»" } }, - { "keys": ["‹"], "command": "bracketeer", "args": { "braces": "‹›" } }, - { "keys": ["›"], "command": "bracketeer", "args": { "braces": "‹›", "pressed": "›" } }, - { "keys": ["“"], "command": "bracketeer", "args": { "braces": "“”" } }, - { "keys": ["”"], "command": "bracketeer", "args": { "braces": "“”", "pressed": "”" } }, - { "keys": ["‘"], "command": "bracketeer", "args": { "braces": "‘’" } }, - { "keys": ["’"], "command": "bracketeer", "args": { "braces": "‘’", "pressed": "’" } }, - //| - //| AUTO DELETE MATCHING '', "", [], etc. - //| - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "\"$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^\"" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "'$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^'" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "`$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^`" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "«$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^»" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "‹$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^›" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "“$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^”" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "‘$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^’" } - ] - }, - { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Left Right.sublime-macro"}, "context": - [ - { "key": "selector", "operator": "equal", "operand": "text.restructuredtext" }, - { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, - { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "\\*$" }, - { "key": "following_text", "operator": "regex_contains", "operand": "^\\*" } - ] - }, - //| - //| Bracket and select - //| - { "keys": ["ctrl+alt+[", "backspace"], "command": "bracketeer", "args": { "braces": "", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "{"], "command": "bracketeer", "args": { "braces": "{}", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "{"], "command": "bracketeer", "args": { "braces": "{}", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", " "], "command": "bracketeer", "args": { "braces": " ", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", " "], "command": "bracketeer", "args": { "braces": " ", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "["], "command": "bracketeer", "args": { "braces": "[]", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "["], "command": "bracketeer", "args": { "braces": "[]", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "("], "command": "bracketeer", "args": { "braces": "()", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "("], "command": "bracketeer", "args": { "braces": "()", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "\""], "command": "bracketeer", "args": { "braces": "\"\"", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "\""], "command": "bracketeer", "args": { "braces": "\"\"", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "ctrl+shift+'"], "command": "bracketeer", "args": { "braces": "\"\"\"\"\"\"", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "ctrl+shift+'"], "command": "bracketeer", "args": { "braces": "\"\"\"\"\"\"", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "'"], "command": "bracketeer", "args": { "braces": "''", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "'"], "command": "bracketeer", "args": { "braces": "''", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "ctrl+'"], "command": "bracketeer", "args": { "braces": "''''''", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "ctrl+'"], "command": "bracketeer", "args": { "braces": "''''''", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "`"], "command": "bracketeer", "args": { "braces": "``", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "`"], "command": "bracketeer", "args": { "braces": "``", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "ctrl+`"], "command": "bracketeer", "args": { "braces": "``````", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "ctrl+`"], "command": "bracketeer", "args": { "braces": "``````", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "«"], "command": "bracketeer", "args": { "braces": "«»", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "«"], "command": "bracketeer", "args": { "braces": "«»", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "‹"], "command": "bracketeer", "args": { "braces": "‹›", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "‹"], "command": "bracketeer", "args": { "braces": "‹›", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "“"], "command": "bracketeer", "args": { "braces": "“”", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "“"], "command": "bracketeer", "args": { "braces": "“”", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "‘"], "command": "bracketeer", "args": { "braces": "‘’", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "‘"], "command": "bracketeer", "args": { "braces": "‘’", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "alt+`"], "command": "bracketeer", "args": { "braces": "````", "select": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+alt+[", "alt+`"], "command": "bracketeer", "args": { "braces": "````", "select": true, "replace": true }, "context": - [{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }] - }, - { "keys": ["ctrl+[", "*"], "command": "bracketeer", "args": { "braces": "**", "select": true }, "context": - [ - { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, - { "key": "selector", "operator": "equal", "operand": "text.restructuredtext" } - ] - }, - { "keys": ["ctrl+alt+[", "*"], "command": "bracketeer", "args": { "braces": "**", "select": true, "replace": true }, "context": - [ - { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true }, - { "key": "selector", "operator": "equal", "operand": "text.restructuredtext" } - ] - }, - - //BracketHighlighter - https://github.com/facelessuser/BracketHighlighter/ - - // ClipboardManager - https://github.com/colinta/SublimeClipboardManager - { "keys": ["ctrl+x"], "command": "clipboard_manager_cut" }, - { "keys": ["ctrl+c"], "command": "clipboard_manager_copy" }, - { "keys": ["ctrl+v"], "command": "clipboard_manager_paste", "args": { "indent": true } }, - { "keys": ["ctrl+alt+v"], "command": "clipboard_manager_next_and_paste" }, - { "keys": ["ctrl+shift+alt+v"], "command": "clipboard_manager_previous_and_paste" }, - //{ "keys": ["ctrl+pageup"], "command": "clipboard_manager_next" }, - //{ "keys": ["ctrl+pagedown"], "command": "clipboard_manager_previous" }, - //{ "keys": ["ctrl+home"], "command": "clipboard_manager_show" }, - { "keys": ["ctrl+shift+v"], "command": "clipboard_manager_choose_and_paste" }, - - // EasyMotion - https://github.com/tednaleid/sublime-EasyMotion - { - "keys": ["ctrl+.", ""], - "command": "easy_motion", "args": {"select_text": false} - }, - { - "keys": ["ctrl+.", "enter"], - "command": "easy_motion", "args": {"select_text": false, "character": "enter"} - }, - { - "keys": ["ctrl+shift+.", ""], - "command": "easy_motion", "args": {"select_text": true} - }, - { - "keys": ["ctrl+shift+.", "enter"], - "command": "easy_motion", "args": {"select_text": true, "character": "enter"} - }, - - // ExportHTML - https://github.com/facelessuser/ExportHtml - // use defaults - - // FileDiffs - https://github.com/colinta/SublimeFileDiffs - { "keys": ["ctrl+shift+d"], "command": "file_diff_menu" }, - - // Smart Markdown - https://github.com/demon386/SmartMarkdown - // accept all the defaults for building lists and tables - { "keys": ["tab"], "command": "smart_folding", "context": - [{ "key": "selector", "operator": "equal", "operand": "markup.heading.markdown" }] - }, - { "keys": ["shift+tab"], "command": "global_folding", "context": - [{ "key": "selector", "operator": "equal", "operand": "text.html.markdown" }] - }, - { "keys": ["enter"], "command": "smart_list", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*([-+\\**]|\\d+\\.+)\\s+" } - ]}, - { "keys": ["enter"], "command": "smart_list", "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "selector", "operator": "equal", "operand": "markup.list" } - ]}, - { "keys": ["tab"], "command": "smart_table", "args": {"forward": true}, "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\\||\\+[-=])", "match_all": true} - ]}, - { "keys": ["tab"], "command": "smart_table", "args": {"forward": true}, "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*" }, - { "key": "following_text", "operator": "regex_contains", "operand": "\\s*(\\||\\+[-=])", "match_all": true} - ]}, - { "keys": ["shift+tab"], "command": "smart_table", "args": {"forward": false}, "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(\\||\\+[-=])", - "match_all": true} - ]}, - { "keys": ["shift+tab"], "command": "smart_table", "args": {"forward": false}, "context": [ - { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }, - { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*" }, - { "key": "following_text", "operator": "regex_contains", "operand": "\\s*(\\||\\+[-=])", "match_all": true} - ]}, - { - "keys": ["super+shift+."], "command": "change_heading_level", "args": {"up": true}, "context": [ - {"key": "selector", "operator": "equal", "operand": "text.html.markdown"} - ]}, - { - "keys": ["super+shift+,"], "command": "change_heading_level", "args": {"up": false}, "context": [ - {"key": "selector", "operator": "equal", "operand": "text.html.markdown"} - ]}, - - //Sublime Text 2 - Related Files - https://github.com/fabiokr/sublime-related-files - { "keys": ["ctrl+alt+t"], "command": "related_files" }, - - //SublimeTODO - https://github.com/robcowie/SublimeTODO - // { - // "keys": ["n"], "command": "goto_next_result", - // "context": [{ "key": "setting.todo_results", "operator": "equal", "operand": true }] - // } - { - "keys": ["n"], "command": "navigate_results", - //// {"key": "setting.todo_results"} - "context": [ {"key": "setting.command_mode", "operand": true}], - "args": {"direction": "forward"} - }, - { - "keys": ["down"], "command": "navigate_results", - // {"key": "setting.todo_results"} - "context": [{"key": "setting.command_mode", "operand": true}], - "args": {"direction": "forward"} - }, - { - "keys": ["j"], "command": "navigate_results", - "context": [{"key": "setting.command_mode", "operand": true}], - // {"key": "setting.todo_results"} - "args": {"direction": "forward"} - }, - { - "keys": ["p"], "command": "navigate_results", - // {"key": "setting.todo_results"} - "context": [{"key": "setting.command_mode", "operand": true}], - "args": {"direction": "backward"} - }, - { - "keys": ["up"], "command": "navigate_results", - //{"key": "setting.todo_results"} - "context": [{"key": "setting.command_mode", "operand": true}], - "args": {"direction": "backward"} - }, - { - "keys": ["k"], "command": "navigate_results", - "context": [{"key": "setting.command_mode", "operand": true}], - //{"key": "setting.todo_results"} - "args": {"direction": "backward"} - }, - { - "keys": ["c"], "command": "clear_selection", - // {"key": "setting.todo_results"} - "context": [{"key": "setting.command_mode", "operand": true}] - }, - { - "keys": ["enter"], "command": "goto_comment", - // {"key": "setting.todo_results"} - "context": [{"key": "setting.command_mode", "operand": true}] - }, - - //Snippet Browsing Keybindings - { "keys": ["shift+f1"], "command": "show_overlay", - "args": {"overlay": "command_palette", "text": "snippet"} } -] diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ZZZ.EthanBrown.SublimeKeyMap.Editor/README.md b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ZZZ.EthanBrown.SublimeKeyMap.Editor/README.md deleted file mode 100644 index 94d0340..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ZZZ.EthanBrown.SublimeKeyMap.Editor/README.md +++ /dev/null @@ -1,38 +0,0 @@ -SublimeKeyMap.Editor -==================== - -A simple repository used to host / share my customized Sublime Text 2 key bindings for Sublime editor enhancement plugins - -Designed to be incorporated into `Package Control.sublime-settings` like: - -```json -{ - "installed_packages": - [ - "Abacus", - "Block Cursor Everywhere", - "Bracketeer", - "BracketHighlighter", - "Clipboard Manager", - "EasyMotion", - "ExportHtml", - "FileDiffs", - "Markdown Preview", - "Missing Palette Commands", - "Related Files", - "SmartMarkdown", - "Solarized Color Scheme", - "StringEncode", - "SublimeTODO", - "TrailingSpaces", - ], - "package_name_map": { - "SublimeKeyMap.Editor": "ZZZ.EthanBrown.SublimeKeyMap.Editor" - }, - "repositories": - [ - "https://github.com/abrookins/OpenSearchResult", - "https://github.com/Iristyle/SublimeKeyMap.Editor" - ] -} -``` diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ZZZ.EthanBrown.SublimeKeyMap.Editor/package-metadata.json b/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ZZZ.EthanBrown.SublimeKeyMap.Editor/package-metadata.json deleted file mode 100644 index 2e40fc5..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/PackageCache/ZZZ.EthanBrown.SublimeKeyMap.Editor/package-metadata.json +++ /dev/null @@ -1 +0,0 @@ -{"url": "https://github.com/Iristyle/SublimeKeyMap.Editor", "version": "2013.09.17.02.08.40", "description": "A simple repository used to host / share my customized Sublime Text 2 key bindings for Sublime editor enhancement plugins"} \ No newline at end of file diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/Preferences.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/Preferences.sublime-settings deleted file mode 100644 index 07d2821..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/Preferences.sublime-settings +++ /dev/null @@ -1,58 +0,0 @@ -{ - "auto_complete_commit_on_tab": true, - "caret_style": "phase", - "color_scheme": "Packages/Solarized Color Scheme/Solarized (dark).tmTheme", - "draw_white_space": "all", - "ensure_newline_at_eof_on_save": true, - "font_face": "Source Code Pro", - "font_size": 14, - "highlight_line": true, - "ignored_packages": - [ - "Vintage", - "HTML Export", - "TrailingSpaces" - ], - "indent_guide_options": - [ - "draw_active", - "draw_normal" - ], - "rulers": - [ - 50, - 72, - 80, - 120 - ], - "tab_size": 2, - "todo": - { - "case_sensitive": true, - "file_exclude_patterns": - [ - "*.css", - "*.po", - "*.mo" - ], - "folder_exclude_patterns": - [ - "generated", - "static", - "vendor", - "tmp" - ], - "patterns": - { - "BUG": "BUG[\\s]*?:+(?P.*)$", - "FIXME": "FIX ?ME[\\s]*?:+(?P\\S.*)$", - "HACK": "HACK[\\s]*?:+(?P.*)$", - "NOTE": "NOTE[\\s]*?:+(?P.*)$", - "TODO": "TODO[\\s]*?:+(?P.*)$" - }, - "result_title": "TODO Results" - }, - "translate_tabs_to_spaces": true, - "trim_trailing_white_space_on_save": true, - "wide_caret": true -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/bh_core.sublime-settings b/EthanBrown.SublimeText2.EditorPackages/tools/bh_core.sublime-settings deleted file mode 100644 index ed3d2b1..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/bh_core.sublime-settings +++ /dev/null @@ -1,72 +0,0 @@ -{ - // Define region highlight styles - "bracket_styles": { - // "default" and "unmatched" styles are special - // styles. If they are not defined here, - // they will be generated internally with - // internal defaults. - - // "default" style defines attributes that - // will be used for any style that does not - // explicitly define that attribute. So if - // a style does not define a color, it will - // use the color from the "default" style. - "default": { - "icon": "dot", - // BH1's original default color for reference - // "color": "entity.name.class", - "color": "brackethighlighter.all", - "style": "underline" - }, - - // This particular style is used to highlight - // unmatched bracekt pairs. It is a special - // style. - "unmatched": { - "icon": "question", - // "color": "brackethighlighter.unmatched", - "style": "outline" - }, - // User defined region styles - "curly": { - "icon": "curly_bracket" - // "color": "brackethighlighter.curly", - // "style": "underline" - }, - "round": { - "icon": "round_bracket" - // "color": "brackethighlighter.round", - // "style": "underline" - }, - "square": { - "icon": "square_bracket" - // "color": "brackethighlighter.square", - // "style": "underline" - }, - "angle": { - "icon": "angle_bracket" - // "color": "brackethighlighter.angle", - // "style": "underline" - }, - "tag": { - "icon": "tag", - // "color": "brackethighlighter.tag", - "style": "outline" - }, - "single_quote": { - "icon": "single_quote" - // "color": "brackethighlighter.quote", - // "style": "underline" - }, - "double_quote": { - "icon": "double_quote" - // "color": "brackethighlighter.quote", - // "style": "underline" - }, - "regex": { - "icon": "regex" - // "color": "brackethighlighter.quote", - // "style": "underline" - } - } -} diff --git a/EthanBrown.SublimeText2.EditorPackages/tools/chocolateyInstall.ps1 b/EthanBrown.SublimeText2.EditorPackages/tools/chocolateyInstall.ps1 deleted file mode 100644 index 44e9567..0000000 --- a/EthanBrown.SublimeText2.EditorPackages/tools/chocolateyInstall.ps1 +++ /dev/null @@ -1,48 +0,0 @@ -$package = 'EthanBrown.SublimeText2.EditorPackages' - -function Get-CurrentDirectory -{ - $thisName = $MyInvocation.MyCommand.Name - [IO.Path]::GetDirectoryName((Get-Content function:$thisName).File) -} - -try { - $current = Get-CurrentDirectory - - . (Join-Path $current 'JsonHelpers.ps1') - . (Join-Path $current 'SublimeHelpers.ps1') - - $sublimeUserDataPath = Get-SublimeUserPath - - #straight file copies - 'bh_core.sublime-settings', - 'EasyMotion.sublime-settings', - 'MarkdownPreview.sublime-settings' | - % { - $params = @{ - Path = Join-Path $current $_; - Destination = Join-Path $sublimeUserDataPath $_; - Force = $true - } - Copy-Item @params - } - - $packageCache = Join-Path (Get-CurrentDirectory) 'PackageCache' - Install-SublimePackagesFromCache -Directory $packageCache -Version 2 - Install-SublimePackageControl -PreRelease -Version 2 - $packageControl = Join-Path $current 'Package Control.sublime-settings' - Merge-PackageControlSettings -FilePath $packageControl - - $preferences = Join-Path $current 'Preferences.sublime-settings' - Merge-Preferences -FilePath $preferences - - if (Get-Process -Name sublime_text -ErrorAction SilentlyContinue) - { - Write-Warning 'Please close and re-open Sublime Text to force packages to update' - } - - Write-ChocolateySuccess $package -} catch { - Write-ChocolateyFailure $package "$($_.Exception.Message)" - throw -} diff --git a/EthanBrown.SublimeText2.GitPackages/EthanBrown.SublimeText2.GitPackages.nuspec b/EthanBrown.SublimeText2.GitPackages/EthanBrown.SublimeText2.GitPackages.nuspec deleted file mode 100644 index 019e10b..0000000 --- a/EthanBrown.SublimeText2.GitPackages/EthanBrown.SublimeText2.GitPackages.nuspec +++ /dev/null @@ -1,71 +0,0 @@ - - - - EthanBrown.SublimeText2.GitPackages - Sublime Text 2 - Git Integration Packages - 0.2.2 - Various - Ethan Brown - A number of packages helpful for increased editor productivity when using Git. - Includes a number of very useful packages for Sublime Text 2. - - Included - =========================================================================== - - - EditorConfig - https://github.com/sindresorhus/editorconfig-sublime - - - Git - https://github.com/kemayo/sublime-text-2-git - - - GitHubinator - https://github.com/ehamiter/ST2-GitHubinator - - - Modific - https://github.com/gornostal/Modific - - - SideBarGit - https://github.com/SublimeText/SideBarGit - - - sublime-github (Github Gists) - https://github.com/bgreenlee/sublime-github - - Customized Key Bindings - =========================================================================== - https://github.com/Iristyle/SublimeKeyMap.Git - - Additional Package Preferences - =========================================================================== - Git - Commit message rules - Github Gists - Generates an OAuth token automatically - SideBarGit - disables branch since Git already supplies it - - Additional User Preferences - =========================================================================== - Rules for - - drawing whitespace - - ensuring newline at eof - - rulers at 50, 72, 80 and 120 - - use spaces everywhere - - trim whitespace on save - - http://github.com/Iristyle/ChocolateyPackages/ - SublimeText package editor - - false - https://raw.github.com/Iristyle/ChocolateyPackages/master/SublimeText2.app/Sublime_Text.png - * Use a local package cache to prevent first-time package restore / load errors - - - - - - - - - - - - diff --git a/EthanBrown.SublimeText2.GitPackages/tools/Git Commit Message.sublime-settings b/EthanBrown.SublimeText2.GitPackages/tools/Git Commit Message.sublime-settings deleted file mode 100644 index efd3a4c..0000000 --- a/EthanBrown.SublimeText2.GitPackages/tools/Git Commit Message.sublime-settings +++ /dev/null @@ -1,3 +0,0 @@ -{ - "rulers": [50, 72] -} diff --git a/EthanBrown.SublimeText2.GitPackages/tools/GitHub.sublime-settings b/EthanBrown.SublimeText2.GitPackages/tools/GitHub.sublime-settings deleted file mode 100644 index d0dc0cf..0000000 --- a/EthanBrown.SublimeText2.GitPackages/tools/GitHub.sublime-settings +++ /dev/null @@ -1,8 +0,0 @@ -{ - "accounts": { - "GitHub": { - "base_uri": "https://api.github.com", - "github_token": "" - } - } -} diff --git a/EthanBrown.SublimeText2.GitPackages/tools/Package Control.sublime-settings b/EthanBrown.SublimeText2.GitPackages/tools/Package Control.sublime-settings deleted file mode 100644 index f53395e..0000000 --- a/EthanBrown.SublimeText2.GitPackages/tools/Package Control.sublime-settings +++ /dev/null @@ -1,19 +0,0 @@ -{ - "installed_packages": - [ - "EditorConfig", - "Git", - "GitHubinator", - "Modific", - "SideBarGit", - "sublime-github", - "ZZZ.EthanBrown.SublimeKeyMap.Git" - ], - "package_name_map": { - "SublimeKeyMap.Git": "ZZZ.EthanBrown.SublimeKeyMap.Git" - }, - "repositories": - [ - "https://github.com/Iristyle/SublimeKeyMap.Git" - ] -} diff --git a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/.editorconfig b/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/.editorconfig deleted file mode 100644 index b0d7fd9..0000000 --- a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -# editorconfig.org -root = true - -[*] -indent_style = tab -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/.gitattributes b/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/.gitattributes deleted file mode 100644 index 176a458..0000000 --- a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto diff --git a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/EditorConfig.py b/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/EditorConfig.py deleted file mode 100644 index 57ef4af..0000000 --- a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/EditorConfig.py +++ /dev/null @@ -1,79 +0,0 @@ -import sublime_plugin - -try: - import os, sys - # stupid python module system - sys.path.append(os.path.dirname(os.path.realpath(__file__))) - from .editorconfig import get_properties, EditorConfigError -except: - # Python 2 - from editorconfig import get_properties, EditorConfigError - - -LINE_ENDINGS = { - 'lf': 'unix', - 'crlf': 'windows', - 'cr': 'cr' -} - -CHARSETS = { - 'latin1': 'Western (ISO 8859-1)', - 'utf-8': 'utf-8', - 'utf-8-bom': 'utf-8 with bom', - 'utf-16be': 'utf-16 be', - 'utf-16le': 'utf-16 le' -} - -class EditorConfig(sublime_plugin.EventListener): - def on_load(self, view): - self.init(view, False) - - def on_pre_save(self, view): - self.init(view, True) - - def init(self, view, pre_save): - path = view.file_name() - if not path: - return - try: - config = get_properties(path) - except EditorConfigError: - print('Error occurred while getting EditorConfig properties') - else: - if config: - if pre_save: - self.apply_charset(view, config) - else: - self.apply_config(view, config) - - def apply_charset(self, view, config): - charset = config.get('charset') - if charset in CHARSETS: - view.set_encoding(CHARSETS[charset]) - - def apply_config(self, view, config): - settings = view.settings() - indent_style = config.get('indent_style') - indent_size = config.get('indent_size') - end_of_line = config.get('end_of_line') - trim_trailing_whitespace = config.get('trim_trailing_whitespace') - insert_final_newline = config.get('insert_final_newline') - if indent_style == 'space': - settings.set('translate_tabs_to_spaces', True) - elif indent_style == 'tab': - settings.set('translate_tabs_to_spaces', False) - if indent_size: - try: - settings.set('tab_size', int(indent_size)) - except ValueError: - pass - if end_of_line in LINE_ENDINGS: - view.set_line_endings(LINE_ENDINGS[end_of_line]) - if trim_trailing_whitespace == 'true': - settings.set('trim_trailing_white_space_on_save', True) - elif trim_trailing_whitespace == 'false': - settings.set('trim_trailing_white_space_on_save', False) - if insert_final_newline == 'true': - settings.set('ensure_newline_at_eof_on_save', True) - elif insert_final_newline == 'false': - settings.set('ensure_newline_at_eof_on_save', False) diff --git a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/__init__.py b/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/__init__.py deleted file mode 100644 index 2dd8408..0000000 --- a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -"""EditorConfig Python Core""" - -from editorconfig.versiontools import join_version - -VERSION = (0, 11, 3, "final") - -__all__ = ['get_properties', 'EditorConfigError', 'exceptions'] - -__version__ = join_version(VERSION) - - -def get_properties(filename): - """Locate and parse EditorConfig files for the given filename""" - handler = EditorConfigHandler(filename) - return handler.get_configurations() - - -from editorconfig.handler import EditorConfigHandler -from editorconfig.exceptions import * diff --git a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/compat.py b/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/compat.py deleted file mode 100644 index ebd0405..0000000 --- a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/compat.py +++ /dev/null @@ -1,18 +0,0 @@ -"""EditorConfig Python2/Python3/Jython compatibility utilities""" -import sys -import types - -__all__ = ['slice', 'u'] - - -if sys.version_info[0] == 2: - slice = types.SliceType -else: - slice = slice - - -if sys.version_info[0] == 2: - import codecs - u = lambda s: codecs.unicode_escape_decode(s)[0] -else: - u = lambda s: s diff --git a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/exceptions.py b/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/exceptions.py deleted file mode 100644 index 545732b..0000000 --- a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/exceptions.py +++ /dev/null @@ -1,27 +0,0 @@ -"""EditorConfig exception classes - -Licensed under PSF License (see LICENSE.txt file). - -""" - - -class EditorConfigError(Exception): - """Parent class of all exceptions raised by EditorConfig""" - - -try: - from ConfigParser import ParsingError as _ParsingError -except: - from configparser import ParsingError as _ParsingError - - -class ParsingError(_ParsingError, EditorConfigError): - """Error raised if an EditorConfig file could not be parsed""" - - -class PathError(ValueError, EditorConfigError): - """Error raised if invalid filepath is specified""" - - -class VersionError(ValueError, EditorConfigError): - """Error raised if invalid version number is specified""" diff --git a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/fnmatch.py b/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/fnmatch.py deleted file mode 100644 index a1d5f10..0000000 --- a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/fnmatch.py +++ /dev/null @@ -1,126 +0,0 @@ -"""Filename matching with shell patterns. - -fnmatch(FILENAME, PATTERN) matches according to the local convention. -fnmatchcase(FILENAME, PATTERN) always takes case in account. - -The functions operate by translating the pattern into a regular -expression. They cache the compiled regular expressions for speed. - -The function translate(PATTERN) returns a regular expression -corresponding to PATTERN. (It does not compile it.) - -Based on code from fnmatch.py file distributed with Python 2.6. - -Licensed under PSF License (see LICENSE.txt file). - -Changes to original fnmatch module: -- translate function supports ``*`` and ``**`` similarly to fnmatch C library -""" - -import os -import re - -__all__ = ["fnmatch", "fnmatchcase", "translate"] - -_cache = {} - - -def fnmatch(name, pat): - """Test whether FILENAME matches PATTERN. - - Patterns are Unix shell style: - - - ``*`` matches everything except path separator - - ``**`` matches everything - - ``?`` matches any single character - - ``[seq]`` matches any character in seq - - ``[!seq]`` matches any char not in seq - - ``{s1,s2,s3}`` matches any of the strings given (separated by commas) - - An initial period in FILENAME is not special. - Both FILENAME and PATTERN are first case-normalized - if the operating system requires it. - If you don't want this, use fnmatchcase(FILENAME, PATTERN). - """ - - name = os.path.normcase(name).replace(os.sep, "/") - return fnmatchcase(name, pat) - - -def fnmatchcase(name, pat): - """Test whether FILENAME matches PATTERN, including case. - - This is a version of fnmatch() which doesn't case-normalize - its arguments. - """ - - if not pat in _cache: - res = translate(pat) - _cache[pat] = re.compile(res) - return _cache[pat].match(name) is not None - - -def translate(pat): - """Translate a shell PATTERN to a regular expression. - - There is no way to quote meta-characters. - """ - - i, n = 0, len(pat) - res = '' - escaped = False - while i < n: - c = pat[i] - i = i + 1 - if c == '*': - j = i - if j < n and pat[j] == '*': - res = res + '.*' - else: - res = res + '[^/]*' - elif c == '?': - res = res + '.' - elif c == '[': - j = i - if j < n and pat[j] == '!': - j = j + 1 - if j < n and pat[j] == ']': - j = j + 1 - while j < n and (pat[j] != ']' or escaped): - escaped = pat[j] == '\\' and not escaped - j = j + 1 - if j >= n: - res = res + '\\[' - else: - stuff = pat[i:j] - i = j + 1 - if stuff[0] == '!': - stuff = '^' + stuff[1:] - elif stuff[0] == '^': - stuff = '\\' + stuff - res = '%s[%s]' % (res, stuff) - elif c == '{': - j = i - groups = [] - while j < n and pat[j] != '}': - k = j - while k < n and (pat[k] not in (',', '}') or escaped): - escaped = pat[k] == '\\' and not escaped - k = k + 1 - group = pat[j:k] - for char in (',', '}', '\\'): - group = group.replace('\\' + char, char) - groups.append(group) - j = k - if j < n and pat[j] == ',': - j = j + 1 - if j < n and pat[j] == '}': - groups.append('') - if j >= n or len(groups) < 2: - res = res + '\\{' - else: - res = '%s(%s)' % (res, '|'.join(map(re.escape, groups))) - i = j + 1 - else: - res = res + re.escape(c) - return res + '\Z(?ms)' diff --git a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/handler.py b/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/handler.py deleted file mode 100644 index 72d99bd..0000000 --- a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/handler.py +++ /dev/null @@ -1,126 +0,0 @@ -"""EditorConfig file handler - -Provides ``EditorConfigHandler`` class for locating and parsing -EditorConfig files relevant to a given filepath. - -Licensed under PSF License (see LICENSE.txt file). - -""" - -import os - -from editorconfig import VERSION -from editorconfig.ini import EditorConfigParser -from editorconfig.exceptions import PathError, VersionError - - -__all__ = ['EditorConfigHandler'] - - -def get_filenames(path, filename): - """Yield full filepath for filename in each directory in and above path""" - path_list = [] - while True: - path_list.append(os.path.join(path, filename)) - newpath = os.path.dirname(path) - if path == newpath: - break - path = newpath - return path_list - - -class EditorConfigHandler(object): - - """ - Allows locating and parsing of EditorConfig files for given filename - - In addition to the constructor a single public method is provided, - ``get_configurations`` which returns the EditorConfig options for - the ``filepath`` specified to the constructor. - - """ - - def __init__(self, filepath, conf_filename='.editorconfig', - version=VERSION): - """Create EditorConfigHandler for matching given filepath""" - self.filepath = filepath - self.conf_filename = conf_filename - self.version = version - self.options = None - - def get_configurations(self): - - """ - Find EditorConfig files and return all options matching filepath - - Special exceptions that may be raised by this function include: - - - ``VersionError``: self.version is invalid EditorConfig version - - ``PathError``: self.filepath is not a valid absolute filepath - - ``ParsingError``: improperly formatted EditorConfig file found - - """ - - self.check_assertions() - path, filename = os.path.split(self.filepath) - conf_files = get_filenames(path, self.conf_filename) - - # Attempt to find and parse every EditorConfig file in filetree - for filename in conf_files: - parser = EditorConfigParser(self.filepath) - parser.read(filename) - - # Merge new EditorConfig file's options into current options - old_options = self.options - self.options = parser.options - if old_options: - self.options.update(old_options) - - # Stop parsing if parsed file has a ``root = true`` option - if parser.root_file: - break - - self.preprocess_values() - return self.options - - def check_assertions(self): - - """Raise error if filepath or version have invalid values""" - - # Raise ``PathError`` if filepath isn't an absolute path - if not os.path.isabs(self.filepath): - raise PathError("Input file must be a full path name.") - - # Raise ``VersionError`` if version specified is greater than current - if self.version is not None and self.version[:3] > VERSION[:3]: - raise VersionError( - "Required version is greater than the current version.") - - def preprocess_values(self): - - """Preprocess option values for consumption by plugins""" - - opts = self.options - - # Lowercase option value for certain options - for name in ["end_of_line", "indent_style", "indent_size", - "insert_final_newline", "trim_trailing_whitespace", "charset"]: - if name in opts: - opts[name] = opts[name].lower() - - # Set indent_size to "tab" if indent_size is unspecified and - # indent_style is set to "tab". - if (opts.get("indent_style") == "tab" and - not "indent_size" in opts and self.version >= (0, 10, 0)): - opts["indent_size"] = "tab" - - # Set tab_width to indent_size if indent_size is specified and - # tab_width is unspecified - if ("indent_size" in opts and "tab_width" not in opts and - opts["indent_size"] != "tab"): - opts["tab_width"] = opts["indent_size"] - - # Set indent_size to tab_width if indent_size is "tab" - if ("indent_size" in opts and "tab_width" in opts and - opts["indent_size"] == "tab"): - opts["indent_size"] = opts["tab_width"] diff --git a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/ini.py b/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/ini.py deleted file mode 100644 index 3f58fed..0000000 --- a/EthanBrown.SublimeText2.GitPackages/tools/PackageCache/EditorConfig/editorconfig/ini.py +++ /dev/null @@ -1,150 +0,0 @@ -"""EditorConfig file parser - -Based on code from ConfigParser.py file distributed with Python 2.6. - -Licensed under PSF License (see LICENSE.txt file). - -Changes to original ConfigParser: - -- Special characters can be used in section names -- Octothorpe can be used for comments (not just at beginning of line) -- Only track INI options in sections that match target filename -- Stop parsing files with when ``root = true`` is found - -""" - -import re -from codecs import open -import posixpath -from os import sep -from os.path import normcase, dirname - -from editorconfig.exceptions import ParsingError -from editorconfig.fnmatch import fnmatch -from editorconfig.odict import OrderedDict -from editorconfig.compat import u - - -__all__ = ["ParsingError", "EditorConfigParser"] - - -class EditorConfigParser(object): - - """Parser for EditorConfig-style configuration files - - Based on RawConfigParser from ConfigParser.py in Python 2.6. - """ - - # Regular expressions for parsing section headers and options. - # Allow ``]`` and escaped ``;`` and ``#`` characters in section headers - SECTCRE = re.compile( - r'\s*\[' # [ - r'(?P
([^#;]|\\#|\\;)+)' # very permissive! - r'\]' # ] - ) - # Regular expression for parsing option name/values. - # Allow any amount of whitespaces, followed by separator - # (either ``:`` or ``=``), followed by any amount of whitespace and then - # any characters to eol - OPTCRE = re.compile( - r'\s*(?P