All Projects → asjqkkkk → Markdown_widget

asjqkkkk / Markdown_widget

Licence: mit
📖Rendering markdown by flutter!Welcome for pr and issue.

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to Markdown widget

Gitjournal
Mobile first Note Taking integrated with Git
Stars: ✭ 1,138 (+1437.84%)
Mutual labels:  markdown
Godot Engine.file Editor
A Godot Engine addon that adds a File Editor for multiple file types editing. Create and Write plain text files, configuration files and csv files with custom visualizers and previews. Also supports file translations!
Stars: ✭ 70 (-5.41%)
Mutual labels:  markdown
Markdown Toc
Generate a markdown TOC (table of contents) for a README or any markdown files, using remarkable. Used by assemble, verb, and lots of other projects on GitHub. API and CLI.
Stars: ✭ 1,185 (+1501.35%)
Mutual labels:  markdown
Gh Card
GitHub Repository Card for Any Web Site
Stars: ✭ 1,154 (+1459.46%)
Mutual labels:  markdown
Starter Academic
🎓 Easily create a beautiful academic résumé or educational website using Hugo, GitHub, and Netlify
Stars: ✭ 1,158 (+1464.86%)
Mutual labels:  markdown
Markdown Component Loader
📑 Turn Markdown into dynamic, stateless React components
Stars: ✭ 71 (-4.05%)
Mutual labels:  markdown
Mdsh
Multi-lingual, Markdown-based Literate Programming... in run-anywhere bash
Stars: ✭ 66 (-10.81%)
Mutual labels:  markdown
Vim Pencil
Rethinking Vim as a tool for writing
Stars: ✭ 1,186 (+1502.7%)
Mutual labels:  markdown
Swift
Airbnb's Swift Style Guide.
Stars: ✭ 1,165 (+1474.32%)
Mutual labels:  markdown
Markdown To Confluence
Syncs Markdown files to Confluence
Stars: ✭ 73 (-1.35%)
Mutual labels:  markdown
Wemark
微信小程序Markdown渲染库
Stars: ✭ 1,159 (+1466.22%)
Mutual labels:  markdown
Markdeck
presentations as code - author cool slide decks, text-only, offline-ready, collaborative
Stars: ✭ 1,159 (+1466.22%)
Mutual labels:  markdown
Taskell
Command-line Kanban board/task manager with support for Trello boards and GitHub projects
Stars: ✭ 1,175 (+1487.84%)
Mutual labels:  markdown
Toc
🚩 TOC, zero configuration table of content generator for Markdown files, create table of contents from any Markdown file with ease.
Stars: ✭ 66 (-10.81%)
Mutual labels:  markdown
Enex Dump
Dump the content of .enex files, preserving attachements, some metadata and optionally converting notes to Markdown.
Stars: ✭ 73 (-1.35%)
Mutual labels:  markdown
Typora Issues
Bugs, suggestions or free discussions about the minimal markdown editor — Typora
Stars: ✭ 1,147 (+1450%)
Mutual labels:  markdown
Markdown Formatter
markdown formatter
Stars: ✭ 70 (-5.41%)
Mutual labels:  markdown
Markdownxiaoshujiang
markdownxiaoshujiang
Stars: ✭ 1,188 (+1505.41%)
Mutual labels:  markdown
Markd
Yet another markdown parser, Compliant to CommonMark specification, written in Crystal.
Stars: ✭ 73 (-1.35%)
Mutual labels:  markdown
Evermark
🐘 A command line tool for syncing markdown notes to Evernote
Stars: ✭ 72 (-2.7%)
Mutual labels:  markdown

Language:简体中文|English

📖markdown_widget

support Flutter Web pub package demo

A simple and easy-to-use markdown package created by flutter.

  • Support TOC
  • Support img and Video Tags of HTML
  • Support highlight code

🚀Getting Started

Before the introduction, you can have a try for Online Demo

🔑Useage

import 'package:flutter/material.dart';
import 'package:markdown_widget/markdown_widget.dart';

class MarkdownPage extends StatelessWidget {
  final String data;

  MarkdownPage(this.data);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        margin: EdgeInsets.all(10),
        child: buildMarkdown(),
      ),
    );
  }

  Widget buildMarkdown() => MarkdownWidget(data: data);
}

if you want to use column or other list widget, you can use MarkdownGenerator

  Widget buildMarkdown() => Column(children: MarkdownGenerator(data: data).widgets,);

🌠Dark theme

markdown_widget supports dark mode by default,you can use it by setting the markdownTheme of StyleConfig

  Widget buildMarkdown() => MarkdownWidget(
        data: data,
        controller: controller,
        styleConfig: StyleConfig(
          markdownTheme: MarkdownTheme.lightTheme
        ),
      );

you can also custom your own markdownTheme

🏞Image and Video

if you want to custom a widget, such as img and video:

  Widget buildMarkdown() => MarkdownWidget(
        data: data,
        styleConfig: StyleConfig(
          imgBuilder: (String url,attributes) {
            return Image.network(url);
          },
          videoBuilder: (String url,attributes) {
            return YourVideoWidget();
          }
        ),
      );

supported markdown samples:

<video src="https://xxx.mp4" controls="controls"/>

<img width="150" alt="018" src="https://xxx.png"/>

![demo](https://xxx)

if you want to custom other tag widgets, you need use WidgetConfig

🔗Links

you can custom link style

  Widget buildMarkdown() => MarkdownWidget(
        data: data,
        styleConfig: StyleConfig(
          pConfig: PConfig(
            linkStyle: TextStyle(...),
            onLinkTap: (url){
              _launchUrl(url);
            }
          )
        ),
      );

🍑Custom Tag

you can use custom tag like this

<avatar size="12" name="tom" />

then add custom like this

      MarkdownWidget(
        data: data,
            styleConfig: StyleConfig(
              pConfig: PConfig(
                custom: (m.Element node) {
                  ...
                  return YourCustomWidget();
                },
              ),
            ),
          ),

📜TOC

it's very easy to use TOC

  final TocController tocController = TocController();

  Widget buildTocWidget() => TocListWidget(controller: controller);

  Widget buildMarkdown() => MarkdownWidget(data: data, controller: controller);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Row(
      children: <Widget>[
        Expanded(child: buildTocWidget()),
        Expanded(child: buildMarkdown(), flex: 3)
      ],
    ));
  }

🎈Highlight code

you can config lots of theme for code

import 'package:markdown_widget/config/highlight_themes.dart' as theme;

  Widget buildMarkdown() => MarkdownWidget(
        data: data,
        styleConfig: StyleConfig(
          preConfig: PreConfig(
            language: 'java',
            theme: theme.a11yLightTheme
          )
        ),
      );

if you have any good idea or sugesstion, welcome for PR and issue

appendix

Here are the other packages used in markdown_widget

package explain
markdown parse markdown data
flutter_highlight make code highlight
html parse html data
video_player_web play video in flutter web
video_player video interface
scrollable_positioned_list for TOC function
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].