项目
在 GitHub 查看
lwansbrough/react-native-markdown
关于
适用于 React Native 的 Markdown 组件
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文react-native-markdown
A component for rendering Markdown in React Native. Pull requests welcome.
Known issues
- Due to a bug in underlying layout engine for React Native (facebook/css-layout), this module will put your application in an infinite loop unless you patch the upstream changes from
css-layout's'Layout.candLayout.hfiles.
Getting started
npm install react-native-markdown --save
Usage
All you need is to require the react-native-markdown module and then use the
<Markdown/> tag.
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
View
} = React;
var Markdown = require('react-native-markdown');
var mdApp = React.createClass({
render: function() {
return (
<View>
<Markdown>
Some *really* basic **Markdown**.
{'\n\n'}
| # | Name | Age |{'\n'}
|---|--------|-----|{'\n'}
| 1 | John | 19 |{'\n'}
| 2 | Sally | 18 |{'\n'}
| 3 | Stream | 20 |{'\n'}
</Markdown>
</View>
);
}
});
AppRegistry.registerComponent('mdApp', () => mdApp);
Properties
style
Default style properties will be applied to the markdown. You will likely want to customize these styles, the following properties can be used to modify the rendered elements:
Note: The text inside the parentheses denotes the element type.
autolink(<Text>) - WIPblockQuote(<Text>) - WIPbr(<Text>)codeBlock(<View>) - WIPdel(<Text>)em(<Text>)heading(<Text>) - Alsoheading1throughheading6hr(<View>)image(<Image>) - Implemented but size is fixed to50x50until auto width is supported by React Native.inlineCode(<Text>)link(<Text>) - WIPlist(<View>) - AlsolistItem(<View>),listItemBullet(<Text>) andlistItemNumber(<Text>)mailto(<Text>) - WIPnewline(<Text>) - WIPparagraph(<View>)plainText(<Text>) - Use for styling text without any associated stylesstrong(<Text>)table(<View>)tableHeader(<View>)tableHeaderCell(<Text>)tableRow(<View>)tableRowCell(<View>)tableRowLast(<View>, inherits fromtableRow)text(<Text>) - Inherited by all text based elementsu(<View>)url(<Text>)view(<View>) - This is the containerViewthat the Markdown is rendered in.
探索相关项目
加载中…