Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 232cf77

Browse files
webinistaAisha BlakeGatsbyJS Bot
authored
docs/glossary: Add Markdown article. (gatsbyjs#21587)
* docs/glossary: Add Markdown article. Updated sidebar, glossary.md with links to new entry. * Add a Markdown example. * Add a Markdown example. * Remove a stray < from the code example. * Typo fixes, swap caption for figcaption * switch in to from * chore: format Co-authored-by: Aisha Blake <[email protected]> Co-authored-by: GatsbyJS Bot <[email protected]>
1 parent 14131a0 commit 232cf77

File tree

3 files changed

+68
-1
lines changed

3 files changed

+68
-1
lines changed

docs/docs/glossary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ Linting is the process of running a program that will analyze code for potential
210210

211211
Extends [Markdown](#markdown) to support [React](#react) [components](#component) within your content.
212212

213-
### Markdown
213+
### [Markdown](/docs/glossary/markdown/)
214214

215215
A way of writing HTML content with plain text, using special characters to denote content types such as hash symbols for [headings](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements), and underscores and asterisks for text emphasis.
216216

docs/docs/glossary/markdown.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: Markdown
3+
disableTableOfContents: true
4+
---
5+
6+
Learn what Markdown is, why you might use it, and how it fits into the Gatsby ecosystem.
7+
8+
## What is Markdown?
9+
10+
Markdown is a plain text syntax for writing text documents that can be transformed to HTML. Markdown uses punctuation characters to indicate HTML elements. That punctuation then gets converted to HTML tags during a transformation or export process.
11+
12+
Markdown dates back to 2004, when John Gruber published the original [Markdown syntax guide](https://daringfireball.net/projects/markdown/syntax). Gruber, along with Aaron Swartz, created Markdown with two goals:
13+
14+
1. to make Markdown <q>as easy-to-read and easy-to-write as is feasible.</q>; and
15+
1. to support inline HTML within Markdown-formatted text.
16+
17+
Text-to-HTML filters such as [Textile](https://textile-lang.com/) define a syntax that replaces a wide range of HTML elements. Other filters, such as [reStructuredText](https://docutils.readthedocs.io/en/sphinx-docs/user/rst/quickstart.html), do not support inline HTML tags.
18+
19+
Markdown, by contrast, only defines a syntax for a small subset of HTML elements. For other elements, you use the corresponding HTML tag. In other words, Markdown makes it possible to write documents without knowing HTML, but HTML is available if you need it. A Markdown document might look like the example that follows.
20+
21+
```markdown
22+
# Markdown!
23+
24+
You can use Markdown to create documents for [Gatsby](https://www.gatsbyjs.org/).
25+
26+
<figure class="chart">
27+
<object data="chart.svg" type="image/svg+xml"></object>
28+
<figcaption>
29+
Developers who love using Gatsby versus those who haven't tried it yet.
30+
</figcaption>
31+
</figure>
32+
```
33+
34+
When converted to HTML, the preceding Markdown will become the markup below.
35+
36+
```html
37+
<h1>Markdown!</h1>
38+
<p>
39+
You can use Markdown to create documents for
40+
<a href="https://www.gatsbyjs.org/">Gatsby</a>.
41+
</p>
42+
<figure class="chart">
43+
<object data="chart.svg" type="image/svg+xml"></object>
44+
<figcaption>
45+
Developers who love using Gatsby versus those who haven't tried it yet.
46+
</figcaption>
47+
</figure>
48+
```
49+
50+
You can use Markdown files as a content source for your Gatsby site. To do so, you'll need to install two plugins: [`gatsby-source-filesystem`](/packages/gatsby-source-filesystem) and [`gatsby-transformer-remark`](/packages/gatsby-transformer-remark/). As with Gatsby itself, you can install both using [npm](/docs/glossary/#npm).
51+
52+
```bash
53+
npm install --save gatsby-source-filesystem gatsby-transformer-remark
54+
```
55+
56+
The `gatsby-source-filesystem` plugin reads files from your computer. The `gatsby-transformer-remark` plugin makes the contents of your Markdown files available to GraphQL.
57+
58+
You can also try a [Gatsby starter](https://www.gatsbyjs.org/starters/?c=Markdown) package that has Markdown support already included.
59+
60+
## Learn more about Markdown
61+
62+
- [Markdown syntax](/docs/mdx/markdown-syntax/) from the Gatsby docs
63+
- [CommonMark](https://commonmark.org/), a proposed Markdown specification
64+
- [Sourcing from the Filesystem](/docs/sourcing-from-the-filesystem/) from the Gatsby docs
65+
- [Adding Markdown Pages](/docs/adding-markdown-pages/) from the Gatsby docs

www/src/data/sidebars/doc-links.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,8 @@
748748
link: /docs/glossary/headless-wordpress/
749749
- title: JAMStack
750750
link: /docs/glossary/jamstack
751+
- title: Markdown
752+
link: /docs/glossary/markdown/
751753
- title: Node.js
752754
link: /docs/glossary/node
753755
- title: React

0 commit comments

Comments
 (0)