This repository has been archived by the owner on Jul 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
fabiantheblind
committed
Aug 30, 2016
0 parents
commit 7e86dd4
Showing
7 changed files
with
143 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# MAC OSX | ||
.DS_Store | ||
# WIN | ||
Thumbs.db | ||
# nodejs and web dev | ||
node_modules | ||
bower_components | ||
# sublime sftp plugin | ||
sftp-config.json | ||
# sublime | ||
*.sublime-project | ||
*.sublime-workspace | ||
# processing | ||
sketch.properties | ||
build-tmp | ||
# codekit | ||
.codekit-cache | ||
# a file with private data | ||
private.json | ||
private | ||
# for extendscript ID dev | ||
pdfs | ||
*.idlk | ||
# for CRAN | ||
# History files | ||
.Rhistory | ||
# Example code in package build process | ||
*-Ex.R | ||
# R data files from past sessions | ||
.Rdata | ||
# RStudio files | ||
.Rproj.user/ | ||
|
||
# GOLANG | ||
# After Effects | ||
Adobe\ After\ Effects\ Auto-Save/ | ||
Adobe\ After\ Effects\ Auto-Speichern | ||
|
||
# Particle Photon | ||
*.bin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ | ||
{ "caption": "Enable frontal slide highlighting", "command": "frontal" } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"enabled":false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"id": "tools", | ||
"children": | ||
[ | ||
{"id": "wrap"}, | ||
{ "command": "frontal" } | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import sublime, sublime_plugin, re | ||
|
||
# see https://forum.sublimetext.com/t/dev-build-3118/21270 | ||
class Frontal(sublime_plugin.ViewEventListener): | ||
def __init__(self, view): | ||
self.view = view | ||
self.phantom_set = sublime.PhantomSet(view) | ||
self.timeout_scheduled = False | ||
self.needs_update = False | ||
settings = sublime.load_settings('Frontal.sublime-settings') | ||
self.enabled = settings.get('enabled') | ||
print (self.enabled) | ||
if self.enabled == False: | ||
self.phantom_set.update([]) | ||
PHANTOM_SUPPORT = int(sublime.version()) >= 3118 | ||
self.update_phantoms() | ||
|
||
@classmethod | ||
def is_applicable(cls, settings): | ||
syntax = settings.get('syntax') | ||
print (syntax) | ||
mde = 'Packages/MarkdownEditing/Markdown.tmLanguage' | ||
pt = 'Packages/Text/Plain text.tmLanguage' | ||
md = 'Packages/Markdown/Markdown.sublime-syntax' | ||
mmd = 'Packages/Markdown/MultiMarkdown.sublime-syntax' | ||
return syntax == mde or syntax == pt or syntax == md or syntax == mmd and self.enabled == True and PHANTOM_SUPPORT == True | ||
|
||
def update_phantoms(self): | ||
phantoms = [] | ||
lines = self.view.find_all('^---') | ||
|
||
counter = 2 | ||
for r in lines: | ||
# line_region = self.view.line(r.a) | ||
# line = self.view.substr(line_region) | ||
name = '<div style="background-color:rgba(123,123,123,0.4);">Frontal Slide: ' + str(counter) + '</div>' | ||
phantoms.append(sublime.Phantom( | ||
r, | ||
name, | ||
sublime.LAYOUT_BLOCK)) | ||
counter = counter + 1 | ||
|
||
self.phantom_set.update(phantoms) | ||
|
||
def handle_timeout(self): | ||
self.timeout_scheduled = False | ||
if self.needs_update: | ||
self.needs_update = False | ||
self.update_phantoms() | ||
|
||
def on_modified(self): | ||
# Call update_phantoms(), but not any more than 10 times a second | ||
if self.timeout_scheduled: | ||
self.needs_update = True | ||
else: | ||
sublime.set_timeout(lambda: self.handle_timeout(), 100) | ||
self.update_phantoms() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, | ||
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. | ||
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. | ||
|
||
--- | ||
--- | ||
|
||
|
||
--- | ||
|
||
--- | ||
|
||
|
||
--- | ||
|
||
|
||
|
||
<FOOTER> | ||
|
||
</FOOTER> | ||
|
||
--- | ||
|
||
|
||
--- | ||
|
||
|