|
| 1 | +--- |
| 2 | +sidebar_position: 4 |
| 3 | +--- |
| 4 | + |
| 5 | +# Markdown Features |
| 6 | + |
| 7 | +Out docs page uses **Docusaurus**. Docusaurus supports **[Markdown](https://daringfireball.net/projects/markdown/syntax)** and a few **additional features**. |
| 8 | + |
| 9 | +## Using links |
| 10 | + |
| 11 | +Regular Markdown links are supported, using url paths or relative file paths. |
| 12 | + |
| 13 | +```md |
| 14 | +Returns a [Student](../models/student) object. |
| 15 | +``` |
| 16 | + |
| 17 | +Link to [Student](../models/student) model. |
| 18 | + |
| 19 | +## Images |
| 20 | + |
| 21 | +Regular Markdown images are supported. |
| 22 | + |
| 23 | +You can use absolute paths to reference images in the static directory (`static/img/docusaurus.png`): |
| 24 | + |
| 25 | +```md |
| 26 | + |
| 27 | +``` |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | +You can reference images relative to the current file as well. This is particularly useful to colocate images close to the Markdown files using them: |
| 32 | + |
| 33 | +```md |
| 34 | + |
| 35 | +``` |
| 36 | + |
| 37 | +## Code Blocks |
| 38 | + |
| 39 | +Markdown code blocks are supported with Syntax highlighting. |
| 40 | + |
| 41 | + ```jsx title="src/components/HelloDocusaurus.js" |
| 42 | + function HelloDocusaurus() { |
| 43 | + return ( |
| 44 | + <h1>Hello, Docusaurus!</h1> |
| 45 | + ) |
| 46 | + } |
| 47 | + ``` |
| 48 | + |
| 49 | +```jsx title="src/components/HelloDocusaurus.js" |
| 50 | +function HelloDocusaurus() { |
| 51 | + return <h1>Hello, Docusaurus!</h1>; |
| 52 | +} |
| 53 | +``` |
| 54 | + |
| 55 | +## Admonitions |
| 56 | + |
| 57 | +Docusaurus has a special syntax to create admonitions and callouts: |
| 58 | + |
| 59 | + :::tip My tip |
| 60 | + |
| 61 | + Use this awesome feature option |
| 62 | + |
| 63 | + ::: |
| 64 | + |
| 65 | + :::danger Take care |
| 66 | + |
| 67 | + This action is dangerous |
| 68 | + |
| 69 | + ::: |
| 70 | + |
| 71 | +:::tip My tip |
| 72 | + |
| 73 | +Use this awesome feature option |
| 74 | + |
| 75 | +::: |
| 76 | + |
| 77 | +:::danger Take care |
| 78 | + |
| 79 | +This action is dangerous |
| 80 | + |
| 81 | +::: |
| 82 | + |
| 83 | +## MDX and React Components |
| 84 | + |
| 85 | +[MDX](https://mdxjs.com/) can make your documentation more **interactive** and allows using any **React components inside Markdown**: |
| 86 | + |
| 87 | +```jsx |
| 88 | +export const Highlight = ({children, color}) => ( |
| 89 | + <span |
| 90 | + style={{ |
| 91 | + backgroundColor: color, |
| 92 | + borderRadius: '20px', |
| 93 | + color: '#fff', |
| 94 | + padding: '10px', |
| 95 | + cursor: 'pointer', |
| 96 | + }} |
| 97 | + onClick={() => { |
| 98 | + alert(`You clicked the color ${color} with label ${children}`) |
| 99 | + }}> |
| 100 | + {children} |
| 101 | + </span> |
| 102 | +); |
| 103 | + |
| 104 | +This is <Highlight color="#25c2a0">Docusaurus green</Highlight> ! |
| 105 | + |
| 106 | +This is <Highlight color="#1877F2">Facebook blue</Highlight> ! |
| 107 | +``` |
| 108 | + |
| 109 | +export const Highlight = ({children, color}) => ( |
| 110 | + <span |
| 111 | + style={{ |
| 112 | + backgroundColor: color, |
| 113 | + borderRadius: '20px', |
| 114 | + color: '#fff', |
| 115 | + padding: '10px', |
| 116 | + cursor: 'pointer', |
| 117 | + }} |
| 118 | + onClick={() => { |
| 119 | + alert(`You clicked the color ${color} with label ${children}`); |
| 120 | + }}> |
| 121 | + {children} |
| 122 | + </span> |
| 123 | +); |
| 124 | + |
| 125 | +This is <Highlight color="#25c2a0">Docusaurus green</Highlight> ! |
| 126 | + |
| 127 | +This is <Highlight color="#1877F2">Facebook blue</Highlight> ! |
0 commit comments