utopia-project 0.2.1 → 0.3.0

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: a9254ec1335e8bb5b9b4a72277c0c758127db694186b8290253776c2fc55388d
4
- data.tar.gz: eb0c13feab735f177d597a0bc73b312b6d44bdac2b95bdcbbc618ab60073784a
3
+ metadata.gz: 85fc87afd1995b56900a8c667b2c2a114d64a220f02b49323c9b96144b6c9df9
4
+ data.tar.gz: f1c9502a2078cd29d4aa2b1b39e6194429f488b325975c9814c106fa76bcd528
5
5
  SHA512:
6
- metadata.gz: f0ab5ee3f504207a4b93d6363b39d6159655d716368cceb3bb3603c7f6159cffbf65cba06965faade1ca28d2616d8dcdf50b96cd9fe4856e01374cacbceacd5a
7
- data.tar.gz: 8fd4a5f81cbe6b20fcd0bc4e7a803e891e07cc8931dc4c5310b4b6a7f221d0af070e1262e89bf617f7976b38e6089a4b89a739443935f4dc71468ecbc05d960e
6
+ metadata.gz: a161d8d671a97d3dc138b80ebfd08a3dff467035268a9f06e3a3240ddfc4f4f58671e2e342d318f7d607286903921d9701af9bc09543743d9e13855dcaf37ac6
7
+ data.tar.gz: 32227079b3b4f5af305c61c583135005c2b53bb5b0ae24c782c234038b0fb4cff435062b7aca6e25274096a8b4c2b83bc32b01b0e6bdd82c8ede77d8c9588001
data/README.md CHANGED
@@ -10,6 +10,14 @@ My goal is to provide task-centric documentation, and to continually improve the
10
10
 
11
11
  With that in mind, this web application provides such a model and will evolve over time to suit my requirements and the needs of my users.
12
12
 
13
+ ## Installation
14
+
15
+ Execute the following in your project:
16
+
17
+ ~~~ bash
18
+ bundle add utopia-project
19
+ ~~~
20
+
13
21
  ## Usage
14
22
 
15
23
  Please see the <a href="https://socketry.github.io/utopia-project/">project documentation</a> or run it locally using `bake utopia:project:serve`.
@@ -62,8 +62,8 @@ module Utopia
62
62
  builder.use Rack::ShowExceptions unless UTOPIA.testing?
63
63
  end
64
64
 
65
- public_root = File.expand_path("public", root)
66
- builder.use Utopia::Static, root: public_root
65
+ # We serve static files from the project root:
66
+ builder.use Utopia::Static, root: root
67
67
 
68
68
  builder.use Utopia::Static, root: PUBLIC_ROOT
69
69
 
@@ -22,6 +22,6 @@
22
22
 
23
23
  module Utopia
24
24
  module Project
25
- VERSION = "0.2.1"
25
+ VERSION = "0.3.0"
26
26
  end
27
27
  end
data/pages/controller.rb CHANGED
@@ -7,10 +7,6 @@ on 'index' do
7
7
  if readme_path = @base.path_for('README.md')
8
8
  @document = Kramdown::Document.new(File.read(readme_path), syntax_highlighter: nil)
9
9
 
10
- if title = @document.root.children.shift
11
- @title = title.children.first.value
12
- end
13
-
14
10
  start = @document.root.children.index{|node| node.children.first&.value == "Usage"}
15
11
  finish = start + 1
16
12
 
@@ -9,7 +9,7 @@
9
9
  <?r
10
10
  base = controller[:base]
11
11
 
12
- base.guides do |guides|
12
+ base.guides do |guide|
13
13
  ?><li><a href="#{guide.name}/">#{guide.title}</a></li><?r
14
14
  end
15
15
  ?></ul>
data/pages/index.xnode CHANGED
@@ -1,9 +1,31 @@
1
1
  <content:page>
2
- <content:heading>#{self[:title] || "Project"}</content:heading>
3
-
4
- <?r if document = self[:document] ?>
5
- #{MarkupString.raw document.to_html}
6
- <?r else ?>
7
- <p>This project does not have a README.md file.</p>
8
- <?r end ?>
2
+ <?r
3
+ if document = self[:document]
4
+ children = document.root.children
5
+
6
+ if children.first.type == :header
7
+ header = children.shift
8
+ title = header.children.first
9
+ case title.type
10
+ when :text
11
+ ?><content:heading>#{title.value}</content:heading><?r
12
+ when :img
13
+ self.document.attributes[:title] ||= title.attr["alt"]
14
+ ?><header><img src="#{title.attr["src"]}" /></header><?r
15
+ else
16
+ ?><content:heading>Project</content:heading><?r
17
+ end
18
+ else
19
+ ?><content:heading>Project</content:heading><?r
20
+ end
21
+
22
+ ?>#{MarkupString.raw document.to_html}<?r
23
+ else
24
+ ?>
25
+ <content:heading>Project</content:heading>
26
+
27
+ <p>This project does not have a README.md file.</p>
28
+ <?r
29
+ end
30
+ ?>
9
31
  </content:page>
@@ -75,7 +75,7 @@ body {
75
75
  margin: 0 auto;
76
76
  }
77
77
 
78
- h1, h2, h3, h4, h5, h6, p, ul, dl, ol {
78
+ header, h1, h2, h3, h4, h5, h6, p, ul, dl, ol {
79
79
  margin: 1rem;
80
80
  }
81
81
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utopia-project
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams