kdwatch 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a061720f05736d7be0f68e3e18887c799f94bdc5d83be4ac0b0553f7f65b822
4
- data.tar.gz: 66ba9346da80aa7a1587baa978163290c59f3f3f6255964fae1a2a89913c3047
3
+ metadata.gz: 77f59a0c0a41535d090f2b858a44759a830b7cddc4e760a39c75613f06d2b37f
4
+ data.tar.gz: 6c53346765beb3f0391991db58bda4f00debfed880b8dca8763462567bbcd435
5
5
  SHA512:
6
- metadata.gz: a42cd6df0ec3c6c8562ab41809d7676162d08dd1b34993f4e3aa8010d1edbe4930bb94507489176996f15c55b7e43d4b29642913a8305e157d009bf5dc0567cb
7
- data.tar.gz: 50856210e599e8aa2e37af01da0e6173a349cd3d94858c3ff90f4b9b1ad5510a403fb11248f0f0fbe0f4a5c132a088c891a5412a5bdf0a90f6148a0490789302
6
+ metadata.gz: d9c2df05241e752a0d7d80e34cf8324872110a0aa4bc800bb9ef7ec1afe0ad2034b06691b56d84c14a6462c252606ef371cad1f85f021ac424046c09dcdc5182
7
+ data.tar.gz: 001ca06bd402115c0d63e8cd06e3558a99787f12ba97b9641c158ec8f9f8d87f99cdea3850a5121b28f53336d14c1312c13ec037ace624b97c19effba70fdea8
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Kdwatch
2
2
 
3
- Autoreloading display of [kramdown-rfc][] document in browser
3
+ Auto-formatting, auto-reloading display of formatted [kramdown-rfc][] document in browser
4
4
 
5
5
  [kramdown-rfc]: http://rfc.space
6
6
 
@@ -14,11 +14,11 @@ $ gem install kdwatch
14
14
 
15
15
  * For some reason, the initial `gem install` takes a couple of minutes,
16
16
  during the first few of which it may seem nothing happens.
17
- * If the above `pip3` doesn't work, no problem: in a pinch, kdrfc will
18
- use the IETF web service for xml2rfc processing (but that may be a
19
- bit slower).
20
- * Depending on system configuration, add `sudo` (but don't if it isn't
21
- actually needed).
17
+ * If the above `pip3` (or `pip`) doesn't work, no problem: in a pinch,
18
+ kdrfc will use the IETF web service for xml2rfc processing (but that
19
+ may be a bit slower).
20
+ * Depending on system configuration, add `sudo` on the pip/gem
21
+ commands (but don't if it isn't actually needed).
22
22
 
23
23
  ## Usage
24
24
 
@@ -34,12 +34,16 @@ $ kdwatch
34
34
  pop up with the URL to use, which depends on the options given, but
35
35
  defaults to <http://127.0.0.1:7991/>).
36
36
 
37
- Now, whenever you do an editor save of the markdown file, after a
38
- couple of seconds (1.6 s for my Intel Mac, 0.8 s for my M1 Mac) you
39
- see an updated HTML in the browser.
37
+ Now, whenever you do an editor save of the kramdown-rfc markdown file,
38
+ kdwatch auto-formats and, after a couple of seconds(*), you see an
39
+ updated HTML in the browser without pressing buttons or switching windows.
40
40
 
41
41
  You will need to keep the `kdwatch` terminal/screen open to see
42
42
  potential error messages, e.g., if you break the markdown in some way.
43
+ (The author uses an Emacs "Async Shell Command" buffer for that.)
44
+
45
+ (*) The latency depends on your computer and a bit on the size of the
46
+ file, say, around 1.6 s for my Intel Mac, 0.8 s for my M1 Mac.
43
47
 
44
48
  ### There can only be one (per host/port)
45
49
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kdwatch
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
data/lib/kdwatch-app.rb CHANGED
@@ -40,7 +40,18 @@ get "/" do
40
40
  warn "...done"
41
41
  end
42
42
  end
43
- File.read(dfn)
43
+ dfc = File.stat(dfn).ctime rescue Time.at(0)
44
+ ret = File.read(dfn)
45
+ if sfc > dfc # somehow the above went wrong
46
+ ret.gsub!(<<CSS, <<RED)
47
+ /* general and mobile first */
48
+ html {
49
+ CSS
50
+ /* general and mobile first */
51
+ html { border: 5px solid red;
52
+ RED
53
+ end
54
+ ret
44
55
  end
45
56
 
46
57
  get "/metadata.min.js" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kdwatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-10 00:00:00.000000000 Z
11
+ date: 2021-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler