├── .gitignore
├── Lippy.sketchplugin
└── Contents
│ ├── Resources
│ ├── Lippy.framework
│ │ ├── Lippy
│ │ ├── Resources
│ │ └── Versions
│ │ │ ├── A
│ │ │ ├── Lippy
│ │ │ ├── Resources
│ │ │ │ ├── Assets.car
│ │ │ │ ├── Info.plist
│ │ │ │ ├── LippyMainViewController.nib
│ │ │ │ ├── LippySourceEditorWindow.nib
│ │ │ │ └── lippy-content.json
│ │ │ └── _CodeSignature
│ │ │ │ └── CodeResources
│ │ │ └── Current
│ └── icon.png
│ └── Sketch
│ ├── manifest.json
│ ├── markov.js
│ └── script.js
├── README.md
├── appcast.xml
└── lippy-gh.gif
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | .DS_Store
3 | notarization.json
4 |
--------------------------------------------------------------------------------
/Lippy.sketchplugin/Contents/Resources/Lippy.framework/Lippy:
--------------------------------------------------------------------------------
1 | Versions/Current/Lippy
--------------------------------------------------------------------------------
/Lippy.sketchplugin/Contents/Resources/Lippy.framework/Resources:
--------------------------------------------------------------------------------
1 | Versions/Current/Resources
--------------------------------------------------------------------------------
/Lippy.sketchplugin/Contents/Resources/Lippy.framework/Versions/A/Lippy:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abynim/lippy/20b3a68d5917c63dcf78e1b9f8aa0cbe795f84d4/Lippy.sketchplugin/Contents/Resources/Lippy.framework/Versions/A/Lippy
--------------------------------------------------------------------------------
/Lippy.sketchplugin/Contents/Resources/Lippy.framework/Versions/A/Resources/Assets.car:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abynim/lippy/20b3a68d5917c63dcf78e1b9f8aa0cbe795f84d4/Lippy.sketchplugin/Contents/Resources/Lippy.framework/Versions/A/Resources/Assets.car
--------------------------------------------------------------------------------
/Lippy.sketchplugin/Contents/Resources/Lippy.framework/Versions/A/Resources/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildMachineOSBuild
6 | 23E224
7 | CFBundleDevelopmentRegion
8 | en
9 | CFBundleExecutable
10 | Lippy
11 | CFBundleIdentifier
12 | com.abynim.Lippy
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | Lippy
17 | CFBundlePackageType
18 | FMWK
19 | CFBundleShortVersionString
20 | 1.2
21 | CFBundleSupportedPlatforms
22 |
23 | MacOSX
24 |
25 | CFBundleVersion
26 | 225
27 | DTCompiler
28 | com.apple.compilers.llvm.clang.1_0
29 | DTPlatformBuild
30 |
31 | DTPlatformName
32 | macosx
33 | DTPlatformVersion
34 | 14.4
35 | DTSDKBuild
36 | 23E208
37 | DTSDKName
38 | macosx14.4
39 | DTXcode
40 | 1530
41 | DTXcodeBuild
42 | 15E204a
43 | LSMinimumSystemVersion
44 | 10.13
45 | NSHumanReadableCopyright
46 | Copyright © 2019 Aby Nimbalkar. All rights reserved.
47 |
48 |
49 |
--------------------------------------------------------------------------------
/Lippy.sketchplugin/Contents/Resources/Lippy.framework/Versions/A/Resources/LippyMainViewController.nib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abynim/lippy/20b3a68d5917c63dcf78e1b9f8aa0cbe795f84d4/Lippy.sketchplugin/Contents/Resources/Lippy.framework/Versions/A/Resources/LippyMainViewController.nib
--------------------------------------------------------------------------------
/Lippy.sketchplugin/Contents/Resources/Lippy.framework/Versions/A/Resources/LippySourceEditorWindow.nib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abynim/lippy/20b3a68d5917c63dcf78e1b9f8aa0cbe795f84d4/Lippy.sketchplugin/Contents/Resources/Lippy.framework/Versions/A/Resources/LippySourceEditorWindow.nib
--------------------------------------------------------------------------------
/Lippy.sketchplugin/Contents/Resources/Lippy.framework/Versions/A/Resources/lippy-content.json:
--------------------------------------------------------------------------------
1 | {
2 | "active" : "com.abynim.sources.default",
3 | "sources" : [
4 | {
5 | "identifier" : "com.abynim.sources.default",
6 | "name" : "Lorem Ipsum",
7 | "content" : "Certe, inquam, pertinax non ero tibique, si mihi probabis ea, quae dices, libenter assentiar. Probabo, inquit, modo ista sis aequitate, quam ostendis. sed uti oratione perpetua malo quam interrogare aut interrogari. Ut placet, inquam. Tum dicere exorsus est. Primum igitur, inquit, sic agam, ut ipsi auctori huius disciplinae placet: constituam, quid et quale sit id, de quo quaerimus, non quo ignorare vos arbitrer, sed ut ratione et via procedat oratio. quaerimus igitur, quid sit extremum et ultimum bonorum, quod omnium philosophorum sententia tale debet esse, ut ad id omnia referri oporteat, ipsum autem nusquam. hoc Epicurus in voluptate ponit, quod summum bonum esse vult, summumque malum dolorem, idque instituit docere sic: Omne animal, simul atque natum sit, voluptatem appetere eaque gaudere ut summo bono, dolorem aspernari ut summum malum et, quantum possit, a se repellere, idque facere nondum depravatum ipsa natura incorrupte atque integre iudicante. itaque negat opus esse ratione neque disputatione, quam ob rem voluptas expetenda, fugiendus dolor sit. sentiri haec putat, ut calere ignem, nivem esse albam, dulce mel. quorum nihil oportere exquisitis rationibus confirmare, tantum satis esse admonere. interesse enim inter argumentum conclusionemque rationis et inter mediocrem animadversionem atque admonitionem. altera occulta quaedam et quasi involuta aperiri, altera prompta et aperta iudicari. etenim quoniam detractis de homine sensibus reliqui nihil est, necesse est, quid aut ad naturam aut contra sit, a natura ipsa iudicari. ea quid percipit aut quid iudicat, quo aut petat aut fugiat aliquid, praeter voluptatem et dolorem? Sunt autem quidam e nostris, qui haec subtilius velint tradere et negent satis esse, quid bonum sit aut quid malum, sensu iudicari, sed animo etiam ac ratione intellegi posse et voluptatem ipsam per se esse expetendam et dolorem ipsum per se esse fugiendum. itaque aiunt hanc quasi naturalem atque insitam in animis nostris inesse notionem, ut alterum esse appetendum, alterum aspernandum sentiamus. Alii autem, quibus ego assentior, cum a philosophis compluribus permulta dicantur, cur nec voluptas in bonis sit numeranda nec in malis dolor, non existimant oportere nimium nos causae confidere, sed et argumentandum et accurate disserendum et rationibus conquisitis de voluptate et dolore disputandum putant. Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit, amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt, ut labore et dolore magnam aliquam quaerat voluptatem. ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? quis autem vel eum iure reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla pariatur? At vero eos et accusamus et iusto odio dignissimos ducimus, qui blanditiis praesentium voluptatum deleniti atque corrupti, quos dolores et quas molestias excepturi sint, obcaecati cupiditate non provident, similique sunt in culpa, qui officia deserunt mollitia animi, id est laborum et dolorum fuga. et harum quidem rerum facilis est et expedita distinctio. nam libero tempore, cum soluta nobis est eligendi optio, cumque nihil impedit, quo minus id, quod maxime placeat, facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet, ut et voluptates repudiandae sint et molestiae non recusandae. itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.\nHanc ego cum teneam sententiam, quid est cur verear, ne ad eam non possim accommodare Torquatos nostros? quos tu paulo ante cum memoriter, tum etiam erga nos amice et benivole collegisti, nec me tamen laudandis maioribus meis corrupisti nec segniorem ad respondendum reddidisti. quorum facta quem ad modum, quaeso, interpretaris? sicine eos censes aut in armatum hostem impetum fecisse aut in liberos atque in sanguinem suum tam crudelis fuisse, nihil ut de utilitatibus, nihil ut de commodis suis cogitarent? at id ne ferae quidem faciunt, ut ita ruant itaque turbent, ut earum motus et impetus quo pertineant non intellegamus, tu tam egregios viros censes tantas res gessisse sine causa? Quae fuerit causa, mox videro; interea hoc tenebo, si ob aliquam causam ista, quae sine dubio praeclara sunt, fecerint, virtutem iis per se ipsam causam non fuisse. Torquem detraxit hosti. Et quidem se texit, ne interiret. At magnum periculum adiit. In oculis quidem exercitus. Quid ex eo est consecutus? Laudem et caritatem, quae sunt vitae sine metu degendae praesidia firmissima. Filium morte multavit. Si sine causa, nollem me ab eo ortum, tam inportuno tamque crudeli; sin, ut dolore suo sanciret militaris imperii disciplinam exercitumque in gravissimo bello animadversionis metu contineret, saluti prospexit civium, qua intellegebat contineri suam. atque haec ratio late patet. In quo enim maxime consuevit iactare vestra se oratio, tua praesertim, qui studiose antiqua persequeris, claris et fortibus viris commemorandis eorumque factis non emolumento aliquo, sed ipsius honestatis decore laudandis, id totum evertitur eo delectu rerum, quem modo dixi, constituto, ut aut voluptates omittantur maiorum voluptatum adipiscendarum causa aut dolores suscipiantur maiorum dolorum effugiendorum gratia."
8 | },
9 | {
10 | "identifier" : "com.abynim.sources.blocks",
11 | "name" : "Xxxxxx",
12 | "content" : "XX XXX XXXXXX XXX XXXXXXXXX XXXXXXX XXXXXXX XXXXXXX X XXXXXXX XXXX XX X XXXXXXXX XXXXXXXXX XXX XXXXXX XXXXXXXX XXXXXXXXX XXXXX XXX XXXXXXXXX XXXXXXX XXX XXXXXXXXX XX XXXXXXX XXXX XXXXXXX XXXXXX XXXXXXX XXXXXX XXXX XXXX XXXXXXXX XXXXXXXXX XXXXXXXXX X XXXXXXXX XXXXX XXXXXXXXX XXXXXX XXXXXXXX XXXXXXX XXXX XXXXXX X XXXXXXXXX XXX XXXXXX XXXX XXXX XX XXXXXXXX XXXXXXX XXXXX XXXXXX X XXXXX XXXXXXXXX X XXX XXXXXXX XXXXXXX XXXXX XXXXXXX XXXXX XXX XXX XXXX XXXXXXXX XXXXXXXXX XXXXXX XXX XXX XXXXX XXXXXXXXX XXXXXXXX X XX XXXXXXX XX XXXXXXXX XXXXX XXXXXXX XXXXX XXXXXXXX XXXX XX XXXXXXXX XXX X XXXXX XXXXXXX XXXX XXXXXXXXX XX XXXXX XXXXXXXXX XXXXXXXXX XX XXXXXXXXX XXXXXXXXX XXXXXXXX X XXXXXX XXXXXX XXX XXXXXX XXXXXXXX XXXXXXX XXXXXXXXX XXXXXXXXX X XX XX XXXXXXXX XXX XXX XXX XXXXXX XXXXXXXXX XXXXX XXXXXXXX X XXXXXXXX XXXXXXXX X XXXX XXXXX XX XXX XXX XXXXXX XXXXXX XX XX XXXXXXX XX XXXXX XXXX XXXXXXXX XXXXXX XXX XXXXXX XXX XXX X XXXXXXXXX XXXX XXXXXXX XXX XXXXXXXX XXXXX XXXXX XXX XXXX XXXXXXX XXXXX XXXXX XXXXXXXX XXXX XXXXXXX XXXXX XXX XX XXXX XXXXXXX XXXXXXXXX X XX X XXXXX XXXXXX XXXXXXX XXXX XXXXXXXX XXXXXXXXX XXXXXXXX XX XXXX XXX XXX XXXXX XXXX XXXXXX XXX XXXX XX XXXXXXXXX X X XXXXXXXXX XXXX XXXXXX XXX XXXXXXX XXXXXXXX X XXXXXXXX X XXXXX XXXXXXX XXX X XXXXXXX XXXXXXX XXXXX XXX XXXXX XXX XXXXXXXX XXX XXXXXXX XXXXXX XXXXXXXX XXXXXXXX XXX XXXXXXXX XXXXX XXXX XXXXXXX XXX XXXX XXXXXXXXX XXX XXXXXXXXX XX XXXXXX XXXXXXXXX XX XXXXXXX XXXXXXXX XX XXXXX XXXXX XXXX XXXXX XXXXXX XXXXX XXXX XXXXXX XXXXX XXXXXXXX X XXXXXXXX XXXXX XXXXX XXXXXXXX XXXXXXX XX XXXXX XXXXX XX XXX XXXXXX XXXX XXXXX XXXXXXXX XXXXXX XX XXXXXX XXXXXXXX XXXXXXXX XXXX XXX XXXXX XXXXXXXX XXXXXX XX XXXXXXXX XXXXX XXXXXXXXX X XX XXXXXXXX XXXXXXXXX XXXX XXX XXXXXX X XXXXXX XXXX XXXXXXX XXXXXXXXX XXXXXX XXXXXXX XXXXXXXXX XXXX X XXXXX XXXXXXX XX XXXXXXXXX XXXXXXX XXXXXXX XXXXXXXXX XXXXX X XXXXXXXXX XXXXXXXXX X XXXXX XXX XXXXX XX XXXXXXXXX XX XXXXXXXXX X XXXXXXXX XXXXXXX XXXXXXXXX XXXXXXX XXX XX XXXXXXXX XXXXXXX XXXXX XXXX XXXXX XX XXXXX XXXXXX X XXXXXX XXXXX XXXX XXXXXXXXX X XXXXXXX XX XXXXX XXXXXXXX XXXXXX XXXX XXX XXX XX XXXXXX XXXXXXXX XXXXXXXXX XXXX XXX XXXX XX XXXX XXXXXX XXXXXXXX XXXXXXXXX XXXXXX XXXXXXXXX XXX XXXXXXXX XX XX XXXXXXXX XXXXXXX XXXX XXXXXX XXXXXXXX XXXX XXXXX XXX X XXX X XXXXXXX XXXXXXXXX XXX X XX XXXXXX XXXXXXXXX XXXX XXX XXXXX XX XXXXXXXXX XXXX XXXX X XXXX XXXXX XXXXXXX XXXX XXXXXXXXX X XX XXXXXXXXX XXXXXX XXXXX XXX XXXXXXXX XXXX XXXXX XXX XXXXXXX XXXX XXXXXX XXXXXXXX XXX XXXXX XXX XXXXXXXXX XX XXXXXXXXX XXXXXXXX XX XX XXXX XXXXXXXXX XXXX XXXXXX XXXXXXXX XXXXX XXXXX XXXX XXXXX XXXXXXXX XXXXXX XX XXXXXXXXX XXX XX XXXXXX XXXX XXXXXXX XXXXXXXX XXXXXXXX X XXXX X XXXXXX XXXXXXXX XXXXXXXXX X XXX XXXXXX X XXXXXX XX XXXXXXX XXXXXXXX XXXXX XXXX XXXX XXXXXXX XXX X XXXXXXX XXXXXX X XXXXXXXXX XXXXXX XXX XXXXX XXXXXXX X X XX XXXXXX X XXXX XXXXXXXXX XXXXXXXXX XX XX XXXXXX X XXXXXX XXXXXX XXXXXX XX XX XXXXXXX XXXX X XXX XXXXX XXX X XX XXXXXXXXX XXXXX XXXXXXXXX XXXXXXX X XXX XXXXXX XX XX XXXXXXXX X XXXXXXXXX XXXXXXX XXXXXXXX XXXXXX XX XXXXXXXXX"
13 | }
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/Lippy.sketchplugin/Contents/Resources/Lippy.framework/Versions/A/_CodeSignature/CodeResources:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | files
6 |
7 | Resources/Assets.car
8 |
9 | 0MbGqN0gImesys7Q7s0g76KHHZY=
10 |
11 | Resources/Info.plist
12 |
13 | Jhpk5XMyRGfI9SktaLSpQrtPW/o=
14 |
15 | Resources/LippyMainViewController.nib
16 |
17 | G8+3jeSDMLpiTKx+W4L0SKScBDs=
18 |
19 | Resources/LippySourceEditorWindow.nib
20 |
21 | VxGdDXTSvu8G+M0S0mg2dzdf8dY=
22 |
23 | Resources/lippy-content.json
24 |
25 | x53g0chLzdoYb/VWSZRP+IgsdrQ=
26 |
27 |
28 | files2
29 |
30 | Resources/Assets.car
31 |
32 | hash2
33 |
34 | I1os1YmNcOymLKipfOy2iKKnpPVqY9loVa+eTCBvnkk=
35 |
36 |
37 | Resources/Info.plist
38 |
39 | hash2
40 |
41 | cIAxf3362OQFNkLeOjMu9OLzSZDx+DwqeUV7SQhFbXo=
42 |
43 |
44 | Resources/LippyMainViewController.nib
45 |
46 | hash2
47 |
48 | zrQSpx/eowsdEymJZLVZDSY+E3zmjWVk9BZ/WcpHmN0=
49 |
50 |
51 | Resources/LippySourceEditorWindow.nib
52 |
53 | hash2
54 |
55 | UFT2QMgpKm+qjykLZhW8tsS90lJdpmcz+LPtF4kuqR0=
56 |
57 |
58 | Resources/lippy-content.json
59 |
60 | hash2
61 |
62 | ZTCBkF8fJXlbEy7oEZ2aSntVM9rVv6LUs/p2nf8AdUQ=
63 |
64 |
65 |
66 | rules
67 |
68 | ^Resources/
69 |
70 | ^Resources/.*\.lproj/
71 |
72 | optional
73 |
74 | weight
75 | 1000
76 |
77 | ^Resources/.*\.lproj/locversion.plist$
78 |
79 | omit
80 |
81 | weight
82 | 1100
83 |
84 | ^Resources/Base\.lproj/
85 |
86 | weight
87 | 1010
88 |
89 | ^version.plist$
90 |
91 |
92 | rules2
93 |
94 | .*\.dSYM($|/)
95 |
96 | weight
97 | 11
98 |
99 | ^(.*/)?\.DS_Store$
100 |
101 | omit
102 |
103 | weight
104 | 2000
105 |
106 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/
107 |
108 | nested
109 |
110 | weight
111 | 10
112 |
113 | ^.*
114 |
115 | ^Info\.plist$
116 |
117 | omit
118 |
119 | weight
120 | 20
121 |
122 | ^PkgInfo$
123 |
124 | omit
125 |
126 | weight
127 | 20
128 |
129 | ^Resources/
130 |
131 | weight
132 | 20
133 |
134 | ^Resources/.*\.lproj/
135 |
136 | optional
137 |
138 | weight
139 | 1000
140 |
141 | ^Resources/.*\.lproj/locversion.plist$
142 |
143 | omit
144 |
145 | weight
146 | 1100
147 |
148 | ^Resources/Base\.lproj/
149 |
150 | weight
151 | 1010
152 |
153 | ^[^/]+$
154 |
155 | nested
156 |
157 | weight
158 | 10
159 |
160 | ^embedded\.provisionprofile$
161 |
162 | weight
163 | 20
164 |
165 | ^version\.plist$
166 |
167 | weight
168 | 20
169 |
170 |
171 |
172 |
173 |
--------------------------------------------------------------------------------
/Lippy.sketchplugin/Contents/Resources/Lippy.framework/Versions/Current:
--------------------------------------------------------------------------------
1 | A
--------------------------------------------------------------------------------
/Lippy.sketchplugin/Contents/Resources/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abynim/lippy/20b3a68d5917c63dcf78e1b9f8aa0cbe795f84d4/Lippy.sketchplugin/Contents/Resources/icon.png
--------------------------------------------------------------------------------
/Lippy.sketchplugin/Contents/Sketch/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "commands" : [
3 | {
4 | "script" : "script.js",
5 | "handler" : "go",
6 | "shortcut" : "ctrl i",
7 | "name" : "Lippy",
8 | "identifier" : "lippy",
9 | "description": "An interactive lorem ipsum generator."
10 | },
11 | {
12 | "script" : "script.js",
13 | "handler" : "updateSource",
14 | "identifier" : "updateSource"
15 | }
16 | ],
17 | "menu": {
18 | "title" : "Lippy",
19 | "isRoot" : true,
20 | "items": [
21 | "lippy"
22 | ]
23 | },
24 | "identifier" : "com.abynim.Lippy",
25 | "version" : "1.2",
26 | "icon" : "icon.png",
27 | "description" : "An interactive lorem ipsum generator",
28 | "author" : "Aby Nimbalkar",
29 | "name" : "Lippy",
30 | "disableCocoaScriptPreprocessor" : true,
31 | "homepage" : "https://abynim.github.io/lippy",
32 | "appcast" : "https://abynim.github.io/lippy/appcast.xml"
33 | }
34 |
--------------------------------------------------------------------------------
/Lippy.sketchplugin/Contents/Sketch/markov.js:
--------------------------------------------------------------------------------
1 | class Markov {
2 | // source: https://gist.github.com/kevincennis/5440878
3 | // basic usage: new Markov(lotsOfText).generate()
4 |
5 | // markov chain constructor
6 | //
7 | // @string input {example text}
8 | // @integer len {optional # of words to output}
9 | // @integer stateSize {optional chain order}
10 | constructor(input, len, stateSize) {
11 | this.cache = Object.create(null)
12 | this.words = input.replace(/\./g,'').split(/\s+/)
13 | this.startwords = [this.words[0]]
14 | this.stateSize = stateSize || 2
15 | this.outputSize = len || 100
16 | this.analyzed = false
17 | }
18 |
19 | // return a random element from an array
20 | choose(arr) {
21 | return arr[~~( Math.random() * arr.length )]
22 | }
23 |
24 | // get the next set of words as a string
25 | getNextSet(i) {
26 | return this.words.slice(i, i + this.stateSize).join(' ')
27 | }
28 |
29 | // create a markov lookup
30 | analyze(input) {
31 | var len = this.words.length, next
32 | this.words.forEach(function( word, i ){
33 | next = this.getNextSet(++i)
34 | ;(this.cache[word] = this.cache[word] || []).push(next)
35 | ;/[A-Z]/.test(word[0]) && this.startwords.push(word)
36 | }.bind(this))
37 | return this.analyzed = true && this
38 | }
39 |
40 | // generate new text from a markov lookup
41 | generate() {
42 | var seed, arr, choice, curr, i = 1
43 | !this.analyzed && this.analyze()
44 | arr = [seed = this.choose(this.startwords)]
45 | for ( ; i < this.outputSize; i += this.stateSize ){
46 | arr.push(choice = this.choose(curr || this.cache[seed]))
47 | curr = this.cache[choice.split(' ').pop()]
48 | }
49 | var ret = arr.join(' ')
50 | if (ret.charAt(ret.length - 1) == ',') {
51 | ret = ret.slice(0,-1)
52 | }
53 | return ret.charAt(0).toUpperCase() + ret.slice(1).toLowerCase() + '.'
54 | }
55 | }
56 |
57 | module.exports = Markov
58 |
--------------------------------------------------------------------------------
/Lippy.sketchplugin/Contents/Sketch/script.js:
--------------------------------------------------------------------------------
1 | const Markov = require('./markov');
2 |
3 | var go = function (context) {
4 |
5 | if (pluginUpdated(context)) return;
6 |
7 | if (!NSClassFromString("Lippy") && !Mocha.sharedRuntime().loadFrameworkWithName_inDirectory('Lippy', NSBundle.bundleWithURL(context.plugin.url()).resourceURL().path())) {
8 | console.log("[Lippy] Could not load the Lippy plugin 💩");
9 | return;
10 | }
11 |
12 | const lipsumSource = Lippy.fetchSource() + "";
13 | generateMarkovWithSource(lipsumSource, context);
14 | Lippy.go(context);
15 |
16 | }
17 |
18 | var updateSource = function (context) {
19 | try {
20 | const lipsumSource = Lippy.fetchSource() + "";
21 | generateMarkovWithSource(lipsumSource, context);
22 | Lippy.go(context);
23 | } catch (err) { }
24 | }
25 |
26 | const generateMarkovWithSource = function (lipsumSource, context) {
27 | var words = new Markov(lipsumSource, 500, 1);
28 | context.words = words.generate();
29 |
30 | var sentences = new Markov(lipsumSource, 13, 1);
31 | var sentencesArray = [];
32 | for (var i = 0; i < 50; i++) {
33 | sentencesArray.push(sentences.generate());
34 | }
35 | context.sentences = NSArray.arrayWithArray(sentencesArray);
36 |
37 | var paragraphs = new Markov(lipsumSource, 39, 1);
38 | var paragraphsArray = [];
39 | for (var i = 0; i < 15; i++) {
40 | paragraphsArray.push(paragraphs.generate());
41 | }
42 | context.paragraphs = NSArray.arrayWithArray(paragraphsArray);
43 | }
44 |
45 | const pluginUpdated = function (context) {
46 |
47 | if (!NSClassFromString("Lippy")) return false;
48 |
49 | const wasUpdated = NSUserDefaults.standardUserDefaults().objectForKey("LippyLastVersion") != context.plugin.version();
50 |
51 | if (wasUpdated) {
52 | const alert = NSAlert.alloc().init();
53 | alert.setMessageText("Lippy was updated recently");
54 | alert.setInformativeText("Sketch must be restarted before you can use Lippy again.");
55 | alert.addButtonWithTitle("Later");
56 | alert.addButtonWithTitle("Quit Sketch");
57 | if (alert.runModal() == NSAlertSecondButtonReturn) {
58 | NSApp.terminate(nil);
59 | }
60 | }
61 |
62 | return wasUpdated;
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Lippy
2 | An interactive lorem ipsum generator plugin for Sketch.
3 |
4 | 
5 |
6 | ## Installing
7 | Download the contents of this repository, then double-click the `Lippy.sketchplugin` bundle.
8 | Or install via [Sketch Runner](https://sketchrunner.com/).
9 |
10 | ## How to use
11 | 1. Select a text layer or a text override
12 | 2. Go to `Plugins > Lippy` or hit `Cmd+L`
13 | 3. Click the appropriate cells to create Words, Sentences, or Paragraphs.
14 | 4. To create more content, click and drag from the last cell.
15 |
16 | ### Using the keyboard
17 | If you prefer using your keyboard instead of the mouse, use the arrow keys when Lippy is displayed.
18 | - `→` and `←` for Words (hold `Shift` to add/remove 10 words).
19 | - `↑` and `↓` for Sentences.
20 | - `Shift ↑` and `Shift ↓` for Paragraphs.
21 | - `Escape` or `Return` when you're done.
22 |
23 | ### Settings
24 | **Punctuation**
25 | Choose to include punctuation when generating *Words*. Defaults to `NO`.
26 | Punctuation is always included when generating *Sentences* and *Paragraphs*.
27 |
28 | ## Adding more text sources
29 | 1. Click the gear icon and select `Source Text > Add New`
30 | 2. Enter a Name, and paste in at least 500 words of content for source text
31 | 3. Save
32 |
33 | ---
34 |
35 | Feedback or suggestions? Find me on Twitter: [@abynim](http://twitter.com/abynim)
36 |
37 | MIT License
38 |
--------------------------------------------------------------------------------
/appcast.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Lippy
5 | https://abynim.github.io/lippy
6 | An interactive lorem ipsum generator plugin for Sketch
7 | en
8 | -
9 | Lippy 1.2
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/lippy-gh.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/abynim/lippy/20b3a68d5917c63dcf78e1b9f8aa0cbe795f84d4/lippy-gh.gif
--------------------------------------------------------------------------------