Skip to content

Commit fa766a3

Browse files
committed
Add recipe for operating on a specified file list
1 parent ac9265f commit fa766a3

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

tools/make/lib/markdown/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ The command supports the following environment variables:
5858

5959
- **MARKDOWN_ASSET_PATH**: a file path relative to the project root directory; e.g., `./README.md`.
6060

61+
* * *
62+
63+
### Namespace ToCs
64+
6165
#### markdown-namespace-tocs
6266

6367
Updates the table of contents of namespace Markdown files.
@@ -81,6 +85,26 @@ $ make markdown-namespace-tocs MARKDOWN_PATTERN='README.md' MARKDOWN_FILTER='.*/
8185

8286
This command is useful when wanting to glob for Markdown files (e.g., process all Markdown files for a particular package).
8387

88+
#### markdown-namespace-tocs-files
89+
90+
Updates the table of contents of a specified list of namespace Markdown files.
91+
92+
<!-- run-disable -->
93+
94+
```bash
95+
$ make markdown-namespace-tocs-files FILES='/foo/foo.md /foo/bar.md'
96+
```
97+
98+
The command supports the following environment variables:
99+
100+
- **FILES**: list of Markdown files.
101+
102+
This command is useful when wanting to process a list of Markdown files generated by some other command (e.g., a list of changed Markdown files obtained via `git diff`).
103+
104+
* * *
105+
106+
### Package URLs
107+
84108
#### markdown-pkg-urls
85109

86110
Updates Markdown files by resolving package identifiers to GitHub repository URLs.

tools/make/lib/markdown/namespace_toc.mk

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ REMARK_TOC_OUTPUT_FLAG ?= --output
4747
#
4848
# ## Notes
4949
#
50+
# - This rule is useful when wanting to glob for Markdown files (e.g., process all Markdown files for a particular package).
5051
# - In order to update table of contents, a namespace Markdown file must contain namespace table of contents comments.
5152
#
5253
# @param {string} [MARKDOWN_FILTER] - file path pattern (e.g., `.*/math/base/special/.*`)
@@ -58,10 +59,31 @@ REMARK_TOC_OUTPUT_FLAG ?= --output
5859
# @example
5960
# make markdown-namespace-tocs MARKDOWN_PATTERN='README.md' MARKDOWN_FILTER='.*/math/base/special/.*'
6061
#/
61-
markdown-namespace-tocs: $(NODE_MODULES) assert-clean-working-directory
62+
markdown-namespace-tocs: $(NODE_MODULES)
6263
$(QUIET) NODE_PATH="$(NODE_PATH)" $(REMARK) $(MARKDOWN_FILES) \
6364
$(REMARK_TOC_FLAGS) \
6465
$(REMARK_TOC_PLUGIN_FLAGS) \
6566
$(REMARK_TOC_OUTPUT_FLAG)
6667

6768
.PHONY: markdown-namespace-tocs
69+
70+
#/
71+
# Updates the table of contents of a specified list of namespace Markdown files.
72+
#
73+
# ## Notes
74+
#
75+
# - This rule is useful when wanting to process a list of Markdown files generated by some other command (e.g., a list of changed Markdown files obtained via `git diff`).
76+
# - In order to update table of contents, a namespace Markdown file must contain namespace table of contents comments.
77+
#
78+
# @param {string} FILES - list of files
79+
#
80+
# @example
81+
# make markdown-namespace-tocs-files FILES='/foo/foo.md /foo/bar.md'
82+
#/
83+
markdown-namespace-tocs-files: $(NODE_MODULES)
84+
$(QUIET) NODE_PATH="$(NODE_PATH)" $(REMARK) $(FILES) \
85+
$(REMARK_TOC_FLAGS) \
86+
$(REMARK_TOC_PLUGIN_FLAGS) \
87+
$(REMARK_TOC_OUTPUT_FLAG)
88+
89+
.PHONY: markdown-namespace-tocs-files

0 commit comments

Comments
 (0)