Skip to content

Commit e3c2a49

Browse files
tranzystorekkmeator
andcommitted
Use mdbook-admonish to visualize bad/good examples
resolves #2 Co-authored-by: meator <[email protected]>
1 parent 5c9a6d6 commit e3c2a49

File tree

4 files changed

+46
-21
lines changed

4 files changed

+46
-21
lines changed

book.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ git-repository-url = "https://github.com/meator/xbps-src-tutorials"
1414
command = "mdbook-toc"
1515
renderer = ["html"]
1616

17+
[preprocessor.admonish]
18+
command = "mdbook-admonish"
19+
1720
#[output.linkcheck]

src/packaging-bat.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ of it is in their repository: <https://github.com/sharkdp/bat>
3232

3333
Remember that plaintext changelogs are preferred:
3434

35-
Bad: `changelog=https://github.com/sharkdp/bat/blob/master/CHANGELOG.md`
35+
~~~admonish failure title="Bad"
36+
`changelog=https://github.com/sharkdp/bat/blob/master/CHANGELOG.md`
37+
~~~
38+
39+
~~~admonish success title="Good"
40+
`changelog=https://raw.githubusercontent.com/sharkdp/bat/master/CHANGELOG.md`
41+
~~~
3642

37-
Good: `https://raw.githubusercontent.com/sharkdp/bat/master/CHANGELOG.md`
3843
- `distfiles`: `bat`'s release has a lot of files in it:
3944

4045
![bat release](images/bat/release.png)
@@ -45,9 +50,13 @@ of it is in their repository: <https://github.com/sharkdp/bat>
4550

4651
Don't forget to replace the version with `${version}`:
4752

48-
Bad: `https://github.com/sharkdp/bat/archive/refs/tags/v0.24.0.tar.gz`
53+
~~~admonish failure title="Bad"
54+
`https://github.com/sharkdp/bat/archive/refs/tags/v0.24.0.tar.gz`
55+
~~~
4956

50-
Good: `https://github.com/sharkdp/bat/archive/refs/tags/v${version}.tar.gz`
57+
~~~admonish success title="Good"
58+
`https://github.com/sharkdp/bat/archive/refs/tags/v${version}.tar.gz`
59+
~~~
5160

5261
## Creating the template
5362

@@ -459,7 +468,7 @@ It also includes a patch to make the XBPS version of `libgit2` work in `bat`.
459468
## What now?
460469
You might be wondering how the SHLIB detection works. This is best explained
461470
while packaging a library. The next part of this tutorial packages
462-
[`oiguruma`](https://github.com/kkos/oniguruma) a dependency of `bat`:
471+
[`oniguruma`](https://github.com/kkos/oniguruma) a dependency of `bat`:
463472

464473
[Packaging oniguruma](packaging-oniguruma.md)
465474

src/packaging-j4-dmenu-desktop.md

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ CONTRIBUTING](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTI
187187

188188
Namely **<span style="color:red"><ins>software without a release or tag</ins></span>,
189189
cryptocurrency packages, browser forks, simple shell scripts, themes, prebuilt
190-
packages** and more won't likely get accepted. I recommend you to read the
190+
packages** and more won't likely get accepted. I recommend you read the
191191
requirements in full linked above.
192192

193193
### Has it been packaged already?
@@ -420,13 +420,18 @@ explanation:
420420

421421
The version shouldn't contain unnecessary characters:
422422

423-
Bad: `version=r2.18`
423+
~~~admonish failure title="Bad"
424+
`version=r2.18`
425+
or
426+
`version=v0.24.0`
427+
~~~
424428

425-
Good: `version=2.18`
429+
~~~admonish success title="Good"
430+
`version=2.18`
431+
or
432+
`version=0.24.0`
433+
~~~
426434

427-
Bad: `version=v0.24.0`
428-
429-
Good: `version=0.24.0`
430435
- `revision` = revision of the package; it can sometimes happen that the package
431436
has to be changed without updating it to for example fix some
432437
problem with the currently packaged version; `revision` is used
@@ -444,13 +449,15 @@ explanation:
444449
characters, it mustn't start with an article and it should
445450
start with an uppercase letter:
446451

447-
Bad: `short_desc="A desktop menu"`
448-
449-
Good: `short_desc="Desktop menu"`
450-
451-
Bad: `short_desc="desktop menu"`
452+
~~~admonish failure title="Bad"
453+
`short_desc="A desktop menu"`
454+
or
455+
`short_desc="desktop menu"`
456+
~~~
452457

453-
Good: `short_desc="Desktop menu"`
458+
~~~admonish success title="Good"
459+
`short_desc="Desktop menu"`
460+
~~~
454461

455462
A good choice for `short_desc` is the GitHub short description (if the
456463
packaged project has one):
@@ -500,9 +507,13 @@ explanation:
500507
501508
You can then copy the link.
502509
503-
Bad: `https://github.com/enkore/j4-dmenu-desktop/blob/develop/CHANGELOG`
510+
~~~admonish failure title="Bad"
511+
`https://github.com/enkore/j4-dmenu-desktop/blob/develop/CHANGELOG`
512+
~~~
504513
505-
Good: `https://raw.githubusercontent.com/enkore/j4-dmenu-desktop/develop/CHANGELOG`
514+
~~~admonish success title="Good"
515+
`https://raw.githubusercontent.com/enkore/j4-dmenu-desktop/develop/CHANGELOG`
516+
~~~
506517
507518
We need to gather all of this information about `j4-dmenu-desktop` to be able to
508519
package it.

src/packaging-oniguruma.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ sed -i /oniguruma/d common/shlibs
3030

3131
This link includes `${version}` twice, so it has to be substituted twice:
3232

33-
Bad:
33+
~~~admonish failure title="Bad"
3434
`distfiles="https://github.com/kkos/oniguruma/releases/download/v6.9.9/onig-${version}.tar.gz"`
35+
~~~
3536

36-
Good:
37+
~~~admonish success title="Good"
3738
`distfiles="https://github.com/kkos/oniguruma/releases/download/v${version}/onig-${version}.tar.gz"`
39+
~~~
3840

3941
## A word about subpackages
4042
A package can have

0 commit comments

Comments
 (0)