-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.md.jinja2
615 lines (516 loc) · 32.1 KB
/
README.md.jinja2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
<!--
{% set project_name='snipinator' %}
{% set project_name_proper='Snipinator' %}
{% set last_release=shell('tomlq -r -e \'.["tool"]["snipinator-project-metadata"]["last_release"]\' pyproject.toml',
include_args=False) | trim %}
{% set last_stable_release=shell('tomlq -r -e \'.["tool"]["snipinator-project-metadata"]["last_stable_release"]\' pyproject.toml',
include_args=False) | trim %}
{% set tested_python_versions=shell('python -m yq -r -c \'[.jobs["build-and-test"]["strategy"]["matrix"]["python-version"][].gh] | join(", ")\' .github/workflows/build-and-test.yml',
include_args=False) | trim %}
{% set dev_dependencies=shell('python -m yq -r -c \'.dev | keys_unsorted | join(" ")\' .github/dependencies.yml',
include_args=False)|trim %}
{% set badge_color='0A1E1E' %}
-->
# <div align="center">[![{{project_name_proper}}][1]][2]</div>
<div align="center">
<!-- Icons from https://lucide.dev/icons/users -->
<!-- Icons from https://lucide.dev/icons/laptop-minimal -->
![**Audience:** Developers][3] ![**Platform:** Linux][4]
</div>
<p align="center">
<strong>
<a href="https://github.com/realazthat/{{project_name}}">🏠Home</a>
•
<a href="#-features">🎇Features</a>
•
<a href="#-install">🔨Install</a>
•
<a href="#-usage">🚜Usage</a>
•
<a href="#-command-line-options">💻CLI</a>
•
<a href="#-examples">💡Examples</a>
</strong>
</p>
<p align="center">
<strong>
<a href="#-jinja2-api">🤖Jinja2 API</a>
•
<a href="#-requirements">✅Requirements</a>
•
<a href="#-docker-image">🐳Docker</a>
•
<a href="#-gotchas-and-limitations">🚸Gotchas</a>
</strong>
</p>
<div align="center">
![Top language][5] [![GitHub License][6]][7] [![PyPI - Version][8]][9]
[![Python Version][10]][9]
**CLI to embed (testable) snippets from your codebase into your README**
</div>
---
<div align="center">
| | Status | Stable | Unstable | |
| ----------------- | --------------------------- | ------------------------- | ------------------------- | ------------------------ |
| **[Master][11]** | [![Build and Test][12]][13] | [![since tagged][14]][15] | | [![last commit][16]][17] |
| **[Develop][18]** | [![Build and Test][19]][13] | [![since tagged][20]][21] | [![since tagged][22]][23] | [![last commit][24]][25] |
</div>
<img src="./.github/demo.gif" alt="Demo" width="100%">
## ❔ What
What it does: **{{project_name_proper}}** lets you take a `EXAMPLE.md` template
and include snippets from your (working and tested) codebase.
Turn this ({{ path('./snipinator/examples/SIMPLE.md.jinja2', link='md') }}):
<!--{{ rawsnippet('./snipinator/examples/SIMPLE.md.jinja2', backtickify='md', decomentify='nl') }}-->
Into this ({{ path('./snipinator/examples/SIMPLE.generated.md', link='md') }}):
<!--{{ rawsnippet('./snipinator/examples/SIMPLE.generated.md', backtickify='md', decomentify='nl') }}-->
## 🎇 Features
- 📦✅🪄 Supports anything **[Jinja2](https://github.com/pallets/jinja)**
supports.
- 🥇🐍📜 First-class support for **python** source code.
- Can include python function signatures, docstrings, entire function source
code, classes.
- ✂🌐🗂️ Snip from **any source code language**.
- Put delimiter markers into the code (e.g `# START_SNIPPET`,
`# END_TEMPLATE`), and use [snippet()](#snippet).
- 🥇🔖📜 First-class support for **Markdown** templates (with `backtickify`,
`decomentify`).
- 📦🐚🖨️ Can include **[shell](#shell) output**.
- Supports ANSI colors :heart: :green_heart: :blue_heart: with SVG output
:camera:.
- ⚙️🔗🗃️ More robust **references/links** to local files using [path()](#path).
- 🐳🌊🖥️ Docker Image (See [README: Docker Image](#-docker-image)).
## 🔨 Install
```bash
# Install from pypi (https://pypi.org/project/{{project_name}}/)
pip install {{project_name}}
# Install from git (https://github.com/realazthat/{{project_name}})
pip install git+https://github.com/realazthat/{{project_name}}.git@v{{last_stable_release}}
```
## 🚜 Usage
Example template README:
({{path('./snipinator/examples/SIMPLE.md.jinja2', link='md')}}):
<!--{{ rawsnippet('./snipinator/examples/SIMPLE.md.jinja2', backtickify='md', decomentify='nl') }}-->
Generating the README:
<!--{{ shell('python -m snipinator.cli -t snipinator/examples/SIMPLE.md.jinja2', backtickify='bash', decomentify='nl') }}-->
Fuller example:
<!--{{ shell('cat ./.deleteme/simple_example.output',
start=': ECHO_SNIPPET_START',
end='^.*: ECHO_SNIPPET_END',
regex='MULTILINE',
rich='README.example.generated.svg',
rich_alt='Output of `bash ./snipinator/examples/simple_example.sh`',
rich_bg_color='black',
rich_term='xterm-256color',
rich_cols=160,
include_args=False,
decomentify='nl') }}-->
## 💻 Command Line Options
<!--{{ shell('python -m snipinator.cli --help',
rich='README.help.generated.svg',
rich_alt='Output of `python -m snipinator.cli --help`',
rich_bg_color='black',
rich_term='xterm-256color',
rich_cols=160,
decomentify='nl') }}-->
## 💡 Examples
- {{project_name_proper}}'s own `README`:
- Template: {{path('./.github/README.md.jinja2', link='md')}}.
- Generated: {{path('./README.md', link='md')}}.
- Generation script: {{path('./scripts/generate-readme.sh', link='md')}}.
- Example:
- Template: {{path('./snipinator/examples/SIMPLE.md.jinja2', link='md')}}.
- Generated: {{path('./snipinator/examples/SIMPLE.generated.md', link='md')}}.
- Generation script:
{{path('./snipinator/examples/simple_example.sh', link='md')}}.
- Long example of many features:
- Template:
{{path('./snipinator/examples/LONG-EXAMPLE.md.jinja2', link='md')}}.
- Generated:
{{path('./snipinator/examples/LONG-EXAMPLE.generated.md', link='md')}}.
- Generation script:
{{path('./snipinator/examples/long_example.sh', link='md')}}.
- Projects using {{project_name_proper}}:
- [realazthat/snipinator][26]
- Template: {{path('./.github/README.md.jinja2', link='md')}}.
- Generated: [snipinator/README.md][27].
- Generation script: [snipinator/scripts/generate-readme.sh#L20][28].
- [realazthat/mdremotifier][29].
- Template: [mdremotifier/README.md.jinja2][30].
- Generated: [mdremotifier/README.md][31].
- Generation script: [mdremotifier/generate-readme.sh#L20][32].
- [realazthat/changeguard][33].
- Template: [changeguard/README.md.jinja2][34].
- Generated: [changeguard/README.md][35].
- Generation script: [changeguard/generate-readme.sh#L20][36].
- [realazthat/excalidraw-brute-export-cli][37],
- Template: [excalidraw-brute-export-cli/README.md.jinja2][38].
- Generated: [excalidraw-brute-export-cli/README.md][39].
- Generation script:
[excalidraw-brute-export-cli/generate-readme.sh#L65][40].
- [realazthat/comfy-catapult][41].
- Template: [comfy-catapult/README.md.jinja2][42].
- Generated: [comfy-catapult/README.md][43].
- Generation script: [comfy-catapult/generate-readme.sh#L17][44].
- [realazthat/comfylowda][45].
- Template: [comfylowda/README.md.jinja2][46].
- Generated: [comfylowda/README.md][47].
- Generation script: [comfylowda/generate-readme.sh#L17][48].
## 🤖 Jinja2 API
The regular Jinja2 v3 template syntax is supported. For more information, see
[Template Designer Documentation](https://jinja.palletsprojects.com/en/3.1.x/templates/).
Additional (Jinja2) functions made available:
### 🐍✂ pysnippet
Used several times in
{{path('./snipinator/examples/LONG-EXAMPLE.md.jinja2', link='md')}}.
Documentation:
<!--{{ pysignature(path='./snipinator/snipinate.py', symbol='pysnippet', backtickify='py', decomentify='nl') }}-->
### 🐍📖 pysignature
Used several times in {{path('./.github/README.md.jinja2', link='md')}}.
Documentation:
<!--{{ pysignature(path='./snipinator/snipinate.py', symbol='pysignature', backtickify='py', decomentify='nl') }}-->
### ✂ rawsnippet
Used several times in {{path('./.github/README.md.jinja2', link='md')}}.
Documentation:
<!--{{ pysignature(path='./snipinator/snipinate.py', symbol='rawsnippet', backtickify='py', decomentify='nl') }}-->
### ✂ snippet
Example in {{path('./snipinator/examples/LONG-EXAMPLE.md.jinja2', link='md')}}.
Documentation:
<!--{{ pysignature(path='./snipinator/snipinate.py', symbol='snippet', backtickify='py', decomentify='nl') }}-->
### 🐚 shell
Used several times in {{path('./.github/README.md.jinja2', link='md')}}.
Documentation:
<!--{{ pysignature(path='./snipinator/snipinate.py', symbol='shell', backtickify='py', decomentify='nl') }}-->
### 🌀 path
Used several times in {{path('./.github/README.md.jinja2', link='md')}}.
Documentation:
<!--{{ pysignature(path='./snipinator/snipinate.py', symbol='path', backtickify='py', decomentify='nl') }}-->
## ✅ Requirements
- Linux-like environment
- Why: Uses pexpect.spawn().
- Python 3.8+
- Why: Some dev dependencies require Python 3.8+.
### Tested Platforms
- WSL2 Ubuntu 20.04, Python `{{rawsnippet('./.python-version') | trim}}`.
- Ubuntu 20.04, Python `{{tested_python_versions}}`, tested in GitHub Actions
workflow ([build-and-test.yml](./.github/workflows/build-and-test.yml)).
## 🐳 Docker Image
Docker images are published to [ghcr.io/realazthat/{{project_name}}][49] at each
tag.
<!--{{snippet('./snipinator/examples/remote-docker_example-noautorun.sh',
start='# SNIPPET_START',
end='\n# SNIPPET_END',
backtickify='bash',
decomentify='nl')|trim}}-->
If you want to build the image yourself, you can use the Dockerfile in the
repository.
<!--{{snippet('./snipinator/examples/local-docker_example.sh',
start='# SNIPPET_START',
end='\n# SNIPPET_END',
backtickify='bash',
decomentify='nl')|trim}}-->
## 🚸 Gotchas and Limitations
- **Security:** This tool is NOT designed to be used with untrusted input. It is
designed to be used with your own codebase. Even when using your own input, be
careful that your own code won't be doing anything that might inadvertently
include untrusted input.
- Be careful to escape `{% raw %}{{{% endraw %}` and `{% raw %}}}{% endraw %}`,
or `{% raw %}{%{% endraw %}` and `{% raw %}%}{% endraw %}` or anything jinja2
is sensitive to, in the templates. You'll have to escape it properly for
jinja2, which involves using `{% raw %}{% raw %}{% endraw %}` and
`{% raw %}{%{% endraw %} endraw {% raw %}%}{% endraw %}` tags.
- Recursion: {{project_name_proper}} doesn't directly support recursive
inclusion of generated content. You can generate the contents of one file
first, and include that generated content into another template. This would
mean that you have to worry about order of generation.
- Embedded Backticks: If there are backticks in the included snippet, it might
ruin the backticks you have in your markdown. This is why `backtickify`
parameter exists in the API, so that {{project_name_proper}} provides the
backticks, and it will detect if there are backticks in the snippet and use a
different number of backticks on the entire snippet. So if the snippet
contains ` ```My Snippet``` `, {{project_name_proper}} will use
` ````language ```My Snippet``` ```` ` and this is a method that Markdown uses
to allow embedded backticks inside a code block.
- Formatting: The `{% raw %}{{{% endraw %}` `{% raw %}}}{% endraw %}` used to
surround the snippet calls will unfortunately be formatted by a Markdown
formatter and make the call invalid. Workarounds:
- **Decommentify**: Put the snippet call inside a HTML comment, then use
`decommentify` parameter. See
{{path('./snipinator/examples/LONG-EXAMPLE.md.jinja2', link='md')}} for
examples.
- [prettier](https://prettier.io/) formatter is pretty good at leaving the
Jinja2 calls alone, especially if you don't have any spaces. This especially
helps for markdown "reference-style links" that have Jinja2 calls in them
generating part of the URL, mdformat will URL encode the Jinja2 calls,
and/or split them on spaces, which is not what we want. prettier will leave
them alone.
- For code blocks: If you embed the snippet call in a code block, it will not
be formatted. However, because of **Embedded Backticks** gotcha, (see
above), this is not recommended, unless you know for sure that there are no
embedded backticks.
- If your formatter supports a comment that disabled formatting, you can
surround the snippet call with that comment.
- Editing the wrong file: When you have a template and a generated file, it is
easy to edit the wrong file. To combat this:
- {{project_name_proper}} provides a warning at the top of the generated file
to remind you that it is auto-generated.
- {{project_name_proper}} will optionally chmod the file for you to make it
read-only.
- Newlines: This program assumes LF newlines. I don't know if it will work for
anything else.
- Combining `backtickify` and `indent`: Doesn't make much sense, but if you do
it, it will run backtickify first, then indent everything including the
backticks.
## 🤏 Versioning
We use SemVer for versioning. For the versions available, see the tags on this
repository.
## 🔑 License
This project is licensed under the MIT License - see the
{{path('./LICENSE.md', link='md')}} file for details.
## 🙏 Thanks
Main libraries used in {{project_name_proper}} are:
- Templating: [Jinja2](https://github.com/pallets/jinja).
- Snippet inclusion: Python's AST library.
- Colorful CLI help: [rich-argparse](https://github.com/hamdanal/rich-argparse).
- ANSI coloring shell output:
{[pexpect](https://pexpect.readthedocs.io/en/stable/),
[rich](https://github.com/Textualize/rich)}.
## 🤝 Related Projects
Not complete, and not necessarily up to date. Make a PR
([contributions](#-contributions)) to insert/modify.
| Project | Stars | Last Update | Language | Platform | Similarity X Obviousness |
| ------------------------------------------------------------------- | --------- | ------------ | ---------- | ------------------------ | ------------------------ |
| [mdx-js / mdx][50] | 16.8k | `2024/04/17` | JS | N/A | ⭐⭐⭐⭐⭐ |
| [fletcher / MultiMarkdown-6][51] | 599 | `2023/12/30` | C | CLI | ⭐⭐⭐⭐⭐ |
| [gajus / gitdown][52] | 448 | `2022/03/01` | JS | CLI | ⭐⭐⭐⭐⭐ |
| [gpoore / codebraid][53] | 362 | `2023/10/17` | Python | CLI | ⭐⭐⭐⭐⭐ |
| [amyreese / markdown-pp][54] (archived) | 307 | `2021/09/02` | Python | CLI | ⭐⭐⭐⭐⭐ |
| [zakhenry / embedme][55] | 222 | `2023/11/08` | JS | CLI | ⭐⭐⭐⭐⭐ |
| [DCsunset / pandoc-include][56] | 62 | `2024/04/30` | Python | Pandoc / CLI | ⭐⭐⭐⭐⭐ |
| [BurdetteLamar / markdown_helper][57] | 38 | `2020/03/16` | Ruby | CLI | ⭐⭐⭐⭐⭐ |
| [SimonCropp / MarkdownSnippets][58] | 23 | `2024/04/23` | .NET | CLI | ⭐⭐⭐⭐⭐ |
| [endocode / snippetextractor][59] | 4 | `2014/08/16` | C++ | CLI | ⭐⭐⭐⭐⭐ |
| [polywrap / doc-snippets][60] | 3 | `2023/09/26` | JS | CLI | ⭐⭐⭐⭐⭐ |
| [hxtmike / markdown_include][61] | 2 | `2024/05/09` | Python | CLI | ⭐⭐⭐⭐⭐ |
| [JulianCataldo / remark-embed][62] | 2 | `2022/09/22` | JS | JS / library | ⭐⭐⭐⭐⭐ |
| [xrd / oreilly-snippets][63] | 2 | `2015/10/15` | Ruby | Ruby / library | ⭐⭐⭐⭐⭐ |
| [DamonOehlman / injectcode][64] | 1 | `2021/08/01` | JS | CLI | ⭐⭐⭐⭐⭐ |
| [electrovir / markdown-code-example-inserter][65] | 1 | `2024/02/19` | JS | CLI | ⭐⭐⭐⭐⭐ |
| [andersfischernielsen / Simple-Embedded-Markdown-Code-Snippets][66] | 1 | `2021/02/12` | JS | CLI | ⭐⭐⭐⭐⭐ |
| [ildar-shaimordanov / git-markdown-snippet][67] | 0 | `2021/09/14` | Perl | CLI | ⭐⭐⭐⭐⭐ |
| [marc-bouvier-graveyard / baldir_markdown][68] | 0 | `2020/06/15` | Python | CLI | ⭐⭐⭐⭐⭐ |
| [facelessuser / pymdown-extensions][69] ([snippets][70]) | 903 | `2024/05/05` | Python | Python / PyMarkdown | ⭐⭐⭐⭐ |
| [dineshsonachalam / markdown-autodocs][71] | 176 | `2022/09/19` | JS | GH Action | ⭐⭐⭐⭐ |
| [sethen / markdown-include][72] | 148 | `2017/10/26` | JS | CLI+config | ⭐⭐⭐⭐ |
| [cmacmackin / markdown-include][73] | 95 | `2023/02/07` | Python | Python / library | ⭐⭐⭐⭐ |
| [tokusumi / markdown-embed-code][74] | 28 | `2022/01/05` | Python | GH Action | ⭐⭐⭐⭐ |
| [sammndhr / gridsome-remark-embed-snippet][75] | 2 | `2021/06/14` | JS | [Gridsome][76] | ⭐⭐⭐⭐ |
| [NativeScript / markdown-snippet-injector][77] | 4 | `2019/01/24` | JS | CLI | ⭐⭐⭐⭐ |
| [fossunited/markdown-macros][78] | 0 | `2021/06/10` | Python | Python / Python-Markdown | ⭐⭐⭐⭐ |
| [fuxingloh / remark-code-import-replace][79] | 0 | `2022/12/21` | JS | Remark? | ⭐⭐⭐⭐ |
| [teyc / markdown-snippet][80] | 0 | `2024/01/22` | Powershell | Powershell / function | ⭐⭐⭐⭐ |
| [szkiba / mdcode][81] | 15 | `2014/02/12` | Go | CLI | ⭐⭐⭐ |
| [devincornell/pymddoc][82] | 0 | `2023/12/01` | Python | Python | ⭐⭐⭐ |
| [shiftkey / scribble][83] ([docs][84]) | 40 | `2013/08/08` | .NET | CLI | ⭐⭐ |
| [calebpeterson / jest-transformer-test-md][85] | 2 | `2020/08/21` | JS | Jest Tests | ⭐⭐ |
| [tjstankus / commitate][86] | 0 | `2014/05/29` | Ruby | CLI | ⭐ |
| [GitHub Docs: Creating a permanent link to a code snippet][87] | N/A | N/A | N/A | GitHub | ⭐ |
| [javierfernandes / markdown-exercises][88] | 1 | `2017/05/01` | JS | N/A | ⭐ |
| [gatsby-remark-embed-snippet][89] | N/A (55k) | `2024/01/23` | JS | [Gatsby][90] | ⭐ |
| [ARMmbed / snippet][91] ([docs][92]) | 6 | `2021/08/05` | Python | CLI | ⭐ |
| [drewavis / markdowninclude][93] | 1 | `2024/04/06` | JS | VSCode Extension | ? |
| [romnn / embedme][94] | 0 | `2024/04/18` | Go | N/A | ⭐ |
## 🫡 Contributions
### Development environment: Linux-like
- For running `pre.sh` (Linux-like environment).
- From {{path('./.github/dependencies.yml', link='md')}}, which is used for
the GH Action to do a fresh install of everything:
{{shell('python -m yq --yaml-output \'.dev\' .github/dependencies.yml',
include_args=False,
backtickify='yaml',
indented=4
)}}
- On Ubuntu: `sudo apt-get update` and then
`sudo apt-get install -y {{dev_dependencies}}`.
- Requires `pyenv`, or an exact matching version of python as in
{{path('./.python-version', link='md')}} (which is currently
`{{ rawsnippet('./.python-version') | trim }}`).
- act (to run the GH Action locally):
- Requires nodejs.
- Requires Go.
- docker.
- Generate animation:
- docker
- docker (for building the docker image).
### Commit Process
1. (Optionally) Fork the `develop` branch.
2. Stage your files: `git add path/to/file.py`.
3. `bash ./scripts/pre.sh`, this will format, lint, and test the code.
4. `git status` check if anything changed (generated
{{path('./README.md', link='md')}} for example), if so, `git add` the
changes, and go back to the previous step.
5. `git commit -m "..."`.
6. Make a PR to `develop` (or push to develop if you have the rights).
## 🔄🚀 Release Process
These instructions are for maintainers of the project.
1. In the `develop` branch, run `bash {{path('./scripts/pre.sh')}}` to ensure
everything is in order.
2. In the `develop` branch, bump the version in
{{path('./pyproject.toml', link='md')}}, following semantic versioning
principles. Also modify the `last_release` and `last_stable_release` in the
`[tool.{{project_name}}-project-metadata]` table as appropriate. Run
`bash ./scripts/pre.sh` to ensure everything is in order.
3. In the `develop` branch, commit these changes with a message like
`"Prepare release X.Y.Z"`. (See the contributions section
[above](#commit-process)).
4. Merge the `develop` branch into the `master` branch:
`git checkout master && git merge develop --no-ff`.
5. `master` branch: Tag the release: Create a git tag for the release with
`git tag -a vX.Y.Z -m "Version X.Y.Z"`.
6. Publish to PyPI: Publish the release to PyPI with
`bash ./scripts/deploy-to-pypi.sh`.
7. Push to GitHub: Push the commit and tags to GitHub with
`git push && git push --tags`.
8. The `--no-ff` option adds a commit to the master branch for the merge, so
refork the develop branch from the master branch:
`git checkout develop && git merge master`.
9. Push the develop branch to GitHub: `git push origin develop`.
[1]: ./.github/logo-exported.svg
[2]: https://github.com/realazthat/{{project_name}}
[3]:
https://img.shields.io/badge/Audience-Developers-{{badge_color}}?style=plastic&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXVzZXJzIj48cGF0aCBkPSJNMTYgMjF2LTJhNCA0IDAgMCAwLTQtNEg2YTQgNCAwIDAgMC00IDR2MiIvPjxjaXJjbGUgY3g9IjkiIGN5PSI3IiByPSI0Ii8+PHBhdGggZD0iTTIyIDIxdi0yYTQgNCAwIDAgMC0zLTMuODciLz48cGF0aCBkPSJNMTYgMy4xM2E0IDQgMCAwIDEgMCA3Ljc1Ii8+PC9zdmc+
[4]:
https://img.shields.io/badge/Platform-Linux-{{badge_color}}?style=plastic&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWxhcHRvcC1taW5pbWFsIj48cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTIiIHg9IjMiIHk9IjQiIHJ4PSIyIiByeT0iMiIvPjxsaW5lIHgxPSIyIiB4Mj0iMjIiIHkxPSIyMCIgeTI9IjIwIi8+PC9zdmc+
[5]:
https://img.shields.io/github/languages/top/realazthat/{{project_name}}.svg?cacheSeconds=28800&style=plastic&color={{badge_color}}
[6]:
https://img.shields.io/github/license/realazthat/{{project_name}}?style=plastic&color={{badge_color}}
[7]: ./LICENSE.md
[8]:
https://img.shields.io/pypi/v/{{project_name}}?style=plastic&color={{badge_color}}
[9]: https://pypi.org/project/{{project_name}}/
[10]:
https://img.shields.io/pypi/pyversions/{{project_name}}?style=plastic&color={{badge_color}}
[11]: https://github.com/realazthat/{{project_name}}/tree/master
[12]:
https://img.shields.io/github/actions/workflow/status/realazthat/{{project_name}}/build-and-test.yml?branch=master&style=plastic
[13]:
https://github.com/realazthat/{{project_name}}/actions/workflows/build-and-test.yml
[14]:
https://img.shields.io/github/commits-since/realazthat/{{project_name}}/v{{last_stable_release}}/master?style=plastic
[15]:
https://github.com/realazthat/{{project_name}}/compare/v{{last_stable_release}}...master
[16]:
https://img.shields.io/github/last-commit/realazthat/{{project_name}}/master?style=plastic
[17]: https://github.com/realazthat/{{project_name}}/commits/master
[18]: https://github.com/realazthat/{{project_name}}/tree/develop
[19]:
https://img.shields.io/github/actions/workflow/status/realazthat/{{project_name}}/build-and-test.yml?branch=develop&style=plastic
[20]:
https://img.shields.io/github/commits-since/realazthat/{{project_name}}/v{{last_stable_release}}/develop?style=plastic
[21]:
https://github.com/realazthat/{{project_name}}/compare/v{{last_stable_release}}...develop
[22]:
https://img.shields.io/github/commits-since/realazthat/{{project_name}}/v{{last_release}}/develop?style=plastic
[23]:
https://github.com/realazthat/{{project_name}}/compare/v{{last_release}}...develop
[24]:
https://img.shields.io/github/last-commit/realazthat/{{project_name}}/develop?style=plastic
[25]: https://github.com/realazthat/{{project_name}}/commits/develop
[26]: https://github.com/realazthat/{{project_name}}
[27]:
https://github.com/realazthat/snipinator/blob/376cb1d83124ad00ce7c2a887d713ac2a85b9258/README.md?plain=1
[28]:
https://github.com/realazthat/snipinator/blob/376cb1d83124ad00ce7c2a887d713ac2a85b9258/scripts/generate-readme.sh#L20
[29]: https://github.com/realazthat/mdremotifier
[30]:
https://github.com/realazthat/mdremotifier/blob/b1ea58ebb4f1b223719c6103d67ed5d588e66181/README.md.jinja2
[31]:
https://github.com/realazthat/mdremotifier/blob/b1ea58ebb4f1b223719c6103d67ed5d588e66181/README.md?plain=1
[32]:
https://github.com/realazthat/mdremotifier/blob/b1ea58ebb4f1b223719c6103d67ed5d588e66181/scripts/generate-readme.sh#L20
[33]: https://github.com/realazthat/changeguard
[34]:
https://github.com/realazthat/changeguard/blob/909d21314de67f66ea05c6603a6df1d675d86697/README.md.jinja2
[35]:
https://github.com/realazthat/changeguard/blob/909d21314de67f66ea05c6603a6df1d675d86697/README.md?plain=1
[36]:
https://github.com/realazthat/changeguard/blob/909d21314de67f66ea05c6603a6df1d675d86697/scripts/generate-readme.sh#L20
[37]: https://github.com/realazthat/excalidraw-brute-export-cli
[38]:
https://github.com/realazthat/excalidraw-brute-export-cli/blob/4b689ab75cfdec71e5788b3194f8736246e7544f/README.md.jinja2
[39]:
https://github.com/realazthat/excalidraw-brute-export-cli/blob/4b689ab75cfdec71e5788b3194f8736246e7544f/README.md?plain=1
[40]:
https://github.com/realazthat/excalidraw-brute-export-cli/blob/4b689ab75cfdec71e5788b3194f8736246e7544f/scripts/generate-readme.sh#L65
[41]: https://github.com/realazthat/comfy-catapult
[42]:
https://github.com/realazthat/comfy-catapult/blob/ff353d48b25fa7b9c35fa11b31d5f2b3039c41c8/README.md.jinja2
[43]:
https://github.com/realazthat/comfy-catapult/blob/ff353d48b25fa7b9c35fa11b31d5f2b3039c41c8/README.md?plain=1
[44]:
https://github.com/realazthat/comfy-catapult/blob/ff353d48b25fa7b9c35fa11b31d5f2b3039c41c8/scripts/gen-readme.sh#L17
[45]: https://github.com/realazthat/comfylowda
[46]:
https://github.com/realazthat/comfylowda/blob/e01a32c38107aa0b89ccea21c4678d193a186a78/README.md.jinja2
[47]:
https://github.com/realazthat/comfylowda/blob/e01a32c38107aa0b89ccea21c4678d193a186a78/README.md?plain=1
[48]:
https://github.com/realazthat/comfylowda/blob/e01a32c38107aa0b89ccea21c4678d193a186a78/scripts/gen-readme.sh#L19
[49]: https://ghcr.io/realazthat/{{project_name}}
[50]: https://github.com/mdx-js/mdx
[51]: https://github.com/fletcher/MultiMarkdown-6
[52]: https://github.com/gajus/gitdown
[53]: https://github.com/gpoore/codebraid
[54]: https://github.com/amyreese/markdown-pp "Archived"
[55]: https://github.com/zakhenry/embedme
[56]: https://github.com/DCsunset/pandoc-include
[57]: https://github.com/BurdetteLamar/markdown_helper
[58]: https://github.com/SimonCropp/MarkdownSnippets
[59]: https://github.com/endocode/snippetextractor
[60]: https://github.com/polywrap/doc-snippets
[61]: https://github.com/hxtmike/markdown_include
[62]: https://github.com/JulianCataldo/remark-embed
[63]: https://github.com/xrd/oreilly-snippets
[64]: https://github.com/DamonOehlman/injectcode
[65]: https://github.com/electrovir/markdown-code-example-inserter
[66]:
https://github.com/andersfischernielsen/Simple-Embedded-Markdown-Code-Snippets
[67]: https://github.com/ildar-shaimordanov/git-markdown-snippet
[68]: https://github.com/marc-bouvier-graveyard/baldir_markdown
[69]: https://github.com/facelessuser/pymdown-extensions
[70]: https://facelessuser.github.io/pymdown-extensions/extensions/snippets/
[71]: https://github.com/dineshsonachalam/markdown-autodocs
[72]:
https://github.com/sethen/markdown-include
"CLI but requires that you make a json file with various optiosn to produce the output"
[73]: https://github.com/cmacmackin/markdown-include
[74]: https://github.com/tokusumi/markdown-embed-code
[75]: https://github.com/sammndhr/gridsome-remark-embed-snippet
[76]: https://gridsome.org/
[77]: https://github.com/NativeScript/markdown-snippet-injector
[78]: https://github.com/fossunited/markdown-macros
[79]: https://github.com/fuxingloh/remark-code-import-replace
[80]: https://github.com/teyc/markdown-snippet
[81]:
https://github.com/szkiba/mdcode
"Extracts code blocks from README and produces tests; a similar approach, but quite different"
[82]: https://github.com/devincornell/pymddoc
[83]: https://github.com/shiftkey/scribble
[84]:
https://github.com/shiftkey/scribble/blob/master/docs/features/code-snippets.md
[85]: https://github.com/calebpeterson/jest-transformer-test-md
[86]: https://github.com/tjstankus/commitate "Missing usage example"
[87]:
https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet
[88]:
https://github.com/javierfernandes/markdown-exercises
"This doesn't embed files, rather allows markdown code sections to be tested, no usage example"
[89]:
https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-embed-snippet
[90]: https://github.com/gatsbyjs/gatsby
[91]:
https://github.com/ARMmbed/snippet
"Unclear from documentation on how to embed the code into the template"
[92]: https://github.com/ARMmbed/snippet/blob/master/USAGE.md
[93]: https://github.com/drewavis/markdowninclude
[94]: https://github.com/romnn/embedme "Documentation is lacking"