Skip to content

Commit

Permalink
Merge pull request #6 from newrelic/develop
Browse files Browse the repository at this point in the history
upsTES
  • Loading branch information
pachicodes authored Feb 22, 2021
2 parents 48ad80a + f3bba13 commit 8b05d7a
Show file tree
Hide file tree
Showing 15 changed files with 1,594 additions and 414 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## [1.35.2](https://github.com/newrelic/developer-website/compare/v1.35.1...v1.35.2) (2021-02-05)


### Bug Fixes

* upgrade snyk from 1.433.0 to 1.437.4 ([0207f55](https://github.com/newrelic/developer-website/commit/0207f55b262fe576b8ef7993e842eba3a958f06d))

## [1.35.1](https://github.com/newrelic/developer-website/compare/v1.35.0...v1.35.1) (2021-02-05)


### Bug Fixes

* fixed spelling errors and image sizing on the builders page ([f8ce0a5](https://github.com/newrelic/developer-website/commit/f8ce0a56eab6ca878fab8ae17f3dd6a5f000865b))
* removed package-lock.json and reverting mdx package ([db3db0f](https://github.com/newrelic/developer-website/commit/db3db0f065c7b150b3e7547047419a0e1a86305e))

# [1.35.0](https://github.com/newrelic/developer-website/compare/v1.34.0...v1.35.0) (2021-02-01)


Expand Down
168 changes: 10 additions & 158 deletions COMPONENT_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,21 @@
- [Globally available components](#globally-available-components)
- [Video](#video)
- [Usage](#usage)
- [Intro](#intro)
- [Usage](#usage-1)
- [Steps](#steps)
- [Usage](#usage-2)
- [Step](#step)
- [Usage](#usage-3)
- [A code example](#a-code-example)
- [Another code example](#another-code-example)
- [Code blocks](#code-blocks)
- [Usage](#usage-4)
- [Callouts](#callouts)
- [Usage](#usage-5)
- [Related Resources](#related-resources)
- [Maximum references](#maximum-references)
- [Resource population logic](#resource-population-logic)
- [Order of priority](#order-of-priority)
- [Resource site tags](#resource-site-tags)
- [Announcement Banner](#announcement-banner)

# Globally available components

## Video

`<Video />` component provides formatting for videos in markdown.
# Component Documentation

### Usage
## Global Components

The Video component requires two props:
Refer to the [New Relic Gatsby Theme](https://github.com/newrelic/gatsby-theme-newrelic/blob/develop/packages/gatsby-theme-newrelic/README.md)
component documentation for details on all the components used on this site.

- `id`: the video ID
- `type`: the host of the video. Accepted values are:
- `wistia`
- `youtube`
## Developer Site Components

```md
<Video id="zxunt1u1as" type="wistia"/>
```
Below are the components that are unique to the Developer Site. These components support patterns that are specific to the Developer Site and are not used by other sites.

## Intro

The `<Intro />` component provides formatting for the title and introduction of the markdown document.

### Usage

It takes the title provided in the Frontmatter and accepts plain text for the description. An example of Frontmatter that will have a title of **Example Guide**:
It takes the title provided in the front matter and accepts plain text for the description. An example of front matter that will have a title of **Example Guide**:

```
---
Expand All @@ -59,10 +29,9 @@ description: 'Example guide page'

It also accepts a `<Video />` component as a child, which it will place on the left side of the description.

```md
<Intro>
This is a description for the markdown guide.

```html
<Video id="zxunt1u1as" type="youtube"/>
</Intro>
```
Expand All @@ -79,7 +48,6 @@ The Steps component accepts `<Step/>` components as its children and will increm

```md
<Steps>

<Step>

## Step 1
Expand Down Expand Up @@ -185,7 +153,7 @@ return <div>Hello, {props.name}</div>;
</Step>
````

You can also use images in steps. To get an image to appear on the right side as with code blocks, you must use an HTML `img` tag, traditional markdown will not align the image to the right.
You can also use images in steps.

```md
<Step>
Expand All @@ -198,120 +166,4 @@ A step description
</Step>
```

> Note: keep in mind that a new line is necesary after an `img` tag to ensure proper rendering of subsequent text/markdown.
## Code blocks

Code blocks are automatically formatted by three backticks. This is our preferred method to delineate code snippets, but it's worth noting that markdown will also consider any text that is indented 4 spaces (or 1 tab) to be a code block.

### Usage

There are four props that can be supplied to a code snippet.

- `language`: The first prop must be a code language. [Here](https://prismjs.com/#supported-languages) is a list of accepted languages for syntax highlighting.

````md
```jsx
```
````

- `lineNumbers`: `true` or `false`. Will show line numbers of the left side of the code, defaults to `false`.

````md
```jsx lineNumbers=true
```
````

- `lineHighlight`: Will highlight lines of code in the snippet. You can supply individual line numbers separted by commas, or ranges by using a hyphen. Be sure not to use any spaces.

````md
```jsx lineHighlight=1,3,6-8,10
```
````

- `copyable`: `true` or `false`. Will display or not display the copy button, defaults to `true`
````md
```jsx copyable=false
```
````

## Callouts

Callouts direct your attention to information of special importance or to information that doesn't fit smoothly into the main text.

- Caution: Screams at you that this could cause a crash or cost you data loss beyond the task at hand.
- Important: Urges awareness that this could impair the task at hand or cost you time if you ignore the text.
- Tip: Whispers to you that this is nice to know, like a shortcut, best practice, or reminder.

### Usage

```md
<Callout variant="caution">

Text with `markdown`.

</Callout>

<Callout variant="important">

Text with `markdown`.

</Callout>

<Callout variant="tip">

Text with `markdown`.

</Callout>
```

All callouts have default titles that can be overridden like this:

```md
<Callout title="A custom title">

Text

</Callout>
```

## Related Resources

The related resources component is controlled by specific Frontmatter slugs that
are defined on a page.

By setting the Frontmatter for `resources` and `tags` you can control what is populated
in this component. Please review the [Style Guide](STYLE_GUIDE.md) for further details
on these slugs.

### Maximum references

This component allows a maximum of 5 resources.

### Resource population logic

If no resources or tags are available in the page Frontmatter the component will fallback
to using the page title as the search query term but you will
always have 5 results, assuming Swiftype can return 5 results for that query.

### Order of priority

The order of priority for populating content in this component is driven by:

1. Any resources defined in the page Frontmatter.
2. Any tags defined in the the page Frontmatter will send a search query term and return results from Swiftype.
2b. Any Swifttype results that match the page title.

### Resource site tags

Resource site tags control the labels that appears below each resource URL. These
can be found in the [Resources.js](./src/components/RelatedContentModules/Resources.js).
If you are adding a resource that doesn't currently have a defined site tag, you will need to
modify this file an add a new site tag accordingly.

When naming the site tag the site domain name should be used for the site tag name.

## Announcement Banner

To utilize the announcement banner that is available in the Global Theme please see these
[instructions](https://github.com/newrelic/gatsby-theme-newrelic/tree/develop/packages/gatsby-theme-newrelic#announcements).
> Note: keep in mind that a new line is necessary after an `img` tag to ensure proper rendering of subsequent text/markdown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "developer-website",
"private": true,
"version": "1.35.0",
"version": "1.35.2",
"dependencies": {
"@emotion/core": "^10.1.1",
"@emotion/styled": "^10.0.27",
Expand Down Expand Up @@ -47,7 +47,7 @@
"react-simple-code-editor": "^0.11.0",
"react-typist": "^2.0.5",
"react-use": "^15.3.4",
"snyk": "^1.425.4",
"snyk": "^1.437.4",
"use-dark-mode": "^2.3.1",
"use-media": "^1.4.0",
"warning": "^4.0.3",
Expand Down
16 changes: 0 additions & 16 deletions src/components/__tests__/Footer.js

This file was deleted.

Loading

0 comments on commit 8b05d7a

Please sign in to comment.