Replies: 2 comments 1 reply
-
I agree, this should be a feature request — or maybe three feature requests, considering:
|
Beta Was this translation helpful? Give feedback.
1 reply
-
One of the nice things about Framework is that it is relatively easy to load new libraries. You can load the file attachment as text, and then parse it with an off-the-shelf yaml parser:
# Hello, yaml!
```js
import yaml from "npm:yaml";
```
```js
const yamlText = await FileAttachment("./data.yml").text();
const data = yaml.parse(yamlText);
```
```js
display(data);
``` Of course, this doesn't get you the front matter. But it does let you load arbitrary yaml. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm considering putting some data there that I will use to drive HTML generation on the page. The nice thing about the front matter is that it's YAML, while loading yaml from a file isn't supported directly (as
FileAttachment('data.yml').yaml()
). I really don't want to maintain the data in any other syntax.Beta Was this translation helpful? Give feedback.
All reactions