Skip to content

Commit 03a7c00

Browse files
Use gif recording as demo, update headings to numeric circles
1 parent a7badaa commit 03a7c00

File tree

8 files changed

+68
-15
lines changed

8 files changed

+68
-15
lines changed

Diff for: README.md

+2-12
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,7 @@ Plugin to improve viewing Markdown files in Neovim
44

55
Plugin is experimental at this time
66

7-
## Rendered
8-
9-
This shows the `rendered` view which you would see in normal mode
10-
11-
![Rendered Screenshot](demo/rendered.png)
12-
13-
## Non-Rendered
14-
15-
This shows the non-rendered view which you would see in insert mode
16-
17-
![Base Screenshot](demo/base.png)
7+
![Demo](demo/demo.gif)
188

199
# Features
2010

@@ -79,7 +69,7 @@ require('markdown').setup({
7969
-- modes will be uneffected by this plugin
8070
render_modes = { 'n', 'c' },
8171
-- Characters that will replace the # at the start of markdown headings
82-
headings = { '', '', '', '' },
72+
headings = { '󰲡', '󰲣', '󰲥', '󰲧', '󰲩', '󰲫' },
8373
-- Character to use for the bullet point in lists
8474
bullet = '',
8575
highlights = {

Diff for: demo/base.png

-57.2 KB
Binary file not shown.

Diff for: demo/demo.gif

278 KB
Loading

Diff for: demo/record.py

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import time
2+
from argparse import ArgumentParser
3+
4+
import pyautogui
5+
6+
7+
def main(file: str, cast: str) -> None:
8+
# Open new tmux window
9+
pyautogui.hotkey("`", "c")
10+
time.sleep(1.0)
11+
12+
# Zoom in
13+
for _ in range(15):
14+
pyautogui.hotkey("command", "=")
15+
16+
# Start recording demo file
17+
# https://docs.asciinema.org/manual/cli/usage/
18+
pyautogui.write(f"asciinema rec -c 'nvim {file}' {cast}")
19+
pyautogui.press("enter")
20+
time.sleep(1.0)
21+
22+
# Start typing in new heading
23+
pyautogui.press("o")
24+
pyautogui.press("enter")
25+
pyautogui.write("## Heading 2", interval=0.1)
26+
27+
# Enter normal mode
28+
pyautogui.press("esc")
29+
time.sleep(2.0)
30+
31+
for _ in range(2):
32+
pyautogui.press("i")
33+
time.sleep(1.0)
34+
pyautogui.press("esc")
35+
time.sleep(2.0)
36+
37+
# Close demo file
38+
pyautogui.write(":q!")
39+
pyautogui.press("enter")
40+
time.sleep(0.5)
41+
42+
# Zoom out
43+
pyautogui.hotkey("command", "0")
44+
45+
# Close tmux window
46+
pyautogui.write("exit")
47+
pyautogui.press("enter")
48+
49+
50+
if __name__ == "__main__":
51+
parser = ArgumentParser(description="Generate a demo recording using asciinema")
52+
parser.add_argument("--file", type=str, required=True)
53+
parser.add_argument("--cast", type=str, required=True)
54+
args = parser.parse_args()
55+
main(args.file, args.cast)

Diff for: demo/rendered.png

-89.1 KB
Binary file not shown.

Diff for: demo/sample.md

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Heading 1
22

3-
## Heading 2
4-
53
### Heading 3
64

75
#### Heading 4

Diff for: justfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
demo:
2+
rm -f demo/demo.gif
3+
python demo/record.py \
4+
--file "demo/sample.md" \
5+
--cast demo.cast
6+
# https://docs.asciinema.org/manual/agg/usage/
7+
agg demo.cast demo/demo.gif \
8+
--font-family "JetBrainsMono NFM" \
9+
--last-frame-duration 1
10+
rm demo.cast

Diff for: lua/markdown/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function M.setup(opts)
5050
]]
5151
),
5252
render_modes = { 'n', 'c' },
53-
headings = { '', '', '', '' },
53+
headings = { '󰲡', '󰲣', '󰲥', '󰲧', '󰲩', '󰲫' },
5454
bullet = '',
5555
highlights = {
5656
heading = {

0 commit comments

Comments
 (0)