-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
feat: The timing of the doneEach hook call for the cover
#2427
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
Open
YiiGuxing
wants to merge
16
commits into
docsifyjs:develop
Choose a base branch
from
YiiGuxing:feat-cover-lifecycle
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+229
−136
Open
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
bd5f879
feat: The timing of the `doneEach` hook call for the cover
YiiGuxing bcd1090
Merge branch 'develop' into feat-cover-lifecycle
jhildenbiddle 117eb08
Merge branch 'develop' into feat-cover-lifecycle
jhildenbiddle f7666ca
Merge branch 'develop' into feat-cover-lifecycle
YiiGuxing dea1229
test: Add test cases for the `doneEach` hook
YiiGuxing 56c922f
style: Fix eslint code style
YiiGuxing b2a9c06
Merge branch 'develop' into feat-cover-lifecycle
Koooooo-7 a3c3359
Merge branch 'develop' into feat-cover-lifecycle
sy-records 837d04a
fix(test): fix HTML logging
YiiGuxing ec48f93
feat(test): add dynamic and asynchronous content provision support fo…
YiiGuxing 7cc7cdf
feat: cover page supports embedding external files
YiiGuxing 0333d96
test: disable logging
YiiGuxing e796604
Merge branch 'develop' into feat-cover-lifecycle
jhildenbiddle 2c55a47
Merge branch 'develop' into feat-cover-lifecycle
trusktr 9dd2a67
fix type errors
trusktr 1526a78
replace old method with new method
trusktr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import docsifyInit from '../helpers/docsify-init.js'; | ||
| import { test, expect } from './fixtures/docsify-init-fixture.js'; | ||
|
|
||
| test.describe('Embed files', () => { | ||
| const routes = { | ||
| 'fragment.md': '## Fragment', | ||
| }; | ||
|
|
||
| test('embed into homepage', async ({ page }) => { | ||
| await docsifyInit({ | ||
| routes, | ||
| markdown: { | ||
| homepage: "# Hello World\n\n[fragment](fragment.md ':include')", | ||
| }, | ||
| // _logHTML: {}, | ||
| }); | ||
|
|
||
| await expect(page.locator('#main')).toContainText('Fragment'); | ||
| }); | ||
|
|
||
| test('embed into cover', async ({ page }) => { | ||
| await docsifyInit({ | ||
| routes, | ||
| markdown: { | ||
| homepage: '# Hello World', | ||
| coverpage: "# Cover\n\n[fragment](fragment.md ':include')", | ||
| }, | ||
| // _logHTML: {}, | ||
| }); | ||
|
|
||
| await expect(page.locator('.cover-main')).toContainText('Fragment'); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YiiGuxing I think we should update the hooks in a backwards compatible way, such that the hook can somehow see which content it is called for. For example it can see string values like "cover", "sidebar", etc. The default (right now no sort of value to determine the target of the hook) would work the same as before for anyone who hasn't updated their plugin code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ultimate result should be, that all markdown files are handled the same, regardless where in the app they are rendered (cover, sidebar, nav, etc) but any plugin can easily decide which to handle.
Something like
or similar.