cosensee 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +56 -0
- data/.rubocop_todo.yml +7 -0
- data/README.md +40 -0
- data/Rakefile +10 -0
- data/lib/cosensee/blank_bracket.rb +8 -0
- data/lib/cosensee/bracket_parser.rb +82 -0
- data/lib/cosensee/bracket_serializer.rb +26 -0
- data/lib/cosensee/code.rb +18 -0
- data/lib/cosensee/codeblock.rb +18 -0
- data/lib/cosensee/command_line.rb +18 -0
- data/lib/cosensee/decorate_bracket.rb +16 -0
- data/lib/cosensee/double_bracket.rb +20 -0
- data/lib/cosensee/empty_bracket.rb +8 -0
- data/lib/cosensee/error.rb +5 -0
- data/lib/cosensee/external_link_bracket.rb +8 -0
- data/lib/cosensee/formula_bracket.rb +8 -0
- data/lib/cosensee/hash_tag.rb +19 -0
- data/lib/cosensee/html_builder.rb +59 -0
- data/lib/cosensee/html_encodable.rb +12 -0
- data/lib/cosensee/icon_bracket.rb +8 -0
- data/lib/cosensee/image_bracket.rb +8 -0
- data/lib/cosensee/indent.rb +25 -0
- data/lib/cosensee/internal_link_bracket.rb +8 -0
- data/lib/cosensee/line.rb +47 -0
- data/lib/cosensee/line_parser.rb +253 -0
- data/lib/cosensee/link.rb +18 -0
- data/lib/cosensee/link_encodable.rb +26 -0
- data/lib/cosensee/page.rb +68 -0
- data/lib/cosensee/page_store.rb +63 -0
- data/lib/cosensee/parsed_bracket.rb +42 -0
- data/lib/cosensee/parsed_line.rb +76 -0
- data/lib/cosensee/project.rb +46 -0
- data/lib/cosensee/quote.rb +22 -0
- data/lib/cosensee/tailwind_renderer/blank_bracket.rb +11 -0
- data/lib/cosensee/tailwind_renderer/code.rb +14 -0
- data/lib/cosensee/tailwind_renderer/codeblock_builder.rb +37 -0
- data/lib/cosensee/tailwind_renderer/command_line.rb +17 -0
- data/lib/cosensee/tailwind_renderer/decorate_bracket.rb +25 -0
- data/lib/cosensee/tailwind_renderer/double_bracket.rb +13 -0
- data/lib/cosensee/tailwind_renderer/empty_bracket.rb +11 -0
- data/lib/cosensee/tailwind_renderer/external_link_bracket.rb +15 -0
- data/lib/cosensee/tailwind_renderer/formula_bracket.rb +13 -0
- data/lib/cosensee/tailwind_renderer/hash_tag.rb +17 -0
- data/lib/cosensee/tailwind_renderer/icon_bracket.rb +14 -0
- data/lib/cosensee/tailwind_renderer/image_bracket.rb +15 -0
- data/lib/cosensee/tailwind_renderer/internal_link_bracket.rb +15 -0
- data/lib/cosensee/tailwind_renderer/link.rb +14 -0
- data/lib/cosensee/tailwind_renderer/page.rb +31 -0
- data/lib/cosensee/tailwind_renderer/parsed_line.rb +30 -0
- data/lib/cosensee/tailwind_renderer/quote.rb +14 -0
- data/lib/cosensee/tailwind_renderer/text_bracket.rb +12 -0
- data/lib/cosensee/tailwind_renderer.rb +36 -0
- data/lib/cosensee/text_bracket.rb +10 -0
- data/lib/cosensee/user.rb +37 -0
- data/lib/cosensee/version.rb +5 -0
- data/lib/cosensee.rb +54 -0
- data/sig/cosensee.rbs +4 -0
- data/templates/index.html.erb +39 -0
- data/templates/page.html.erb +59 -0
- metadata +130 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cosensee
|
4
|
+
class TailwindRenderer
|
5
|
+
DecorateBracket = Data.define(:content) do
|
6
|
+
def render
|
7
|
+
classes = []
|
8
|
+
classes << font_sizes[content.font_size] if content.font_size
|
9
|
+
classes << 'font-semibold' if content.font_size && content.font_size > 0
|
10
|
+
classes << 'underline' if content.underlined
|
11
|
+
classes << 'italic' if content.slanted
|
12
|
+
classes << 'line-through' if content.deleted
|
13
|
+
class_attr = classes.join(' ')
|
14
|
+
|
15
|
+
%(<span class="#{class_attr}">#{content.text}</span>)
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def font_sizes
|
21
|
+
%w[text-base text-lg text-xl text-2xl text-3xl text-4xl text-5xl text-6xl text-7xl text-8xl text-9xl].freeze
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cosensee
|
4
|
+
class TailwindRenderer
|
5
|
+
DoubleBracket = Data.define(:content) do
|
6
|
+
def render
|
7
|
+
rendered_content = Cosensee::TailwindRenderer.new(content: content.content).render
|
8
|
+
|
9
|
+
%(<span class="font-bold">#{rendered_content}</span>)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cosensee
|
4
|
+
class TailwindRenderer
|
5
|
+
ExternalLinkBracket = Data.define(:content) do
|
6
|
+
include HtmlEncodable
|
7
|
+
|
8
|
+
def render
|
9
|
+
link = content.link
|
10
|
+
anchor = content.anchor || content.link
|
11
|
+
%(<span><a href="#{link}" class="text-blue-500 hover:text-blue-700">#{escape_html(anchor)}</a></span>)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cosensee
|
4
|
+
class TailwindRenderer
|
5
|
+
FormulaBracket = Data.define(:content) do
|
6
|
+
include HtmlEncodable
|
7
|
+
|
8
|
+
def render
|
9
|
+
%(<span class="math-container">$#{escape_html(content.formula)}$</span>)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'uri'
|
4
|
+
|
5
|
+
module Cosensee
|
6
|
+
class TailwindRenderer
|
7
|
+
HashTag = Data.define(:content) do
|
8
|
+
include LinkEncodable
|
9
|
+
include HtmlEncodable
|
10
|
+
|
11
|
+
def render
|
12
|
+
hash_tag = content.content
|
13
|
+
%(<span><a href="#{make_link(hash_tag)}" class="text-blue-500 hover:text-blue-700">##{escape_html(hash_tag)}</a></span>)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cosensee
|
4
|
+
class TailwindRenderer
|
5
|
+
IconBracket = Data.define(:content) do
|
6
|
+
include HtmlEncodable
|
7
|
+
|
8
|
+
def render
|
9
|
+
# XXX use icon image finder with project object
|
10
|
+
%(<span>[icon:#{escape_html(content.icon_name)}]</span>)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cosensee
|
4
|
+
class TailwindRenderer
|
5
|
+
ImageBracket = Data.define(:content) do
|
6
|
+
def render
|
7
|
+
if content.link
|
8
|
+
%(<span><a href="#{content.link}"><img src="#{content.src}" class="max-w-max max-h-80"></a></span>)
|
9
|
+
else
|
10
|
+
%(<span><img src="#{content.src}" class="max-w-max max-h-80"></span>)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'uri'
|
4
|
+
|
5
|
+
module Cosensee
|
6
|
+
class TailwindRenderer
|
7
|
+
InternalLinkBracket = Data.define(:content) do
|
8
|
+
include HtmlEncodable
|
9
|
+
|
10
|
+
def render
|
11
|
+
%(<span><a href="#{content.link}" class="text-blue-500 hover:text-blue-700">#{escape_html(content.anchor)}</a></span>)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cosensee
|
4
|
+
class TailwindRenderer
|
5
|
+
Link = Data.define(:content) do
|
6
|
+
include HtmlEncodable
|
7
|
+
|
8
|
+
def render
|
9
|
+
link = content.content
|
10
|
+
%(<span><a href="#{escape_html(link)}" class="text-blue-500 hover:text-blue-700">#{escape_html(link)}</a></span>)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cosensee
|
4
|
+
class TailwindRenderer
|
5
|
+
Page = Data.define(:content) do
|
6
|
+
def render
|
7
|
+
current_block_builder = nil
|
8
|
+
|
9
|
+
page = content
|
10
|
+
rendered_lines = []
|
11
|
+
|
12
|
+
page.parsed_lines.each do |parsed_line|
|
13
|
+
if current_block_builder
|
14
|
+
if current_block_builder.continued_line?(parsed_line)
|
15
|
+
current_block_builder.append(parsed_line)
|
16
|
+
else
|
17
|
+
rendered_lines << current_block_builder.render
|
18
|
+
rendered_lines << ParsedLine.new(parsed_line).render
|
19
|
+
end
|
20
|
+
elsif parsed_line.codeblock?
|
21
|
+
current_block_builder = CodeblockBuilder.new(parsed_line)
|
22
|
+
else
|
23
|
+
rendered_lines << ParsedLine.new(parsed_line).render
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
rendered_lines.join
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cosensee
|
4
|
+
class TailwindRenderer
|
5
|
+
ParsedLine = Data.define(:content) do
|
6
|
+
include HtmlEncodable
|
7
|
+
|
8
|
+
def render
|
9
|
+
result = if content.line_content?
|
10
|
+
TailwindRenderer.new(content: content.line_content).render
|
11
|
+
else
|
12
|
+
content.content.map do |c|
|
13
|
+
if c.is_a?(String)
|
14
|
+
escape_html(c)
|
15
|
+
else
|
16
|
+
TailwindRenderer.new(content: c).render
|
17
|
+
end
|
18
|
+
end.join
|
19
|
+
end
|
20
|
+
level = content.indent_level * 2
|
21
|
+
result = ' ' if result == ''
|
22
|
+
if level > 0
|
23
|
+
%(<div class="relative pl-[#{level}rem]"><span class="absolute left-[#{level - 1}rem] top-1/2 -translate-y-1/2 w-1.5 h-1.5 rounded-full bg-gray-800"></span>#{result}</div>)
|
24
|
+
else
|
25
|
+
%(<div class="relative pl-[#{level}rem]">#{result}</div>)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
module Cosensee
|
6
|
+
class TailwindRenderer
|
7
|
+
Quote = Data.define(:content) do
|
8
|
+
def render
|
9
|
+
code = Cosensee::TailwindRenderer.new(content: content.content).render
|
10
|
+
%(<blockquote class="border-l-4 border-gray-300 bg-gray-100 px-4 text-gray-800">#{code}</blockquote>)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cosensee
|
4
|
+
# convert into html
|
5
|
+
class TailwindRenderer
|
6
|
+
include HtmlEncodable
|
7
|
+
|
8
|
+
# content is Cosensee objects or an array of them
|
9
|
+
def initialize(content:)
|
10
|
+
@content = content
|
11
|
+
end
|
12
|
+
|
13
|
+
attr_reader :content
|
14
|
+
|
15
|
+
def render
|
16
|
+
if content.is_a?(Array)
|
17
|
+
content.map do |c|
|
18
|
+
if c.is_a?(String)
|
19
|
+
escape_html(c)
|
20
|
+
else
|
21
|
+
renderer_class(c).new(content: c).render
|
22
|
+
end
|
23
|
+
end.join
|
24
|
+
else
|
25
|
+
renderer_class(content).new(content:).render
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# ex. Cosensee::TailwindRenderer::Code for Cosensee::Code
|
30
|
+
def renderer_class(content)
|
31
|
+
name = content.class.name.split('::').last
|
32
|
+
|
33
|
+
Cosensee::TailwindRenderer.const_get(name)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
module Cosensee
|
6
|
+
# for User
|
7
|
+
User = Data.define(:id, :name, :display_name, :email) do
|
8
|
+
def self.from_array(users_args)
|
9
|
+
users_args.map { |args| new(**args) }
|
10
|
+
end
|
11
|
+
|
12
|
+
# allow both `:display_key` and `:displayKey`
|
13
|
+
def initialize(id:, name:, email:, **kwargs)
|
14
|
+
display_name = if kwargs.keys == [:display_name]
|
15
|
+
kwargs[:display_name]
|
16
|
+
elsif kwargs.keys == [:displayName]
|
17
|
+
kwargs[:displayName]
|
18
|
+
else
|
19
|
+
raise Cosensee::Error, 'Cosensee::User.new need an argument :display_name or :displayName'
|
20
|
+
end
|
21
|
+
super(
|
22
|
+
id:,
|
23
|
+
display_name:,
|
24
|
+
name:,
|
25
|
+
email:
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
def to_obj
|
30
|
+
{ id:, name:, displayName: display_name, email: }
|
31
|
+
end
|
32
|
+
|
33
|
+
def to_json(*)
|
34
|
+
to_obj.to_json(*)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/cosensee.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'cosensee/version'
|
4
|
+
require_relative 'cosensee/error'
|
5
|
+
require_relative 'cosensee/bracket_serializer'
|
6
|
+
require_relative 'cosensee/html_encodable'
|
7
|
+
require_relative 'cosensee/link_encodable'
|
8
|
+
|
9
|
+
require_relative 'cosensee/blank_bracket'
|
10
|
+
require_relative 'cosensee/bracket_parser'
|
11
|
+
require_relative 'cosensee/code'
|
12
|
+
require_relative 'cosensee/codeblock'
|
13
|
+
require_relative 'cosensee/command_line'
|
14
|
+
require_relative 'cosensee/decorate_bracket'
|
15
|
+
require_relative 'cosensee/double_bracket'
|
16
|
+
require_relative 'cosensee/empty_bracket'
|
17
|
+
require_relative 'cosensee/external_link_bracket'
|
18
|
+
require_relative 'cosensee/formula_bracket'
|
19
|
+
require_relative 'cosensee/hash_tag'
|
20
|
+
require_relative 'cosensee/html_builder'
|
21
|
+
require_relative 'cosensee/icon_bracket'
|
22
|
+
require_relative 'cosensee/image_bracket'
|
23
|
+
require_relative 'cosensee/indent'
|
24
|
+
require_relative 'cosensee/internal_link_bracket'
|
25
|
+
require_relative 'cosensee/line_parser'
|
26
|
+
require_relative 'cosensee/line'
|
27
|
+
require_relative 'cosensee/link'
|
28
|
+
require_relative 'cosensee/page'
|
29
|
+
require_relative 'cosensee/page_store'
|
30
|
+
require_relative 'cosensee/parsed_bracket'
|
31
|
+
require_relative 'cosensee/parsed_line'
|
32
|
+
require_relative 'cosensee/project'
|
33
|
+
require_relative 'cosensee/quote'
|
34
|
+
require_relative 'cosensee/tailwind_renderer'
|
35
|
+
require_relative 'cosensee/tailwind_renderer/blank_bracket'
|
36
|
+
require_relative 'cosensee/tailwind_renderer/code'
|
37
|
+
require_relative 'cosensee/tailwind_renderer/codeblock_builder'
|
38
|
+
require_relative 'cosensee/tailwind_renderer/command_line'
|
39
|
+
require_relative 'cosensee/tailwind_renderer/decorate_bracket'
|
40
|
+
require_relative 'cosensee/tailwind_renderer/double_bracket'
|
41
|
+
require_relative 'cosensee/tailwind_renderer/empty_bracket'
|
42
|
+
require_relative 'cosensee/tailwind_renderer/external_link_bracket'
|
43
|
+
require_relative 'cosensee/tailwind_renderer/formula_bracket'
|
44
|
+
require_relative 'cosensee/tailwind_renderer/hash_tag'
|
45
|
+
require_relative 'cosensee/tailwind_renderer/icon_bracket'
|
46
|
+
require_relative 'cosensee/tailwind_renderer/image_bracket'
|
47
|
+
require_relative 'cosensee/tailwind_renderer/internal_link_bracket'
|
48
|
+
require_relative 'cosensee/tailwind_renderer/link'
|
49
|
+
require_relative 'cosensee/tailwind_renderer/page'
|
50
|
+
require_relative 'cosensee/tailwind_renderer/parsed_line'
|
51
|
+
require_relative 'cosensee/tailwind_renderer/quote'
|
52
|
+
require_relative 'cosensee/tailwind_renderer/text_bracket'
|
53
|
+
require_relative 'cosensee/text_bracket'
|
54
|
+
require_relative 'cosensee/user'
|
data/sig/cosensee.rbs
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8"/>
|
5
|
+
<meta name="referrer" content="same-origin"/>
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"/>
|
7
|
+
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/>
|
8
|
+
<title><%= project.display_name %></title>
|
9
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
10
|
+
<style>
|
11
|
+
p.pagetitle {
|
12
|
+
display: -webkit-box;
|
13
|
+
-webkit-line-clamp: 3;
|
14
|
+
-webkit-box-orient: vertical;
|
15
|
+
}
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
<body class="bg-gray-100 p-4">
|
19
|
+
<div class="max-w-screen-xl mx-auto">
|
20
|
+
<h1 class="text-xl mb-4"><%= project.display_name %> ページ一覧</h1>
|
21
|
+
<div class="grid grid-cols-8 gap-4">
|
22
|
+
<% project.pages.each do |page|%>
|
23
|
+
<div class="bg-white shadow-md rounded-md aspect-square flex items-start justify-center p-2 overflow-hidden">
|
24
|
+
<div class="break-words text-xs w-full">
|
25
|
+
<a href="<%= page.link_path %>">
|
26
|
+
<p class="pagetitle font-bold overflow-hidden"><%= page.title %></p>
|
27
|
+
</a>
|
28
|
+
<a href="<%= page.link_path %>">
|
29
|
+
<% page.body_lines.each do |line| %>
|
30
|
+
<p class="inline text-xs"><%= line.to_s %></p>
|
31
|
+
<% end %>
|
32
|
+
</a>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
<% end %>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
</body>
|
39
|
+
</html>
|
@@ -0,0 +1,59 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8"/>
|
5
|
+
<meta name="referrer" content="same-origin"/>
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"/>
|
7
|
+
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/>
|
8
|
+
<meta name="format-detection" content="email=no,telephone=no,address=no,date=no"/>
|
9
|
+
<title><%= title %></title>
|
10
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
11
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.18/dist/katex.min.css" integrity="sha384-veTAhWILPOotXm+kbR5uY7dRamYLJf58I7P+hJhjeuc7hsMAkJHTsPahAl0hBST0" crossorigin="anonymous">
|
12
|
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.18/dist/katex.min.js" integrity="sha384-v6mkHYHfY/4BWq54f7lQAdtIsoZZIByznQ3ZqN38OL4KCsrxo31SLlPiak7cj/Mg" crossorigin="anonymous"></script>
|
13
|
+
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.18/dist/contrib/auto-render.min.js" integrity="sha384-hCXGrW6PitJEwbkoStFjeJxv+fSOOQKOPbJxSfM6G5sWZjAyWhXiTIIAmQqnlLlh" crossorigin="anonymous"></script>
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,600,600i,700,700i|Roboto:400,400i,500,500i,700,700i"/>
|
16
|
+
<style>
|
17
|
+
p.pagetitle {
|
18
|
+
display: -webkit-box;
|
19
|
+
-webkit-line-clamp: 3;
|
20
|
+
-webkit-box-orient: vertical;
|
21
|
+
}
|
22
|
+
</style>
|
23
|
+
</head>
|
24
|
+
<body class="bg-slate-100">
|
25
|
+
<div class="max-w-screen-lg mx-auto p-4 m-4">
|
26
|
+
<nav>
|
27
|
+
<a href="/"><%= project.name %></a>
|
28
|
+
</nav>
|
29
|
+
<div class="max-w-screen bg-white">
|
30
|
+
<h1 class="text-3xl py-4 my-4"><%= title %></h1>
|
31
|
+
<div>
|
32
|
+
<%= page&.to_html %>
|
33
|
+
</div>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<div class="grid grid-cols-6 gap-2 py-8">
|
37
|
+
<div class="bg-blue-400 shadow-md rounded-md aspect-square flex items-center justify-center p-2 overflow-hidden">
|
38
|
+
<div class="text-lg text-center text-gray-100">
|
39
|
+
Links<br>🔗
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
<% project.page_store.find_link_pages_by_title(title).each do |page|%>
|
43
|
+
<div class="bg-white shadow-md rounded-md aspect-square flex items-start justify-center p-2 overflow-hidden">
|
44
|
+
<div class="break-words text-xs w-full">
|
45
|
+
<a href="<%= page.link_path %>">
|
46
|
+
<p class="pagetitle font-bold overflow-hidden"><%= page.title %></p>
|
47
|
+
</a>
|
48
|
+
<a href="<%= page.link_path %>">
|
49
|
+
<% page.body_lines.each do |line| %>
|
50
|
+
<p class="inline text-xs"><%= line.to_s %></p>
|
51
|
+
<% end %>
|
52
|
+
</a>
|
53
|
+
</div>
|
54
|
+
</div>
|
55
|
+
<% end %>
|
56
|
+
</div>
|
57
|
+
</div>
|
58
|
+
</body>
|
59
|
+
</html>
|
metadata
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cosensee
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.6.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- takahashim
|
8
|
+
bindir: exe
|
9
|
+
cert_chain: []
|
10
|
+
date: 2025-01-05 00:00:00.000000000 Z
|
11
|
+
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: erubi
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '0'
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - ">="
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '0'
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: tilt
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
description: Cosense (Scrapbox) parser and renderer
|
41
|
+
email:
|
42
|
+
- takahashimm@gmail.com
|
43
|
+
executables: []
|
44
|
+
extensions: []
|
45
|
+
extra_rdoc_files: []
|
46
|
+
files:
|
47
|
+
- ".rspec"
|
48
|
+
- ".rubocop.yml"
|
49
|
+
- ".rubocop_todo.yml"
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- lib/cosensee.rb
|
53
|
+
- lib/cosensee/blank_bracket.rb
|
54
|
+
- lib/cosensee/bracket_parser.rb
|
55
|
+
- lib/cosensee/bracket_serializer.rb
|
56
|
+
- lib/cosensee/code.rb
|
57
|
+
- lib/cosensee/codeblock.rb
|
58
|
+
- lib/cosensee/command_line.rb
|
59
|
+
- lib/cosensee/decorate_bracket.rb
|
60
|
+
- lib/cosensee/double_bracket.rb
|
61
|
+
- lib/cosensee/empty_bracket.rb
|
62
|
+
- lib/cosensee/error.rb
|
63
|
+
- lib/cosensee/external_link_bracket.rb
|
64
|
+
- lib/cosensee/formula_bracket.rb
|
65
|
+
- lib/cosensee/hash_tag.rb
|
66
|
+
- lib/cosensee/html_builder.rb
|
67
|
+
- lib/cosensee/html_encodable.rb
|
68
|
+
- lib/cosensee/icon_bracket.rb
|
69
|
+
- lib/cosensee/image_bracket.rb
|
70
|
+
- lib/cosensee/indent.rb
|
71
|
+
- lib/cosensee/internal_link_bracket.rb
|
72
|
+
- lib/cosensee/line.rb
|
73
|
+
- lib/cosensee/line_parser.rb
|
74
|
+
- lib/cosensee/link.rb
|
75
|
+
- lib/cosensee/link_encodable.rb
|
76
|
+
- lib/cosensee/page.rb
|
77
|
+
- lib/cosensee/page_store.rb
|
78
|
+
- lib/cosensee/parsed_bracket.rb
|
79
|
+
- lib/cosensee/parsed_line.rb
|
80
|
+
- lib/cosensee/project.rb
|
81
|
+
- lib/cosensee/quote.rb
|
82
|
+
- lib/cosensee/tailwind_renderer.rb
|
83
|
+
- lib/cosensee/tailwind_renderer/blank_bracket.rb
|
84
|
+
- lib/cosensee/tailwind_renderer/code.rb
|
85
|
+
- lib/cosensee/tailwind_renderer/codeblock_builder.rb
|
86
|
+
- lib/cosensee/tailwind_renderer/command_line.rb
|
87
|
+
- lib/cosensee/tailwind_renderer/decorate_bracket.rb
|
88
|
+
- lib/cosensee/tailwind_renderer/double_bracket.rb
|
89
|
+
- lib/cosensee/tailwind_renderer/empty_bracket.rb
|
90
|
+
- lib/cosensee/tailwind_renderer/external_link_bracket.rb
|
91
|
+
- lib/cosensee/tailwind_renderer/formula_bracket.rb
|
92
|
+
- lib/cosensee/tailwind_renderer/hash_tag.rb
|
93
|
+
- lib/cosensee/tailwind_renderer/icon_bracket.rb
|
94
|
+
- lib/cosensee/tailwind_renderer/image_bracket.rb
|
95
|
+
- lib/cosensee/tailwind_renderer/internal_link_bracket.rb
|
96
|
+
- lib/cosensee/tailwind_renderer/link.rb
|
97
|
+
- lib/cosensee/tailwind_renderer/page.rb
|
98
|
+
- lib/cosensee/tailwind_renderer/parsed_line.rb
|
99
|
+
- lib/cosensee/tailwind_renderer/quote.rb
|
100
|
+
- lib/cosensee/tailwind_renderer/text_bracket.rb
|
101
|
+
- lib/cosensee/text_bracket.rb
|
102
|
+
- lib/cosensee/user.rb
|
103
|
+
- lib/cosensee/version.rb
|
104
|
+
- sig/cosensee.rbs
|
105
|
+
- templates/index.html.erb
|
106
|
+
- templates/page.html.erb
|
107
|
+
homepage: https://github.com/takahashim/cosensee
|
108
|
+
licenses: []
|
109
|
+
metadata:
|
110
|
+
homepage_uri: https://github.com/takahashim/cosensee
|
111
|
+
source_code_uri: https://github.com/takahashim/cosensee
|
112
|
+
rubygems_mfa_required: 'true'
|
113
|
+
rdoc_options: []
|
114
|
+
require_paths:
|
115
|
+
- lib
|
116
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: 3.4.1
|
121
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
requirements: []
|
127
|
+
rubygems_version: 3.6.2
|
128
|
+
specification_version: 4
|
129
|
+
summary: Cosense (Scrapbox) parser and renderer
|
130
|
+
test_files: []
|