Skip to content

Commit 3098917

Browse files
committed
docs: clean up main page
1 parent c8bbf37 commit 3098917

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

docs/make.jl

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,35 @@ using Random: AbstractRNG
55
readme = joinpath(@__DIR__, "..", "README.md")
66

77
index_content = let r=read(readme, String)
8-
# Clean img tags:
9-
r2 = replace(r, r"""<img src="([^"]+)"[^>]*>""" => "![](\1)")
8+
# Wrap img tags in raw HTML blocks:
9+
r = replace(r, r"(<img\s+[^>]+>)" => s"""
10+
11+
```@raw html
12+
\1
13+
```
14+
15+
""")
16+
# Remove end img tags:
17+
r = replace(r, r"</img>" => "")
1018
# Remove div tags:
11-
r3 = replace(r2, r"<div[^>]*>" => "")
19+
r = replace(r, r"<div[^>]*>" => "")
1220
# Remove end div tags:
13-
r4 = replace(r3, r"</div>" => "")
21+
r = replace(r, r"</div>" => "")
1422

1523
top_part = """
16-
# Contents
24+
# Introduction
25+
26+
"""
27+
28+
bottom_part = """
29+
## Contents
1730
1831
```@contents
1932
Pages = ["utils.md", "api.md", "eval.md"]
2033
```
2134
"""
2235

23-
join((top_part, r4), "\n")
36+
join((top_part, r, bottom_part), "\n")
2437
end
2538

2639
index_md = joinpath(@__DIR__, "src", "index.md")

docs/src/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Gets generated:
2+
index.md

0 commit comments

Comments
 (0)