src/content/post/markdown-elements.md 3.0 K raw
1
---
2
title: "A post of Markdown elements"
3
description: "This post is for testing and listing a number of different markdown elements"
4
publishDate: "22 Feb 2023"
5
tags: ["test", "markdown"]
6
---
7
8
## This is a H2 Heading
9
10
### This is a H3 Heading
11
12
#### This is a H4 Heading
13
14
##### This is a H5 Heading
15
16
###### This is a H6 Heading
17
18
## Horizontal Rules
19
20
---
21
22
---
23
24
---
25
26
## Emphasis
27
28
**This is bold text**
29
30
_This is italic text_
31
32
~~Strikethrough~~
33
34
## Blockquotes
35
36
> Blockquotes can also be nested...
37
>
38
> > ...by using additional greater-than signs right next to each other...
39
> >
40
> > > ...or with spaces between arrows.
41
42
## Lists
43
44
Unordered
45
46
- Create a list by starting a line with `+`, `-`, or `*`
47
- Sub-lists are made by indenting 2 spaces:
48
  - Marker character change forces new list start:
49
    - Ac tristique libero volutpat at
50
    - Facilisis in pretium nisl aliquet
51
    - Nulla volutpat aliquam velit
52
- Very easy!
53
54
Ordered
55
56
1. Lorem ipsum dolor sit amet
57
2. Consectetur adipiscing elit
58
3. Integer molestie lorem at massa
59
60
4. You can use sequential numbers...
61
5. ...or keep all the numbers as `1.`
62
63
Start numbering with offset:
64
65
57. foo
66
1. bar
67
68
## Code
69
70
Inline `code`
71
72
Indented code
73
74
    // Some comments
75
    line 1 of code
76
    line 2 of code
77
    line 3 of code
78
79
Block code "fences"
80
81
```
82
Sample text here...
83
```
84
85
Syntax highlighting
86
87
```js
88
const axios = require('axios')
89
const FormData = require('form-data')
90
const fs = require('fs')
91
require('dotenv').config()
92
93
const pinFileToIPFS = async () => {
94
  try {
95
    let data = new FormData()
96
    data.append('file', fs.createReadStream('./assets/Pinnie.png'))
97
    data.append('pinataOptions', '{"cidVersion": 0}')
98
    data.append('pinataMetadata', '{"name": "pinnie"}')
99
100
    const res = await axios.post('https://api.pinata.cloud/pinning/pinFileToIPFS', data, {
101
      headers: {
102
        'Authorization': `Bearer ${process.env.PINATA_JWT}`
103
      }
104
    })
105
    console.log(res.data)
106
    console.log(`View the file here: https://gateway.pinata.cloud/ipfs/${res.data.IpfsHash}`)
107
  } catch (error) {
108
    console.log(error)
109
  } 
110
}
111
112
pinFileToIPFS()
113
```
114
115
## Tables
116
117
| Option | Description                                                               |
118
| ------ | ------------------------------------------------------------------------- |
119
| data   | path to data files to supply the data that will be passed into templates. |
120
| engine | engine to be used for processing templates. Handlebars is the default.    |
121
| ext    | extension to be used for dest files.                                      |
122
123
Right aligned columns
124
125
| Option |                                                               Description |
126
| -----: | ------------------------------------------------------------------------: |
127
|   data | path to data files to supply the data that will be passed into templates. |
128
| engine |    engine to be used for processing templates. Handlebars is the default. |
129
|    ext |                                      extension to be used for dest files. |
130
131
## Links
132
133
[Content from markdown-it](https://markdown-it.github.io/)
134
135
## Quotes
136
137
"Double quotes" and 'single quotes'