utopia-project 0.21.0 → 0.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/bake/utopia/project/readme/update.rb +56 -0
- data/bake/utopia/project/readme/usage.trenni +5 -0
- data/lib/utopia/project/document.rb +3 -2
- data/lib/utopia/project/guide.rb +2 -2
- data/lib/utopia/project/version.rb +1 -1
- data/public/.DS_Store +0 -0
- data/public/_components/.DS_Store +0 -0
- data/public/_components/jquery-syntax/.DS_Store +0 -0
- data/public/_components/mermaid/.DS_Store +0 -0
- data/readme.md +19 -5
- data.tar.gz.sig +0 -0
- metadata +9 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ab639a6ea814e5195fb740583a00a28f55d6e18d86cb46a61341b7768ac4804
|
4
|
+
data.tar.gz: 4988213ac4168bb50ec1201e0cdd24c0d423b92092933546a7fa99f1e002f015
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b58e868cd25562bf2e17aaffdf2cfb830a72d888cf1106edebbe6edef5ba88f07b9f94c0de58d2fd18705401e40694b36725d2cbd925f19197bd9b753f0c782
|
7
|
+
data.tar.gz: b60d7c5fc718544aec358b953507eec731c5e93fa460e7172500a5b2414d33e2ec5456806effa8609e525ce85377c6c43a1bdb481c4a77c02d52b80b9eb8c380
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -0,0 +1,56 @@
|
|
1
|
+
|
2
|
+
require 'utopia/project'
|
3
|
+
require 'trenni'
|
4
|
+
|
5
|
+
def update(path: "readme.md", documentation_url: nil)
|
6
|
+
project = Utopia::Project::Base.new(context.root)
|
7
|
+
readme = project.readme_document
|
8
|
+
|
9
|
+
documentation_url ||= public_documentation_url
|
10
|
+
|
11
|
+
readme.replace_section("Usage") do |header|
|
12
|
+
current = header
|
13
|
+
|
14
|
+
usage_section = self.usage_section(documentation_url, project)
|
15
|
+
usage_section.each do |child|
|
16
|
+
current.insert_after(child)
|
17
|
+
current = child
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
File.write(path, readme.root.to_markdown)
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
Scope = Struct.new(:documentation_url, :project)
|
27
|
+
|
28
|
+
def gemspec_path
|
29
|
+
Dir.glob("*.gemspec", base: context.root).first
|
30
|
+
end
|
31
|
+
|
32
|
+
def gemspec
|
33
|
+
if gemspec_path = self.gemspec_path
|
34
|
+
@gemspec ||= Gem::Specification.load(gemspec_path)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# The public documentation URL if it can be determined.
|
39
|
+
def public_documentation_url
|
40
|
+
if metadata = gemspec.metadata
|
41
|
+
if documentation_uri = metadata['documentation_uri']
|
42
|
+
return documentation_uri
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
return gemspec&.homepage
|
47
|
+
end
|
48
|
+
|
49
|
+
def usage_section(documentation_url, project)
|
50
|
+
template = Trenni::Template.load_file(File.expand_path("usage.trenni", __dir__))
|
51
|
+
scope = Scope.new(documentation_url, project)
|
52
|
+
|
53
|
+
output = template.to_string(scope)
|
54
|
+
|
55
|
+
return Markly.parse(output)
|
56
|
+
end
|
@@ -46,11 +46,12 @@ module Utopia
|
|
46
46
|
if header.first_child.to_plaintext.include?(name)
|
47
47
|
# Now subsequent children:
|
48
48
|
current = header.next
|
49
|
-
|
49
|
+
|
50
50
|
# Delete everything in the section until we encounter another header:
|
51
51
|
while current && current.type != :header
|
52
|
+
current_next = current.next
|
52
53
|
current.delete
|
53
|
-
current =
|
54
|
+
current = current_next
|
54
55
|
end
|
55
56
|
|
56
57
|
return yield(header)
|
data/lib/utopia/project/guide.rb
CHANGED
@@ -83,8 +83,8 @@ module Utopia
|
|
83
83
|
|
84
84
|
# The hypertext reference to this guide.
|
85
85
|
# @returns [String]
|
86
|
-
def href
|
87
|
-
"
|
86
|
+
def href(base = "/")
|
87
|
+
"#{base}guides/#{self.name}/index"
|
88
88
|
end
|
89
89
|
|
90
90
|
# The best documentation, extracted from the source files of the guide.
|
data/public/.DS_Store
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/readme.md
CHANGED
@@ -2,19 +2,33 @@
|
|
2
2
|
|
3
3
|
A simple Ruby project documentation website.
|
4
4
|
|
5
|
-
[![
|
5
|
+
[![Test](https://github.com/socketry/utopia-project/actions/workflows/test.yaml/badge.svg)](https://github.com/socketry/utopia-project/actions/workflows/test.yaml)
|
6
6
|
|
7
7
|
## Motivation
|
8
8
|
|
9
|
-
I've used many documentation tools. Most are over-complicated and focus on what is possible rather than what is useful.
|
9
|
+
I've used many documentation tools. Most are over-complicated and focus on what is possible rather than what is useful.
|
10
|
+
Because I manage many open source projects, at a certain scale it makes sense to build something to suit your needs
|
11
|
+
rather than try to adapt to existing systems. This is one such instance.
|
10
12
|
|
11
|
-
My goal is to provide task-centric documentation, and to continually improve the way it's presented. The primary entry
|
13
|
+
My goal is to provide task-centric documentation, and to continually improve the way it's presented. The primary entry
|
14
|
+
point for new developers are the structured usage guides, however having rich cross-referencing into the code is equally
|
15
|
+
important.
|
12
16
|
|
13
|
-
With that in mind, this web application provides such a model and will evolve over time to suit my requirements and the
|
17
|
+
With that in mind, this web application provides such a model and will evolve over time to suit my requirements and the
|
18
|
+
needs of my users.
|
14
19
|
|
15
20
|
## Usage
|
16
21
|
|
17
|
-
Please see the
|
22
|
+
Please see the [project documentation](https://socketry.github.io/utopia-project/) for more details.
|
23
|
+
|
24
|
+
- [Getting Started](https://socketry.github.io/utopia-project/guides/getting-started/index) - This guide explains how
|
25
|
+
to use `utopia-project` for your own project.
|
26
|
+
|
27
|
+
- [Documentation Formatting](https://socketry.github.io/utopia-project/guides/documentation-formatting/index) - This
|
28
|
+
guide explains the conventions used by `utopia-project` when generating documentation for your project.
|
29
|
+
|
30
|
+
- [GitHub Pages Integration](https://socketry.github.io/utopia-project/guides/github-pages-integration/index) - This
|
31
|
+
guide shows you how to use `utopia-project` with GitHub Pages.
|
18
32
|
|
19
33
|
## Contributing
|
20
34
|
|
data.tar.gz.sig
CHANGED
Binary file
|
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.
|
4
|
+
version: 0.23.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -39,7 +39,7 @@ cert_chain:
|
|
39
39
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
40
40
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
41
41
|
-----END CERTIFICATE-----
|
42
|
-
date: 2023-
|
42
|
+
date: 2023-06-15 00:00:00.000000000 Z
|
43
43
|
dependencies:
|
44
44
|
- !ruby/object:Gem::Dependency
|
45
45
|
name: decode
|
@@ -188,6 +188,8 @@ extensions: []
|
|
188
188
|
extra_rdoc_files: []
|
189
189
|
files:
|
190
190
|
- bake/utopia/project.rb
|
191
|
+
- bake/utopia/project/readme/update.rb
|
192
|
+
- bake/utopia/project/readme/usage.trenni
|
191
193
|
- lib/utopia/project.rb
|
192
194
|
- lib/utopia/project/base.md
|
193
195
|
- lib/utopia/project/base.rb
|
@@ -218,10 +220,13 @@ files:
|
|
218
220
|
- pages/source/controller.rb
|
219
221
|
- pages/source/index.xnode
|
220
222
|
- pages/source/show.xnode
|
223
|
+
- public/.DS_Store
|
221
224
|
- public/.nojekyll
|
225
|
+
- public/_components/.DS_Store
|
222
226
|
- public/_components/jquery-litebox/jquery.litebox.css
|
223
227
|
- public/_components/jquery-litebox/jquery.litebox.gallery.css
|
224
228
|
- public/_components/jquery-litebox/jquery.litebox.js
|
229
|
+
- public/_components/jquery-syntax/.DS_Store
|
225
230
|
- public/_components/jquery-syntax/base/jquery.syntax.brush.apache.css
|
226
231
|
- public/_components/jquery-syntax/base/jquery.syntax.brush.applescript.css
|
227
232
|
- public/_components/jquery-syntax/base/jquery.syntax.brush.assembly.css
|
@@ -292,6 +297,7 @@ files:
|
|
292
297
|
- public/_components/jquery/jquery.slim.js
|
293
298
|
- public/_components/jquery/jquery.slim.min.js
|
294
299
|
- public/_components/jquery/jquery.slim.min.map
|
300
|
+
- public/_components/mermaid/.DS_Store
|
295
301
|
- public/_components/mermaid/mermaid.min.js
|
296
302
|
- public/_components/mermaid/mermaid.min.js.map
|
297
303
|
- public/_static/icon.png
|
@@ -322,7 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
322
328
|
- !ruby/object:Gem::Version
|
323
329
|
version: '0'
|
324
330
|
requirements: []
|
325
|
-
rubygems_version: 3.4.
|
331
|
+
rubygems_version: 3.4.7
|
326
332
|
signing_key:
|
327
333
|
specification_version: 4
|
328
334
|
summary: A project documentation tool based on Utopia.
|
metadata.gz.sig
CHANGED
Binary file
|