Skip to content

Updated embed to strip YAML front matter fixes #1129 #1148

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

Merged
merged 1 commit into from
May 7, 2020

Conversation

sytone
Copy link
Contributor

@sytone sytone commented Apr 27, 2020

Summary

This fixes #1129 where embed was pulling through the YAML header when rendering pages as an embed. I did not want to pull the YAML parser by default. There are no rendering hooks for embed so I added a flag to check to see if the front matter plugin is installed and if it is use it to strip the content before returning the txt to render to the page.

FYI: I am not a JavaScript developer. :)

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of default theme, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)

You have tested in the following browsers: (Providing a detailed version will be better.)

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated
  • Related tests have been updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:


  • DO NOT include files inside lib directory.

Update embeded files documentation
Add example with front matter
Add various comments I used to understand code
Updated front matter to have installed flag
Added function to parse front matter
Added intercept to remove front matter for embed
@sytone sytone changed the title Updated embed to strip YAML front matter Updated embed to strip YAML front matter fixes #1129 Apr 27, 2020
@anikethsaha
Copy link
Member

thanks for the PR. It will be reviewed soon 👍

@anikethsaha anikethsaha requested a review from a team April 28, 2020 12:23
Copy link
Member

@Koooooo-7 Koooooo-7 left a comment

Choose a reason for hiding this comment

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

After test, it works that skipped the YAML header. 👍

@sytone
Copy link
Contributor Author

sytone commented Apr 30, 2020

Any other questions on this one? Also if this goes into develop what is the propagation to master/release? I am considering pulling develop locally building and referencing that locally until pushed if it will take a while.

This is an awesome system. I'm am building/using a personal journal system out of it as I write notes and journal entries in markdown to start with. Just have a simple powershell web server running it all.

@anikethsaha
Copy link
Member

I think its good. I will do a final review this weekend and will do a release by Monday 👍

@sytone
Copy link
Contributor Author

sytone commented May 4, 2020

Just following up to see if there were any issues.

@anikethsaha anikethsaha merged commit 22030f4 into docsifyjs:develop May 7, 2020
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.

Markdown include not stripping YAML front matter
3 participants