Published markdown

This commit is contained in:
thomashii 2021-06-21 14:33:18 +08:00
parent 0cccae9cd4
commit 3906c64fc6
6 changed files with 38 additions and 37 deletions

View file

@ -1,6 +1,10 @@
# 3.0.0
# Change Log
## 3.0.0
* Migrated to support Dart SDK 2.12.x NNBD
# 2.0.0
## 2.0.0
* Angel 2 + Dart 2 updates.
* Use `package:file`.
* Use `package:file`.

View file

@ -1,24 +1,28 @@
# markdown
[![Pub](https://img.shields.io/pub/v/angel_markdown.svg)](https://pub.dartlang.org/packages/angel_markdown)
# Angel3 Markdown
Markdown view generator for Angel.
[![version](https://img.shields.io/badge/pub-v3.0.0-brightgreen)](https://pub.dartlang.org/packages/angel3_markdown)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
With this plug-in, you can easily serve
static sites without doing more than writing simple Markdown. Thus, it is a friendly
choice for writing API documentation or other tedious HTML-writing tasks.
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/markdown/LICENSE)
Markdown view generator for Angel3.
With this plug-in, you can easily serve static sites without doing more than writing simple Markdown. Thus, it is a friendly choice for writing API documentation or other tedious HTML-writing tasks.
## Installation
# Installation
In your `pubspec.yaml`:
```yaml
dependencies:
angel_framework: ^1.0.0
angel_markdown: ^1.0.0
angel3_framework: ^4.0.0
angel3_markdown: ^3.0.0
```
# Usage
It's very straightforward to configure an Angel server to use Markdown.
Keep in mind to use `package:file` instead of `dart:io`:
## Usage
It's very straightforward to configure an Angel server to use Markdown. Keep in mind to use `package:file` instead of `dart:io`:
```dart
configureServer(Angel app) async {
@ -40,11 +44,12 @@ configureServer(Angel app) async {
}
```
`package:angel_markdown` by default searches for files with a `.md` extension; however,
`package:angel3_markdown` by default searches for files with a `.md` extension; however,
you can easily override this.
## Interpolation
`angel_markdown` can interpolate the values of data from `locals` before building the Markdown.
`angel3_markdown` can interpolate the values of data from `locals` before building the Markdown.
For example, with the following template `species.md`:
@ -66,6 +71,7 @@ requestHandler(ResponseContext res) {
To disable interpolation for a single bracket, prefix it with an `@`, ex: `@{{raw | not_interpolated | angular}}`.
## Templates
Markdown is frequently used to build the *content* of sites, but not the templates.
You might want to wrap the content of pages in a custom template to apply pretty
CSS and JS, etc:
@ -95,5 +101,6 @@ The `template` function will have access to whatever values were passed to the r
or an empty `Map`.
## Enhancing Markdown
You can pass an `extensionSet` to add additional features to the Markdown renderer.
By default, this plug-in configures it to enable Github-flavored Markdown.
By default, this plug-in configures it to enable Github-flavored Markdown.

View file

@ -1,8 +1,8 @@
import 'dart:async';
import 'dart:io';
import 'package:angel_framework/angel_framework.dart';
import 'package:angel_framework/http.dart';
import 'package:angel_markdown/angel_markdown.dart';
import 'package:angel3_framework/angel3_framework.dart';
import 'package:angel3_framework/http.dart';
import 'package:angel3_markdown/angel3_markdown.dart';
import 'package:file/local.dart';
void main() async {

View file

@ -1,6 +1,6 @@
import 'dart:async';
import 'dart:mirrors';
import 'package:angel_framework/angel_framework.dart';
import 'package:angel3_framework/angel3_framework.dart';
import 'package:file/file.dart';
import 'package:markdown/markdown.dart';

View file

@ -1,23 +1,14 @@
name: angel_markdown
name: angel3_markdown
version: 3.0.0
description: Angel Markdown view generator. Write static sites, with no build step.
homepage: https://github.com/angel-dart/markdown
publish_to: none
description: Angel3 Markdown view generator. Write static sites, with no build step.
homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/markdown
environment:
sdk: ">=2.10.0 <3.0.0"
dependencies:
angel_framework:
git:
url: https://github.com/dukefirehawk/angel.git
ref: sdk-2.12.x_nnbd
path: packages/framework
angel3_framework: ^4.0.0
file: ^6.1.2
markdown: ^4.0.0
dev_dependencies:
angel_test:
git:
url: https://github.com/dukefirehawk/angel.git
ref: sdk-2.12.x_nnbd
path: packages/test
angel3_test: ^4.0.0
pedantic: ^1.11.0
test: ^1.17.0

View file

@ -2,7 +2,6 @@ name: angel3_sembast
version: 2.0.0
description: A sembast-powered CRUD services for the Angel3 framework.
homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/sembast
publish_to: none
environment:
sdk: '>=2.12.0 <3.0.0'
dependencies: