remark-mdat 0.2.0 → 0.3.0

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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import h from"chalk";var J,L=((J=process==null?void 0:process.versions)==null?void 0:J.node)!==void 0,ae={verbose:!1,log(...e){if(!this.verbose)return;let r=h.gray("[Log]");L?console.warn(r,...e):console.log(r,...e)},logPrefixed(e,...r){this.info(h.blue(`[${e}]`),...r)},info(...e){if(!this.verbose)return;let r=h.green("[Info]");L?console.warn(r,...e):console.info(r,...e)},infoPrefixed(e,...r){this.info(h.blue(`[${e}]`),...r)},warn(...e){console.warn(h.yellow("[Warning]"),...e)},warnPrefixed(e,...r){this.warn(h.blue(`[${e}]`),...r)},error(...e){console.error(h.red("[Error]"),...e)},errorPrefixed(e,...r){this.error(h.blue(`[${e}]`),...r)}},y=ae;import w from"chalk";import D from"node:path";function u(e,r,n,t,o,i){var p,c;let a,s;o===void 0||typeof o=="number"?(a=o??0,s=i??0):(a=((p=o==null?void 0:o.position)==null?void 0:p.start.line)??0,s=((c=o==null?void 0:o.position)==null?void 0:c.start.column)??0);let l={place:{end:{column:s,line:a},start:{column:s,line:a}},source:n},d=e.message(t,l);d.fatal=r==="error"?!0:r==="warn"?!1:void 0}function le(e){return{column:e.column,level:e.fatal?"error":e.fatal===!1?"warn":"info",line:e.line,message:e.reason,source:e.source}}function me(e){return e.map(r=>U(r))}function U(e){var n;let r={destinationPath:e.history.length>0?e.history.at(-1):void 0,errors:[],infos:[],sourcePath:e.history.at(0)??e.path,warnings:[]};(n=r.sourcePath)!=null&&n.startsWith(".")&&(r.sourcePath=D.relative(process.cwd(),D.join(process.cwd(),r.sourcePath)));for(let t of e.messages){let o=le(t);o.level==="error"?r.errors.push(o):o.level==="warn"?r.warnings.push(o):r.infos.push(o)}return r}function de(e){for(let r of e){let n=U(r),{destinationPath:t,errors:o,infos:i,sourcePath:a,warnings:s}=n;y.info(`${w.bold("Comment Expansion Report:")}`),y.info(` From: ${w.blue.bold(a)}`),y.info(` To: ${w.blue.bold(t)}`);for(let l of o)y.error(V(a,l));for(let l of s)y.warn(V(a,l));for(let l of i)y.info(V(a,l));o.length===0&&s.length===0?y.info(`No issues found in ${a}`):y.error(`${o.length} errors, ${s.length} warnings found in ${a}`)}}function V(e,r){let{column:n,level:t,line:o,message:i,source:a}=r,s=a?w.gray(`[${a}] `):"",l=o&&n?`:${o}:${n}`:"",d=pe(i,t);return`${s}${d} ${w.whiteBright(e+l)}`}function pe(e,r){return e.replaceAll(/<!--.+-->/g,n=>r==="info"?w.green(n):r==="warn"?w.yellow(n):w.red(n))}import ue from"json5";import{VFileMessage as P}from"vfile-message";function R(e,r,n){var t;try{let o=ce(e.value,n);return o===void 0?void 0:{...o,node:e,parent:r}}catch(o){throw o instanceof P?(o.line=(t=e.position)==null?void 0:t.start.line,o):o instanceof Error?new P(o.message,e):new P("Unknown error",e)}}function ce(e,r){if(!fe(e))return;let{closingPrefix:n,keywordPrefix:t,metaCommentIdentifier:o}=r,i=e.trim(),a=i.replace(/^\s*<!--+\s*/,"").replace(/\s*-*-->\s*$/,""),[s,...l]=a.split(/(\s+|\(|{)/),d=s.startsWith(o)?"meta":t!==""&&!s.startsWith(t)&&!s.startsWith(`${n}${t}`)?"native":s.startsWith(n)?"close":"open";if(d==="meta")return{content:ye(a,o),html:i,type:d};if(d==="native")return{content:a,html:i,type:d};let p=s.replace(new RegExp(`^${n}`),"").replace(new RegExp(`^${t}`),""),c=ge(l.join(""));if(d==="open"||d==="close"){let f={};try{f=ue.parse(c)}catch(g){if(g instanceof Error)throw new P(`Failed to parse comment options "${c}" for keyword "${p}": ${g.message}`)}return{closingPrefix:n,html:i,keyword:p,keywordPrefix:t,options:f,type:d}}}function fe(e){let r=e.trim();return r.startsWith("<!--")&&r.endsWith("-->")}function ge(e){return e=e.trim(),e=e.startsWith("(")?e.slice(1):e,e=e.endsWith(")")?e.slice(0,-1):e,e=e.trim(),!e.startsWith("{")&&!e.startsWith("[")&&(e="{"+e),!e.endsWith("}")&&!e.endsWith("]")&&(e+="}"),e}function ye(e,r){return e=e.trim(),e=e.startsWith(r)?e.slice(r.length):e,e=e.endsWith(r)?e.slice(0,-r.length):e,e}import{z as m}from"zod";function M(e){let r={};for(let[n,t]of Object.entries(e))if(typeof t=="string")r[n]={applicationOrder:0,content:async()=>t,order:void 0,required:!1};else if(typeof t=="function")r[n]={applicationOrder:0,content:async(o,i)=>t(o,i),order:void 0,required:!1};else if(Array.isArray(t))r[n]={applicationOrder:0,content:Object.values(M(Object.fromEntries(t.entries()))),order:void 0,required:!1};else if(typeof t.content=="string"){let o=t.content;r[n]={applicationOrder:t.applicationOrder??0,content:async()=>o,order:t.order??void 0,required:t.required??!1}}else if(Array.isArray(t.content))r[n]={applicationOrder:t.applicationOrder??0,content:Object.values(M(Object.fromEntries(t.content.entries()))),order:t.order??void 0,required:t.required??!1};else{let o=t.content;r[n]={applicationOrder:t.applicationOrder??0,content:async(i,a)=>o(i,a),order:t.order??void 0,required:t.required??!1}}return he(r),r}function b(e){try{v.parse(e)}catch(r){if(r instanceof Error)throw new TypeError(`Error validating rules: ${r.message}`)}}function he(e){try{we.parse(e)}catch(r){if(r instanceof Error)throw new TypeError(`Error validating rules: ${r.message}`)}}var B=m.any(),G=m.any(),Z=m.lazy(()=>m.object({applicationOrder:m.number(),content:m.union([m.function().args(B.optional(),G.optional()).returns(m.promise(m.string())),m.array(Z)]),order:m.number().optional(),required:m.boolean().default(!1)})),K=m.function().args(B.optional(),G.optional()).returns(m.union([m.string(),m.promise(m.string())])),S=m.lazy(()=>m.union([K,m.array(S),m.string(),m.object({applicationOrder:m.number().optional(),content:m.union([K,m.array(S),m.string()]),order:m.number().optional(),required:m.boolean().optional()})])),v=m.record(S).describe("Mdat Rules"),we=m.record(Z).describe("Mdat Rules");async function C(e,r,n,t=!1){if(Array.isArray(e.content)){let o=[];for(let[i,a]of e.content.entries()){let s=Array.isArray(r)?r.at(i):void 0;try{o.push(await C(a,s??{},n))}catch(l){if(t)throw l}}return o.join(`
1
+ import h from"chalk";var J,L=((J=process==null?void 0:process.versions)==null?void 0:J.node)!==void 0,ae={verbose:!1,log(...e){if(!this.verbose)return;let r=h.gray("[Log]");L?console.warn(r,...e):console.log(r,...e)},logPrefixed(e,...r){this.info(h.blue(`[${e}]`),...r)},info(...e){if(!this.verbose)return;let r=h.green("[Info]");L?console.warn(r,...e):console.info(r,...e)},infoPrefixed(e,...r){this.info(h.blue(`[${e}]`),...r)},warn(...e){console.warn(h.yellow("[Warning]"),...e)},warnPrefixed(e,...r){this.warn(h.blue(`[${e}]`),...r)},error(...e){console.error(h.red("[Error]"),...e)},errorPrefixed(e,...r){this.error(h.blue(`[${e}]`),...r)}},y=ae;import w from"chalk";import D from"node:path";function u(e,r,n,t,o,i){var p,c;let a,s;o===void 0||typeof o=="number"?(a=o??0,s=i??0):(a=((p=o==null?void 0:o.position)==null?void 0:p.start.line)??0,s=((c=o==null?void 0:o.position)==null?void 0:c.start.column)??0);let l={place:{end:{column:s,line:a},start:{column:s,line:a}},source:n},d=e.message(t,l);d.fatal=r==="error"?!0:r==="warn"?!1:void 0}function le(e){return{column:e.column,level:e.fatal?"error":e.fatal===!1?"warn":"info",line:e.line,message:e.reason,source:e.source}}function me(e){return e.map(r=>U(r))}function U(e){var n;let r={destinationPath:e.history.length>0?e.history.at(-1):void 0,errors:[],infos:[],sourcePath:e.history.at(0)??e.path,warnings:[]};(n=r.sourcePath)!=null&&n.startsWith(".")&&(r.sourcePath=D.relative(process.cwd(),D.join(process.cwd(),r.sourcePath)));for(let t of e.messages){let o=le(t);o.level==="error"?r.errors.push(o):o.level==="warn"?r.warnings.push(o):r.infos.push(o)}return r}function de(e){for(let r of e){let n=U(r),{destinationPath:t,errors:o,infos:i,sourcePath:a,warnings:s}=n;y.info(`${w.bold("Mdat Report:")}`),y.info(` From: ${w.blue.bold(a)}`),y.info(` To: ${w.blue.bold(t)}`);for(let l of o)y.error(V(a,l));for(let l of s)y.warn(V(a,l));for(let l of i)y.info(V(a,l));o.length===0&&s.length===0?y.info(`No issues found in ${a}`):y.error(`${o.length} errors, ${s.length} warnings found in ${a}`)}}function V(e,r){let{column:n,level:t,line:o,message:i,source:a}=r,s=a?w.gray(`[${a}] `):"",l=o&&n?`:${o}:${n}`:"",d=pe(i,t);return`${s}${d} ${w.whiteBright(e+l)}`}function pe(e,r){return e.replaceAll(/<!--.+-->/g,n=>r==="info"?w.green(n):r==="warn"?w.yellow(n):w.red(n))}import ue from"json5";import{VFileMessage as P}from"vfile-message";function R(e,r,n){var t;try{let o=ce(e.value,n);return o===void 0?void 0:{...o,node:e,parent:r}}catch(o){throw o instanceof P?(o.line=(t=e.position)==null?void 0:t.start.line,o):o instanceof Error?new P(o.message,e):new P("Unknown error",e)}}function ce(e,r){if(!fe(e))return;let{closingPrefix:n,keywordPrefix:t,metaCommentIdentifier:o}=r,i=e.trim(),a=i.replace(/^\s*<!--+\s*/,"").replace(/\s*-*-->\s*$/,""),[s,...l]=a.split(/(\s+|\(|{)/),d=s.startsWith(o)?"meta":t!==""&&!s.startsWith(t)&&!s.startsWith(`${n}${t}`)?"native":s.startsWith(n)?"close":"open";if(d==="meta")return{content:ye(a,o),html:i,type:d};if(d==="native")return{content:a,html:i,type:d};let p=s.replace(new RegExp(`^${n}`),"").replace(new RegExp(`^${t}`),""),c=ge(l.join(""));if(d==="open"||d==="close"){let f={};try{f=ue.parse(c)}catch(g){if(g instanceof Error)throw new P(`Failed to parse comment options "${c}" for keyword "${p}": ${g.message}`)}return{closingPrefix:n,html:i,keyword:p,keywordPrefix:t,options:f,type:d}}}function fe(e){let r=e.trim();return r.startsWith("<!--")&&r.endsWith("-->")}function ge(e){return e=e.trim(),e=e.startsWith("(")?e.slice(1):e,e=e.endsWith(")")?e.slice(0,-1):e,e=e.trim(),!e.startsWith("{")&&!e.startsWith("[")&&(e="{"+e),!e.endsWith("}")&&!e.endsWith("]")&&(e+="}"),e}function ye(e,r){return e=e.trim(),e=e.startsWith(r)?e.slice(r.length):e,e=e.endsWith(r)?e.slice(0,-r.length):e,e}import{z as m}from"zod";function M(e){let r={};for(let[n,t]of Object.entries(e))if(typeof t=="string")r[n]={applicationOrder:0,content:async()=>t,order:void 0,required:!1};else if(typeof t=="function")r[n]={applicationOrder:0,content:async(o,i)=>t(o,i),order:void 0,required:!1};else if(Array.isArray(t))r[n]={applicationOrder:0,content:Object.values(M(Object.fromEntries(t.entries()))),order:void 0,required:!1};else if(typeof t.content=="string"){let o=t.content;r[n]={applicationOrder:t.applicationOrder??0,content:async()=>o,order:t.order??void 0,required:t.required??!1}}else if(Array.isArray(t.content))r[n]={applicationOrder:t.applicationOrder??0,content:Object.values(M(Object.fromEntries(t.content.entries()))),order:t.order??void 0,required:t.required??!1};else{let o=t.content;r[n]={applicationOrder:t.applicationOrder??0,content:async(i,a)=>o(i,a),order:t.order??void 0,required:t.required??!1}}return he(r),r}function b(e){try{v.parse(e)}catch(r){if(r instanceof Error)throw new TypeError(`Error validating rules: ${r.message}`)}}function he(e){try{we.parse(e)}catch(r){if(r instanceof Error)throw new TypeError(`Error validating rules: ${r.message}`)}}var B=m.any(),G=m.any(),Z=m.lazy(()=>m.object({applicationOrder:m.number(),content:m.union([m.function().args(B.optional(),G.optional()).returns(m.promise(m.string())),m.array(Z)]),order:m.number().optional(),required:m.boolean().default(!1)})),K=m.function().args(B.optional(),G.optional()).returns(m.union([m.string(),m.promise(m.string())])),S=m.lazy(()=>m.union([K,m.array(S),m.string(),m.object({applicationOrder:m.number().optional(),content:m.union([K,m.array(S),m.string()]),order:m.number().optional(),required:m.boolean().optional()})])),v=m.record(S).describe("Mdat Rules"),we=m.record(Z).describe("Mdat Rules");async function C(e,r,n,t=!1){if(Array.isArray(e.content)){let o=[];for(let[i,a]of e.content.entries()){let s=Array.isArray(r)?r.at(i):void 0;try{o.push(await C(a,s??{},n))}catch(l){if(t)throw l}}return o.join(`
2
2
 
3
3
  `)}try{return await e.content(r,n)}catch(o){if(t)throw o}throw new Error("Failed to expand content")}function ke(e){return Me(e)}function Re(e){let r=Object.keys(e);if(r.length!==1)throw new Error(`Expected exactly one rule, found ${r.length}`);return r[0]}function Me(e){let r=Object.values(e);if(r.length===0)throw new Error('Found no entries in a "sole record" record. This should never happen');if(r.length>1)throw new Error('Found multiple entries in "sole record" record. This should never happen');return r[0]}import Q from"chalk";import Ce from"cli-table3";import{CONTINUE as xe,visit as Oe}from"unist-util-visit";async function F(e,r,n){let{closingPrefix:t,keywordPrefix:o,metaCommentIdentifier:i,paranoid:a=!1,rules:s}=n;b(s);let l=M(s),d=[];Oe(e,"html",(p,c,f)=>{if(f===void 0||c===void 0)return xe;let g=R(p,f,{closingPrefix:t,keywordPrefix:o,metaCommentIdentifier:i});if(g!==void 0){let $=g.type==="open"||g.type==="close"?l[g.keyword]:void 0;d.push({...g,rule:$})}}),Te(r,d,l),Ve(r,d),Se(r,d,n),await Pe(r,d,e),a&&$e(r,d,l),ve(r,d),be(r,d,l,n)}async function Pe(e,r,n){for(let t of r)if(t.type==="open"&&t.rule!==void 0)try{(await C(t.rule,t.options,n,!0)).trim()===""&&u(e,t.rule.required?"error":"warn","check",`${t.html} returned an empty string.`,t.node)}catch(o){o instanceof Error&&u(e,t.rule.required?"error":"warn","check",`Could not get content for ${t.html}. ${o.message}`,t.node)}}function be(e,r,n,t){if(t.keywordPrefix==="")return;let o=Object.keys(n);for(let i of r)i.type==="native"&&o.includes(i.content)&&u(e,"warn","check",`Missing prefix: ${i.html}`,i.node)}function ve(e,r){for(let n of r)n.type==="open"&&n.rule===void 0&&u(e,"warn","check",`Missing rule for: ${n.html}`,n.node)}function $e(e,r,n){for(let[t,o]of Object.entries(n))!o.required&&!r.some(i=>i.type==="open"&&i.keyword===t)&&!Y(o,r)&&u(e,"warn","check",`Missing optional: <!-- ${t} -->`)}function Te(e,r,n){for(let[t,o]of Object.entries(n))o.required&&!r.some(i=>i.type==="open"&&i.keyword===t)&&!Y(o,r)&&u(e,"error","check",`Missing required: <!-- ${t} -->`)}function Y(e,r){return r.reduce((n,t)=>{var o;if(Array.isArray((o=t.rule)==null?void 0:o.content))for(let i of t.rule.content)i.content.toString()===e.content.toString()&&(n=!0);return n},!1)}function Ve(e,r){let n=r.filter(s=>{var l;return s.type==="open"&&((l=s.rule)==null?void 0:l.order)!==void 0}),t=[...n].sort((s,l)=>{var c,f;let d=(c=s.rule)==null?void 0:c.order,p=(f=l.rule)==null?void 0:f.order;if(d===void 0||p===void 0)throw new Error("Unexpected undefined rule order");return d-p}),o=X(n),i=X(t),a=new Ce({head:[Q.bold.red("Current Order"),Q.bold.green("Required Order")],style:{compact:!0}});o.join(",")!==i.join(",")&&(a.push(...o.map((s,l)=>[s,i[l]])),u(e,"error","check",`Out of order:
4
4
  ${a.toString()}`))}function Se(e,r,n){let{addMetaComment:t}=n,o=r.filter(i=>i.type==="meta").length;t&&o!==1&&u(e,"error","check","Missing meta comment"),!t&&o!==0&&u(e,"error","check","Unexpected meta comment"),o>1&&u(e,"error","check","Multiple meta comments")}function X(e){return e.map((r,n)=>{if(r.type==="open"||r.type==="close")return`${n+1}. ${r.html}`;throw new Error("Unexpected comment type")})}import{CONTINUE as k,visit as Fe}from"unist-util-visit";function E(e,r,n){let t;Fe(e,"html",(o,i,a)=>{if(a===void 0||i===void 0)return k;let s=R(o,a,n);if(s===void 0||s.type==="native")return k;if(s.type==="meta")return a.children.splice(i,1),[k,i];if(s.type==="open")return t=s,k;if(s.type==="close"){if(t===void 0)return u(r,"error","clean","Found closing marker without opening marker",o),k;if(t.parent!==s.parent)return u(r,"error","clean","Opening marker doesn't share a parent",o),k;if(t.keyword!==s.keyword)return u(r,"error","clean","Opening marker doesn't share a keyword",o),k;let l=a.children.indexOf(t.node),p=a.children.indexOf(s.node)-l+1;return a.children.splice(l+1,p-1),t=void 0,[k,i-p+1]}})}import{remark as Ee}from"remark";import ze from"remark-gfm";import{CONTINUE as Ne,visit as We}from"unist-util-visit";async function z(e,r,n){let{addMetaComment:t,closingPrefix:o,keywordPrefix:i,metaCommentIdentifier:a,rules:s}=n;b(s);let l=M(s),d=[];We(e,"html",(p,c,f)=>{if(f===void 0||c===void 0)return Ne;let g=R(p,f,{closingPrefix:o,keywordPrefix:i,metaCommentIdentifier:a});g!==void 0&&g.type==="open"&&l[g.keyword]!==void 0&&d.push(g)}),d.sort((p,c)=>l[p.keyword].applicationOrder-l[c.keyword].applicationOrder);for(let p of d){let{closingPrefix:c,html:f,keyword:g,keywordPrefix:$,node:O,options:te,parent:A}=p,oe=l[g],T="";try{T=await C(oe,te,e),T.trim()===""&&u(r,"error","expand",`Got empty content when expanding ${f}`,O)}catch(H){H instanceof Error&&u(r,"error","expand",`Caught error expanding ${f}, Error message: "${H.message}"`,O);continue}let ne=Ee().use(ze).parse(T).children,ie={type:"html",value:`<!-- ${c}${$}${g} -->`},se=A.children.indexOf(O);A.children.splice(se+1,0,...ne,ie),u(r,"info","expand",`Expanded: ${f}`,O)}if(t){let p="Warning: Content in HTML comment blocks generated by mdat",c=new Date().toISOString().slice(0,10),f={type:"html",value:`<!--${a} ${p} on ${c} ${a}-->`};e.children.unshift(f)}}import{fromHtml as Ie}from"hast-util-from-html";import{CONTINUE as N,SKIP as je,visit as re}from"unist-util-visit";function W(e,r){re(e,"html",(n,t,o)=>{if(o===void 0||t===void 0)return N;let i=qe(n);i.length>1&&(u(r,"warn","split","Multiple comments in a single HTML node.",n),o.children.splice(t,1,{children:i,type:"paragraph"}))})}function qe(e){let r=Ie(e.value,{fragment:!0}),n=[];return re(r,t=>{var o,i;return t.type==="root"?N:t.type==="text"?(n.push({position:_(t.position,(o=e.position)==null?void 0:o.start),type:"text",value:ee(e,t)}),N):(n.push({position:_(t.position,(i=e.position)==null?void 0:i.start),type:"html",value:ee(e,t)}),je)}),n}function _(e,r){if(!(e===void 0||r===void 0))return{end:{column:e.end.column-1+r.column,line:e.end.line-1+r.line,offset:e.end.offset!==void 0&&r.offset!==void 0?e.end.offset+r.offset:void 0},start:{column:e.start.column-1+r.column,line:e.start.line-1+r.line,offset:e.start.offset!==void 0&&r.offset!==void 0?e.start.offset+r.offset:void 0}}}function ee(e,r){if(r.position===void 0)throw new Error("Hast ElementContent node has no position!");return e.value.slice(r.position.start.offset,r.position.end.offset)}async function I(e,r,n){let{addMetaComment:t,closingPrefix:o,keywordPrefix:i,metaCommentIdentifier:a,rules:s}=n;W(e,r),E(e,r,{closingPrefix:o,keywordPrefix:i,metaCommentIdentifier:a}),await z(e,r,{addMetaComment:t,closingPrefix:o,keywordPrefix:i,metaCommentIdentifier:a,rules:s}),await F(e,r,{addMetaComment:t,closingPrefix:o,keywordPrefix:i,metaCommentIdentifier:a,paranoid:!1,rules:s})}import{deepmerge as Ae}from"deepmerge-ts";function j(e){return Array.isArray(e)?e.map(r=>r&&typeof r=="object"?j(r):r).filter(r=>r!==void 0):Object.entries(e).map(([r,n])=>[r,n&&typeof n=="object"?j(n):n]).reduce((r,[n,t])=>t===void 0?r:{...r,[n]:t},{})}function q(...e){let r=e.map((n,t)=>t===0?n:j(n));return Ae(...r)}import{z as x}from"zod";var He={addMetaComment:!1,closingPrefix:"/",keywordPrefix:"",metaCommentIdentifier:"+",rules:{mdat:"Powered by the Markdown Autophagic Template system: [mdat](https://github.com/kitschpatrol/mdat)."}},Le=x.object({addMetaComment:x.boolean().optional(),closingPrefix:x.string().optional(),keywordPrefix:x.string().optional(),metaCommentIdentifier:x.string().optional(),rules:v.optional()}).describe("Mdat Options"),Je=function(e){let r=q(He,e);return async function(n,t){await I(n,t,r)}},De=Je;export{q as deepMergeDefined,De as default,me as getMdatReports,ke as getSoleRule,Re as getSoleRuleKey,y as log,I as mdat,F as mdatCheck,E as mdatClean,z as mdatExpand,W as mdatSplit,Le as optionsSchema,de as reporterMdat,v as rulesSchema};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remark-mdat",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "A remark plugin implementing the Markdown Autophagic Template (mdat) system.",
6
6
  "repository": {
@@ -69,7 +69,7 @@
69
69
  "scripts": {
70
70
  "build": "tsup && tsc -p tsconfig.build.json",
71
71
  "dev": "pnpm run test",
72
- "mdat": "../mdat-readme/bin/cli.js --config ../../mdat.config.ts",
72
+ "mdat": "../mdat/bin/cli.js readme --config ../../mdat.config.ts",
73
73
  "test": "vitest"
74
74
  }
75
75
  }
package/readme.md CHANGED
@@ -1,4 +1,4 @@
1
- <!--+ Warning: Content in HTML comment blocks generated by mdat on 2024-02-08 +-->
1
+ <!--+ Warning: Content in HTML comment blocks generated by mdat on 2024-02-09 +-->
2
2
 
3
3
  <!-- header -->
4
4
 
@@ -12,7 +12,7 @@
12
12
  <!-- /header -->
13
13
 
14
14
  > \[!NOTE]\
15
- > **Please see the [Mdat Monorepo readme](http://github.com/kitschpatrol/mdat) for additional context.**
15
+ > **Please see [mdat](http://github.com/kitschpatrol/mdat) for a higher-level CLI tool and library with a collection of built-in expansion rules.**
16
16
 
17
17
  <!-- table-of-contents -->
18
18
 
@@ -54,9 +54,7 @@ And replace it with dynamic data. In this case, from `package.json`:
54
54
  <!-- /title -->
55
55
  ```
56
56
 
57
- This plugin powers the higher-level [`mdat`](../mdat) and [`mdat-readme`](../mdat-readme) packages in this monorepo. Either of those is a better place to start if you just want to expand some comments.
58
-
59
- Please see the [Mdat Monorepo readme](http://github.com/kitschpatrol/mdat) for much more information and context.
57
+ This plugin powers the higher-level [`mdat`](../mdat) package in this monorepo. [`mdat`](../mdat) is a better better place to start if you just want to expand some comments and aren't working directly with remark processing pipelines.
60
58
 
61
59
  ## Getting started
62
60
 
@@ -152,9 +150,7 @@ console.log(markdownOutput.toString())
152
150
  // <!-- /time -->
153
151
  ```
154
152
 
155
- See the [`mdat`](../mdat) package for a higher-level API and CLI that can operate directly on files or strings. It also provides dynamic rule loading and configuration resolution.
156
-
157
- [`mdat-readme`](../mdat-readme) also provides a higher-still API and CLI, and bundles a collection of rules convenient for use in readme files.
153
+ See the [`mdat`](../mdat) package for a higher-level API and CLI that can operate directly on files or strings. It also provides dynamic rule loading and configuration resolution, and bundles a collection of rules convenient for use in readme files.
158
154
 
159
155
  ## Utilities
160
156
 
@@ -206,7 +202,7 @@ The remark-mdat plugin chains these utilities together to accommodate the typica
206
202
 
207
203
  ## Acknowledgements
208
204
 
209
- Please see the [monorepo readme](../../readme.md#acknowledgments).
205
+ Please see the [mdat readme](../mdat/readme.md#acknowledgments).
210
206
 
211
207
  <!-- footer -->
212
208