Tell us about your environment
Windows 10
- MarkBind Version:
v3.1.1
What did you do? Please include the actual source code causing the issue.
I think it is pretty complicated for someone new with MarkBind to do a simple task such as ignoring files from node_modules. This is a common scenario when starting a js project and adding MarkBind to it. I took some time myself in order to figure out how to do it and initially thought that it was bug 😢
A typical project initialization process might look like this:
- Start a new js project
npm init
- Install the latest version of markbind-cli
npm i markbind-cli
- Add in the
package.json's script that "build": "markbind build", "init": "markbind init"
- initialize a markbind project
npm run init
- try building the project by
npm run build
- will copy and build all the files in node_modules
- not what is expected
- read the docs to discover the
ignore attribute
- try adding "node_modules/*" in
site.json's ignore attribute
- try building the project by
npm run build
- doesn't quite work, still tries to build 500 plus pages, and ended with an error
- possibly due to the glob pattern of
"**/*.+(md|mbd)"
- read the docs again to figure out that there's a globExcludes that works with glob (I initially thought that it is defined in a separate object and that doesn't work)
- try adding "node_modules/*" in a globExcludes:
Note that this doesn't work, but it's the first thing I tried:
{
"glob": ["**/index.md", "**/*.+(md|mbd)"],
},
{
"globExclude": ["node_modules/*"]
}
This works
{
"glob": ["**/index.md", "**/*.+(md|mbd)"],
"globExclude": ["node_modules/*"]
}
- possibly also realize that this will work:
"pagesExclude": ["node_modules/*"],
What did you expect to happen?
I expect the common task to be simple.
What actually happened? Please include the actual, raw output.
Currently, it requires a new user to understand a few attributes such as 'ignore', 'glob', 'globExcludes', 'pagesExclude' just to get started.
This could be due to the fact that we only mention how to globally install markbind-cli in our user guide. While that works, it may not work well for existing projects or those that already have the setup of a package.json with node_modules. My proposal is as follows:
Tell us about your environment
Windows 10
v3.1.1
What did you do? Please include the actual source code causing the issue.
I think it is pretty complicated for someone new with MarkBind to do a simple task such as ignoring files from
node_modules. This is a common scenario when starting a js project and adding MarkBind to it. I took some time myself in order to figure out how to do it and initially thought that it was bug 😢A typical project initialization process might look like this:
npm initnpm i markbind-clipackage.json's script that"build": "markbind build","init": "markbind init"npm run initnpm run buildignoreattributesite.json'signoreattributenpm run build"**/*.+(md|mbd)"Note that this doesn't work, but it's the first thing I tried:
This works
What did you expect to happen?
I expect the common task to be simple.
What actually happened? Please include the actual, raw output.
Currently, it requires a new user to understand a few attributes such as 'ignore', 'glob', 'globExcludes', 'pagesExclude' just to get started.
This could be due to the fact that we only mention how to globally install markbind-cli in our user guide. While that works, it may not work well for existing projects or those that already have the setup of a package.json with node_modules. My proposal is as follows:
npm i markbind-cli@3.1.1. Related: Add examples of usingnpxto setup MarkBind sites in the user guide #1772site.json, ignorenode_modules/*and also set"pagesExclude": ["node_modules/*"]markbind init#1782