mdat 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +1 -1
- package/package.json +2 -2
- package/readme.md +5 -5
package/bin/cli.js
CHANGED
|
@@ -300,4 +300,4 @@ _State anyone or anything that significantly helped with the development of your
|
|
|
300
300
|
<!-- contributing -->
|
|
301
301
|
|
|
302
302
|
<!-- license -->
|
|
303
|
-
`;var $={"Mdat Readme":{content:{compound:un,explicit:fn},description:"The house style. An expansive starting point. Prune to your context and taste.",exampleLink:"https://github.com/kitschpatrol/mdat/blob/main/readme.md"},"Standard Readme Basic":{content:{compound:gn,explicit:hn},description:'Includes only the "required" sections from the Standard Readme specification.',exampleLink:"https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/minimal-readme.md"},"Standard Readme Full":{content:{compound:yn,explicit:wn},description:"Includes all sections from the Standard Readme specification.",exampleLink:"https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/maximal-readme.md"}};import{confirm as bn,group as jo,intro as Fo,note as Cn,outro as Uo,select as pt}from"@clack/prompts";import x from"chalk";import Vo from"node:fs/promises";import Pe from"node:path";import{deepMergeDefined as Bo}from"remark-mdat";import{write as Jo}from"to-vfile";async function Pn(){let t=await ct(),e=await X();return{packageDirectory:e===void 0?void 0:Pe.dirname(Pe.resolve(e)),readmePath:t}}async function On(){let{packageDirectory:t,readmePath:e}=await Pn(),n=Pe.resolve(process.cwd());Fo(`Running ${x.bold("mdat readme init")} interactively`);let o=await jo({overwrite:async()=>e===void 0||await bn({message:`Found an existing readme at "${x.blue(e)}". Do you want to overwrite it?`,active:"Overwrite",inactive:"Exit"})?!0:(()=>{throw new Error("`mdat readme init` was cancelled to avoid an overwrite - no changes were made")})(),output:async()=>t!==void 0&&t!==n?pt({initialValue:t,message:"There's a root package directory nearby, do you want to create the readme there instead of the current directory?",options:[{label:`Create in the current package root: "${x.blue(t)}"`,value:t},{label:`Create in current working directory: "${x.blue(n)}"`,value:n}]}):n,template:async()=>pt({message:"Which template would you like to use?",options:qo()}),compound:async()=>pt({message:'Do you want to use "compound comments" where possible, which combine several expansions into a single comment block?',options:[{label:`Yes: Combine things like ${x.green("<!-- title -->")} and ${x.green("<!-- badges -->")} in a single ${x.green("<!-- header -->")} comment.`,value:!0},{label:"No: Use individual `mdat` expansion comments for each section.",value:!1}]}),expand:async()=>t===void 0?!1:bn({initialValue:!0,message:"Do you want to run `mdat readme` now to expand the template with content from your package.json?"})},{onCancel(){throw new Error("`mdat readme init` was cancelled - no changes were made")}}),i=await lt(o);return t===void 0&&Cn("No package.json was found. Once you've created one, you can run `mdat readme` to expand the template with content from your package.json."),Cn(`Readme created: "${x.bold.blue(i)}"`),Uo("Done!"),i}async function lt(t){let{packageDirectory:e}=await Pn(),n=Bo({compound:!0,output:e??process.cwd(),overwrite:!0,expand:e!==void 0,template:Object.keys($)[0]},t??{}),o=Ho(n.template,n.compound),i=Pe.join(n.output,"readme.md");await Vo.writeFile(i,o,"utf8");let[r]=await Ce(i);return await Jo(r),i}function Ho(t,e){let o=$[t].content[e?"compound":"explicit"];if(o===void 0||o==="")throw new Error(`No template found for "${t}"`);return o}function qo(){return Object.entries($).map(([t,e])=>({label:t,hint:e.description,value:t}))}var N={config:{defaultDescription:"Configuration is loaded if found from the usual places, or defaults are used.",description:"Path(s) to files containing mdat configs.",string:!0,type:"array"}},G={meta:{alias:"m",description:"Embed an extra comment at the top of the generated Markdown noting the date of generation and warning editors that certain sections of the document have been generated dynamically.",type:"boolean"}},K={name:{alias:"n",defaultDescription:"Same name as input file. Overwrites the input file.",description:"Output file name.",type:"string"}},F={output:{alias:"o",defaultDescription:"Same directory as input file.",description:"Output file directory.",type:"string"}},A={prefix:{description:"Require a string prefix before all comments to be considered for expansion. Useful if you have a bunch of non-`mdat` comments in your Markdown file, or if you're willing to trade some verbosity for safety.",type:"string"}},W={print:{description:"Print the expanded Markdown to stdout instead of saving to a file. Ignores `--output` and `--name` options.",type:"boolean"}},Y={rules:{alias:"r",description:"Path(s) to files containing `mdat` comment expansion rules.",string:!0,type:"array"}},E={verbose:{describe:"Enable verbose logging. All verbose logs and prefixed with their log level and are printed to stderr for ease of redirection.",type:"boolean"}},Oe=["files",{array:!0,demandOption:!0,describe:"Markdown file(s) with `mdat` placeholder comments to collapse.",type:"string"}];var ut={package:{defaultDescription:"The closest package.json file is used by default.",description:"Path to the package.json file to use to populate the readme.",string:!0}},ft={assets:{defaultDescription:"./assets",description:"Path to find and save readme-related assets.",string:!0}},Rn={interactive:{alias:"i",default:!0,description:"Run the guided interactive `init` process. Set explicitly to `false` to use default values and skip the prompt.",type:"boolean"}},Sn={overwrite:{default:!1,defaultDescription:"`false`, if an existing readme is found, don't touch it.",description:"Replace an existing readme file if one is found.",type:"boolean"}},kn={expand:{alias:"e",default:!0,description:"Automatically run `mdat readme` immediately after creating the readme template.",type:"boolean"}},xn={template:{alias:"t",choices:Object.keys($),default:Object.keys($)[0],description:"Specify a template to use for the new readme.",type:"string"}},En={compound:{alias:"c",default:!0,description:"Use compound comment version of the template to replace several individual comment placeholders where possible. This combines things like `<!-- title -->`, `<!-- badges -->`, etc. in a single `<!-- header -->` comment. It's less clutter when you're editing, but it's also less explicit. The final readme.md output is identical.",type:"boolean"}},Re=["files",{array:!0,demandOption:!1,describe:"Readme file(s) with `mdat` placeholder comments to collapse. If not provided, the closest readme.md file is used.",type:"string"}];import gt from"chalk";import _ from"pretty-ms";import{getMdatReports as zo,log as u,reporterMdat as U}from"remark-mdat";import{write as Se}from"to-vfile";import Go from"yargs";import{hideBin as Ko}from"yargs/helpers";var I=performance.now(),Ln=Go(Ko(process.argv));try{await Ln.scriptName("mdat").usage("$0 [command]","Work with `mdat` placeholder comments in any Markdown file.").command(["$0 <files..> [options]","expand <files..> [options]"],"Expand `mdat` placeholder comments.",t=>t.positional(...Oe).option(N).option(Y).option(F).option(K).option(G).option(A).option(W).option(E),async({config:t,files:e,meta:n,name:o,output:i,prefix:r,print:a,rules:s,verbose:d})=>{u.verbose=d??!1,ke({name:o,output:i,print:a});let m=V(t,{addMetaComment:n,keywordPrefix:r}),c=await Et(e,o,i,m,s);for(let p of c)a?process.stdout.write(p.toString()):await Se(p);U(c),u.info(`Expanded comments in ${_(performance.now()-I)}.`),process.exitCode=B(c)}).command("check <files..> [options]","Validate a markdown file with `mdat` placeholder comments.",t=>t.positional(...Oe).option(N).option(Y).option(G).option(A).option(E),async({config:t,files:e,meta:n,prefix:o,rules:i,verbose:r})=>{u.verbose=r??!1;let a=V(t,{addMetaComment:n,keywordPrefix:o}),s=await Lt(e,void 0,void 0,a,i);U(s),u.info(`Checked comments in ${_(performance.now()-I)}.`),process.exitCode=B(s)}).command("collapse <files..> [options]","Collapse `mdat` placeholder comments.",t=>t.positional(...Oe).option(N).option(F).option(K).option(A).option(W).option(E),async({config:t,files:e,name:n,output:o,prefix:i,print:r,verbose:a})=>{u.verbose=a??!1,ke({name:n,output:o,print:r});let s=V(t,{keywordPrefix:i}),d=await vt(e,void 0,void 0,s);for(let m of d)r?process.stdout.write(m.toString()):await Se(m);U(d),u.info(`Cleaned comments in ${_(performance.now()-I)}.`),process.exitCode=B(d)}).command("readme [command]","Work with `mdat` comments in your readme.md.",t=>t.command(["$0 [files..] [options]","expand [files..] [options]"],"Expand `mdat` comment placeholders in your readme.md using a collection of helpful built-in expansion rules.",e=>e.positional(...Re).option(N).option(Y).option(F).option(K).option(ut).option(ft).option(A).option(G).option(W).option(E),async({assets:e,config:n,files:o,meta:i,name:r,output:a,package:s,prefix:d,print:m,rules:c,verbose:p})=>{u.verbose=p??!1,ke({name:r,output:a,print:m});let g=V(n,{addMetaComment:i,assetsPath:e,keywordPrefix:d,packageFile:s}),y=await Ce(o,r,a,g,c);for(let M of y)m?process.stdout.write(M.toString()):await Se(M);U(y);let{packageFile:w}=await P();u.info(`Pulled package metadata from: ${gt.bold.blue(w)}`),u.info(`Expanded readme(s) in ${_(performance.now()-I)}.`),process.exitCode=B(y)}).command("check [files..] [options]","Validate `mdat` placeholder comments in your readme.md.",e=>e.positional(...Re).option(N).option(Y).option(ut).option(ft).option(A).option(G).option(E),async({assets:e,config:n,files:o,meta:i,package:r,prefix:a,rules:s,verbose:d})=>{u.verbose=d??!1;let m=V(n,{addMetaComment:i,assetsPath:e,keywordPrefix:a,packageFile:r}),c=await pn(o,void 0,void 0,m,s);U(c);let{packageFile:p}=await P();u.info(`Pulled package metadata from: ${gt.bold.blue(p)}`),u.info(`Checked readme(s) in ${_(performance.now()-I)}.`),process.exitCode=B(c)}).command("collapse [files..] [options]","Collapse `mdat` placeholder comments in your readme.md.",e=>e.positional(...Re).option(F).option(K).option(W).option(N).option(A).option(E),async({config:e,files:n,name:o,output:i,prefix:r,print:a,verbose:s})=>{u.verbose=s??!1,ke({name:o,output:i,print:a});let d=V(e,{keywordPrefix:r}),m=await ln(n,void 0,void 0,d);for(let c of m)a?process.stdout.write(c.toString()):await Se(c);U(m),u.info(`Cleaned readme(s) in ${_(performance.now()-I)}.`),process.exitCode=B(m)}).command("init [options]","Interactively create a new readme.md file with sensible default `mdat` comment placeholders.",e=>e.option(Rn).option(Sn).option(F).option(kn).option(xn).option(En).option(E),async({compound:e,expand:n,interactive:o,output:i,overwrite:r,template:a,verbose:s})=>{if(u.verbose=s??!1,o)await On();else{let d=await lt({compound:e,expand:n,output:i,overwrite:r,template:a});u.info(`Created readme at "${gt.blue(d)}" in ${_(performance.now()-I)}.`)}process.exitCode=0}),()=>{u.error("Root mdat readme command should be unreachable.")}).help().alias("h","help").version().alias("v","version").wrap(process.stdout.isTTY?Math.min(120,Ln.terminalWidth()):0).fail(!1).parse()}catch(t){t instanceof Error&&u.error(t.message),process.exitCode=1}function ke(t){t.print&&t.output&&u.warn("Ignoring --output option because --print is set"),t.print&&t.name&&u.warn("Ignoring --name option because --print is set")}function V(t,e){return[...Q(t),e]}function B(t){return zo(t).reduce((o,i)=>o+i.errors.length,0)>0?1:0}
|
|
303
|
+
`;var $={"Mdat Readme":{content:{compound:un,explicit:fn},description:"The house style. An expansive starting point. Prune to your context and taste.",exampleLink:"https://github.com/kitschpatrol/mdat/blob/main/readme.md"},"Standard Readme Basic":{content:{compound:gn,explicit:hn},description:'Includes only the "required" sections from the Standard Readme specification.',exampleLink:"https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/minimal-readme.md"},"Standard Readme Full":{content:{compound:yn,explicit:wn},description:"Includes all sections from the Standard Readme specification.",exampleLink:"https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/maximal-readme.md"}};import{confirm as bn,group as jo,intro as Fo,note as Cn,outro as Uo,select as pt}from"@clack/prompts";import x from"chalk";import Vo from"node:fs/promises";import Pe from"node:path";import{deepMergeDefined as Bo}from"remark-mdat";import{write as Jo}from"to-vfile";async function Pn(){let t=await ct(),e=await X();return{packageDirectory:e===void 0?void 0:Pe.dirname(Pe.resolve(e)),readmePath:t}}async function On(){let{packageDirectory:t,readmePath:e}=await Pn(),n=Pe.resolve(process.cwd());Fo(`Running ${x.bold("mdat readme init")} interactively`);let o=await jo({overwrite:async()=>e===void 0||await bn({message:`Found an existing readme at "${x.blue(e)}". Do you want to overwrite it?`,active:"Overwrite",inactive:"Exit"})?!0:(()=>{throw new Error("`mdat readme init` was cancelled to avoid an overwrite - no changes were made")})(),output:async()=>t!==void 0&&t!==n?pt({initialValue:t,message:"There's a root package directory nearby, do you want to create the readme there instead of the current directory?",options:[{label:`Create in the current package root: "${x.blue(t)}"`,value:t},{label:`Create in current working directory: "${x.blue(n)}"`,value:n}]}):n,template:async()=>pt({message:"Which template would you like to use?",options:qo()}),compound:async()=>pt({message:'Do you want to use "compound comments" where possible, which combine several expansions into a single comment block?',options:[{label:`Yes: Combine things like ${x.green("<!-- title -->")} and ${x.green("<!-- badges -->")} in a single ${x.green("<!-- header -->")} comment.`,value:!0},{label:"No: Use individual `mdat` expansion comments for each section.",value:!1}]}),expand:async()=>t===void 0?!1:bn({initialValue:!0,message:"Do you want to run `mdat readme` now to expand the template with content from your package.json?"})},{onCancel(){throw new Error("`mdat readme init` was cancelled - no changes were made")}}),i=await lt(o);return t===void 0&&Cn("No package.json was found. Once you've created one, you can run `mdat readme` to expand the template with content from your package.json."),Cn(`Readme created: "${x.bold.blue(i)}"`),Uo("Done!"),i}async function lt(t){let{packageDirectory:e}=await Pn(),n=Bo({compound:!0,output:e??process.cwd(),overwrite:!0,expand:e!==void 0,template:Object.keys($)[0]},t??{}),o=Ho(n.template,n.compound),i=Pe.join(n.output,"readme.md");await Vo.writeFile(i,o,"utf8");let[r]=await Ce(i);return await Jo(r),i}function Ho(t,e){let o=$[t].content[e?"compound":"explicit"];if(o===void 0||o==="")throw new Error(`No template found for "${t}"`);return o}function qo(){return Object.entries($).map(([t,e])=>({label:t,hint:e.description,value:t}))}var N={config:{defaultDescription:"Configuration is loaded if found from the usual places, or defaults are used.",description:"Path(s) to files containing mdat configs.",string:!0,type:"array"}},G={meta:{alias:"m",description:"Embed an extra comment at the top of the generated Markdown warning editors that certain sections of the document have been generated dynamically.",type:"boolean"}},K={name:{alias:"n",defaultDescription:"Same name as input file. Overwrites the input file.",description:"Output file name.",type:"string"}},F={output:{alias:"o",defaultDescription:"Same directory as input file.",description:"Output file directory.",type:"string"}},A={prefix:{description:"Require a string prefix before all comments to be considered for expansion. Useful if you have a bunch of non-`mdat` comments in your Markdown file, or if you're willing to trade some verbosity for safety.",type:"string"}},W={print:{description:"Print the expanded Markdown to stdout instead of saving to a file. Ignores `--output` and `--name` options.",type:"boolean"}},Y={rules:{alias:"r",description:"Path(s) to files containing `mdat` comment expansion rules.",string:!0,type:"array"}},E={verbose:{describe:"Enable verbose logging. All verbose logs and prefixed with their log level and are printed to stderr for ease of redirection.",type:"boolean"}},Oe=["files",{array:!0,demandOption:!0,describe:"Markdown file(s) with `mdat` placeholder comments to collapse.",type:"string"}];var ut={package:{defaultDescription:"The closest package.json file is used by default.",description:"Path to the package.json file to use to populate the readme.",string:!0}},ft={assets:{defaultDescription:"./assets",description:"Path to find and save readme-related assets.",string:!0}},Rn={interactive:{alias:"i",default:!0,description:"Run the guided interactive `init` process. Set explicitly to `false` to use default values and skip the prompt.",type:"boolean"}},Sn={overwrite:{default:!1,defaultDescription:"`false`, if an existing readme is found, don't touch it.",description:"Replace an existing readme file if one is found.",type:"boolean"}},kn={expand:{alias:"e",default:!0,description:"Automatically run `mdat readme` immediately after creating the readme template.",type:"boolean"}},xn={template:{alias:"t",choices:Object.keys($),default:Object.keys($)[0],description:"Specify a template to use for the new readme.",type:"string"}},En={compound:{alias:"c",default:!0,description:"Use compound comment version of the template to replace several individual comment placeholders where possible. This combines things like `<!-- title -->`, `<!-- badges -->`, etc. in a single `<!-- header -->` comment. It's less clutter when you're editing, but it's also less explicit. The final readme.md output is identical.",type:"boolean"}},Re=["files",{array:!0,demandOption:!1,describe:"Readme file(s) with `mdat` placeholder comments to collapse. If not provided, the closest readme.md file is used.",type:"string"}];import gt from"chalk";import _ from"pretty-ms";import{getMdatReports as zo,log as u,reporterMdat as U}from"remark-mdat";import{write as Se}from"to-vfile";import Go from"yargs";import{hideBin as Ko}from"yargs/helpers";var I=performance.now(),Ln=Go(Ko(process.argv));try{await Ln.scriptName("mdat").usage("$0 [command]","Work with `mdat` placeholder comments in any Markdown file.").command(["$0 <files..> [options]","expand <files..> [options]"],"Expand `mdat` placeholder comments.",t=>t.positional(...Oe).option(N).option(Y).option(F).option(K).option(G).option(A).option(W).option(E),async({config:t,files:e,meta:n,name:o,output:i,prefix:r,print:a,rules:s,verbose:d})=>{u.verbose=d??!1,ke({name:o,output:i,print:a});let m=V(t,{addMetaComment:n,keywordPrefix:r}),c=await Et(e,o,i,m,s);for(let p of c)a?process.stdout.write(p.toString()):await Se(p);U(c),u.info(`Expanded comments in ${_(performance.now()-I)}.`),process.exitCode=B(c)}).command("check <files..> [options]","Validate a markdown file with `mdat` placeholder comments.",t=>t.positional(...Oe).option(N).option(Y).option(G).option(A).option(E),async({config:t,files:e,meta:n,prefix:o,rules:i,verbose:r})=>{u.verbose=r??!1;let a=V(t,{addMetaComment:n,keywordPrefix:o}),s=await Lt(e,void 0,void 0,a,i);U(s),u.info(`Checked comments in ${_(performance.now()-I)}.`),process.exitCode=B(s)}).command("collapse <files..> [options]","Collapse `mdat` placeholder comments.",t=>t.positional(...Oe).option(N).option(F).option(K).option(A).option(W).option(E),async({config:t,files:e,name:n,output:o,prefix:i,print:r,verbose:a})=>{u.verbose=a??!1,ke({name:n,output:o,print:r});let s=V(t,{keywordPrefix:i}),d=await vt(e,void 0,void 0,s);for(let m of d)r?process.stdout.write(m.toString()):await Se(m);U(d),u.info(`Cleaned comments in ${_(performance.now()-I)}.`),process.exitCode=B(d)}).command("readme [command]","Work with `mdat` comments in your readme.md.",t=>t.command(["$0 [files..] [options]","expand [files..] [options]"],"Expand `mdat` comment placeholders in your readme.md using a collection of helpful built-in expansion rules.",e=>e.positional(...Re).option(N).option(Y).option(F).option(K).option(ut).option(ft).option(A).option(G).option(W).option(E),async({assets:e,config:n,files:o,meta:i,name:r,output:a,package:s,prefix:d,print:m,rules:c,verbose:p})=>{u.verbose=p??!1,ke({name:r,output:a,print:m});let g=V(n,{addMetaComment:i,assetsPath:e,keywordPrefix:d,packageFile:s}),y=await Ce(o,r,a,g,c);for(let M of y)m?process.stdout.write(M.toString()):await Se(M);U(y);let{packageFile:w}=await P();u.info(`Pulled package metadata from: ${gt.bold.blue(w)}`),u.info(`Expanded readme(s) in ${_(performance.now()-I)}.`),process.exitCode=B(y)}).command("check [files..] [options]","Validate `mdat` placeholder comments in your readme.md.",e=>e.positional(...Re).option(N).option(Y).option(ut).option(ft).option(A).option(G).option(E),async({assets:e,config:n,files:o,meta:i,package:r,prefix:a,rules:s,verbose:d})=>{u.verbose=d??!1;let m=V(n,{addMetaComment:i,assetsPath:e,keywordPrefix:a,packageFile:r}),c=await pn(o,void 0,void 0,m,s);U(c);let{packageFile:p}=await P();u.info(`Pulled package metadata from: ${gt.bold.blue(p)}`),u.info(`Checked readme(s) in ${_(performance.now()-I)}.`),process.exitCode=B(c)}).command("collapse [files..] [options]","Collapse `mdat` placeholder comments in your readme.md.",e=>e.positional(...Re).option(F).option(K).option(W).option(N).option(A).option(E),async({config:e,files:n,name:o,output:i,prefix:r,print:a,verbose:s})=>{u.verbose=s??!1,ke({name:o,output:i,print:a});let d=V(e,{keywordPrefix:r}),m=await ln(n,void 0,void 0,d);for(let c of m)a?process.stdout.write(c.toString()):await Se(c);U(m),u.info(`Cleaned readme(s) in ${_(performance.now()-I)}.`),process.exitCode=B(m)}).command("init [options]","Interactively create a new readme.md file with sensible default `mdat` comment placeholders.",e=>e.option(Rn).option(Sn).option(F).option(kn).option(xn).option(En).option(E),async({compound:e,expand:n,interactive:o,output:i,overwrite:r,template:a,verbose:s})=>{if(u.verbose=s??!1,o)await On();else{let d=await lt({compound:e,expand:n,output:i,overwrite:r,template:a});u.info(`Created readme at "${gt.blue(d)}" in ${_(performance.now()-I)}.`)}process.exitCode=0}),()=>{u.error("Root mdat readme command should be unreachable.")}).help().alias("h","help").version().alias("v","version").wrap(process.stdout.isTTY?Math.min(120,Ln.terminalWidth()):0).fail(!1).parse()}catch(t){t instanceof Error&&u.error(t.message),process.exitCode=1}function ke(t){t.print&&t.output&&u.warn("Ignoring --output option because --print is set"),t.print&&t.name&&u.warn("Ignoring --name option because --print is set")}function V(t,e){return[...Q(t),e]}function B(t){return zo(t).reduce((o,i)=>o+i.errors.length,0)>0?1:0}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mdat",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI tool and library for using comments as content templates in Markdown files, with helpful presets for readmes.",
|
|
6
6
|
"repository": {
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"which": "^4.0.0",
|
|
71
71
|
"yargs": "^17.7.2",
|
|
72
72
|
"zod": "^3.22.4",
|
|
73
|
-
"remark-mdat": "0.6.
|
|
73
|
+
"remark-mdat": "0.6.3"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@types/node": "^20.11.19",
|
package/readme.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!--+ Warning: Content
|
|
1
|
+
<!--+ Warning: Content inside HTML comment blocks was generated by mdat and may be overwritten. +-->
|
|
2
2
|
|
|
3
3
|
<!-- header -->
|
|
4
4
|
|
|
@@ -261,7 +261,7 @@ mdat expand <files..> [options]
|
|
|
261
261
|
| `--rules` | `-r` | Path(s) to files containing `mdat` comment expansion rules. | `array` | |
|
|
262
262
|
| `--output` | `-o` | Output file directory. | `string` | Same directory as input file. |
|
|
263
263
|
| `--name` | `-n` | Output file name. | `string` | Same name as input file. Overwrites the input file. |
|
|
264
|
-
| `--meta` | `-m` | Embed an extra comment at the top of the generated Markdown
|
|
264
|
+
| `--meta` | `-m` | Embed an extra comment at the top of the generated Markdown warning editors that certain sections of the document have been generated dynamically. | `boolean` | |
|
|
265
265
|
| `--prefix` | | Require a string prefix before all comments to be considered for expansion. Useful if you have a bunch of non-`mdat` comments in your Markdown file, or if you're willing to trade some verbosity for safety. | `string` | |
|
|
266
266
|
| `--print` | | Print the expanded Markdown to stdout instead of saving to a file. Ignores `--output` and `--name` options. | `boolean` | |
|
|
267
267
|
| `--verbose` | | Enable verbose logging. All verbose logs and prefixed with their log level and are printed to stderr for ease of redirection. | `boolean` | |
|
|
@@ -286,7 +286,7 @@ mdat check <files..> [options]
|
|
|
286
286
|
| ----------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ----------------------------------------------------------------------------- |
|
|
287
287
|
| `--config` | | Path(s) to files containing mdat configs. | `array` | Configuration is loaded if found from the usual places, or defaults are used. |
|
|
288
288
|
| `--rules` | `-r` | Path(s) to files containing `mdat` comment expansion rules. | `array` | |
|
|
289
|
-
| `--meta` | `-m` | Embed an extra comment at the top of the generated Markdown
|
|
289
|
+
| `--meta` | `-m` | Embed an extra comment at the top of the generated Markdown warning editors that certain sections of the document have been generated dynamically. | `boolean` | |
|
|
290
290
|
| `--prefix` | | Require a string prefix before all comments to be considered for expansion. Useful if you have a bunch of non-`mdat` comments in your Markdown file, or if you're willing to trade some verbosity for safety. | `string` | |
|
|
291
291
|
| `--verbose` | | Enable verbose logging. All verbose logs and prefixed with their log level and are printed to stderr for ease of redirection. | `boolean` | |
|
|
292
292
|
| `--help` | `-h` | Show help | `boolean` | |
|
|
@@ -363,7 +363,7 @@ mdat readme expand [files..] [options]
|
|
|
363
363
|
| `--package` | | Path to the package.json file to use to populate the readme. | `string` | The closest package.json file is used by default. |
|
|
364
364
|
| `--assets` | | Path to find and save readme-related assets. | `string` | `./assets` |
|
|
365
365
|
| `--prefix` | | Require a string prefix before all comments to be considered for expansion. Useful if you have a bunch of non-`mdat` comments in your Markdown file, or if you're willing to trade some verbosity for safety. | `string` | |
|
|
366
|
-
| `--meta` | `-m` | Embed an extra comment at the top of the generated Markdown
|
|
366
|
+
| `--meta` | `-m` | Embed an extra comment at the top of the generated Markdown warning editors that certain sections of the document have been generated dynamically. | `boolean` | |
|
|
367
367
|
| `--print` | | Print the expanded Markdown to stdout instead of saving to a file. Ignores `--output` and `--name` options. | `boolean` | |
|
|
368
368
|
| `--verbose` | | Enable verbose logging. All verbose logs and prefixed with their log level and are printed to stderr for ease of redirection. | `boolean` | |
|
|
369
369
|
| `--help` | `-h` | Show help | `boolean` | |
|
|
@@ -390,7 +390,7 @@ mdat readme check [files..] [options]
|
|
|
390
390
|
| `--package` | | Path to the package.json file to use to populate the readme. | `string` | The closest package.json file is used by default. |
|
|
391
391
|
| `--assets` | | Path to find and save readme-related assets. | `string` | `./assets` |
|
|
392
392
|
| `--prefix` | | Require a string prefix before all comments to be considered for expansion. Useful if you have a bunch of non-`mdat` comments in your Markdown file, or if you're willing to trade some verbosity for safety. | `string` | |
|
|
393
|
-
| `--meta` | `-m` | Embed an extra comment at the top of the generated Markdown
|
|
393
|
+
| `--meta` | `-m` | Embed an extra comment at the top of the generated Markdown warning editors that certain sections of the document have been generated dynamically. | `boolean` | |
|
|
394
394
|
| `--verbose` | | Enable verbose logging. All verbose logs and prefixed with their log level and are printed to stderr for ease of redirection. | `boolean` | |
|
|
395
395
|
| `--help` | `-h` | Show help | `boolean` | |
|
|
396
396
|
| `--version` | `-v` | Show version number | `boolean` | |
|