This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 277
/
TOPIC_TEMPLATE
222 lines (151 loc) · 6.27 KB
/
TOPIC_TEMPLATE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
---
title: Basic template
---
Introductory text that gives an overview of the topic you will be writing about.
The purpose of this page is to provide you with a pre-formatted template and useful [markdown](https://glossary.magento.com/markdown) references to help you get started writing docs.
You can start by editing the local version of this file using markdown language (and [HTML](https://glossary.magento.com/html) where needed). Then, create a pull request (PR) to have your contribution reviewed by the Docs team.
## Metadata parameters
Add the following metadata parameters at the top of your page. We use YAML for the metadata in front matter. We use this data when generating the DevDocs for the following:
Parameter | Description
--- | ---
`title:` | The title of the page.
`group:` | Optional. The table of contents this file belongs to if it does not follow the default for its directory. The group maps to files located in `_data/toc/`. Only add the name of the file without the extension. For example, if the group of the file is `group: getting-started`, it points to the table of contents defined in `_data/toc/getting-started.yml`.
`redirect_from` | Optional. Add a list of other pages in the User Guide that should redirect to this page.
`ee_only:` | Optional. If set to `true`, graphics/cues display on the page indicating it applies to the Magento Commerce product and is not included with Open Source installations.
`b2b_only:` | Optional. If set to `true`, graphics/cues display on the page indicating it applies to the Magento Commerce product with the B2B extension installed and configured.
If you need help with metadata, we can assist!
## Basic markdown syntax {#basic}
Below are some basic examples of what you can do with markdown.
### Text effects {#text}
| Example | Output |
| ----------------- | ------------ |
|`_emphasis_` | _emphasis_ |
|`**bold**` | **bold** |
|`` `inline code` ``| `inline code`|
Use code fences to create code blocks. For extensive examples of adding code samples, see [Code blocks](#code-blocks).
```text
//This is a code block!
print "Hello World!";
```
For more examples of basic markdown please follow this [link](https://daringfireball.net/projects/markdown/syntax){:target="_blank"}.
### Lists {#lists}
Lists are useful for organizing and displaying related items. Below are examples of a bulleted list and an ordered list.
#### Bulleted list
```markdown
- List Item 1
- List Item 2
- List Item 3
```
Output:
- List Item 1
- List Item 2
- List Item 3
#### Ordered list
```markdown
1. First Step
1. Second Step
1. Third Step
```
Output:
1. First Step
1. Second Step
1. Third Step
### Images {#images}
Add any images you may need to the [`src/images`](https://github.com/magento/merchdocs/tree/master/src/images) directory.
When the image is added, you can use it in your documentation:
Example: `![Image example]({% link magento/assets/commerce-account-login.png %})`
Output:
![Image example]({{ site.baseurl }}/src/magento/assets/commerce-account-login.png)
You can even scale the image if it is too large:
Example: `![Scaled Image]({{ site.baseurl }}/src/magento/assets/commerce-account-login.png){:width="446"}`
Output:
![Scaled Image Example]({{ site.baseurl }}/src/magento/assets/commerce-account-login.png){:width="446"}
### Tables {#tables}
Tables can be useful for displaying different kinds of data in an organized way.
Example:
```markdown
<!-- Basic Markdown Table Syntax -->
| Column Heading | Column Heading | Column Heading |
|----------------|----------------|----------------|
| Data 1 | Data 2 | Data 3 |
| Data 4 | Data 5 | |
| Data 6 | | |
```
Output:
| Column Heading | Column Heading | Column Heading |
|----------------|----------------|----------------|
| Data 1 | Data 2 | Data 3 |
| Data 4 | Data 5 | |
| Data 6 | | |
You can read more about table syntax [here](http://kramdown.gettalong.org/syntax.html#tables){:target="_blank"}.
## Advanced syntax {#advanced}
### Callout Messages {#callouts}
Use these messages to highlight or bring attention to a piece of information.
#### Notes
```
{%raw%}
{:.bs-callout-info}
This is a note callout. You can use these to provide important information on a topic.
{%endraw%}
```
Output:
{:.bs-callout-info}
This is a note callout. You can use these to provide important information on a topic.
#### Warnings
```
{%raw%}
{:.bs-callout-warning}
This is a warning callout. This can be used to convey important information to the reader.
{%endraw%}
```
Output:
{:.bs-callout-warning}
This is a warning callout. This can be used to convey important information to the reader.
#### Tips
```
{%raw%}
{:.bs-callout-tip}
This is a tip callout. These can be used to provide useful tips or interesting facts on a topic.
{%endraw%}
```
Output:
{:.bs-callout-tip}
This is a tip callout. These can be used to provide useful tips or interesting facts on a topic.
### Collapsible content {#collapsible}
You can use the collapsible content tag for large code samples in your content. Any content in a collapse is blocked from searching on page.
{:.bs-callout-info}
The `{%raw%}{% collapsible %}{%endraw%}` tag must be preceded by a blank line.
Example:
```liquid
{%raw%}
{% collapsible This is the title %}
Markdown content goes in this area.
{% endcollapsible %}
{%endraw%}
```
*Output:*
{% collapsible This is the title %}
Markdown content goes in this area.
{% endcollapsible %}
### Code blocks {#code-blocks}
Code blocks can also be defined using [Rouge formatting](http://rouge.jneen.net/){:target="_blank"}. View the .md file of this template for examples.
For inline code, surround the content with single backticks: `` `example` ``.
For blocks of code, surround content with three backticks and a [supported language](https://GitHub.com/jneen/rouge/wiki/List-of-supported-languages-and-lexers){:target="_blank"}.
Example:
```text
<div class="container">
<h4 class="title">Title</h4>
<div class="content">
<p>Paragraph content.</p>
</div>
</div>
```
Output:
```html
<div class="container">
<h4 class="title">Title</h4>
<div class="content">
<p>Paragraph content.</p>
</div>
</div>
```