From 628fcf941c322dd0ed24a643c58394392484740e Mon Sep 17 00:00:00 2001 From: mms Date: Sun, 5 Jan 2025 22:34:37 +0100 Subject: bookmark dump --- new/splash/bin/build.rb | 11 +++++++++++ new/splash/bin/server.rb | 10 +++++----- new/splash/lib/splash.rb | 11 ++++++----- new/splash/lib/splash/builder.rb | 8 ++++++++ new/splash/lib/splash/server.rb | 3 ++- new/splash/pages/.dir-locals.el | 1 + new/splash/pages/index.html.erb | 9 +++++++++ new/splash/pages/index.rb | 29 ----------------------------- new/splash/theme/index.erb | 7 ------- 9 files changed, 42 insertions(+), 47 deletions(-) create mode 100755 new/splash/bin/build.rb create mode 100644 new/splash/lib/splash/builder.rb create mode 100644 new/splash/pages/.dir-locals.el create mode 100644 new/splash/pages/index.html.erb delete mode 100644 new/splash/pages/index.rb delete mode 100644 new/splash/theme/index.erb (limited to 'new') diff --git a/new/splash/bin/build.rb b/new/splash/bin/build.rb new file mode 100755 index 0000000..404431f --- /dev/null +++ b/new/splash/bin/build.rb @@ -0,0 +1,11 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require_relative '../lib/splash' +require_relative '../../bin/builder' + +builder_class = Crys::Splash::Builder +output_dir = "#{File.dirname(File.dirname(__FILE__))}/output" +file_path = "#{File.dirname(File.dirname(__FILE__))}/pages/#{@options[:filepath]}" + +Crys::BuilderRunner.new(file_path: file_path, output_dir: output_dir, builder_class: builder_class).run diff --git a/new/splash/bin/server.rb b/new/splash/bin/server.rb index 9da053a..15b3432 100755 --- a/new/splash/bin/server.rb +++ b/new/splash/bin/server.rb @@ -1,10 +1,10 @@ #!/usr/bin/env ruby +# frozen_string_literal: true -require_relative "../lib/splash.rb" -require_relative "../../bin/server.rb" +require_relative '../lib/splash' +require_relative '../../bin/server' server_class = Crys::Splash::Server -root = File.dirname(File.dirname(__FILE__)) + "/output" -Crys::ServerRunner.new(root: root, server_class: server_class, section: "Splash Page").serve - +root = "#{File.dirname(File.dirname(__FILE__))}/output" +Crys::ServerRunner.new(root: root, server_class: server_class, section: 'Splash Page').serve diff --git a/new/splash/lib/splash.rb b/new/splash/lib/splash.rb index ce51e17..68674f9 100644 --- a/new/splash/lib/splash.rb +++ b/new/splash/lib/splash.rb @@ -1,10 +1,11 @@ -require_relative "../../lib/crys.rb" -require_relative "splash/server" +# frozen_string_literal: true + +require_relative '../../lib/crys' + +require_relative 'splash/server' +require_relative 'splash/builder' module Crys module Splash end end - - - diff --git a/new/splash/lib/splash/builder.rb b/new/splash/lib/splash/builder.rb new file mode 100644 index 0000000..5a737e9 --- /dev/null +++ b/new/splash/lib/splash/builder.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module Crys + module Splash + class Builder < Crys::Builder + end + end +end diff --git a/new/splash/lib/splash/server.rb b/new/splash/lib/splash/server.rb index 5c2a473..688d701 100644 --- a/new/splash/lib/splash/server.rb +++ b/new/splash/lib/splash/server.rb @@ -1,7 +1,8 @@ +# frozen_string_literal: true + module Crys module Splash class Server < Crys::Server - end end end diff --git a/new/splash/pages/.dir-locals.el b/new/splash/pages/.dir-locals.el new file mode 100644 index 0000000..4e2be03 --- /dev/null +++ b/new/splash/pages/.dir-locals.el @@ -0,0 +1 @@ +((nil . ((add-hook 'after-save-hook ('message :a)))) diff --git a/new/splash/pages/index.html.erb b/new/splash/pages/index.html.erb new file mode 100644 index 0000000..d033c90 --- /dev/null +++ b/new/splash/pages/index.html.erb @@ -0,0 +1,9 @@ + + + It works! + + +

Test

+ Last update: <%= Time.now %> + + diff --git a/new/splash/pages/index.rb b/new/splash/pages/index.rb deleted file mode 100644 index b9772d8..0000000 --- a/new/splash/pages/index.rb +++ /dev/null @@ -1,29 +0,0 @@ -require_relative "../lib/theme.rb" - -module Crys - module Splash - class IndexPage < Theme - BODY = ERB.new <<-EOF -

<%= title %>

- <%= name %> - EOF - - DATA = { - title: "A page", - name: "A name" - } - - PAGE = "index.erb" - - # filename - # other embbeds - # from .erb file - # from .org file - - - - end - end -end - -p Crys::Splash::IndexPage.new.render diff --git a/new/splash/theme/index.erb b/new/splash/theme/index.erb deleted file mode 100644 index ed1dda8..0000000 --- a/new/splash/theme/index.erb +++ /dev/null @@ -1,7 +0,0 @@ - - <%= title %> -<head> -<%= body %> - -</head> -</html> -- cgit v1.2.3