Skip to content

Commit f91c526

Browse files
committed
docs: Add demo for MkDocs integration
1 parent 07aae8b commit f91c526

File tree

4 files changed

+74
-0
lines changed

4 files changed

+74
-0
lines changed

demo/mkdocs/index.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Demo for oembedpy.adapter.mkdocs
2+
3+
## Description
4+
5+
This page is demo about working `oembedpy.adapters.mkdocs`.
6+
7+
## Setup
8+
9+
1. Install `oEmbedPy`.
10+
2. Add plugin `oembedpy` into your MkDocs configuration.
11+
12+
```yaml
13+
plugins:
14+
- oembedpy
15+
```
16+
17+
## Usage
18+
19+
Write contents that you want to display embed as code-block fenced `oembed`.
20+
Contents in code-block must be written as TOML and are one required key and two optional keys.
21+
22+
### Keys
23+
24+
* `url`: (Required) URL of target content.
25+
* `max_width`: (Optional) Max width of embed content.
26+
* `max_height`: (Optional) Max height of embed content.
27+
28+
## Demo
29+
30+
### URL only
31+
32+
Source:
33+
34+
````markdown
35+
```oembed
36+
url = 'https://bsky.app/profile/attakei.net/post/3l6uxhgm3sz2t'
37+
```
38+
````
39+
40+
Output:
41+
42+
```oembed
43+
url = 'https://bsky.app/profile/attakei.net/post/3l6uxhgm3sz2t'
44+
```
45+
46+
### With size options
47+
48+
Source:
49+
50+
````markdown
51+
```oembed
52+
url = 'https://www.youtube.com/watch?v=Oyh8nuaLASA'
53+
max_width = 640
54+
max_height = 640
55+
```
56+
````
57+
58+
Output:
59+
60+
```oembed
61+
url = 'https://www.youtube.com/watch?v=Oyh8nuaLASA'
62+
max_width = 640
63+
max_height = 640
64+
```

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
api/
2+
_extra/demo

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
html_theme = "furo"
1616
html_static_path = ["_static"]
17+
html_extra_path = ["_extra"]
1718

1819
# -- Options for Linkcheck output
1920
linkcheck_ignore = [

mkdocs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
site_name: 'Demo of oembedpy.adapter.mkdocs'
2+
# site_url: ''
3+
4+
docs_dir: 'demo/mkdocs'
5+
site_dir: 'docs/_extra/demo/mkdocs'
6+
7+
plugins:
8+
- 'oembedpy'

0 commit comments

Comments
 (0)