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

feat: mdv syntax #318

Merged
merged 19 commits into from
Jun 2, 2021
Merged

feat: mdv syntax #318

merged 19 commits into from
Jun 2, 2021

Conversation

farnabaz
Copy link
Collaborator

@farnabaz farnabaz commented May 20, 2021

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

  • Remove the need for {yml}
  • Split slots and props using ---
  • Nest : in the opposite order (::: => :::: => ::::: instead of ::::: => :::: => :::)
  • There is an issue with Yaml array (Markdown list) and the sections separator.
:::someblock
data:
 - item 1
 - item 2
---
content
:::
  • Support indention for nested blocks
:::alert
type: info
---
    Nested Blocks with data

    ::::alert
    type: success
    ---
    Yaay
    ::::
:::
  • Support multiple slots (named slots other than default)
  • Simplify markdown slots usages, <Makrdown> component updated to detect parent slot and render Content
  • Simplify block usages with double colons ::
  • Adding extra colons to nested block should be completely optional
<Markdown slot="title" />

Resolves #314

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes (if not applicable, please state why)

@vercel
Copy link

vercel bot commented May 20, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nuxtlabs/docus/FsypZ2LkYzdVZ6yXN7PQM2gymKCd
✅ Preview: https://docus-git-feat-new-syntax-nuxtlabs.vercel.app

@farnabaz farnabaz marked this pull request as ready for review May 27, 2021 07:22
@farnabaz farnabaz requested review from Tahul and atinux May 27, 2021 07:22
@atinux
Copy link
Contributor

atinux commented May 28, 2021

For context:
Screenshot 2021-05-28 at 12 19 05@2x

@farnabaz
Copy link
Collaborator Author

Updated with simpler syntax that we discussed @atinux

Sadly, Scoped slots not working on SSR.
The issue is not related to Docus nor Nuxt. There is a similar open issue on Nuxt Components nuxt/components#164

@pi0 does resolve this issue in vuejs/vue#11963 and we should wait for upstream ([email protected])

@atinux
Copy link
Contributor

atinux commented May 28, 2021

What are the components with scoped slots we have?

Copy link
Collaborator Author

For now the issue applies to BlockHero, maybe we should revert its implementation to use props

@atinux
Copy link
Contributor

atinux commented May 29, 2021

When looking at it is still uses props, do you have the link to the one using scoped slots?

Copy link
Contributor

atinux commented May 30, 2021

Any ETA for Vue release?

EDIT: i just asked Evan, will comment when he answered

Copy link
Contributor

atinux commented May 30, 2021

He said then can do a quick release on Monday 👀

Copy link
Contributor

@Tahul Tahul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation looks good to me.

Only comments refers to code style.

I think for such features, we definitely need comments. 😄

If you are not comfortable with writing comments I can totally understand, at least commenting what each function does could be really interesting for long term maintenance.

Obviously the upcoming usage of tests into Docus will also help with that but I think this needs to become a standard that we comment functions, even when only exposed internally.

Other than these little comments about code style, I think you did an amazing job @farnabaz and that you are paving the way among something bigger than we can understand yet! 😄

Can't wait to see this syntax used in our upcoming editor. 🥲

👏 👏 👏

@Tahul Tahul merged commit 4fb1565 into main Jun 2, 2021
@Tahul Tahul deleted the feat/new-syntax branch June 2, 2021 18:38
@atinux
Copy link
Contributor

atinux commented Jun 2, 2021

I complete @Tahul on it, amazing work done for a powerful future!

Could we use something like JS/TS docs comments as a standard + inline comment in function if necessary to explain some logic?

@Tahul
Copy link
Contributor

Tahul commented Jun 2, 2021

Yeah, TSDoc is basically JSDoc without the need of specifying parameters as it is filled by typings. 😄

We basically need to comment every function, I'll help on that obviously. 😄

If I need to add a commit in each PR to fix typos and any language problem, that will be a pleasure for me.

🙏

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

Successfully merging this pull request may close these issues.

feat: mdv syntax
3 participants