Browse Source

Merge pull request #305 from brianr/tutorial-explain-showdown

Tutorial: show how to add showdown.js
main
Paul O’Shannessy 11 years ago
parent
commit
1d0a9ae884
  1. 12
      docs/tutorial.md

12
docs/tutorial.md

@ -203,7 +203,17 @@ By surrounding a JavaScript expression in braces inside JSX (as either an attrib
Markdown is a simple way to format your text inline. For example, surrounding text with asterisks will make it emphasized. Markdown is a simple way to format your text inline. For example, surrounding text with asterisks will make it emphasized.
First, add the third-party **Showdown** library to your application. This is a JavaScript library which takes Markdown text and converts it to raw HTML. This requires a script tag in your head (which we have already included in the React playground). First, add the third-party **Showdown** library to your application. This is a JavaScript library which takes Markdown text and converts it to raw HTML. This requires a script tag in your head (which we have already included in the React playground):
```html{6}
<!-- template.html -->
<head>
<title>Hello React</title>
<script src="http://fb.me/react-{{site.react_version}}.js"></script>
<script src="http://fb.me/JSXTransformer-{{site.react_version}}.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/showdown/0.3.1/showdown.min.js"></script>
</head>
```
Next, let's convert the comment text to Markdown and output it: Next, let's convert the comment text to Markdown and output it:

Loading…
Cancel
Save