|
| 1 | +<!-- |
| 2 | +
|
| 3 | +@license Apache-2.0 |
| 4 | +
|
| 5 | +Copyright (c) 2021 The Stdlib Authors. |
| 6 | +
|
| 7 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | +you may not use this file except in compliance with the License. |
| 9 | +You may obtain a copy of the License at |
| 10 | +
|
| 11 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +
|
| 13 | +Unless required by applicable law or agreed to in writing, software |
| 14 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | +See the License for the specific language governing permissions and |
| 17 | +limitations under the License. |
| 18 | +
|
| 19 | +--> |
| 20 | + |
1 | 21 | # Markdown |
2 | 22 |
|
3 | | -> Markdown recipes. |
| 23 | +> Markdown commands. |
4 | 24 |
|
5 | 25 | <!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. --> |
6 | 26 |
|
7 | 27 | <section class="intro"> |
8 | 28 |
|
9 | | -This directory contains [`make`][make] recipes for managing Markdown files. |
| 29 | +This directory contains [`make`][make] rules for managing Markdown files. |
10 | 30 |
|
11 | 31 | </section> |
12 | 32 |
|
13 | 33 | <!-- /.intro --> |
14 | 34 |
|
| 35 | +<!-- Usage documentation. --> |
| 36 | + |
| 37 | +<section class="usage"> |
| 38 | + |
| 39 | +## Usage |
| 40 | + |
| 41 | +```text |
| 42 | +Usage: make <command> [<ENV_VAR>=<value> <ENV_VAR>=<value> ...] |
| 43 | +``` |
| 44 | + |
| 45 | +### Commands |
| 46 | + |
| 47 | +#### markdown-asset-url |
| 48 | + |
| 49 | +Generates an asset URL (derived from the current Git hash) for inclusion in a project Markdown file. |
| 50 | + |
| 51 | +<!-- run-disable --> |
| 52 | + |
| 53 | +```bash |
| 54 | +$ make markdown-asset-url MARKDOWN_ASSET_PATH='./README.md' |
| 55 | +``` |
| 56 | + |
| 57 | +The command supports the following environment variables: |
| 58 | + |
| 59 | +- **MARKDOWN_ASSET_PATH**: a file path relative to the project root directory; e.g., `./README.md`. |
| 60 | + |
| 61 | +#### markdown-namespace-tocs |
| 62 | + |
| 63 | +Updates the table of contents of namespace Markdown files. |
| 64 | + |
| 65 | +<!-- run-disable --> |
| 66 | + |
| 67 | +```bash |
| 68 | +$ make markdown-namespace-tocs |
| 69 | +``` |
| 70 | + |
| 71 | +The command supports the following environment variables: |
| 72 | + |
| 73 | +- **MARKDOWN_PATTERN**: filename pattern; e.g., `*.md`. |
| 74 | +- **MARKDOWN_FILTER**: file path pattern; e.g., `.*/math/base/special/.*` |
| 75 | + |
| 76 | +<!-- run-disable --> |
| 77 | + |
| 78 | +```bash |
| 79 | +$ make markdown-namespace-tocs MARKDOWN_PATTERN='README.md' MARKDOWN_FILTER='.*/math/base/special/.*' |
| 80 | +``` |
| 81 | + |
| 82 | +#### markdown-pkg-urls |
| 83 | + |
| 84 | +Updates Markdown files by resolving package identifiers to GitHub repository URLs. |
| 85 | + |
| 86 | +<!-- run-disable --> |
| 87 | + |
| 88 | +```bash |
| 89 | +$ make markdown-pkg-urls |
| 90 | +``` |
| 91 | + |
| 92 | +The command supports the following environment variables: |
| 93 | + |
| 94 | +- **MARKDOWN_PATTERN**: filename pattern; e.g., `*.md`. |
| 95 | +- **MARKDOWN_FILTER**: file path pattern; e.g., `.*/math/base/special/.*` |
| 96 | + |
| 97 | +<!-- run-disable --> |
| 98 | + |
| 99 | +```bash |
| 100 | +$ make markdown-pkg-urls MARKDOWN_PATTERN='README.md' MARKDOWN_FILTER='.*/math/base/special/.*' |
| 101 | +``` |
| 102 | + |
| 103 | +* * * |
| 104 | + |
| 105 | +### Equations |
| 106 | + |
| 107 | +#### markdown-equations |
| 108 | + |
| 109 | +Processes Markdown files containing Markdown equation elements. |
| 110 | + |
| 111 | +<!-- run-disable --> |
| 112 | + |
| 113 | +```bash |
| 114 | +$ make markdown-equations |
| 115 | +``` |
| 116 | + |
| 117 | +The command supports the following environment variables: |
| 118 | + |
| 119 | +- **MARKDOWN_PATTERN**: filename pattern; e.g., `*.md`. |
| 120 | +- **MARKDOWN_FILTER**: file path pattern; e.g., `.*/math/base/special/.*` |
| 121 | + |
| 122 | +<!-- run-disable --> |
| 123 | + |
| 124 | +```bash |
| 125 | +$ make markdown-equations MARKDOWN_PATTERN='README.md' MARKDOWN_FILTER='.*/math/base/special/.*' |
| 126 | +``` |
| 127 | + |
| 128 | +Processed files are committed to source control. Accordingly, this command must be run on a clean working directory. |
| 129 | + |
| 130 | +#### markdown-img-equations |
| 131 | + |
| 132 | +Transforms Markdown files containing equation comment markup to include image equation elements. |
| 133 | + |
| 134 | +<!-- run-disable --> |
| 135 | + |
| 136 | +```bash |
| 137 | +$ make markdown-img-equations |
| 138 | +``` |
| 139 | + |
| 140 | +The command supports the following environment variables: |
| 141 | + |
| 142 | +- **MARKDOWN_PATTERN**: filename pattern; e.g., `*.md`. |
| 143 | +- **MARKDOWN_FILTER**: file path pattern; e.g., `.*/math/base/special/.*` |
| 144 | + |
| 145 | +<!-- run-disable --> |
| 146 | + |
| 147 | +```bash |
| 148 | +$ make markdown-img-equations MARKDOWN_PATTERN='README.md' MARKDOWN_FILTER='.*/math/base/special/.*' |
| 149 | +``` |
| 150 | + |
| 151 | +#### markdown-img-equations-src-urls |
| 152 | + |
| 153 | +Inserts resource URLs into Markdown image equation elements. |
| 154 | + |
| 155 | +<!-- run-disable --> |
| 156 | + |
| 157 | +```bash |
| 158 | +$ make markdown-img-equations-src-urls |
| 159 | +``` |
| 160 | + |
| 161 | +The command supports the following environment variables: |
| 162 | + |
| 163 | +- **MARKDOWN_PATTERN**: filename pattern; e.g., `*.md`. |
| 164 | +- **MARKDOWN_FILTER**: file path pattern; e.g., `.*/math/base/special/.*` |
| 165 | + |
| 166 | +<!-- run-disable --> |
| 167 | + |
| 168 | +```bash |
| 169 | +$ make markdown-img-equations-src-urls MARKDOWN_PATTERN='README.md' MARKDOWN_FILTER='.*/math/base/special/.*' |
| 170 | +``` |
| 171 | + |
| 172 | +This command assumes that image SVG equation files already exist and have been committed to source control. See `markdown-svg-equations`. |
| 173 | + |
| 174 | +#### markdown-svg-equations |
| 175 | + |
| 176 | +Generates SVG equation files from Markdown equation comments. |
| 177 | + |
| 178 | +<!-- run-disable --> |
| 179 | + |
| 180 | +```bash |
| 181 | +$ make markdown-svg-equations |
| 182 | +``` |
| 183 | + |
| 184 | +The command supports the following environment variables: |
| 185 | + |
| 186 | +- **MARKDOWN_PATTERN**: filename pattern; e.g., `*.md`. |
| 187 | +- **MARKDOWN_FILTER**: file path pattern; e.g., `.*/math/base/special/.*` |
| 188 | + |
| 189 | +<!-- run-disable --> |
| 190 | + |
| 191 | +```bash |
| 192 | +$ make markdown-svg-equations MARKDOWN_PATTERN='README.md' MARKDOWN_FILTER='.*/math/base/special/.*' |
| 193 | +``` |
| 194 | + |
| 195 | +#### clean-markdown-svg-equations |
| 196 | + |
| 197 | +Removes SVG equation files. |
| 198 | + |
| 199 | +<!-- run-disable --> |
| 200 | + |
| 201 | +```bash |
| 202 | +$ make clean-markdown-svg-equations |
| 203 | +``` |
| 204 | + |
| 205 | +The command supports the following environment variables: |
| 206 | + |
| 207 | +- **SVG_EQUATIONS_PATTERN**: filename pattern; e.g., `equation*.svg`. |
| 208 | +- **SVG_EQUATIONS_FILTER**: file path pattern; e.g., `.*/math/base/special/.*` |
| 209 | + |
| 210 | +<!-- run-disable --> |
| 211 | + |
| 212 | +```bash |
| 213 | +$ make clean-markdown-svg-equations SVG_EQUATIONS_PATTERN='equation*.svg' SVG_EQUATIONS_FILTER='.*/math/base/special/.*' |
| 214 | +``` |
| 215 | + |
| 216 | +</section> |
| 217 | + |
| 218 | +<!-- /.usage --> |
| 219 | + |
15 | 220 | <!-- Section to include notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. --> |
16 | 221 |
|
17 | 222 | <section class="notes"> |
|
0 commit comments