Zachary DeRose 1298a0f6db
docs(core): node and react tutorial rework (#12498)
* docs(react): update react tutorial text

* docs(react): fixes to computation cache lesson

* docs(react): reworking react tutorial

* docs(react): fixing broken links in tutorial

* docs(react): fixing broken more links in tutorial

* docs(react): fixing last broken link in tutorial

* docs(react): really fixing last broken link in tutorial

* fixing images in preview

* docs(react): cleaning up text and formatting issues

* docs(react): more fixes and cleanup

* docs(react): more fixes

* docs(react): fixing nx console broken links

* docs(react): adjusting ending summary cards

* docs(react): more typo fixes

* docs(react): incorporating victor and isaac's feedback

* docs(react): fixing broken link

* docs(react): a self-round of typo and formatting fixes

* docs(react): another round of formatting fixes

* docs(react): another small change

* docs(react): another typo fix

* docs(react): more typo fixed noticed working with node tutorial

* docs(react): making h1's consistent

* docs(react): fixing tab title for part 1

* docs(react): fixing the title

* docs(react): escaping colon in title

* docs(node): copying react tutorials as starting point

* docs(node): fixing map.json and links to other lessons

* docs(node): updating the copy-pasted react tutorial for the node example

* docs(node): more fixes after self-review

* docs(node): fixing another typo

* docs(node): Making h1's consistent

* docs(node): fixing tab title in step 1

* docs(node): fixing the title

* docs(node): escaping colon in title

* docs(core): nx graph => project graph

* docs(core): fixing titles

* docs(core): further shortening the text

* docs(core): formatting fixes

* docs(core): responding to victor comments

* docs(core): switching to new terminal code blocks

* docs(core): light and dark mode friendly images
2022-10-14 10:12:05 -07:00
..

Documentation

Markdown syntax available

The default markdown syntax is supported when writing documentation.

Front matter

Front matter is used to add metadata to your Markdown file (title & description). It is provided at the very top of the file, enclosed by three dashes ---. The content is parsed as YAML.

If no Front matter is detected, the metadata will be populated with the following:

  • title: first main title detected
  • description: first paragraph detected
---
title: This is a custom title
description: This is a custom description
---

Custom markdown syntax

The documentation website nx.dev is using custom Markdown syntax to enable the authors to add functionality to its content.

Callouts

Callouts are available to get the attention of the reader on some specific type of information.

{% callout type="caution|check|note|warning" title="string" %}
Your content goes here.
{% /callout %}

Cards

Cards allow to show content in a grid system with a title, a description, a type and an url (internal/external).

{% cards %}
{% card title="string" description="string" type="documentation|external|video" url="string" /%}
{% card title="string" description="string" type="documentation|external|video" url="string" /%}
// as many as cards you want
{% /cards %}

Code

You can add specific languages and a filename on the code snippet displayed.

```javascript {% fileName="main.js" %}
 const code = "goes here";
```

Terminal Output

You can display your terminal output with a dedicated component the same way you would show code.

``` {% command="node index.js" %}
 My terminal output here!
```

You can optionally also pass a path like

``` {% command="node index.js" path="~/myorg" %}
 My terminal output here!
```

Custom iframes

We can display a special iframe and setting its width inside the document.

{% iframe
src="https://staging.nx.app/orgs/62d013d4d26f260059f7765e/workspaces/62d013ea0852fe0a2df74438?hideHeader=true"
title="Nx Cloud dashboard"
width="100%" /%}

If the type of the card is set to type="video" the url is a valid YouTube url, then the card will show a thumbnail of the video.

GitHub repositories

We can display a special button inviting the reader to go to a GitHub repository.

{% github-repository url="https://github.com/nrwl/nx-examples" /%}

Install Nx Console

We can display a special button inviting the reader to go to a VSCode marketplace to install the official Nx plugin.

{% install-nx-console /%}

Nx Cloud section

We can display Nx Cloud related content in the documentation with a visual cue.

{% nx-cloud-section %}
Your content goes here.
{% /nx-cloud-section %}

Side by side

You can show content in a grid of 2 columns, via the side-by-side shortcode.

{% side-by-side %}
You first content is here.

You second content is over here. _Note the space in between._
{% /side-by-side %}

Tabs

You can display multiple related information via a tabbing system.

{% tabs %}
{% tab label="npm" %}
NPM related information.
{% /tab %}
{% tab label="yarn" %}
Yarn related information.
{% /tab %}
{% /tabs %}
Youtube

Embed a YouTube video directly with the following shortcode, control the title and the associated width.

{% youtube
src="https://www.youtube.com/embed/rNImFxo9gYs"
title="Nx Console Run UI Form"
width="100%" /%}