runeblog 0.3.24 → 0.3.27

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: fcf07214d034b5091d1b1b0910aee40fe46b8c735c33451fd364eaf57621084f
4
- data.tar.gz: 7b6bab92b5a4a1835de24650c721f62aac77d0a36405877871b5db98198ba976
3
+ metadata.gz: a5338170556c8520e1d03e284f43a1f0b33833dbedf3d6e33991b06086dc655b
4
+ data.tar.gz: a0e4c476dd214cd0ca3460597e6b1a07415b2223101c2eb1a1eed1966380c41f
5
5
  SHA512:
6
- metadata.gz: 14d8f4233ae7a9e8aaa91f9f9c9bb725d821f852ccfcaee2a493074743ed8ac3d830e334dda9b1367bea2951e04b5ddb78987a9f11130adaadb0af26a0ea39d1
7
- data.tar.gz: 3c2904ff1064fb28dd1885f2e58f640287a9c8e3527d379eb573e2a950753bdbe01d0b206e5060d7bbbd0d28880c92c43435721b0693c27658cc08862abc02ad
6
+ metadata.gz: 3cd616193a36e21dc6a9ffe56cf2a16c7abc1e3b50bfe339ba0b2b3446c4fd3d7fdcb63c3f569d2a2044d59c0cdbf05a38bc15aa5a1bb70d6482e276a1eb9b91
7
+ data.tar.gz: aef8ad80e260ecc9805a13ea24b8ca22d9bb9fb8fbf719dd6d7f5fbb9e28032f9313335df8b96ab6993db68a60b16bbab6ccc6cba9261add841aba002dcc1930
data/README.lt3 CHANGED
@@ -10,14 +10,16 @@
10
10
  <li>It's based on Livetext (highly extensible Ruby-based markup)</li>
11
11
  <li>It has the concept of multiple "views" for a blog</li>
12
12
  <li>The multiple views are in effect multiple blogs managed with the same backend.</li>
13
+ <li>Each view may have its own "look and feel" (and even be hosted on differing domains)</li>
13
14
  </ul>
14
15
 
15
16
 
16
17
 
17
18
  .h2 What is Livetext?
18
19
 
19
- Livetext is a markup format that is a throwback to the old, old days of text
20
- formatters such as ``nroff. It's very flexible, and it is extensible _[in Ruby].
20
+ Livetext is a markup format (media generator?) that is a throwback to the old,
21
+ old days of text formatters such as ``nroff. It's very flexible, and it is
22
+ extensible _[in Ruby].
21
23
 
22
24
  It is far from mature or full-featured, but it is usable. Runeblog uses Livetext,
23
25
  along with some custom definitions, to try to ease the formatting of a blog entry.
@@ -45,8 +47,8 @@ Any post can be in more than one view
45
47
  .h2 The <tt>blog</tt> environment
46
48
 
47
49
  There is a command-line tool called `blog which is a REPL (read-eval-print loop).
48
- Note that this tool is a curses-based environment (mainly so it can display menus
49
- and such to the user).
50
+ Note that this tool is a curses-based environment (mainly so that it can display
51
+ menus and such to the user).
50
52
 
51
53
  The help message looks like this:
52
54
 
@@ -57,7 +59,7 @@ The help message looks like this:
57
59
  <b>q, quit</b> Exit the program <b>cv VIEW</b> Change current view
58
60
  <b>v, version</b> Print version information <b>new view</b> Create a new view
59
61
  <b>clear</b> Clear screen <b>list views</b> List all views available
60
- <b>lsv</b> Same as: list views
62
+ <b>lsv</b> Same as: list views
61
63
  <br>
62
64
  <b>Posts:</b> <b>Advanced:</b>
63
65
  ------------------------------------------- -------------------------------------------
@@ -82,6 +84,7 @@ You'll then enter the editor (vim for now) to add configuration info to the `glo
82
84
 
83
85
  <!-- <pre><b>FIXME add menu screenshot here</b></pre> -->
84
86
  <!-- <pre><b>FIXME add vim screenshot here</b></pre> -->
87
+
85
88
  <img src="readme/vim-global.png" width="494" height="696" align="center"></img>
86
89
 
87
90
  The next thing you should do is to create at least one view of your own. Use the `[new view]
data/README.md CHANGED
@@ -44,6 +44,7 @@ But the important points are these:
44
44
  * Each view can have its own look and feel, and it can be linked/published separately from the others.
45
45
  * Each view can be hosted in a different location and/or a different server and domain
46
46
  * Any post can be in more than one view
47
+
47
48
  ## The <tt>blog</tt> environment
48
49
  There is a command-line tool called <font size=+1><tt>blog</tt></font> which is a REPL (read-eval-print loop).
49
50
  Note that this tool is a curses-based environment (mainly so it can display menus
@@ -60,7 +61,7 @@ The help message looks like this:
60
61
  <b>q, quit</b> Exit the program <b>cv VIEW</b> Change current view
61
62
  <b>v, version</b> Print version information <b>new view</b> Create a new view
62
63
  <b>clear</b> Clear screen <b>list views</b> List all views available
63
- <b>lsv</b> Same as: list views
64
+ <b>lsv</b> Same as: list views
64
65
  <br>
65
66
  <b>Posts:</b> <b>Advanced:</b>
66
67
  ------------------------------------------- -------------------------------------------
@@ -73,6 +74,7 @@ The help message looks like this:
73
74
  <b>edit ID</b> Edit a post <b>ssh</b> Login to remote server
74
75
  <b>import ASSETS</b> Import assets (images, etc.) <b>manage WIDGET</b> Manage content/layout of a widget
75
76
  </pre>
77
+
76
78
  ## Getting started
77
79
  But when you first run the REPL, it checks for an existing blog repository under
78
80
  the <font size=+1><tt>.blogs</tt></font> directory. If it doesn't find one, it asks whether you want to create
@@ -2,15 +2,12 @@ app_name = "raido1"
2
2
  app_client = "rAyZILgqGB7uHQ"
3
3
  secret = "0CqLXyFu6ABb1MrErWRsB7Bo-i8"
4
4
 
5
- https://www.reddit.com/api/v1/authorize?client_id=rAyZILgqGB7uHQ&response_type=code&state=abc237def&redirect_uri=http%3A%2F%2Frubyhacker.com&duration=permanent&scope=identity%20edit%20flair%20history%20modconfig%20modflair%20modlog%20modposts%20modwiki%20mysubreddits%20privatemessages%20read%20report%20save%20submit%20subscribe%20vote%20wikiedit%20wikiread
6
-
7
-
5
+ # https://www.reddit.com/api/v1/authorize?client_id=rAyZILgqGB7uHQ&response_type=code&state=abc237def&redirect_uri=http%3A%2F%2Frubyhacker.com&duration=permanent&scope=identity%20edit%20flair%20history%20modconfig%20modflair%20modlog%20modposts%20modwiki%20mysubreddits%20privatemessages%20read%20report%20save%20submit%20subscribe%20vote%20wikiedit%20wikiread
8
6
 
9
7
  require 'net/http'
10
8
  require 'uri'
11
9
  require 'json'
12
10
 
13
-
14
11
  =begin
15
12
  get_token = URI.parse("https://www.reddit.com/api/v1/access_token")
16
13
  data = {
@@ -20,8 +17,6 @@ data = {
20
17
  }
21
18
  =end
22
19
 
23
-
24
-
25
20
  uri = URI.parse("http://reddit.com/api/submit")
26
21
 
27
22
  header = {'Content-Type': 'text/json'}
data/lib/liveblog.rb CHANGED
@@ -197,6 +197,7 @@ def banner
197
197
  count += 1
198
198
  tag, *data = line.split
199
199
  data ||= []
200
+ deps = [@blog.view.globals[:ViewDir]/:data/"global.lt3"]
200
201
  case tag
201
202
  when "width"; wide = data[0]
202
203
  when "height"; high = data[0]
@@ -217,7 +218,7 @@ def banner
217
218
  if ! File.exist?(file)
218
219
  src = file.sub(/html$/, "lt3")
219
220
  if File.exist?(src)
220
- preprocess src: src, dst: file, call: ".nopara", vars: @blog.view.globals
221
+ preprocess src: src, dst: file, deps: deps, call: ".nopara", vars: @blog.view.globals
221
222
  else
222
223
  raise FoundNeither(file, src)
223
224
  end
data/lib/menus.rb CHANGED
@@ -14,33 +14,107 @@ notimp = proc { RubyText.splash("Not implemented yet") }
14
14
  top_about = proc { RubyText.splash("RuneBlog v #{RuneBlog::VERSION}") }
15
15
  top_help = proc { RubyText.splash(RuneBlog::REPL::Help.gsub(/[{}]/, " ")) }
16
16
 
17
+ def edit_blog_generate
18
+ edit_file("#@std/blog/generate.lt3")
19
+ end
20
+
21
+ def edit_blog_head
22
+ edit_file("#@std/blog/head.lt3")
23
+ end
24
+
25
+ def edit_blog_index
26
+ edit_file("#@std/blog/index.lt3")
27
+ end
28
+
29
+ def edit_post_entry
30
+ edit_file("#@std/blog/post_entry.lt3")
31
+ end
32
+
33
+ def edit_blog_banner
34
+ edit_file("#@std/banner/banner.lt3")
35
+ end
36
+
37
+ def edit_blog_navbar
38
+ edit_file("#@std/navbar/navbar.lt3")
39
+ end
40
+
41
+ def edit_post_generate
42
+ edit_file("#@std/post/generate.lt3")
43
+ end
44
+
45
+ def edit_post_head
46
+ edit_file("#@std/post/head.lt3")
47
+ end
48
+
49
+ def edit_post_index
50
+ edit_file("#@std/post/index.lt3")
51
+ end
52
+
53
+ def edit_view_global
54
+ edit_file("#@data/global.lt3")
55
+ end
56
+
57
+ def edit_settings_view
58
+ edit_file("settings/view.txt")
59
+ end
60
+
61
+ def edit_settings_recent
62
+ edit_file("settings/recent.txt")
63
+ end
64
+
65
+ def edit_settings_publish
66
+ edit_file("settings/publish.txt")
67
+ end
68
+
69
+ def edit_settings_features
70
+ edit_file("settings/features.txt")
71
+ end
72
+
73
+ def edit_config_reddit
74
+ edit_file("config/reddit/credentials.txt")
75
+ end
76
+
77
+ def edit_config_facebook
78
+ edit_file("config/facebook/credentials.txt")
79
+ end
80
+
81
+ def edit_config_twitter
82
+ edit_file("config/twitter/credentials.txt")
83
+ end
84
+
85
+ def edit_etc_blog_css
86
+ edit_file("#@std/etc/blog.css.lt3")
87
+ end
88
+
89
+ def edit_etc_externals
90
+ edit_file("#@std/etc/externals.lt3")
91
+ end
17
92
 
18
93
  # dir = @blog.view.dir/"themes/standard/"
19
94
 
20
- std = "themes/standard"
21
- data = "." # CHANGED
95
+ @std = "themes/standard"
96
+ @data = "." # CHANGED
22
97
 
23
98
  Menu.top_config = {
24
- "Variables (general)" => edit("#{data}/global.lt3"),
25
- " View-specific" => edit("settings/view.txt"),
26
- " Recent posts" => edit("settings/recent.txt"),
27
- " Publishing" => edit("settings/publish.txt"),
28
- "Configuration: enable/disable" => edit("settings/features.txt"),
29
- " Reddit" => edit("config/reddit/credentials.txt"),
30
- " Facebook" => edit("config/facebook/credentials.txt"),
31
- " Twitter" => edit("config/twitter/credentials.txt"),
32
- "View: generator" => edit("#{std}/blog/generate.lt3"),
33
- " HEAD info" => edit("#{std}/blog/head.lt3"),
34
- " Layout " => edit("#{std}/blog/index.lt3"),
35
- " Recent-posts entry" => edit("#{std}/blog/post_entry.lt3"),
36
- " Banner: Description" => edit("#{std}/banner/banner.lt3"),
37
- " Navbar" => edit("#{std}/navbar/navbar.lt3"),
38
- # " Text portion" => edit("#{std}/banner/top.lt3"),
39
- "Generator for a post" => edit("#{std}/post/generate.lt3"),
40
- " HEAD info for post" => edit("#{std}/post/head.lt3"),
41
- " Content for post" => edit("#{std}/post/index.lt3"),
42
- "Global CSS" => edit("#{std}/etc/blog.css.lt3"),
43
- "External JS/CSS (Bootstrap, etc.)" => edit("/etc/externals.lt3")
99
+ "View: generator" => proc { edit_blog_generate },
100
+ " HEAD info" => proc { edit_blog_head },
101
+ " Layout " => proc { edit_blog/index },
102
+ " Recent-posts entry" => proc { edit_post_entry },
103
+ " Banner: Description" => proc { edit_banner },
104
+ " Navbar" => proc { edit_navbar },
105
+ "Generator for a post" => proc { edit_post_generate },
106
+ " HEAD info for post" => proc { edit_post_head },
107
+ " Content for post" => proc { edit_post_index },
108
+ "Variables (general)" => proc { edit_view_global },
109
+ " View-specific" => proc { edit_settings_view },
110
+ " Recent posts" => proc { edit_settings_recent },
111
+ " Publishing" => proc { edit_settings_publish },
112
+ "Configuration: enable/disable" => proc { edit_settings_features },
113
+ " Reddit" => proc { edit_config_reddit },
114
+ " Facebook" => proc { edit_config_facebook },
115
+ " Twitter" => proc { edit_config_twitter },
116
+ "Global CSS" => proc { edit_etc_blog_css },
117
+ "External JS/CSS (Bootstrap, etc.)" => proc { edit_etc_externals }
44
118
  }
45
119
 
46
120
  Menu.top_build = {
data/lib/processing.rb CHANGED
@@ -21,10 +21,10 @@ def stale?(src, dst, deps, force = false)
21
21
  end
22
22
 
23
23
  def preprocess(cwd: Dir.pwd, src:,
24
- dst: nil, strip: false,
25
- deps: [], copy: nil, debug: false, force: false,
26
- mix: [], call: [],
27
- vars: {})
24
+ dst: nil, strip: false,
25
+ deps: [], copy: nil, debug: false, force: false,
26
+ mix: [], call: [],
27
+ vars: {})
28
28
  src += LEXT unless src.end_with?(LEXT)
29
29
  if strip
30
30
  dst = File.basename(src).sub(/.lt3$/,"")
@@ -33,8 +33,6 @@ def preprocess(cwd: Dir.pwd, src:,
33
33
  end
34
34
  sp = " "*12
35
35
 
36
-
37
-
38
36
  Dir.chdir(cwd) do
39
37
  if debug
40
38
  STDERR.puts "#{sp} -- preprocess "
data/lib/repl.rb CHANGED
@@ -251,7 +251,7 @@ log! str: "=== ...finished!"
251
251
  end
252
252
  n = viewnames.values.find_index(@blog.view.name)
253
253
  name = @blog.view.name
254
- k, name = STDSCR.menu(title: "Views", items: viewnames, curr: n)
254
+ k, name = STDSCR.menu(title: "Views", items: viewnames, curr: n, wrap: true)
255
255
  return if name.nil?
256
256
  log! str: "cv Setting to #{name.inspect}"
257
257
  @blog.view = name
@@ -418,7 +418,6 @@ log! str: "cv Setting to #{name.inspect}"
418
418
  base = draft.sub(/.lt3$/, "")
419
419
  dir = @blog.root/:posts/base
420
420
  meta = nil
421
- puts "Trying chdir into #{dir}..."
422
421
  Dir.chdir(dir) { meta = @blog.read_metadata }
423
422
  num, title = meta.num, meta.title
424
423
  num = '%4d' % num.to_s
@@ -1,7 +1,7 @@
1
1
  if !defined?(RuneBlog::Path)
2
2
 
3
3
  class RuneBlog
4
- VERSION = "0.3.24"
4
+ VERSION = "0.3.27"
5
5
 
6
6
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
7
7
  Path = File.dirname(path)
data/lib/view.rb CHANGED
@@ -39,8 +39,8 @@ class RuneBlog::View
39
39
 
40
40
  live = Livetext.customize(call: ".nopara")
41
41
  live.xform_file(gfile)
42
- live._setvar("ViewDir", @blog.root/:views/@name)
43
- live._setvar("View", @name)
42
+ live.setvar("ViewDir", @blog.root/:views/@name)
43
+ live.setvar("View", @name)
44
44
  @globals = live.vars
45
45
  # dump_globals_stderr
46
46
  end
data/runeblog.gemspec CHANGED
@@ -21,7 +21,7 @@ spec = Gem::Specification.new do |s|
21
21
  s.authors = ["Hal Fulton"]
22
22
  s.email = 'rubyhacker@gmail.com'
23
23
  s.executables << "blog"
24
- s.add_runtime_dependency 'livetext', '~> 0.9', '>= 0.9.09'
24
+ s.add_runtime_dependency 'livetext', '~> 0.9', '>= 0.9.10'
25
25
  s.add_runtime_dependency 'rubytext', '~> 0.1', '>= 0.1.23'
26
26
  s.add_runtime_dependency 'rouge', '~> 3.25', '>= 3.25.0'
27
27
 
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.3.24
4
+ version: 0.3.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-07 00:00:00.000000000 Z
11
+ date: 2022-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '0.9'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.9.09
22
+ version: 0.9.10
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '0.9'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.9.09
32
+ version: 0.9.10
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rubytext
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -54,42 +54,42 @@ dependencies:
54
54
  name: rouge
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- version: 3.25.0
60
57
  - - "~>"
61
58
  - !ruby/object:Gem::Version
62
59
  version: '3.25'
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 3.25.0
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- version: 3.25.0
70
67
  - - "~>"
71
68
  - !ruby/object:Gem::Version
72
69
  version: '3.25'
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: 3.25.0
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: minitest
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- version: 5.10.0
80
77
  - - "~>"
81
78
  - !ruby/object:Gem::Version
82
79
  version: '5.10'
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 5.10.0
83
83
  type: :development
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: 5.10.0
90
87
  - - "~>"
91
88
  - !ruby/object:Gem::Version
92
89
  version: '5.10'
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: 5.10.0
93
93
  description: A blog system based on Ruby and Livetext
94
94
  email: rubyhacker@gmail.com
95
95
  executables:
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  - !ruby/object:Gem::Version
257
257
  version: '0'
258
258
  requirements: []
259
- rubygems_version: 3.0.8
259
+ rubygems_version: 3.1.2
260
260
  signing_key:
261
261
  specification_version: 4
262
262
  summary: A command-line blogging system