Skip to content

Commit

Permalink
Support GitHub Flavored Markdown (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
神楽坂花火 authored and domesticmouse committed Oct 22, 2019
1 parent 6c79298 commit 8f558fd
Show file tree
Hide file tree
Showing 7 changed files with 486 additions and 83 deletions.
75 changes: 63 additions & 12 deletions packages/flutter_markdown/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,67 @@ import 'package:flutter_markdown/flutter_markdown.dart';
const String _markdownData = """# Markdown Example
Markdown allows you to easily include formatted text, images, and even formatted Dart code in your app.
## Styling
Style text as _italic_, __bold__, ~~strikethrough~~, or `inline code`.
## Titles
- Use bulleted lists
- To better clarify
- Your points
Setext-style
```
This is an H1
=============
This is an H2
-------------
```
Atx-style
```
# This is an H1
## This is an H2
###### This is an H6
```
Select the valid headers:
- [x] `# hello`
- [ ] `#hello`
## Links
You can use [hyperlinks](hyperlink) in markdown
[Google's Homepage][Google]
```
[inline-style](https://www.google.com)
[reference-style][Google]
```
## Images
You can include images:
![Flutter logo](/dart-lang/site-shared/master/src/_assets/image/flutter/icon/64.png)
![Flutter logo](https://raw.githubusercontent.com/dart-lang/site-shared/master/src/_assets/image/flutter/icon/64.png)
## Tables
## Markdown widget
|Syntax |Result |
|---------------------------------------|-------------------------------------|
|`*italic 1*` |*italic 1* |
|`_italic 2_` | _italic 2_ |
|`**bold 1**` |**bold 1** |
|`__bold 2__` |__bold 2__ |
|`This is a ~~strikethrough~~` |This is a ~~strikethrough~~ |
|`***italic bold 1***` |***italic bold 1*** |
|`___italic bold 2___` |___italic bold 2___ |
|`***~~italic bold strikethrough 1~~***`|***~~italic bold strikethrough 1~~***|
|`~~***italic bold strikethrough 2***~~`|~~***italic bold strikethrough 2***~~|
This is an example of how to create your own Markdown widget:
## Styling
Style text as _italic_, __bold__, ~~strikethrough~~, or `inline code`.
Markdown(data: 'Hello _world_!');
- Use bulleted lists
- To better clarify
- Your points
## Code blocks
Formatted Dart code looks really pretty too:
Expand All @@ -43,15 +83,26 @@ void main() {
}
```
## Markdown widget
This is an example of how to create your own Markdown widget:
Markdown(data: 'Hello _world_!');
Enjoy!
[Google]: https://www.google.com/
""";

void main() {
runApp(MaterialApp(
title: "Markdown Demo",
home: Scaffold(
appBar: AppBar(title: const Text('Markdown Demo')),
body: const Markdown(data: _markdownData),
body: Markdown(
data: _markdownData,
imageDirectory: 'https://raw.githubusercontent.com',
),
),
));
}
Loading

0 comments on commit 8f558fd

Please sign in to comment.