https://github.com/siaikin/ngr2-markdown
可拖放的markdown编辑器
https://github.com/siaikin/ngr2-markdown
angular markdown markdown-to-html
Last synced: 4 months ago
JSON representation
可拖放的markdown编辑器
- Host: GitHub
- URL: https://github.com/siaikin/ngr2-markdown
- Owner: siaikin
- License: gpl-3.0
- Created: 2019-02-28T10:14:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-16T09:36:27.000Z (about 6 years ago)
- Last Synced: 2025-03-06T18:41:29.095Z (4 months ago)
- Topics: angular, markdown, markdown-to-html
- Language: TypeScript
- Homepage: https://abc1310054026.github.io/ngr2-markdown/
- Size: 10.3 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ngr2Markdown
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.2.1.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Install
```text
npm install --save ngr2-markdown
```
## Usage
在模块中导入`Ngr2MarkdownModule`
```diff
+ import { Ngr2MarkdownModule } from 'ngr2-markdown';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
+ Ngr2MarkdownModule
],
providers: [],
bootstrap: [AppComponent]
})
```
在HTML模板中使用
```angular2html```
## 参数说明
### options
| name | value | default | description |
| --- | --- | --- | --- |
| TOC | `true`/`false`: boolean | `true` | 打开/关闭目录 |
| direction | `left`/`right`: string | `left` | 目录在内容左边/右边 |
| bodyClassName | string | `markdown-body` | 用于给内容添加样式 |
| height | string | `800px` | 内容高度, 可以使用`800px/vh/cm`等mdn标准单位以及使用calc()计算 |
| themeColor | string | `#3f51a5` | 目录中高亮标题的颜色 |
### markdown
| name | value | description |
| --- | --- | --- |
| markdown | string | markdown原始文本 |