Skip to content

Commit

Permalink
~ v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatiusmb committed May 5, 2021
1 parent e777f15 commit 84d5ee6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# marqua changelog

## Unreleased
## 0.2.0

- [[`#10`](https://github.com/ignatiusmb/marqua/pull/10)]: add advanced typings for autocompletion
- [[`#10`](https://github.com/ignatiusmb/marqua/pull/10)]: export new `forge` helper
- [[`#8`](https://github.com/ignatiusmb/marqua/pull/8)]: (breaking) change `filename` to `breadcrumb`
- [[`#8`](https://github.com/ignatiusmb/marqua/pull/8)]: add recursive parsing to `traverse`
- [[`#8`](https://github.com/ignatiusmb/marqua/pull/8)]: change `filename` to `breadcrumb`
- [[`#8`](https://github.com/ignatiusmb/marqua/pull/8)]: remove `.sort` when calling `traverse`

## 0.1.2
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ const data = traverse(

Marqua is shipped with built-in types, so any code editor that supports it should give autocompletion for the arguments passed. For a more detailed information, take a look at the [source code](src/index.ts) itself or at the [types](src/internal/types.ts) directly.

The first argument of `compile` can either be `string | FileOptions`, and for `traverse` it can be `string | (DirOptions & FileOptions)`. The second argument of both functions is an optional callback (`hydrate`), when not specified or `undefined`, will return an object with `content` and all properties of `frontMatter`.
The first argument of `compile` can either be `string | FileOptions`, and for `traverse` it can be `string | DirOptions`. The second argument of both functions is an optional callback (`hydrate`), when not specified or `undefined`, will return an object with `content` and all properties of `frontMatter`.

```ts
interface FileOptions {
pathname: string;
entry: string;

/**
* minimal = false
Expand All @@ -123,8 +123,8 @@ interface FileOptions {
exclude?: Array<string>;
}

interface DirOptions {
dirname: string;
interface DirOptions extends FileOptions {
entry: string;

/**
* recurse = false
Expand Down Expand Up @@ -165,10 +165,10 @@ Extending `marker` with plugins is optional, it's already equipped with all the

```js
import { marker, compile } from 'marqua';
import Math from 'markdown-it-texmath';
import TexMath from 'markdown-it-texmath';
import KaTeX from 'katex';

marker.use(Math, {
marker.use(TexMath, {
engine: KaTeX,
delimiters: 'dollars',
});
Expand All @@ -189,9 +189,9 @@ import { compile } from 'marqua';
* with a caveat of declaring its options
* beforehand as const
*/
const opts = { entry: 'path/to/file', minimal: false } as const;
const opts = { entry: 'content/reviews/movie/your-name.md', minimal: false } as const;
// alternative declaration using forge for autocompletion
// const opts = forge.compile({ entry: 'path/to/file', minimal: false });
// const opts = forge.compile({ entry: 'content/reviews/movie/your-name.md', minimal: false });
compile<typeof opts, Post>(opts);


Expand All @@ -200,7 +200,7 @@ compile<typeof opts, Post>(opts);
*/
import { forge } from 'marqua';
compile(
{ entry: 'path/to/file', minimal: false },
{ entry: 'content/reviews/movie/your-name.md', minimal: false },
({ frontMatter, content, breadcrumb }) => {
// do stuff with frontMatter / content
// parse breadcrumb or some other stuff
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "marqua",
"author": "Ignatius Bagus",
"description": "Augmented Markdown Compiler",
"version": "0.1.2",
"version": "0.2.0",
"license": "MIT",
"type": "module",
"main": "index.js",
Expand Down

0 comments on commit 84d5ee6

Please sign in to comment.