wikitxt 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -0
- data/Gemfile.lock +37 -0
- data/Guardfile +4 -0
- data/README.md +1 -1
- data/lib/html/layout.html.erb +45 -0
- data/lib/wikitxt/cli.rb +5 -4
- data/lib/wikitxt/node.rb +1 -1
- data/lib/wikitxt/version.rb +1 -1
- data/samples/index.txt +2 -0
- data/wikitxt.gemspec +2 -2
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4db91ffe011ebcf64fb5bccb168e9385bc51671a20d3ea279795aecd51110cb
|
4
|
+
data.tar.gz: f74c13b996a67e1868ece5513b13bd0fe9b9a573d94606b8ac2219a2a538fd03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47e59b7e06134f35ab00470e21421ea1f1ee1d9f99ef5f1655e1967bfa81145c7ff84a16067be9f7e4e33e99908b9ce0f23cefa532b1862832729dc6c0a05300
|
7
|
+
data.tar.gz: cd1e31f37452b34e0d27f33b632e80645ea230429df5c24f936de3ad193a1286e59ea3ce706c87f1c9ab132370a35637350b6eaea938a06436c234570f3a7085
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -10,9 +10,37 @@ GEM
|
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
12
|
base64 (0.2.0)
|
13
|
+
coderay (1.1.3)
|
13
14
|
diff-lcs (1.5.1)
|
15
|
+
ffi (1.16.3)
|
16
|
+
formatador (1.1.0)
|
17
|
+
guard (2.18.1)
|
18
|
+
formatador (>= 0.2.4)
|
19
|
+
listen (>= 2.7, < 4.0)
|
20
|
+
lumberjack (>= 1.0.12, < 2.0)
|
21
|
+
nenv (~> 0.1)
|
22
|
+
notiffany (~> 0.0)
|
23
|
+
pry (>= 0.13.0)
|
24
|
+
shellany (~> 0.0)
|
25
|
+
thor (>= 0.18.1)
|
26
|
+
guard-compat (1.2.1)
|
27
|
+
guard-process (1.2.1)
|
28
|
+
guard-compat (~> 1.2, >= 1.2.1)
|
29
|
+
spoon (~> 0.0.1)
|
30
|
+
listen (3.9.0)
|
31
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
32
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
33
|
+
lumberjack (1.2.10)
|
34
|
+
method_source (1.0.0)
|
14
35
|
mustermann (3.0.0)
|
15
36
|
ruby2_keywords (~> 0.0.1)
|
37
|
+
nenv (0.3.0)
|
38
|
+
notiffany (0.1.3)
|
39
|
+
nenv (~> 0.1)
|
40
|
+
shellany (~> 0.0)
|
41
|
+
pry (0.14.2)
|
42
|
+
coderay (~> 1.1)
|
43
|
+
method_source (~> 1.0)
|
16
44
|
rack (3.0.10)
|
17
45
|
rack-protection (4.0.0)
|
18
46
|
base64 (>= 0.1.0)
|
@@ -20,6 +48,9 @@ GEM
|
|
20
48
|
rack-session (2.0.0)
|
21
49
|
rack (>= 3.0.0)
|
22
50
|
rake (13.2.1)
|
51
|
+
rb-fsevent (0.11.2)
|
52
|
+
rb-inotify (0.10.1)
|
53
|
+
ffi (~> 1.0)
|
23
54
|
rspec (3.13.0)
|
24
55
|
rspec-core (~> 3.13.0)
|
25
56
|
rspec-expectations (~> 3.13.0)
|
@@ -34,20 +65,26 @@ GEM
|
|
34
65
|
rspec-support (~> 3.13.0)
|
35
66
|
rspec-support (3.13.1)
|
36
67
|
ruby2_keywords (0.0.5)
|
68
|
+
shellany (0.0.1)
|
37
69
|
sinatra (4.0.0)
|
38
70
|
mustermann (~> 3.0)
|
39
71
|
rack (>= 3.0.0, < 4)
|
40
72
|
rack-protection (= 4.0.0)
|
41
73
|
rack-session (>= 2.0.0, < 3)
|
42
74
|
tilt (~> 2.0)
|
75
|
+
spoon (0.0.6)
|
76
|
+
ffi
|
43
77
|
thor (1.3.1)
|
44
78
|
tilt (2.3.0)
|
45
79
|
webrick (1.8.1)
|
46
80
|
|
47
81
|
PLATFORMS
|
48
82
|
arm64-darwin-22
|
83
|
+
x86_64-linux
|
49
84
|
|
50
85
|
DEPENDENCIES
|
86
|
+
guard
|
87
|
+
guard-process
|
51
88
|
rake (~> 13.0)
|
52
89
|
rspec (~> 3.0)
|
53
90
|
wikitxt!
|
data/Guardfile
ADDED
data/README.md
CHANGED
@@ -0,0 +1,45 @@
|
|
1
|
+
<head>
|
2
|
+
<meta charset="UTF-8" />
|
3
|
+
</head>
|
4
|
+
|
5
|
+
<style>
|
6
|
+
body {
|
7
|
+
background: #ddd;
|
8
|
+
padding: 1rem;
|
9
|
+
}
|
10
|
+
|
11
|
+
.content {
|
12
|
+
max-width: 800px;
|
13
|
+
margin: 0 auto;
|
14
|
+
padding: 2rem;
|
15
|
+
background: #fff;
|
16
|
+
border-radius: 0.5rem;
|
17
|
+
}
|
18
|
+
|
19
|
+
.title {
|
20
|
+
margin-bottom: 2rem;
|
21
|
+
font-size: 2rem;
|
22
|
+
font-weight: bold;
|
23
|
+
}
|
24
|
+
|
25
|
+
.line {
|
26
|
+
display: flex;
|
27
|
+
align-items: center;
|
28
|
+
gap: 8px;
|
29
|
+
min-height: 1rem;
|
30
|
+
}
|
31
|
+
|
32
|
+
.dot {
|
33
|
+
width: 5px;
|
34
|
+
height: 5px;
|
35
|
+
background: #333;
|
36
|
+
border-radius: 100%;
|
37
|
+
}
|
38
|
+
</style>
|
39
|
+
|
40
|
+
<body>
|
41
|
+
<div class="content">
|
42
|
+
<div class="title"><%= title %></div>
|
43
|
+
<%= body %>
|
44
|
+
</div>
|
45
|
+
</body>
|
data/lib/wikitxt/cli.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "thor"
|
2
2
|
require 'webrick'
|
3
|
+
require 'erb'
|
3
4
|
|
4
5
|
module Wikitxt
|
5
6
|
class CLI < Thor
|
@@ -11,11 +12,11 @@ module Wikitxt
|
|
11
12
|
files = Dir.glob(File.join(path, "*.txt"))
|
12
13
|
files.each do |file|
|
13
14
|
text = File.read(file)
|
14
|
-
|
15
|
+
body = Wikitxt.to_html(text)
|
16
|
+
title = File.basename(file, ".txt")
|
17
|
+
html = ERB.new(File.read(File.join(__dir__, "../", "html", "layout.html.erb"))).result_with_hash({ body: body, title: title })
|
15
18
|
Dir.mkdir("dist") unless Dir.exist?("dist")
|
16
|
-
File.
|
17
|
-
f.write(html)
|
18
|
-
end
|
19
|
+
File.write(File.join("dist", "#{title}.html"), html)
|
19
20
|
end
|
20
21
|
server = WEBrick::HTTPServer.new :Port => 8000, :DocumentRoot => "dist"
|
21
22
|
trap 'INT' do server.shutdown end
|
data/lib/wikitxt/node.rb
CHANGED
data/lib/wikitxt/version.rb
CHANGED
data/samples/index.txt
CHANGED
data/wikitxt.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["Moeki Kawakami"]
|
9
9
|
spec.email = ["moeki.kawakami@icloud.com"]
|
10
10
|
|
11
|
-
spec.summary = "Most lightweight wiki
|
12
|
-
spec.description = "Most lightweight wiki
|
11
|
+
spec.summary = "Most lightweight wiki written by plain text."
|
12
|
+
spec.description = "Most lightweight wiki written by plain text."
|
13
13
|
spec.homepage = "https://github.com/kawakamimoeki/wikitxt"
|
14
14
|
spec.license = "MIT"
|
15
15
|
spec.required_ruby_version = ">= 2.6.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wikitxt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Moeki Kawakami
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.8'
|
55
|
-
description: Most lightweight wiki
|
55
|
+
description: Most lightweight wiki written by plain text.
|
56
56
|
email:
|
57
57
|
- moeki.kawakami@icloud.com
|
58
58
|
executables:
|
@@ -65,10 +65,12 @@ files:
|
|
65
65
|
- CODE_OF_CONDUCT.md
|
66
66
|
- Gemfile
|
67
67
|
- Gemfile.lock
|
68
|
+
- Guardfile
|
68
69
|
- LICENSE.txt
|
69
70
|
- README.md
|
70
71
|
- Rakefile
|
71
72
|
- exe/wikitxt
|
73
|
+
- lib/html/layout.html.erb
|
72
74
|
- lib/wikitxt.rb
|
73
75
|
- lib/wikitxt/cli.rb
|
74
76
|
- lib/wikitxt/node.rb
|
@@ -102,5 +104,5 @@ requirements: []
|
|
102
104
|
rubygems_version: 3.3.26
|
103
105
|
signing_key:
|
104
106
|
specification_version: 4
|
105
|
-
summary: Most lightweight wiki
|
107
|
+
summary: Most lightweight wiki written by plain text.
|
106
108
|
test_files: []
|