utopia-project 0.34.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6d7813076feeeb716ee8b2fed2db46d2d5522d63ef443632687aec95be009f9
4
- data.tar.gz: a77ff26f76a698e3d9c90b86270a4ee9fefeecd6108e9bade9c5d603ffe38081
3
+ metadata.gz: cfd904d0661eca52af7af1d7c16cc1e39fc9664dcc6d1b263693a779d7777a06
4
+ data.tar.gz: f0ab7c6d9c241794d58de46dfaa6db3d0dd44888aebeac0211dcf8e96b7b15c0
5
5
  SHA512:
6
- metadata.gz: 33e47b9495910bd0e04b7b3f35f05f06de0e02c827dcb2c08cc8619b81b70e9986b288f4014a3c5fa544b38c97a21e3373287f49881ad67cedd868353b4e91cf
7
- data.tar.gz: aad59c90eb1f6556f6332f42afab40bc81031f2414df7fe83231a9bdb71fe2de7f6a4491aec52b53ab225049732c3d7cd0f92722ae4813331bebc29385c2be3c
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.
@@ -1,15 +1,17 @@
1
1
  # Getting Started
2
2
 
3
- This guide explains how to use `utopia-project` for your own project.
3
+ This guide explains how to use `utopia-project` to add documentation to your project.
4
4
 
5
5
  ## Installation
6
6
 
7
- Firstly, add the gem to your project:
7
+ Add the gem to your project:
8
8
 
9
9
  ~~~ bash
10
10
  $ bundle add utopia-project
11
11
  ~~~
12
12
 
13
+ ## Usage
14
+
13
15
  ## Start Local Server
14
16
 
15
17
  Start the local server to preview documentation:
@@ -1,17 +1,67 @@
1
1
  # GitHub Pages Integration
2
2
 
3
- This guide shows you how to use `utopia-project` with GitHub Pages.
3
+ This guide shows you how to use `utopia-project` with GitHub Pages to deploy documentation.
4
4
 
5
- ## Static Site Generation
5
+ ## Enable GitHub Pages
6
6
 
7
- Once you are happy with your project's documentation, use this command to generate a static site:
7
+ In your GitHub project settings, you will need to [enable GitHub Pages from a custom GitHub Actions workflow](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow). Then, use the workflow below to publish the documentation:
8
8
 
9
- ~~~ bash
10
- $ bake utopia:project:static
11
- ~~~
9
+ ```yaml
10
+ name: Documentation
12
11
 
13
- This will generate a static copy of your documentation into `docs/` which is what is required by GitHub Pages.
12
+ on:
13
+ push:
14
+ branches:
15
+ - main
14
16
 
15
- ## Enable GitHub Pages
17
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages:
18
+ permissions:
19
+ contents: read
20
+ pages: write
21
+ id-token: write
22
+
23
+ # Allow one concurrent deployment:
24
+ concurrency:
25
+ group: "pages"
26
+ cancel-in-progress: true
27
+
28
+ env:
29
+ BUNDLE_WITH: maintenance
30
+
31
+ jobs:
32
+ generate:
33
+ runs-on: ubuntu-latest
34
+
35
+ steps:
36
+ - uses: actions/checkout@v4
16
37
 
17
- In your GitHub project settings, you will need to [enable GitHub Pages served from `docs/`](https://help.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#choosing-a-publishing-source).
38
+ - uses: ruby/setup-ruby@v1
39
+ with:
40
+ ruby-version: ruby
41
+ bundler-cache: true
42
+
43
+ - name: Installing packages
44
+ run: sudo apt-get install wget
45
+
46
+ - name: Generate documentation
47
+ timeout-minutes: 5
48
+ run: bundle exec bake utopia:project:static --force no
49
+
50
+ - name: Upload documentation artifact
51
+ uses: actions/upload-pages-artifact@v3
52
+ with:
53
+ path: docs
54
+
55
+ deploy:
56
+ runs-on: ubuntu-latest
57
+
58
+ environment:
59
+ name: github-pages
60
+ url: ${{steps.deployment.outputs.page_url}}
61
+
62
+ needs: generate
63
+ steps:
64
+ - name: Deploy to GitHub Pages
65
+ id: deployment
66
+ uses: actions/deploy-pages@v4
67
+ ```
data/context/index.yaml CHANGED
@@ -9,11 +9,13 @@ metadata:
9
9
  files:
10
10
  - path: getting-started.md
11
11
  title: Getting Started
12
- description: This guide explains how to use `utopia-project` for your own project.
13
- - path: documentation-formatting.md
14
- title: Documentation Formatting
15
- description: This guide explains the conventions used by `utopia-project` when generating
16
- documentation for your project.
12
+ description: This guide explains how to use `utopia-project` to add documentation
13
+ to your project.
14
+ - path: documentation-guidelines.md
15
+ title: Documentation Guides
16
+ description: This guide explains how to create and maintain documentation for your
17
+ project using `utopia-project`.
17
18
  - path: github-pages-integration.md
18
19
  title: GitHub Pages Integration
19
- description: This guide shows you how to use `utopia-project` with GitHub Pages.
20
+ description: This guide shows you how to use `utopia-project` with GitHub Pages
21
+ to deploy documentation.
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Utopia
7
7
  module Project
8
- VERSION = "0.34.1"
8
+ VERSION = "0.35.1"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -21,11 +21,11 @@ needs of my users.
21
21
 
22
22
  Please see the [project documentation](https://socketry.github.io/utopia-project/) for more details.
23
23
 
24
- - [Getting Started](https://socketry.github.io/utopia-project/guides/getting-started/index) - This guide explains how to use `utopia-project` for your own project.
24
+ - [Getting Started](https://socketry.github.io/utopia-project/guides/getting-started/index) - This guide explains how to use `utopia-project` to add documentation to your project.
25
25
 
26
- - [Documentation Formatting](https://socketry.github.io/utopia-project/guides/documentation-formatting/index) - This guide explains the conventions used by `utopia-project` when generating documentation for your project.
26
+ - [Documentation Guides](https://socketry.github.io/utopia-project/guides/documentation-guidelines/index) - This guide explains how to create and maintain documentation for your project using `utopia-project`.
27
27
 
28
- - [GitHub Pages Integration](https://socketry.github.io/utopia-project/guides/github-pages-integration/index) - This guide shows you how to use `utopia-project` with GitHub Pages.
28
+ - [GitHub Pages Integration](https://socketry.github.io/utopia-project/guides/github-pages-integration/index) - This guide shows you how to use `utopia-project` with GitHub Pages to deploy documentation.
29
29
 
30
30
  ## Releases
31
31
 
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.34.1
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-formatting.md
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
Binary file
@@ -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
- ```