markdown-magic 4.5.3 → 4.5.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markdown-magic",
3
- "version": "4.5.3",
3
+ "version": "4.5.6",
4
4
  "description": "Automatically update markdown files with content from external sources",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -42,9 +42,9 @@
42
42
  "dependencies": {
43
43
  "@davidwells/md-utils": "0.0.53",
44
44
  "color-convert": "^2.0.1",
45
- "comment-block-parser": "1.5.2",
46
- "comment-block-replacer": "0.1.11",
47
- "comment-block-transformer": "0.5.3",
45
+ "comment-block-parser": "1.5.4",
46
+ "comment-block-replacer": "0.1.13",
47
+ "comment-block-transformer": "0.5.5",
48
48
  "globrex": "^0.1.2",
49
49
  "gray-matter": "^4.0.3",
50
50
  "is-glob": "^4.0.3",
@@ -70,5 +70,5 @@
70
70
  "publishConfig": {
71
71
  "access": "public"
72
72
  },
73
- "gitHead": "98d153c1e31fabc748c71ea69ff7c5fb57dfcb08"
73
+ "gitHead": "afb6fd2c43370c3e0e7e545739c9aa8540960096"
74
74
  }
package/src/index.js CHANGED
@@ -176,13 +176,18 @@ async function markdownMagic(globOrOpts = {}, options = {}) {
176
176
  open = `${opts.matchWord}:start`
177
177
  }
178
178
 
179
- let close = CLOSE_WORD
180
- if (opts.close) {
179
+ // When open is custom and close not specified, leave close undefined
180
+ // to enable pattern mode in block-parser (auto-generates close as /OpenTag)
181
+ let close
182
+ if (opts.close !== undefined) {
181
183
  close = opts.close
182
184
  // @ts-ignore legacy
183
185
  } else if (opts.matchWord) {
184
186
  // @ts-ignore legacy
185
187
  close = `${opts.matchWord}:end`
188
+ } else if (!opts.open || opts.open === OPEN_WORD) {
189
+ // Only default to /docs when using default open word
190
+ close = CLOSE_WORD
186
191
  }
187
192
 
188
193
  const cwd = opts.cwd || process.cwd()
@@ -1 +1 @@
1
- {"version":3,"file":"cli-run.d.ts","sourceRoot":"","sources":["../../src/cli-run.js"],"names":[],"mappings":";AAsBA,6FAoLC"}
1
+ {"version":3,"file":"cli-run.d.ts","sourceRoot":"","sources":["../../src/cli-run.js"],"names":[],"mappings":";AA0GA,6FA4QC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":";;;yBAkDa,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM;;;;+BAK5B,MAAM,GAAC,KAAK,CAAC,MAAM,CAAC;iCAIpB,OAAO,wBAAwB,EAAE,kBAAkB;;;;;;;;;;YASlD,gBAAgB;;;;;;;;aAEhB,YAAY,GAAC,MAAM;;;;aACnB,UAAU;;;;WACV,MAAM;;;;YACN,MAAM;;;;UACN,MAAM;;;;oBACN,OAAO;;;;iBACP,OAAO;;;;UACP,OAAO;;;;YACP,OAAO;;;;aACP,OAAO;;;;8BACP,OAAO;;;;8BACP,OAAO;;;;0BACP,OAAO;;;;gBACP,MAAM;;;;;;;;;gBAMN,MAAM;;;;qBACN,OAAO;;;;;;;;8BAEP,OAAO;;;;;;;;;;;;;kBAQP,KAAK,CAAC,MAAM,CAAC;;;;;;AApD3B;;;GAGG;AAEH;;;GAGG;AAEH;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;GAOG;AAEH;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,2CARW,gBAAgB,GAAC,oBAAoB,YACrC,oBAAoB,GAClB,OAAO,CAAC,mBAAmB,CAAC,CA6lBxC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":";;;yBAkDa,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,MAAM;;;;+BAK5B,MAAM,GAAC,KAAK,CAAC,MAAM,CAAC;iCAIpB,OAAO,wBAAwB,EAAE,kBAAkB;;;;;;;;;;YASlD,gBAAgB;;;;;;;;aAEhB,YAAY,GAAC,MAAM;;;;aACnB,UAAU;;;;WACV,MAAM;;;;YACN,MAAM;;;;UACN,MAAM;;;;oBACN,OAAO;;;;iBACP,OAAO;;;;UACP,OAAO;;;;YACP,OAAO;;;;aACP,OAAO;;;;8BACP,OAAO;;;;8BACP,OAAO;;;;0BACP,OAAO;;;;gBACP,MAAM;;;;;;;;;gBAMN,MAAM;;;;qBACN,OAAO;;;;;;;;8BAEP,OAAO;;;;;;;;;;;;;kBAQP,KAAK,CAAC,MAAM,CAAC;;;;;;AApD3B;;;GAGG;AAEH;;;GAGG;AAEH;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;GAOG;AAEH;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,2CARW,gBAAgB,GAAC,oBAAoB,YACrC,oBAAoB,GAClB,OAAO,CAAC,mBAAmB,CAAC,CAqmBxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/transforms/code/index.js"],"names":[],"mappings":";;;AA+CiB,kDA8JhB;;;;;;;;;SAxLa,MAAM;;;;aACN,MAAM;;;;aACN,MAAM;;;;YACN,MAAM;;;;cACN,MAAM;;;;mBACN,OAAO"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/transforms/code/index.js"],"names":[],"mappings":";;;AA+CiB,kDA+JhB;;;;;;;;;SAzLa,MAAM;;;;aACN,MAAM;;;;aACN,MAAM;;;;YACN,MAAM;;;;cACN,MAAM;;;;mBACN,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/transforms/file.js"],"names":[],"mappings":"AAKiB,yCA+ChB"}
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/transforms/file.js"],"names":[],"mappings":"AAKiB,yCAsDhB"}
@@ -13,6 +13,12 @@ export function isLocalPath(filePath: string): boolean;
13
13
  export function writeFile(filePath: string, content: string): Promise<void>;
14
14
  export const readFile: typeof fs.readFile;
15
15
  export function findUp(start: any, fileName: any): Promise<string>;
16
+ /**
17
+ * Check if file's directory or any parent has .md-ignore
18
+ * @param {string} filePath - Absolute path to file
19
+ * @returns {boolean} True if should be ignored
20
+ */
21
+ export function hasIgnoreFile(filePath: string): boolean;
16
22
  export function resolveOutputPath(cwd: any, outputDir: any, file: any): string;
17
23
  export function resolveFlatPath(cwd: any, outputDir: any, file: any): string;
18
24
  export function resolveCommonParent(mainDir?: string, fileDir?: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../src/utils/fs.js"],"names":[],"mappings":"AAwLA;;;;GAIG;AACH,sCAHW,MAAM,GACJ,OAAO,CAKnB;AA5KD;;;;;GAKG;AACH,oCAJW,MAAM,WACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAUzB;;AAED,mEAeC;AAsGD,+EAeC;AAED,6EAQC;AAvCD,gFAYC;AA3DD,2EAUC;AApBD;;;;;GAKG;AACH,4CAJW,MAAM,OACN,MAAM,GACJ,MAAM,CAIlB;;iBA1FwB,QAAQ"}
1
+ {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../src/utils/fs.js"],"names":[],"mappings":"AAwLA;;;;GAIG;AACH,sCAHW,MAAM,GACJ,OAAO,CAKnB;AA5KD;;;;;GAKG;AACH,oCAJW,MAAM,WACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAUzB;;AAED,mEAeC;AAiJD;;;;GAIG;AACH,wCAHW,MAAM,GACJ,OAAO,CAenB;AA7DD,+EAeC;AAED,6EAQC;AAvCD,gFAYC;AA3DD,2EAUC;AApBD;;;;;GAKG;AACH,4CAJW,MAAM,OACN,MAAM,GACJ,MAAM,CAIlB;;iBA1FwB,QAAQ"}
@@ -1,3 +1,2 @@
1
- export function remoteRequestSync(url: any, settings: {}, srcPath: any): any;
2
1
  export function remoteRequest(url: any, settings: {}, srcPath: any): Promise<any>;
3
2
  //# sourceMappingURL=remoteRequest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"remoteRequest.d.ts","sourceRoot":"","sources":["../../../src/utils/remoteRequest.js"],"names":[],"mappings":"AAOA,6EAgBC;AAED,kFAmBC"}
1
+ {"version":3,"file":"remoteRequest.d.ts","sourceRoot":"","sources":["../../../src/utils/remoteRequest.js"],"names":[],"mappings":"AAMA,kFAmBC"}