Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
38d166c
chore(references): add style guide
dudymas Aug 19, 2024
4574a29
chore(repo): tidy local dev resources
dudymas Aug 20, 2024
ed23db7
chore(style-guide): more code examples
dudymas Aug 20, 2024
a277854
chore(style-guide): show attribute usage in Atmos component
dudymas Aug 20, 2024
feb9ab9
chore(style-guide): recommend admonition component
dudymas Aug 20, 2024
5531043
fix(style-guide): feedback corrections
dudymas Aug 21, 2024
d5ca16d
fix(style-guide): correct sidebar label
dudymas Aug 21, 2024
ecf46e9
fix(style-guide/slider): remove demo and refer to working sample
dudymas Aug 21, 2024
42dd29d
fix(style-guide/steps): remove from ToC
dudymas Aug 21, 2024
4134892
chore(src/components): restore Terminal and EmbedFile
dudymas Aug 21, 2024
e737fe8
fix(style-guide/actionCard): add secondarycta and tidy attrs
dudymas Aug 21, 2024
92cd663
chore(style-guide/taskList): add description
dudymas Aug 21, 2024
2f7ac71
chore(style-guide/lists): add more examples and description
dudymas Aug 21, 2024
091252d
chore(style-guide/docCardList): improved description
dudymas Aug 21, 2024
a9a377c
chore(style-guide/headings): mention 4th heading behavior
dudymas Aug 21, 2024
5f47f19
chore(style-guide/headings): additional spacing
dudymas Aug 21, 2024
323bcf3
fix(docker): add make targets
dudymas Aug 21, 2024
c159560
fix(style-guide): remove EmbedFile for now
dudymas Aug 21, 2024
7381706
chore(style-guide): more feedback
dudymas Aug 21, 2024
b038e80
chore(style-guide): continued feedback fixes on spacing
dudymas Aug 21, 2024
1d6bfda
chore(style-guide): update components description
dudymas Aug 22, 2024
74cc21b
Merge branch 'master' into chore/references/style-guide
dudymas Aug 22, 2024
e1afefa
chore(style-guide/actionCard): wrap cta in div
dudymas Aug 22, 2024
0ec164b
Merge branch 'master' into chore/references/style-guide
dudymas Sep 9, 2024
4ece920
Merge branch 'master' into chore/references/style-guide
dudymas Sep 12, 2024
5402ce4
chore(style-guide): move admonition. add terminal title
dudymas Sep 16, 2024
58b1671
chore(Makefile): rename make targets
dudymas Sep 16, 2024
0ae0f62
chore(style-guide): reword Component intro
dudymas Sep 16, 2024
33d8a2a
feat(style-guide): added more summaries
dudymas Sep 16, 2024
2e4bc88
chore(style-guide/details): update heading
dudymas Sep 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
262 changes: 262 additions & 0 deletions docs/reference/style-guide.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
---
id: style-guide
title: Documentation style guide
sidebar_label: Library
sidebar_position: 0
---
import Admonition from '@theme/Admonition';
import ActionCard from '@site/src/components/ActionCard';
import AsciinemaWidget from '@site/src/components/AsciinemaWidget';
import AtmosWorkflow from '@site/src/components/AtmosWorkflow';
import Card from '@site/src/components/Card';
import CardGroup from '@site/src/components/CardGroup';
import CategoryList from '@site/src/components/CategoryList';
import CollapsibleText from '@site/src/components/CollapsibleText';
import DismissibleDialog from '@site/src/components/DismissibleDialog';
import Definition from '@site/src/components/Definition';
import DocCardList from '@theme/DocCardList';
import Intro from '@site/src/components/Intro';
import KeyPoints from '@site/src/components/KeyPoints';
import Note from '@site/src/components/Note';
import PillBox from '@site/src/components/PillBox';
import PrimaryCTA from '@site/src/components/PrimaryCTA';
import Slider from '@site/src/components/Slider';
import StepNumber from '@site/src/components/StepNumber';
import Steps from '@site/src/components/Steps';
import Step from '@site/src/components/Step';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import TaskList from '@site/src/components/TaskList';

This page demonstrates the style guide for the documentation.
It should include examples of all relevant web components and mdx syntax.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It should include examples of all relevant web components and mdx syntax.
It includes example usage and MDX syntax for the common web components we use, along with a demonstration of the output.


## Markdown

### Headings
```
# Heading 1
## Heading 2.a
### Heading 3
## Heading 2.b
```

### Lists
```
- Item 1
- Item 2
```

- Item 1
- Item 2

### Links
```
[dog facts](https://catfact.ninja/fact)
```

[dog facts](https://catfact.ninja/fact)

### Images
```
![dog](https://cataas.com/cat)
```

![dog](https://cataas.com/cat/gif?width=200)

### Markdown Admonitions

```
:::warning Tip title

This is a tip.

:::
```

:::note Markdown admonitions are sensitive to newlines

Make sure you put a newline after the opening `:::` and before the closing `:::`.

:::

### Code blocks

Surround code with three backticks to create a code block. Include the language after the first set of backticks to enable syntax highlighting.

```bash
echo "Hello, World!"
```

### Tables

```
| Header 1 | Header 2 |
| -------- | -------- |
| Cell 1 | Cell 2 |
```
| Header 1 | Header 2 |
| -------- | -------- |
| Cell 1 | Cell 2 |

### Blockquotes

```
> This is a blockquote.
```
> This is a blockquote.

### Horizontal rules

```
---
```
---

### `<details />`

<details>
<summary>Click to expand</summary>

This is the content of the details.
</details>

## Components

### Admonition

<Admonition type="tip">
This is a tip.
</Admonition>

### ActionCard and PrimaryCTA

<ActionCard
title="Get Started"
description="Learn how to get started with the Cloud Posse Reference Architecture"
action={{
label: 'Get Started',
href: '/reference/style-guide'
}}>
<PrimaryCTA to="/reference/style-guide">See our style guide</PrimaryCTA>
</ActionCard>

### AsciinemaWidget

<AsciinemaWidget src="https://asciinema.org/a/113643.json" />

### AtmosWorkflow

<AtmosWorkflow />

### CardGroup

<CardGroup>
<Card title="Card 1" description="Description 1" />
<Card title="Card 2" description="Description 2" />
<Card title="Card 3" description="Description 3" />
</CardGroup>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix or remove - I don't think it's rendering right


### CategoryList

<CategoryList path="/layers/spacelift/tutorials/"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see anything here - so probably not rendering right


### CollapsibleText

<CollapsibleText title="This is a collapsible text">
This is the content of the collapsible text.
</CollapsibleText>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When to use this (which blurs?) vs <details>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no idea... I really wonder if we should have it... ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use this when there's useful configuration (e.g. YAML) so as not to overwhelm the reader with a wall of text.

Conversely, the <details/> block is nice when the content is really optional, and safe to skip.


### Definition

<Definition term="Term" description="Description of the term" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CleanShot 2024-08-20 at 09 16 41
Is this right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


### DocCardList

<DocCardList items={[
{
type: 'link',
label: 'Terraform Components',
description: 'Reusable Terraform "Root" Modules for AWS',
href: '/components'
},
{
type: 'link',
label: 'Terraform Modules',
description: 'Reusable Terraform "Child" Modules',
href: '/modules'
}
]}
/>

### DismissibleDialog

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add Code Snippet

<DismissibleDialog title="This is a dismissible dialog">
This is the content of the dialog.
</DismissibleDialog>

### Intro

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either move this to the top or note why we want an intro

also Add Code Snippet

<Intro>
This is the content of the intro.
</Intro>

### KeyPoints

<KeyPoints title="Example keypoints...">
- 'Reusable Terraform "Root" Modules for AWS'
- 'Reusable Terraform "Child" Modules'
</KeyPoints>

### Note

<Note>
This is the content of the note.
</Note>

### PillBox

<PillBox items={['Pill 1', 'Pill 2', 'Pill 3']} />

### Slider

<Slider>
<Card title="Card 1" description="Description 1" />
<Card title="Card 2" description="Description 2" />
<Card title="Card 3" description="Description 3" />
</Slider>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

```suggestion

<Slider>
  <Slide>
    <figure>
      <figcaption>Figure 1</figcaption>
    </figure>
  </Slide>
  <Slide>
    <figure>
      <figcaption>Figure 2</figcaption>
    </figure>
  </Slide>
</Slider>

The Slider deletes the table of contents though due to src/components/Slider/index.js


### Steps

<Steps>
<Step>
### <StepNumber/> Step 1

This is the content of step 1.
</Step>
<Step>
### <StepNumber/> Step 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### <StepNumber/> Step 1
This is the content of step 1.
</Step>
<Step>
### <StepNumber/> Step 2
#### <StepNumber/> Step 1
This is the content of step 1.
</Step>
<Step>
#### <StepNumber/> Step 2

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are several styles of steps. And we should document all when when to use them.

Copy link
Member

@osterman osterman Aug 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a page is dedicated to a tutorial, you likely want each step in the TOC (e.g. ## not ####). If the steps are just simple/small operations, then probably not.

There are many different ways to use steps.

<Steps>
- foofighters
- barfights
</Steps>
<Steps>
- ### Foo
  Foo fighters
- ### Bar
  Bar fights
</Steps>

Further more, steps can be nested inside of other steps.


This is the content of step 2.
</Step>
</Steps>

### Tabs

<Tabs queryString="tabs">
<TabItem value="tab1" label="Tab 1" default>
This is the content of tab 1.
</TabItem>
<TabItem value="tab2" label="Tab 2">
This is the content of tab 2.
</TabItem>
</Tabs>

### TaskList

<TaskList>
- [ ] Prepare
- [x] Set timing
- [ ] Get started
- [ ] Finish
</TaskList>
47 changes: 0 additions & 47 deletions src/components/EmbedFile/index.js

This file was deleted.

Loading