readme: add examples and images

This commit is contained in:
Tom Milligan
2022-02-19 09:23:38 +00:00
parent 33009801da
commit 3074784c42
7 changed files with 30 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ A beautifully styled message.
into this:
![Simple Message](simple-message.png)
![Simple Message](img/simple-message.png)
## Usage
@@ -28,6 +28,8 @@ My example is the best!
```
````
![Best Example](img/best-example.png)
See the [mkdocs-material docs](https://squidfunk.github.io/mkdocs-material/reference/admonitions/#supported-types) for a list of supported admonitions. You'll find:
- `info`
@@ -42,11 +44,13 @@ and quite a few more!
A custom title can be provided, contained in a double quoted JSON string:
````
```admonish example "Simply the best"
My example is the best!
```admonish warning "Data loss"
The following steps can lead to irrecoverable data corruption.
```
````
![Data Loss](img/data-loss.png)
You can also leave out the admonition type altogether, in which case it will default to `note`:
````
@@ -55,6 +59,8 @@ A plain note.
```
````
![Plain Note](img/plain-note.png)
Markdown and HTML can be used in the inner content, as you'd expect:
````
@@ -64,7 +70,21 @@ accomplished with the <span style="color: hotpink">dereference operator</span>,
```
````
![Complex Message](complex-message.png)
![Complex Message](img/complex-message.png)
If you have code blocks you want to include in the content,
use [tildes for the outer code fence](https://spec.commonmark.org/0.30/#fenced-code-blocks):
````
~~~admonish bug
This syntax won't work in Python 3:
```python
print "Hello, world!"
```
~~~
````
![Code Bug](img/code-bug.png)
## Installation
@@ -101,6 +121,12 @@ Then, build your book as usual:
mdbook path/to/book
```
### Updates
**Please note**, when updating your version of `mdbook-admonish`, updated styles
will not be applied unless you rerun `mdbook-admonish install` to update the additional
CSS files in your book.
## Development
Project design

BIN
img/best-example.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
img/code-bug.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

BIN
img/complex-message.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
img/data-loss.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
img/plain-note.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB