Skip to content
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

Feature request: rendering of YAML header as table #67

Closed
akharrou opened this issue May 11, 2021 · 4 comments
Closed

Feature request: rendering of YAML header as table #67

akharrou opened this issue May 11, 2021 · 4 comments

Comments

@akharrou
Copy link

akharrou commented May 11, 2021

Hello,

Would it be possible to have an option to render the YAML header part as a table, maybe separated with a horizontal rule (line) ? Or maybe you can come up with even better :D

E.g.:

YAML header:

Title: My Title
Author: Steve jobs
Date: Tuesday, March 23, 2021
Abstract: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quisque id diam vel quam elementum pulvinar. Orci nulla pellentesque dignissim enim. Magna fringilla urna porttitor rhoncus dolor purus. Mollis nunc sed id semper risus in hendrerit gravida rutrum."

Becomes (equivalent markdown rendering):

|||
|-|-|
**Title** | My Title
**Author** | Steve jobs
**Date** | Tuesday, March 23, 2021
**Abstract** | "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quisque id diam vel quam elementum pulvinar. Orci nulla pellentesque dignissim enim. Magna fringilla urna porttitor rhoncus dolor purus. Mollis nunc sed id semper risus in hendrerit gravida rutrum."

Renders as:
image


I feel this is much more readable. Thank you so much for your extension !

@sbarex
Copy link
Owner

sbarex commented May 12, 2021

It actually looks better that way, but this change takes more work to do.

At the moment when a YAML header is detected, it is simply encapsulated inside a fenced code block ( ```yaml).

This change instead requires parsing the YAML header and then formatting it as a table. It is possible, but it takes some time to do it...

@sbarex
Copy link
Owner

sbarex commented May 31, 2021

Hi @akharrou, I'm implementing this feature.

I have a question for you: Does the text in the yaml header need to be shown as plain text or can it contain markdown formatting to interpret?

@akharrou
Copy link
Author

akharrou commented Jun 2, 2021

Hi @akharrou, I'm implementing this feature.

I have a question for you: Does the text in the yaml header need to be shown as plain text or can it contain markdown formatting to interpret?

I think it's just plaintext.

@sbarex
Copy link
Owner

sbarex commented Jun 2, 2021

On the release 1.0.1 I have added the support for YAML inside a table. Also nested tables are supported.

@sbarex sbarex closed this as completed Oct 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants