utopia-project 0.35.0 → 0.35.1
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/context/documentation-guidelines.md +105 -0
- data/lib/utopia/project/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +2 -3
- data/context/documentation-formatting.md +0 -67
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfd904d0661eca52af7af1d7c16cc1e39fc9664dcc6d1b263693a779d7777a06
|
4
|
+
data.tar.gz: f0ab7c6d9c241794d58de46dfaa6db3d0dd44888aebeac0211dcf8e96b7b15c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22229199613c3b999385d16b9ba274e6453929a36b86e832f4699f096dceeeec6b0e6d9201e0a5e2c870fed38ea6f44c76cba5b84c21a7ac16dd0f9b8ce7e186
|
7
|
+
data.tar.gz: a46c96093621d0e759dffd4ee838aaffdb7ba1beb6477ced3fdc00b358fc094f6aa5cd235ee27741147c789bf2b0f2eeec7c4d424477549e11488bd87bffd3be
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# Documentation Guides
|
2
|
+
|
3
|
+
This guide explains how to create and maintain documentation for your project using `utopia-project`.
|
4
|
+
|
5
|
+
## Overview
|
6
|
+
|
7
|
+
There are two main aspects to consider when creating documentation with `utopia-project`:
|
8
|
+
|
9
|
+
1. **Source Code Documentation**: This involves adding documentation directly within your code using special tags.
|
10
|
+
2. **Examples & Guides**: This includes creating separate example files and guides to help users understand how to use your project.
|
11
|
+
|
12
|
+
### Source Code Documentation
|
13
|
+
|
14
|
+
Source code documentation is included adjacent to the code it describes, using special tags to provide structured information. This allows for easy generation of documentation from the source code itself. The `utopia-project` documentation generator uses the `decode` gem (which is documented elsewhere).
|
15
|
+
|
16
|
+
However, in short:
|
17
|
+
|
18
|
+
- Documentation is expected to be in markdown format.
|
19
|
+
- You may embed links to definitions using `{MyClass}` or `{my_method}`.
|
20
|
+
- You can use tags:
|
21
|
+
- `@parameters name [Type] Description.`
|
22
|
+
- `@yields {|argument| ...} If a block is given.`
|
23
|
+
- `@returns [Type] Description.`
|
24
|
+
- Classes and Modules should typically be described as "Represents a ..." where it makes sense to do so.
|
25
|
+
|
26
|
+
In addition, for complex classes that require extra documentation, e.g. `my_class.rb` can have an adjacent `my_class.md` which should have the title `# MyClass` and can include additional details, examples, and usage guidelines.
|
27
|
+
|
28
|
+
### Examples & Guides
|
29
|
+
|
30
|
+
In addition to source code documentation, it's helpful to provide separate examples and guides to demonstrate how to use your project. This can include:
|
31
|
+
|
32
|
+
- Code snippets that illustrate common use cases.
|
33
|
+
- Step-by-step tutorials for more complex scenarios.
|
34
|
+
|
35
|
+
By providing both inline documentation and separate guides, you can help users understand your project more easily and encourage adoption.
|
36
|
+
|
37
|
+
These resources are located in the `guides/` directory of your project, and have the following format:
|
38
|
+
|
39
|
+
```
|
40
|
+
guides/
|
41
|
+
├── links.yaml
|
42
|
+
├── documentation-guidelines/
|
43
|
+
│ └── readme.md
|
44
|
+
├── documentation-guides/
|
45
|
+
│ └── readme.md
|
46
|
+
├── getting-started/
|
47
|
+
│ └── readme.md
|
48
|
+
└── github-pages-integration/
|
49
|
+
└── readme.md
|
50
|
+
```
|
51
|
+
|
52
|
+
The `links.yaml` file comes from the `utopia` framework, and is used to define metadata and ordering of the guides, e.g.
|
53
|
+
|
54
|
+
```yaml
|
55
|
+
# guides/links.yaml
|
56
|
+
getting-started:
|
57
|
+
order: 1
|
58
|
+
github-pages-integration:
|
59
|
+
order: 2
|
60
|
+
documentation-guides:
|
61
|
+
order: 3
|
62
|
+
```
|
63
|
+
|
64
|
+
Every guide should start with a brief overview, explaining its purpose and what the user can expect to learn: "This guide explains how to use x to do y." – it should be short and to the point, as it's used as the description of the guide on other pages that link to it.
|
65
|
+
|
66
|
+
#### "Getting Started" Guide
|
67
|
+
|
68
|
+
Every project should have a "Getting Started" guide that provides an introduction to the project, including the following sections:
|
69
|
+
|
70
|
+
~~~markdown
|
71
|
+
# Getting Started
|
72
|
+
|
73
|
+
This guide explains how to get started with `$project`.
|
74
|
+
|
75
|
+
## Installation
|
76
|
+
|
77
|
+
Add the gem to your project:
|
78
|
+
|
79
|
+
```bash
|
80
|
+
$ bundle add $project
|
81
|
+
```
|
82
|
+
|
83
|
+
## Core Concepts
|
84
|
+
|
85
|
+
`$project` has several core concepts:
|
86
|
+
|
87
|
+
- A {ruby MyProject::MyClass} which represents the main entry point for using the project.
|
88
|
+
|
89
|
+
## Usage
|
90
|
+
|
91
|
+
Brief explaination about usage.
|
92
|
+
|
93
|
+
### Specific Scenario
|
94
|
+
|
95
|
+
More detailed explanation about usage in a specific scenario.
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
# some example code
|
99
|
+
```
|
100
|
+
~~~
|
101
|
+
|
102
|
+
In the above example:
|
103
|
+
|
104
|
+
- "Core Concepts" is optional and should be included if it helps to clarify the usage and structure of the project.
|
105
|
+
- "Specific Scenario" only makes sense if there are more than one scenario that is typical.
|
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.35.
|
4
|
+
version: 0.35.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -132,7 +132,7 @@ files:
|
|
132
132
|
- bake/utopia/project.rb
|
133
133
|
- bake/utopia/project/agent/context.rb
|
134
134
|
- bake/utopia/project/readme/update.rb
|
135
|
-
- context/documentation-
|
135
|
+
- context/documentation-guidelines.md
|
136
136
|
- context/getting-started.md
|
137
137
|
- context/github-pages-integration.md
|
138
138
|
- context/index.yaml
|
metadata.gz.sig
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
ܑ��#t�[Ҭ����Y!v����+)��n⾒�~��K�h1V(�@�:��*r쟮<C��'�,�V�e��
|
1
|
+
��c�U��߈^������5'
|
2
|
+
N�L� ;+�`� 9��^\��r���}zhKY�͓�-gЃWL�䥕z�Ss�]$r�hG&${]�]��蘒~�g�J0����^ҏ�{����"�Qx�N-�}=Wc��C����yܧb<W-�Q҇}���,l���[�H�6�[UN�x5���#h�|#a"�Fm<�t���3���+��P6ƫ Xb�*#�ݺ{Ȭ�*�
|
@@ -1,67 +0,0 @@
|
|
1
|
-
# Documentation Formatting
|
2
|
-
|
3
|
-
This guide explains the conventions used by `utopia-project` when generating documentation for your project.
|
4
|
-
|
5
|
-
## Source Code Documentation
|
6
|
-
|
7
|
-
Source code documentation is expected to be in markdown format. This is different from the canonical `RDoc` format used by Ruby. However, using markdown is a good format for standardised documentation across a range of different languages.
|
8
|
-
|
9
|
-
### Tags
|
10
|
-
|
11
|
-
#### `@parameter`
|
12
|
-
|
13
|
-
The `@parameter` tag is used to describe the parameters of a method:
|
14
|
-
|
15
|
-
~~~ ruby
|
16
|
-
# @parameter x [Integer] The x co-ordinate.
|
17
|
-
# @parameter y [Integer] The y co-ordinate.
|
18
|
-
def move(x, y)
|
19
|
-
# ...
|
20
|
-
end
|
21
|
-
~~~
|
22
|
-
|
23
|
-
#### `@returns`
|
24
|
-
|
25
|
-
The `@returns` tag is used to describe the return type of the definition:
|
26
|
-
|
27
|
-
~~~ ruby
|
28
|
-
# @returns [Integer] The result of the computation.
|
29
|
-
def fib(n)
|
30
|
-
# ...
|
31
|
-
end
|
32
|
-
~~~
|
33
|
-
|
34
|
-
### References
|
35
|
-
|
36
|
-
It is possible to insert references in your documentation using curly brackets. In the following example `{Input}` will be expanded relative to the usage, to some symbol named `Input`.
|
37
|
-
|
38
|
-
~~~ ruby
|
39
|
-
# Frobulates the input, see {Input} for more details.
|
40
|
-
def frobulate(input)
|
41
|
-
# ... left to the imagination ...
|
42
|
-
end
|
43
|
-
~~~
|
44
|
-
|
45
|
-
## Examples & Guides
|
46
|
-
|
47
|
-
Examples provide structured information to help users understand your project and are located in the `examples/` directory. One sub-directory per example.
|
48
|
-
|
49
|
-
### `readme.md`
|
50
|
-
|
51
|
-
If an example has a `readme.md` file, it is used as the main source of documentation.
|
52
|
-
|
53
|
-
### Source Files
|
54
|
-
|
55
|
-
All other source files are listed on the example page. Top level comments with trailing code (segments) are used to help guide the user through the example.
|
56
|
-
|
57
|
-
## Diagrams
|
58
|
-
|
59
|
-
You can add diagrams formatted using `mermaid.js`.
|
60
|
-
|
61
|
-
``` mermaid
|
62
|
-
graph LR;
|
63
|
-
A-->B;
|
64
|
-
A-->C;
|
65
|
-
B-->D;
|
66
|
-
C-->D;
|
67
|
-
```
|