Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mark-when/parser
Markwhen parser
https://github.com/mark-when/parser
Last synced: 3 months ago
JSON representation
Markwhen parser
- Host: GitHub
- URL: https://github.com/mark-when/parser
- Owner: mark-when
- License: mit
- Created: 2022-07-06T01:59:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-27T02:05:16.000Z (3 months ago)
- Last Synced: 2024-07-27T23:31:25.765Z (3 months ago)
- Language: TypeScript
- Size: 535 KB
- Stars: 24
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - mark-when/parser - Markwhen parser (others)
README
# Markwhen parser
Parse markwhen documents. Outputs a list of events given plain text.
See [markwhen.com](https://markwhen.com), [the documentation](https://docs.markwhen.com), and the [changelog](./CHANGELOG.md).
```js
import { parse } from "@markwhen/parser";const markwhen = parse(`
title: this is my title
timezone: America/New_York#neat:
color: blue
timezone: -32022: event
group My Group #neat
2024: another event`);
console.log(markwhen);
/*
output:
{
timelines: [
{
events: [Array],
tags: {},
ids: {},
ranges: [Array],
foldables: {},
metadata: [Object],
header: {
title: "this is my title",
timezone: "America/New_York"
// Note that for compatability with the embedded yaml parser
// as well as how markwhen uses comments (two slashes),
// entries in the header that start with a hash `#` will
// replace the hash with a right paren `)`
)neat: {
color: "blue",
timezone: -3
}
}
}
]
}
*/
```