runeblog 0.1.56 → 0.1.57

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: 2ded36cfd802fe47978c4168e0cd566ffcdbe8ae52b340603e5add64462924c9
4
- data.tar.gz: 83c1fdf79034407a8d39a2737b3f0dededbedb2abde038749c8654de9bd9ac90
3
+ metadata.gz: 25ab912bbfad61d824612c26a6276f41fcbb0ef2d3ac189e5ec361de80aa6de9
4
+ data.tar.gz: f459c0a6a2ff40e3e57db5a236cc91044d094e3d8d5a6e18ebb5a12edc503f7a
5
5
  SHA512:
6
- metadata.gz: c278a5ca40d38ce088bb38c7e35e849fb15da82c5f371cedf71190873f0c2b1d5012f035181263da96773773278f3ef72b2742e9f047c4e74442509aa2fc7c47
7
- data.tar.gz: 00f51c927d68edf25a434561b12d5fd51ec2a35edd878ce5753537094015b0d665370289919d7ae93cf85effc4a75ba16d4f76d54722071c1fd1fe5d9c1c5a9c
6
+ metadata.gz: c14c72020011927c953b5df97207e80a489fd21fdc0ec45a159109dfbbde3ac7da8cfd2b00764493f041d5c39b11f70bb5949b7c0f06b325a5b259817a069dc0
7
+ data.tar.gz: f50990d4641a0e47fa9685e09fc3ab0cf9da805842c6ba9ffb9f71e1097bcb1617d34c1e0c7a963670f6ad3b38ab39b762a7a3bb8980b57a8f0ef2183cd65a1a
data/README.lt3 CHANGED
@@ -15,10 +15,10 @@ It has the concept of multiple "views" for a blog
15
15
  .h2 What is Livetext?
16
16
 
17
17
  Livetext is a markup format that is a throwback to the old, old days of text
18
- formatters such as nroff. It's very flexible, and it is extensible _[in Ruby].
18
+ formatters such as ``nroff. It's very flexible, and it is extensible _[in Ruby].
19
19
 
20
- It isn't yet full-featured, but it is usable. Runeblog uses Livetext, along
21
- with some custom definitions, to try to ease the formatting of a blog entry.
20
+ It is far from mature or full-featured, but it is usable. Runeblog uses Livetext,
21
+ along with some custom definitions, to try to ease the formatting of a blog entry.
22
22
 
23
23
  .h2 What are "views"?
24
24
 
data/lib/default.rb CHANGED
@@ -7,8 +7,6 @@ NewBlogHeader = <<-TEXT # Can't do this yet!!
7
7
 
8
8
  .title Fake Blog, Fake Title, Fake Author
9
9
 
10
- .asset fakeimage.jpg
11
-
12
10
  <table>
13
11
  <tr>
14
12
  <td>
data/lib/helpers-repl.rb CHANGED
@@ -18,7 +18,7 @@ module RuneBlog::REPL
18
18
 
19
19
  "new view $name" => :cmd_new_view,
20
20
 
21
- "customize" => :cmd_customize,
21
+ # "customize" => :cmd_customize,
22
22
  "tags" => :cmd_tags,
23
23
  "import" => :cmd_import,
24
24
 
data/lib/liveblog.rb CHANGED
@@ -2,7 +2,7 @@ require 'ostruct'
2
2
  require 'pp'
3
3
  require 'date'
4
4
 
5
- require 'runeblog' # Now depends explicitly
5
+ # require 'runeblog' # Now depends explicitly
6
6
 
7
7
  def quote
8
8
  _passthru "<blockquote>"
@@ -35,6 +35,19 @@ end
35
35
  def categories # does nothing right now
36
36
  end
37
37
 
38
+
39
+ def h1; _puts "<h1>#{@_data}</h1>"; end
40
+ def h2; _puts "<h2>#{@_data}</h2>"; end
41
+
42
+ def h3
43
+ _puts "<h3>#{@_data}</h3>"
44
+ end
45
+
46
+ def h4; _puts "<h4>#{@_data}</h4>"; end
47
+ def h5; _puts "<h5>#{@_data}</h5>"; end
48
+ def h6; _puts "<h6>#{@_data}</h6>"; end
49
+
50
+
38
51
  ### inset
39
52
 
40
53
  def inset
@@ -79,6 +92,7 @@ end
79
92
 
80
93
  def init_liveblog # FIXME - a lot of this logic sucks
81
94
  @blog, num = Livetext.parameters
95
+ puts "passed in: #{@blog.view}"
82
96
  @meta = OpenStruct.new
83
97
  @meta.num = num
84
98
  @root = @blog.root rescue nil
@@ -92,6 +106,7 @@ def _errout(*args)
92
106
  end
93
107
 
94
108
  def _passthru(line, context = nil)
109
+ $which = 2
95
110
  return if line.nil?
96
111
  line = _formatting(line, context)
97
112
  @body << line + "\n"
data/lib/repl.rb CHANGED
@@ -39,13 +39,14 @@ module RuneBlog::REPL
39
39
  check_empty(arg)
40
40
  dir = @blog.view.dir
41
41
  items = ["publish",
42
- "custom/blog_header.html",
43
- "custom/blog_trailer.html",
44
- "custom/post_template.html"]
42
+ "templates/blog_header.html",
43
+ "templates/blog_trailer.html",
44
+ "templates/post_template.html"]
45
45
  num, fname = STDSCR.menu(title: "Edit file:", items: items)
46
46
  edit_file("#{dir}/#{fname}")
47
47
  end
48
48
 
49
+ # Currently not used
49
50
  def cmd_customize(arg, testing = false)
50
51
  # add extra views? add tags?
51
52
  puts "\n This is still buggy.\n "
data/lib/runeblog.rb CHANGED
@@ -124,6 +124,7 @@ class RuneBlog
124
124
  def create_view(arg)
125
125
  debug "=== create_view #{arg.inspect}"
126
126
  raise ArgumentError unless arg.is_a?(String) && ! arg.empty?
127
+
127
128
  names = self.views.map(&:to_s)
128
129
  raise ViewAlreadyExists(arg) if names.include?(arg)
129
130
 
@@ -133,19 +134,21 @@ class RuneBlog
133
134
  up = Dir.pwd
134
135
  Dir.chdir(dir)
135
136
  x = RuneBlog::Default
136
- create_dir('custom')
137
+ create_dir('templates')
137
138
  create_dir('assets')
138
139
  pub = "user: xxx\nserver: xxx\ndocroot: xxx\npath: xxx\nproto: xxx\n"
139
140
  dump(pub, "publish")
140
141
  dump("", "tagpool")
141
- # live = Livetext.new
142
- # Livetext.parameters = [RuneBlog.blog, 0]
143
- # meta = live.process_text(x::BlogHeader)
144
- dump(x::BlogHeader, "custom/blog_header.html")
145
- dump(x::BlogTrailer, "custom/blog_trailer.html")
142
+ view = RuneBlog::View.new(arg)
143
+ self.view = view
144
+ Livetext.parameters = [RuneBlog.blog, 0]
145
+ live = Livetext.new
146
+ meta = live.transform(x::NewBlogHeader)
147
+ # dump(x::BlogHeader, "templates/blog_header.html")
148
+ # dump(x::BlogTrailer, "templates/blog_trailer.html")
146
149
  dump("Initial creation", "last_published")
147
150
  Dir.chdir(up)
148
- @views << RuneBlog::View.new(arg)
151
+ @views << view
149
152
  end
150
153
 
151
154
  def delete_view(name, force = false)
@@ -222,7 +225,7 @@ class RuneBlog
222
225
  raise FileNotFound(path) unless File.exist?(path)
223
226
  num = file.to_i # e.g. 0098-this-is-a-title
224
227
  Livetext.parameters = [self, num]
225
- live = Livetext.new(STDOUT) # (nil)
228
+ live = Livetext.new # (STDOUT) # (nil)
226
229
  text = File.read(path)
227
230
  live.process_text(text)
228
231
  rescue => err
@@ -242,8 +245,8 @@ class RuneBlog
242
245
  # Add view header/trailer
243
246
  head = tail = nil
244
247
  Dir.chdir(vdir) do
245
- head = File.read("custom/blog_header.html")
246
- tail = File.read("custom/blog_trailer.html")
248
+ head = File.read("templates/blog_header.html")
249
+ tail = File.read("templates/blog_trailer.html")
247
250
  end
248
251
  @bloghead = interpolate(head)
249
252
  @blogtail = interpolate(tail)
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.1.56"
3
+ VERSION = "0.1.57"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  end
data/test/make_blog.rb CHANGED
@@ -38,6 +38,7 @@ x.create_view("alpha_view")
38
38
  if File.exist?("publish")
39
39
  system("cp publish .blog/data_test/views/alpha_view/publish")
40
40
  end
41
+ puts "inside make_blog: pwd = #{Dir.pwd}"
41
42
  system("cp test/fakeimage.jpg .blog/data_test/assets/")
42
43
  system("cp test/fakeimage.jpg .blog/data_test/views/alpha_view/assets/")
43
44
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runeblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.56
4
+ version: 0.1.57
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-31 00:00:00.000000000 Z
11
+ date: 2019-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext