# Examples

The repository has 2 example docs folders, each with a style of its own. Each is deployed as a site, and you can serve it from the root of a clone of the repository.

## A command-line tool

[`example/cli/docs`](https://github.com/romshark/docpages/tree/main/example/cli/docs/) documents wc, the Unix tool that counts lines, words and bytes, in the style of a man page in a terminal window. See https://romshark.github.io/docpages/example/cli/

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="../media/842c85e23b341365/cli-dark.webp">
  <img src="../media/8ad8f366e4dff8ee/cli-light.webp" alt="The Installation page of the wc docs, in the style of a man page in a terminal window, with a banner across the top and the navigation right of the text">
</picture>

It shows:

- A logo, a favicon and an icon for each group
- Callouts and a code block with a title
- Keys in `<kbd>`, an argument underlined with `<ins>`, as man does, and a line break in a table cell with `<br>`
- A [template](../guide/templates.md) that builds a page of its own from the parts of docpages, with a banner across the top, links in the header, the navigation right of the text and no contents column
- The text in a window between the title line and the footer line of a man page
- A `style.css` that sets the colors and the fonts, frames the window, shows the contents bar at every width and marks the current page in reverse video
- The indentation, the capitals and the square corners of a man page

```sh title="Terminal"
go run ./cmd/docpages -serve 127.0.0.1:7340 example/cli/docs
```

## A Go library

[`example/library/docs`](https://github.com/romshark/docpages/tree/main/example/library/docs/) documents ringbuf, a made-up Go ring buffer, in a monospace style. See https://romshark.github.io/docpages/example/library/

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="../media/16f692dad2dea223/library-dark.webp">
  <img src="../media/240e8245f884e684/library-light.webp" alt="The Concurrency page of the ringbuf docs, with a sequence diagram">
</picture>

It shows:

- The name of the project in place of a logo
- A group that its `README.md` opens
- A Mermaid diagram
- A link in the footer with an icon
- Links to the headings of another page
- A `<details>` that opens
- An exponent in `<sup>` and the base of a logarithm in `<sub>`
- 2 [releases](../guide/versions.md) from the tags with the prefix `example/library/`, v1.0 and v0.9
- A [release folder](../guide/versions.md#fix-a-release) that adds a note to v0.9, which sends readers to v1.0
- A [template](../guide/templates.md#releases) that adds a security banner to the pages of v0.9
- A `style.css` that sets the colors and the fonts

```sh title="Terminal"
go run ./cmd/docpages -serve 127.0.0.1:7340 example/library/docs
```

## This site

The docs of docpages are an example too: a logo, a favicon, images, videos and the colors of [`docs/style.css`](https://github.com/romshark/docpages/blob/main/docs/style.css).
