Skip to content

Add improvements to the README document #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[简体中文](./README-CN.md)

This is a webpack laoder that can load markdown file. With proper configuration, the loader can convert markdown file content into `vue sfc` component object or into html string, so it can be chained with vue-loader or html-loader.
This is a webpack loader that can load markdown files. With proper configuration, the loader can convert markdown file content into `vue sfc` component object or into html string, so it can be chained with vue-loader or html-loader.

The project is inspired by [vuepress](https://github.com/vuejs/vuepress), we reused most of its source code and made some improvements to allow it being used in non-vuepress project.

Expand All @@ -16,9 +16,9 @@ If you are interested in Vuepress, please visit [vuepress](https://github.com/vu
npm i @tianyong90/vue-markdown-loader -S
```

## Useage
## Usage

### sue along with vue-loader
### Use along with vue-loader

Generally, it is recommended to be used with `vue-loader`

Expand Down Expand Up @@ -80,7 +80,7 @@ export default {
</style>
```

### along with html-loader
### Use along with html-loader

`vue-markdown-loader` can parse markdown and return html string which can be loaded by `html-loader`

Expand Down Expand Up @@ -126,13 +126,13 @@ Hello:

![加载后的 html](./images/md-html-string.png)

### use it alone
### Use it alone

`vue-markdown-loader` can parse markdown file and return an object whick contains hteml and frontmattter data of the file.
`vue-markdown-loader` can parse markdown file and return an object which contains html and frontmattter data of the file.

1. configuration

add rule for .md file in webpack.config.js
add rule for `.md` file in webpack.config.js

```js
module: {
Expand Down Expand Up @@ -166,7 +166,7 @@ import Hello from 'hello.md'
console.log(Hello)
```

the variable `Html` contains 2 property, `attributes`(frontmatter data) and `html`(html content), looks lick below:
the variable `Html` contains 2 property, `attributes`(frontmatter data) and `html`(html content), looks like below:

![加载后的对象](./images/md-raw-object.png)

Expand Down