You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We already have a profusion of languages (html, js, css, md), which are intertwined in a single document (not even counting data loaders or tex cells).
For front-matter we adopted yaml since it's the default in many static site generators, but it means that people have to learn yet another markup language, look up yet another reference. (I've also noticed that yaml in all its easiness is often a bit perplexing to users.) It's not a huge deal, since it's a very simple format, but would it make sense to remove it and express the front matter in javascript / typescript / json instead?
Another argument in favor of the change is that the config file must be js or ts, and shares its structure with the front-matter.
Keeping in mind that this informs the server, not the client, it would seem difficult to write it like this:
---js
const toc = false;
const title = "Welcome";
---
although, if we want to support server-side rendering of some elements (like tex#150), we'll need a way to specify that.
But there are other possibilities:
```js SSR
constconfig= {toc:false, title:"Welcome"};
```
or a config flag:
```js config
{toc:false, title:"Welcome"}
```
which accepts JSON but is functionally equivalent to
This is an interesting idea but not one that I think we should pursue in the near future. I think YAML front matter is fine as-is and there’s enough precedent that we don’t need to reinvent how it works. I agree it’s another thing to explain, but I don’t expect there to be much complexity in our front matter configuration — I suggest we try to keep the configuration as small as possible.
Closing. The suggestion here was to remove yaml front-matter and adopt js instead. Supporting both would be a different issue (and I don't think we would want that).
We already have a profusion of languages (html, js, css, md), which are intertwined in a single document (not even counting data loaders or tex cells).
For front-matter we adopted yaml since it's the default in many static site generators, but it means that people have to learn yet another markup language, look up yet another reference. (I've also noticed that yaml in all its easiness is often a bit perplexing to users.) It's not a huge deal, since it's a very simple format, but would it make sense to remove it and express the front matter in javascript / typescript / json instead?
Another argument in favor of the change is that the config file must be js or ts, and shares its structure with the front-matter.
Keeping in mind that this informs the server, not the client, it would seem difficult to write it like this:
---js const toc = false; const title = "Welcome"; ---
although, if we want to support server-side rendering of some elements (like
tex
#150), we'll need a way to specify that.But there are other possibilities:
or a config flag:
which accepts JSON but is functionally equivalent to
The text was updated successfully, but these errors were encountered: