You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
❗ Current head c198553 differs from pull request most recent head fe5407e. Consider uploading reports for the commit fe5407e to get more accurate results
Hello! I'm trying to implement this but I'm having trouble with indexing the generated HTML pages using the methods provided by the Plugins, so any tips or comments to point me in the right direction would be greatly appreciated!
I'm also investigating adding pagefind as a dependency, adding it to the current build process (index.ts) so that an index can be created after the site is built. However, I'm having issues importing the NodeJS API package. Currently Pagefind's npm interface only supports being used as an ESM module via import, rather than as a CJS package through require. So import * as pagefind from 'pagefind' would be acceptable, but const pagefind = require('pagefind') would result in the following error:
message=No "exports" main defined in /Users/wangjingting/markbind/node_modules/pagefind/package.json, stack=Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /Users/wangjingting/markbind/node_modules/pagefind/package.json
at exportsNotFound (node:internal/modules/esm/resolve:303:10)
at packageExportsResolve (node:internal/modules/esm/resolve:593:13)
at resolveExports (node:internal/modules/cjs/loader:591:36)
at Module._findPath (node:internal/modules/cjs/loader:668:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at /Users/wangjingting/markbind/packages/core/src/Site/index.js:509:92, code=ERR_PACKAGE_PATH_NOT_EXPORTED
This issue can be resolved using async import, and I've used it in Site.ts to import the functions with no issue. However, the generated Site.js file would then still convert the import to require('pagefind'), which results in the import issue.
Hello! I'm trying to implement this but I'm having trouble with indexing the generated HTML pages using the methods provided by the Plugins, so any tips or comments to point me in the right direction would be greatly appreciated!
Ok not too sure about the dependency issue but you could try using postRender instead of processNode? The functionality might be similiar to that in the Mermaid PR #2475
Hello! I'm trying to implement this but I'm having trouble with indexing the generated HTML pages using the methods provided by the Plugins, so any tips or comments to point me in the right direction would be greatly appreciated!
I'm also investigating adding pagefind as a dependency, adding it to the current build process (index.ts) so that an index can be created after the site is built. However, I'm having issues importing the NodeJS API package. Currently Pagefind's npm interface only supports being used as an ESM module via import, rather than as a CJS package through require. So import * as pagefind from 'pagefind' would be acceptable, but const pagefind = require('pagefind') would result in the following error:
message=No "exports" main defined in /Users/wangjingting/markbind/node_modules/pagefind/package.json, stack=Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /Users/wangjingting/markbind/node_modules/pagefind/package.json
at exportsNotFound (node:internal/modules/esm/resolve:303:10)
at packageExportsResolve (node:internal/modules/esm/resolve:593:13)
at resolveExports (node:internal/modules/cjs/loader:591:36)
at Module._findPath (node:internal/modules/cjs/loader:668:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
at Module._load (node:internal/modules/cjs/loader:985:27)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at /Users/wangjingting/markbind/packages/core/src/Site/index.js:509:92, code=ERR_PACKAGE_PATH_NOT_EXPORTED
This issue can be resolved using async import, and I've used it in Site.ts to import the functions with no issue. However, the generated Site.js file would then still convert the import to require('pagefind'), which results in the import issue.
Specify the module resolution strategy:
'node16' or 'nodenext' for modern versions of Node.js. Node.js v12 and later supports both ECMAScript imports and CommonJS require, which resolve using different algorithms. These moduleResolution values, when combined with the corresponding module values, picks the right algorithm for each resolution based on whether Node.js will see an import or require in the output JavaScript code.
Tried it, and it correctly converts the .ts to the appropriate .js code for module resolution.
I will also try and work on refining this PR. Cheers!
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.
What is the purpose of this pull request?
Overview of changes:
To track the addition of pagefind for full-text search. Welcome anyone to help look through.
Anything you'd like to highlight/discuss:
Testing instructions:
Proposed commit message: (wrap lines at 72 characters)
Add pagefind for search
Checklist: ☑️
Reviewer checklist:
Indicate the SEMVER impact of the PR:
At the end of the review, please label the PR with the appropriate label:
r.Major,r.Minor,r.Patch.Breaking change release note preparation (if applicable):