Utopia::ProjectGuidesDocumentation Guides

Documentation Guides

This guide explains how to create and maintain documentation for your project using utopia-project.

Overview

There are two main aspects to consider when creating documentation with utopia-project:

  1. Source Code Documentation: This involves adding documentation directly within your code using special tags.
  2. Examples & Guides: This includes creating separate example files and guides to help users understand how to use your project.

Source Code Documentation

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).

However, in short:

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.

Examples & Guides

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:

By providing both inline documentation and separate guides, you can help users understand your project more easily and encourage adoption.

These resources are located in the guides/ directory of your project, and have the following format:

guides/
├── links.yaml
├── documentation-guidelines/
│   └── readme.md
├── documentation-guides/
│   └── readme.md
├── getting-started/
│   └── readme.md
└── github-pages-integration/
    └── readme.md

The links.yaml file comes from the utopia framework, and is used to define metadata and ordering of the guides, e.g.

# guides/links.yaml
getting-started:
  order: 1
github-pages-integration:
  order: 2
documentation-guides:
  order: 3

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.

"Getting Started" Guide

Every project should have a "Getting Started" guide that provides an introduction to the project, including the following sections:

# Getting Started

This guide explains how to get started with `$project`.

## Installation

Add the gem to your project:

```bash
$ bundle add $project
```

## Core Concepts

`$project` has several core concepts:

- A {ruby MyProject::MyClass} which represents the main entry point for using the project.

## Usage

Brief explaination about usage.

### Specific Scenario

More detailed explanation about usage in a specific scenario.

```ruby
# some example code
```

In the above example: