snibbets 2.0.26 → 2.0.28

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8268903f7b48cbc4e12e42e09fc99c5062f6b5f1bf49e6e7a0033d1c759a2069
4
- data.tar.gz: d880b58db9f6f7b849de94157816a4c48774dadbadc977ea109839201194e56d
3
+ metadata.gz: 6f9f01ad7e1ae9656d572bbd502f4b0dc1fa7d344509a6a93f07b765d515ddca
4
+ data.tar.gz: 0bc11012e818d56256550af0b3df3fe952307d2f86b8e7da9d91a8a80dfbafee
5
5
  SHA512:
6
- metadata.gz: a06043d9c6684b6a3fd1d1ec6f813d1a4e1148d99534278561b6359a63083b5766c83c3ff5910b2ba424cef31fc2024f23d147ee20b24ef204c15312f67f601a
7
- data.tar.gz: db1de38bd67085f64e9d1c85ff68ed7f03e29ec335f2cd988925fb4b93d49f4ba0b69612831ddfba1414c7e3cad1750c4ddcd8f7f25184935c3b1e69d70656cd
6
+ metadata.gz: a8926027efe84785a45414761eab33b66474a819ed394e52e1f638c95e5ae7a3aad857df95728640f3ccf68ad0d471b93039b694bfa0d72886b682afad13c3c5
7
+ data.tar.gz: bfc6c99b3178fb1f7cb8dc3b7aad350cca53e6f560ab19357924291346e6bc74583c9755a945363122105840ef66abee960a8aa9ca75547f23b239be088761b1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,40 @@
1
+ ### 2.0.28
2
+
3
+ 2023-04-18 09:18
4
+
5
+ #### NEW
6
+
7
+ - `--nvultra` will open the selected snippet in nvUltra
8
+
9
+ #### IMPROVED
10
+
11
+ - Use Readline for entering info with `--paste`, allows for better editing experience
12
+ - Allow `--edit` with `--paste` to open the new snippet in your editor immediately
13
+
14
+ #### FIXED
15
+
16
+ - Code indentation with `--paste`
17
+ - Nil error when highlighting without extension
18
+ - When detecting indented code blocks, require a blank line (or start of file) before them, to avoid picking up lines within indented lists
19
+
20
+ ### 2.0.27
21
+
22
+ 2023-04-17 15:54
23
+
24
+ #### NEW
25
+
26
+ - `--nvultra` will open the selected snippet in nvUltra
27
+
28
+ #### IMPROVED
29
+
30
+ - Use Readline for entering info with `--paste`, allows for better editing experience
31
+ - Allow `--edit` with `--paste` to open the new snippet in your editor immediately
32
+
33
+ #### FIXED
34
+
35
+ - Code indentation with `--paste`
36
+ - Nil error when highlighting without extension
37
+
1
38
  ### 2.0.26
2
39
 
3
40
  2023-04-16 11:18
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- snibbets (2.0.26)
4
+ snibbets (2.0.28)
5
5
  mdless (~> 1.0, >= 1.0.32)
6
6
  tty-reader (~> 0.9, >= 0.9.0)
7
7
  tty-which (~> 0.5, >= 0.5.0)
data/README.md CHANGED
@@ -118,11 +118,13 @@ The `name_only` key will permanently set Snibbets to only search for snippets by
118
118
 
119
119
  #### Syntax Highlighting
120
120
 
121
- The `highlight` key turns on syntax highlighting. This requires that either `pygmentize` or `skyligting` is available on your system (both available via package managers like Homebrew). This feature is still in development and results may be mixed. You can also set `highlighter` to `pygments` or `skylight` to force using one highlighter over the other.
121
+ The `highlight` key turns on syntax highlighting. This requires that either `pygmentize` or `skylighting` is available on your system (both available via package managers like Homebrew). This feature is still in development and results may be mixed. You can also set `highlighter` to `pygments` or `skylight` to force using one highlighter over the other.
122
122
 
123
- Highlighting using Skylighting requires that your snippets be named with extra extensions defining the lexer to use. The last extension before `.md` (or whatever your snippet extension is set to) should be the one that the highlighter will recognize as a valid lexer, e.g. `my code.jquery.js.md`.
123
+ Highlighting using Skylighting requires that your snippets be named with extra extensions defining the lexer to use. The last extension before `.md` (or whatever your snippet extension is set to) should be the one that the highlighter will recognize as a valid lexer, e.g. `my code.jquery.js.md`.
124
124
 
125
- You can also define languages in your fenced code blocks by putting the lexer name right after the opening fence. This is used with Skylighting, but Pygments will always use it's own lexer detection. When defining multiple snippets in one file that are of different languages, this method will ensure that each one is properly highlighted.
125
+ You can also define languages in your fenced code blocks by putting the lexer name right after the opening fence. When defining multiple snippets in one file that are of different languages, this method will ensure that each one is properly highlighted.
126
+
127
+ If you don't use either extensions or fenced code labels with Skylighting, code won't get highlighted.
126
128
 
127
129
  To define a snippet as python code, for example:
128
130
 
@@ -145,7 +147,7 @@ You can turn highlighting on or off for a single run using `--highlight` or `--n
145
147
 
146
148
  Snibbet's implementation of Skylighting has limited but better-looking themes, and has some lexers that Pygments lacks. However, Pygments has _more_ lexers and a wider array of themes. It also can determine the target syntax automatically better than Skylighting (which requires the syntax to be specified -- it's pulled from the extensions of your snippets), which is why Pygments is the default if it's installed and you don't configure it otherwise.
147
149
 
148
- - Install [Skylighting] with [Homebrew] (`brew install pygmentize`) or [apt-get].
150
+ - Install [Skylighting] with [Homebrew] (`brew install skylighting`) or [apt-get].
149
151
  - Install [Pygments] using [Homebrew] (`brew install pygments`) or `pip install pygments`.
150
152
 
151
153
  [Skylighting]: https://github.com/jgm/skylighting
@@ -155,7 +157,7 @@ Snibbet's implementation of Skylighting has limited but better-looking themes, a
155
157
  ### Usage
156
158
 
157
159
  ```
158
- Snibbets v2.0.26
160
+ Snibbets v2.0.28
159
161
 
160
162
  Usage: snibbets [options] query
161
163
  -a, --all If a file contains multiple snippets, output all of them (no menu)
data/buildnotes.md CHANGED
@@ -1,6 +1,6 @@
1
1
  template: gem, git, gli, project
2
2
  executable: na
3
- readme: src/README.md
3
+ readme: src/_README.md
4
4
  changelog: CHANGELOG.md
5
5
  project: snibbets
6
6
 
@@ -20,11 +20,17 @@ A plain text snippet manager
20
20
 
21
21
  You no longer need to manually bump the version, it will be incremented when this task runs.
22
22
 
23
- ```run Update Changelog and README
23
+ ```run Update Changelog
24
24
  #!/bin/bash
25
25
 
26
26
  changelog -u
27
- scripts/fixreadme.rb
27
+ ```
28
+
29
+ @include(project:Update GitHub README)
30
+
31
+ ```run Update README
32
+ #!/bin/bash
33
+
28
34
  changelog | git commit -a -F -
29
35
  git pull
30
36
  git push
@@ -125,7 +125,7 @@ module Snibbets
125
125
  "<block#{counter}>\n"
126
126
  end
127
127
 
128
- sans_blocks = sans_blocks.gsub(/(?mi)^((?: {4,}|\t+)\S[\S\s]*?)(?=\n\S|\Z)/) do
128
+ sans_blocks = sans_blocks.gsub(/(?mi)(?<=\n\n|\A)\n?((?: {4,}|\t+)\S[\S\s]*?)(?=\n\S|\Z)/) do
129
129
  counter += 1
130
130
  code = Regexp.last_match(1).split(/\n/)
131
131
 
@@ -148,10 +148,9 @@ module Snibbets
148
148
 
149
149
  parts.each do |part|
150
150
  lines = part.split(/\n/).strip_empty
151
-
152
151
  next if lines.blocks == 0
153
152
 
154
- title = lines.count > 1 ? lines.shift.strip.sub(/[.:]$/, '') : 'Default snippet'
153
+ title = lines.count > 1 && lines[0] !~ /<block\d+>/ ? lines.shift.strip.sub(/[.:]$/, '') : 'Default snippet'
155
154
  block = lines.join("\n").gsub(/<(block\d+)>/) { code_blocks[Regexp.last_match(1)] }
156
155
 
157
156
  lang = nil
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Snibbets
4
- VERSION = '2.0.26'
4
+ VERSION = '2.0.28'
5
5
  end
data/snibbets.taskpaper CHANGED
@@ -1,6 +1,7 @@
1
1
  Inbox:
2
2
  - handle multiple code blocks within a section separately for highlighting @maybe @na
3
3
  If a header contains multiple snippets, create an array with a language specifier for each snippet, and then pass the array to the print function to handle individually highlighting each code block. Have a special language specifier for blockquote notes to avoid highlighting them at all.
4
+ Could possibly just highlight each block as its found, and save an original copy in memory for uncolored output, or just write a decoloring method. Skip highlighting if it's not enabled, but decolor ouput sent to non-tty or --copy.
4
5
  snibbets:
5
6
  Feature Requests:
6
7
  Ideas:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snibbets
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.26
4
+ version: 2.0.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-16 00:00:00.000000000 Z
11
+ date: 2023-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler