utopia-project 0.13.3 → 0.14.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: 34e228db61065cbfd8205fcec8a3202ad2a4b64bac59e8f062fbc4ebe76d2246
4
- data.tar.gz: a7d2ec47cbdbf9894624c2b8e0d93c2be8e78e3c11d19b7006f4a7e32d51e325
3
+ metadata.gz: 892e9849fb8f032a63212174f8940f22cd8765a633638aff870f3b73cce9f2e5
4
+ data.tar.gz: dc7265bfbd2f9c52d25c5f068da9d28c38e1fcd8fba5344eb81d177f59b92a5f
5
5
  SHA512:
6
- metadata.gz: 9e98670c836c23f840c94a629179a7b6a32a78a3f219f0e1b8d698793b31580c8f01df0e703dcc6f9ff54e5629a5b0531cf4d3628d1f975655b1006a5e6d83a5
7
- data.tar.gz: 75582e4a7298a61092fb960ea9deea912a3bb8be9eeb842ebc7677bce3b1dd62914e82c71c52a534e5180bc20e8417817ad0d1b79acf5143013730451fedb730
6
+ metadata.gz: f2eff941e3bbcf12d0d930371f95cd06a84e720d9abaf5c2d596f50ab0167284685a69fdd9217121e59ec927594d7baf376692bd1c79603f11257d28e0ec73b4
7
+ data.tar.gz: d8f7baa20bf59b301bc59bbc60285dc65f3bb056aed964c5ea47bfc9caba0e2a3908266c48d770aa125f5e5fc9d387b443c0127306b3b27c2424dcf290de6478
@@ -0,0 +1,7 @@
1
+ # Utopia::Project::Base
2
+
3
+ Provides structured access to a project directory which contains source code and guides.
4
+
5
+ ## Usage
6
+
7
+ To get an instance for the current project, use {Base#instance}.
@@ -106,6 +106,20 @@ module Utopia
106
106
  end
107
107
  end
108
108
 
109
+ def document_for(definition)
110
+ document_path = File.join("lib", definition.lexical_path.map{|_| _.to_s.downcase}) + ".md"
111
+
112
+ if File.exist?(document_path)
113
+ document = self.document(File.read(document_path), definition)
114
+
115
+ if document.first_child.type == :header
116
+ document.first_child.delete
117
+ end
118
+
119
+ return document
120
+ end
121
+ end
122
+
109
123
  def linkify(text, definition, language: definition&.language)
110
124
  rewriter = Linkify.new(self, language, text)
111
125
 
@@ -22,6 +22,6 @@
22
22
 
23
23
  module Utopia
24
24
  module Project
25
- VERSION = "0.13.3"
25
+ VERSION = "0.14.0"
26
26
  end
27
27
  end
@@ -12,7 +12,9 @@
12
12
  when :text
13
13
  ?><content:heading>#{title.string_content}</content:heading><?r
14
14
  when :image
15
- ?><header><img src="#{title.url}" /></header><?r
15
+ self.document.attributes[:title] ||= title.to_plaintext
16
+
17
+ ?><h1><img src="#{title.url}" /></h1><?r
16
18
  else
17
19
  ?><content:heading>Project</content:heading><?r
18
20
  end
@@ -7,7 +7,9 @@
7
7
  <content:heading><code class="language-#{symbol.language.name}">#{symbol.qualified_name}</code></content:heading>
8
8
 
9
9
  <?r
10
- if documentation = symbol.documentation
10
+ if document = base.document_for(symbol)
11
+ ?>#{document.to_html}<?r
12
+ elsif documentation = symbol.documentation
11
13
  ?>#{base.format(documentation.text.join("\n"), symbol)}<?r
12
14
  end
13
15
  ?>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utopia-project
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.3
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-19 00:00:00.000000000 Z
11
+ date: 2020-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: utopia
@@ -187,6 +187,7 @@ extra_rdoc_files: []
187
187
  files:
188
188
  - bake/utopia/project.rb
189
189
  - lib/utopia/project.rb
190
+ - lib/utopia/project/base.md
190
191
  - lib/utopia/project/base.rb
191
192
  - lib/utopia/project/document.rb
192
193
  - lib/utopia/project/guide.rb