mkdocs 2.0.dev0__tar.gz → 2.0.dev2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/PKG-INFO +1 -2
  2. mkdocs-2.0.dev2/docs/README.md +54 -0
  3. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/pyproject.toml +0 -1
  4. mkdocs-2.0.dev2/src/mkdocs/__version__.py +2 -0
  5. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/src/mkdocs/mkdocs.py +15 -4
  6. mkdocs-2.0.dev2/src/mkdocs/theme/base.html +173 -0
  7. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/uv.lock +0 -11
  8. mkdocs-2.0.dev0/README.md +0 -74
  9. mkdocs-2.0.dev0/docs/img/kelp.png +0 -0
  10. mkdocs-2.0.dev0/docs/img/mkdocs.png +0 -0
  11. mkdocs-2.0.dev0/docs/index.md +0 -60
  12. mkdocs-2.0.dev0/docs/navigation.md +0 -92
  13. mkdocs-2.0.dev0/docs/styling.md +0 -153
  14. mkdocs-2.0.dev0/docs/writing.md +0 -241
  15. mkdocs-2.0.dev0/src/mkdocs/__version__.py +0 -2
  16. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/.github/workflows/docs.yml +0 -0
  17. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/.github/workflows/test-suite.yml +0 -0
  18. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/.gitignore +0 -0
  19. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/docs/img/codercat.png +0 -0
  20. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/mkdocs.toml +0 -0
  21. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/requirements.txt +0 -0
  22. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/scripts/install +0 -0
  23. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/scripts/test +0 -0
  24. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/src/mkdocs/__init__.py +0 -0
  25. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/src/mkdocs/default/base.html +0 -0
  26. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/src/mkdocs/default/favicon.html +0 -0
  27. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/src/mkdocs/default/highlight.css +0 -0
  28. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/src/mkdocs/default/style.css +0 -0
  29. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/src/mkdocs/extensions/__init__.py +0 -0
  30. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/src/mkdocs/extensions/relative_urls.py +0 -0
  31. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/src/mkdocs/extensions/short_codes.py +0 -0
  32. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/src/mkdocs/extensions/strike_thru.py +0 -0
  33. {mkdocs-2.0.dev0 → mkdocs-2.0.dev2}/tests/test_mkdocs.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: mkdocs
3
- Version: 2.0.dev0
3
+ Version: 2.0.dev2
4
4
  Summary: HTTP, for Python.
5
5
  Author-email: Kim Christie <noreply@lovelydinosaur.com>
6
6
  Classifier: Development Status :: 4 - Beta
@@ -18,4 +18,3 @@ Requires-Dist: click
18
18
  Requires-Dist: httpx>=1.0.dev5
19
19
  Requires-Dist: jinja2
20
20
  Requires-Dist: markdown
21
- Requires-Dist: pygments
@@ -0,0 +1,54 @@
1
+ <style>
2
+ h2 { margin-top: 50px}
3
+ </style>
4
+
5
+ # MkDocs
6
+
7
+ MkDocs is a smart, simple, website design tool.
8
+
9
+ Getting started is easy...
10
+
11
+ ```shell
12
+ $ pip install mkdocs --pre
13
+ ```
14
+
15
+ *This will install the version 2.0 pre-release.*
16
+
17
+ ## Getting started
18
+
19
+ 1. Create a `docs/README.md` page.
20
+ 2. Run `mkdocs serve` to view your documentation in a browser.
21
+ 3. Run `mkdocs build` to build a static website ready to host.
22
+
23
+ ## Writing your docs
24
+
25
+ 1. Create additional markdown pages.
26
+ 2. Use relative interlinking between pages.
27
+ 3. Include images and use relative interlinking from pages.
28
+
29
+ *MkDocs supports [GitHub Flavored Markdown](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) for page authoring.*
30
+
31
+ ## Styling your docs
32
+
33
+ 1. Create a `templates/base.html` to customise the styling.
34
+ 2. Include css and javascript to serve static files.
35
+
36
+ *MkDocs uses [Jinja templating](https://jinja.palletsprojects.com/en/stable/templates/) for HTML rendering.*
37
+
38
+ A starting point can be as simple as...
39
+
40
+ ```html
41
+ <html>
42
+ <head>
43
+ <meta charset="utf-8">
44
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
45
+ <title>{{ page.title }}</title>
46
+ <link rel="stylesheet" href="{{ '/css/default.css' | url }}">
47
+ </head>
48
+ <body>
49
+ <main>
50
+ {{ page.html }}
51
+ </main>
52
+ </body>
53
+ </html>
54
+ ```
@@ -26,7 +26,6 @@ dependencies = [
26
26
  "click",
27
27
  "jinja2",
28
28
  "markdown",
29
- "pygments",
30
29
  ]
31
30
  dynamic = ["version"]
32
31
 
@@ -0,0 +1,2 @@
1
+ __title__ = "mkdocs"
2
+ __version__ = "2.0.dev2"
@@ -52,6 +52,14 @@ class Page:
52
52
  self.url = str(url).removesuffix('index.html')
53
53
 
54
54
 
55
+ class PageAsHTML:
56
+ def __init__(self, page, title, html):
57
+ self.path = page.path
58
+ self.url = page.url
59
+ self.title = title
60
+ self.html = html
61
+
62
+
55
63
  class Static:
56
64
  def __init__(self, path):
57
65
  self.path = path
@@ -125,7 +133,7 @@ class MkDocs:
125
133
  dir = pathlib.Path(input_dir)
126
134
  loader = jinja2.ChoiceLoader([
127
135
  jinja2.FileSystemLoader(dir.joinpath("templates")),
128
- jinja2.PackageLoader('mkdocs', 'default'),
136
+ jinja2.PackageLoader('mkdocs', 'theme'),
129
137
  ])
130
138
  env = jinja2.Environment(loader=loader, auto_reload=True)
131
139
  env.filters['url'] = url
@@ -134,7 +142,6 @@ class MkDocs:
134
142
  def init_md(self) -> markdown.Markdown:
135
143
  return markdown.Markdown(
136
144
  extensions=[
137
- 'codehilite',
138
145
  'fenced_code',
139
146
  'footnotes',
140
147
  'tables',
@@ -174,7 +181,9 @@ class MkDocs:
174
181
  with self.set_context(page):
175
182
  text = input_path.read_text()
176
183
  html = self.md.reset().convert(text)
177
- output = self.base.render(page=page, html=html)
184
+ title = self.md.toc_tokens[0]['name'] if self.md.toc_tokens else ''
185
+ rendered_page = PageAsHTML(page=page, title=title, html=html)
186
+ output = self.base.render(page=rendered_page)
178
187
 
179
188
  output_path.parent.mkdir(parents=True, exist_ok=True)
180
189
  output_path.write_text(output)
@@ -205,7 +214,9 @@ class MkDocs:
205
214
  with self.set_context(resource):
206
215
  text = input_path.read_text()
207
216
  html = self.md.reset().convert(text)
208
- output = self.base.render(page=resource, html=html)
217
+ title = self.md.toc_tokens[0]['name'] if self.md.toc_tokens else ''
218
+ rendered_page = PageAsHTML(page=page, title=title, html=html)
219
+ output = self.base.render(page=rendered_page)
209
220
  return httpx.Response(200, content=httpx.HTML(output))
210
221
  elif isinstance(resource, Static):
211
222
  input_path = input_dir.joinpath(resource.path)
@@ -0,0 +1,173 @@
1
+ <html>
2
+ <head>
3
+ <meta charset="utf-8">
4
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
5
+ <title>{{ page.title }}</title>
6
+ <link rel="icon" href="data:image/svg+xml,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 100 100&quot;&gt;&lt;text y=&quot;.9em&quot; font-size=&quot;90&quot;&gt;📘&lt;/text&gt;&lt;/svg&gt;">
7
+ <style>
8
+ /* Color scheme */
9
+
10
+ :root {
11
+ --fg-color: #f0f6fc;
12
+ --muted-fg-color: #9198a1;
13
+ --neutral-color: #3d444d;
14
+ --bg-color: #151b23;
15
+
16
+ --link-color: #4493f8;
17
+ --code-bg-color: #0d1117;
18
+
19
+ --accent-note: #0969da;
20
+ --accent-tip: #1a7f37;
21
+ --accent-important:#8250df;
22
+ --accent-warning: #9a6700;
23
+ --accent-caution: #d1242f;
24
+ }
25
+
26
+ /* Basic reset */
27
+
28
+ * {
29
+ margin: 0;
30
+ padding: 0;
31
+ box-sizing: border-box;
32
+ font-weight: 300;
33
+ }
34
+
35
+ /* Layout... */
36
+
37
+ main {
38
+ margin-left: 20%;
39
+ width: 60%;
40
+ padding: 1rem;
41
+ }
42
+
43
+ @media (max-width: 1000px) {
44
+ main {
45
+ padding: 1.5rem 1rem;
46
+ width: 75%;
47
+ margin-left: 25%;
48
+ }
49
+ }
50
+
51
+ @media (max-width: 800px) {
52
+ main {
53
+ padding: 1.5rem 1rem;
54
+ width: 100%;
55
+ margin-left: 0;
56
+ }
57
+ }
58
+
59
+ /* Typography & spacing */
60
+
61
+ html {
62
+ scroll-behavior: smooth;
63
+ }
64
+
65
+ body {
66
+ line-height: 1.6;
67
+ color: var(--fg-color);
68
+ background-color: var(--bg-color);
69
+ font-family: Helvetica, sans-serif;
70
+ }
71
+
72
+ h1, h2, h3, h4, h5 {
73
+ margin-top: 1.5rem;
74
+ margin-bottom: 1.5rem;
75
+ line-height: 1.3;
76
+ }
77
+
78
+ h1 {
79
+ border-bottom: 1px solid var(--neutral-color);
80
+ }
81
+ h2 {
82
+ border-bottom: 1px solid var(--neutral-color);
83
+ }
84
+
85
+ p {
86
+ margin: 1rem 0;
87
+ }
88
+
89
+ strong {
90
+ font-weight: 600;
91
+ }
92
+
93
+ ul, ol {
94
+ padding-left: 2rem;
95
+ }
96
+
97
+ li {
98
+ margin: 0.5rem 0;
99
+ }
100
+
101
+ hr {
102
+ margin-top: 1rem;
103
+ margin-bottom: 1rem;
104
+ border: none;
105
+ border-top: 4px solid;
106
+ color: var(--neutral-color);
107
+ }
108
+
109
+ blockquote {
110
+ border-left: 0.25rem solid var(--neutral-color);
111
+ padding: 0 1rem;
112
+ color: var(--muted-fg-color);
113
+ }
114
+
115
+ pre {
116
+ padding: 1rem;
117
+ overflow-x: scroll;
118
+ background-color: var(--code-bg-color);
119
+ }
120
+
121
+ code {
122
+ padding: 0 5px;
123
+ background-color: var(--code-bg-color);
124
+ }
125
+
126
+ pre code {
127
+ padding: 0;
128
+ }
129
+
130
+ img {
131
+ max-width: 100%
132
+ }
133
+
134
+ a {
135
+ color: var(--link-color);
136
+ text-decoration: none;
137
+ }
138
+
139
+ a:hover {
140
+ text-decoration: underline;
141
+ }
142
+
143
+ /* Tables */
144
+
145
+ table {
146
+ border-collapse: collapse;
147
+ }
148
+
149
+ th, td {
150
+ padding: 6px 13px;
151
+ border: 1px solid var(--neutral-color);
152
+ }
153
+
154
+ /* Header anchor links */
155
+
156
+ a.toclink {
157
+ color: inherit;
158
+ text-decoration: none;
159
+ }
160
+
161
+ a.toclink:hover::after {
162
+ content: "#";
163
+ margin: 0 0.8rem;
164
+ color: var(--neutral-color);
165
+ }
166
+ </style>
167
+ </head>
168
+ <body>
169
+ <main>
170
+ {{ page.html }}
171
+ </main>
172
+ </body>
173
+ </html>
@@ -137,7 +137,6 @@ dependencies = [
137
137
  { name = "httpx" },
138
138
  { name = "jinja2" },
139
139
  { name = "markdown" },
140
- { name = "pygments" },
141
140
  ]
142
141
 
143
142
  [package.metadata]
@@ -146,16 +145,6 @@ requires-dist = [
146
145
  { name = "httpx", specifier = ">=1.0.dev5" },
147
146
  { name = "jinja2" },
148
147
  { name = "markdown" },
149
- { name = "pygments" },
150
- ]
151
-
152
- [[package]]
153
- name = "pygments"
154
- version = "2.21.0"
155
- source = { registry = "https://pypi.org/simple" }
156
- sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329, upload-time = "2026-08-17T08:02:48.824Z" }
157
- wheels = [
158
- { url = "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", size = 1250147, upload-time = "2026-08-17T08:02:44.912Z" },
159
148
  ]
160
149
 
161
150
  [[package]]
mkdocs-2.0.dev0/README.md DELETED
@@ -1,74 +0,0 @@
1
- # MkDocs
2
-
3
- MkDocs is a smart, simple, website design tool.
4
-
5
- ![MkDocs](docs/img/mkdocs.png)
6
-
7
- <br/>
8
-
9
- ## Installation
10
-
11
- Install the `mkdocs` command line tool...
12
-
13
- ```shell
14
- $ pip install git+https://github.com/encode/mkdocs.git
15
- ```
16
-
17
- *This will install the version 2.0 pre-release.*
18
-
19
- <br/>
20
-
21
- ## Getting started
22
-
23
- 1. Create a `README.md` page.
24
- 2. Run `mkdocs serve` to view your documentation in a browser.
25
- 3. Run `mkdocs build` to build a static website ready to host.
26
-
27
- *MkDocs supports [GitHub Flavored Markdown](docs/writing.md) for page authoring.*
28
-
29
- <br/>
30
-
31
- ## Writing your docs
32
-
33
- 1. Create additional markdown pages.
34
- 2. Use [markdown interlinking](docs/navigation.md#interlinking) between pages.
35
- 3. Create a `mkdocs.toml` file to define [the site navigation](docs/navigation.md#navigation) and other configuration.
36
- 4. Move your markdown pages into a `docs` directory, and update the config.
37
-
38
- An example `mkdocs.toml`...
39
-
40
- ```toml
41
- [mkdocs]
42
- nav = [
43
- {path="README.md", title="Introduction"},
44
- {path="CREDITS.md", title="Credits"},
45
- ]
46
-
47
- [loaders]
48
- theme = "pkg://mkdocs/default"
49
- docs = "dir://docs"
50
-
51
- [context]
52
- title = "Documentation"
53
- favicon = "📘"
54
- ```
55
-
56
- *Use either [`README.md` or `index.md`](docs/navigation.md#url-structure) for the homepage.*
57
-
58
- <br/>
59
-
60
- ## Custom styling
61
-
62
- Styling adaptations can be kept simple, such as customising the colour scheme, or more comprehensive, such as creating an entirely new theme.
63
-
64
- 1. Configure the base theme for your project.
65
- 2. Modify [the HTML templating](docs/styling.md#templates) to customise the layout.
66
- 3. Override or add [CSS and JavaScript](docs/styling.md#statics) static assets.
67
-
68
- Take a look at the [default theme](https://github.com/lovelydinosaur/mkdocs-theme) and the [kelp theme](https://github.com/lovelydinosaur/kelp-theme) for examples of getting started with theming.
69
-
70
- <br/>
71
-
72
- ![Kelp](docs/img/kelp.png)
73
-
74
- *The MkDocs documentation, served with the Kelp theme.*
Binary file
Binary file
@@ -1,60 +0,0 @@
1
- # MkDocs
2
-
3
- MkDocs is a smart, simple, website design tool.
4
-
5
- ![MkDocs](img/mkdocs.png)
6
-
7
- ## Installation
8
-
9
- Install the `mkdocs` command line tool...
10
-
11
- ```shell
12
- $ pip install git+https://github.com/encode/mkdocs.git
13
- ```
14
-
15
- *This will install the version 2.0 pre-release.*
16
-
17
- ## Getting started
18
-
19
- 1. Create a `README.md` page.
20
- 2. Run `mkdocs serve` to view your documentation in a browser.
21
- 3. Run `mkdocs build` to build a static website ready to host.
22
-
23
- *MkDocs supports [GitHub Flavored Markdown](writing.md) for page authoring.*
24
-
25
- ## Writing your docs
26
-
27
- 1. Create additional markdown pages.
28
- 2. Use [markdown interlinking](navigation.md#interlinking) between pages.
29
- 3. Create a `mkdocs.toml` file to define [the site navigation](navigation.md#navigation) and other configuration.
30
- 4. Move your markdown pages into a `docs` directory, and update the config.
31
-
32
- An example `mkdocs.toml`...
33
-
34
- ```toml
35
- [mkdocs]
36
- nav = [
37
- {path="README.md", title="Introduction"},
38
- {path="CREDITS.md", title="Credits"},
39
- ]
40
-
41
- [loaders]
42
- theme = "pkg://mkdocs/default"
43
- docs = "dir://docs"
44
-
45
- [context]
46
- title = "Documentation"
47
- favicon = "📘"
48
- ```
49
-
50
- *Use either [`README.md` or `index.md`](navigation.md#url-structure) for the homepage.*
51
-
52
- ## Custom styling
53
-
54
- Styling adaptations can be kept simple, such as customising the colour scheme, or more comprehensive, such as creating an entirely new theme.
55
-
56
- 1. Configure the base theme for your project.
57
- 2. Modify [the HTML templating](styling.md#templates) to customise the layout.
58
- 3. Override or add [CSS and JavaScript](styling.md#statics) static assets.
59
-
60
- Take a look at the [default theme](https://github.com/lovelydinosaur/mkdocs-theme) and the [kelp theme](https://github.com/lovelydinosaur/kelp-theme) for examples of getting started with theming.
@@ -1,92 +0,0 @@
1
- # Interlinking & Navigation
2
-
3
- Navigation within your documentation is handled by using [document interlinking](#interlinking), and optional [site-wide navigation](#navigation).
4
-
5
- ## Interlinking
6
-
7
- Use relative markdown links to allow users to navigate between documents.
8
-
9
- For example, a website with `README.md` and `CONTRIBUTING.md` pages, might include the following&hellip;
10
-
11
- ```markdown
12
- See our [contribution documentation](CONTRIBUTING.md) for more details on getting involved.
13
- ```
14
-
15
- If your site includes pages within a directory structure, the page interlinking might also include [relative paths between directories](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#relative-links).
16
-
17
- ## Navigation
18
-
19
- You can include site-wide navigation by using the `mkdocs.toml` configuration.
20
-
21
- This is typically used by the HTML styling to include a navigation menu.
22
-
23
- ```toml
24
- [mkdocs]
25
- nav = [
26
- {title="Introduction", path="index.md"},
27
- {title="Writing Markdown", path="markdown.md"},
28
- {title="Site Navigation", path="navigation.md"},
29
- {title="HTML Styling", path="styling.md"}
30
- ]
31
- ```
32
-
33
- This allows the theme to display navigation controls, as well as including `← previous` and `next →` links.
34
-
35
- The navigation configuration can also include nested elements.
36
-
37
- ```toml
38
- [mkdocs]
39
- nav = [
40
- {title="Introduction", path="index.md"},
41
- {title="Tutorial", children=[
42
- {title="Creating a project", path="tutorial/new.md"},
43
- {title="Adding pages", path="tutorial/pages.md"},
44
- {title="Publishing your work", path="tutorial/publish.md"},
45
- ]},
46
- {title="Topics", children=[
47
- {title="Page layouts", path="topics/layouts.md"},
48
- {title="Typography", path="topics/typography.md"},
49
- {title="Color schemes", path="topics/schemes.md"},
50
- ]}
51
- ]
52
- ```
53
-
54
- ## URL Structure
55
-
56
- Ensuring your website has a clean, meaningful URL structure is important for navigation.
57
-
58
- * Markdown pages are lowercased.
59
- * The file extension is not included in the URL.
60
- * Use either `index.md` or `README.md` for root URLs.
61
-
62
- **Examples**
63
-
64
- A standard documentation site...
65
-
66
- | **Markdown Page** | **HTML output** | **URL** |
67
- |-------------------|-------------------------|----------------|
68
- | `index.md` | `index.html` | `/` |
69
- | `markdown.md` | `markdown/index.html` | `/markdown/` |
70
- | `navigation.md` | `navigation/index.html` | `/navigation/` |
71
- | `styling.md` | `styling/index.html` | `/styling/` |
72
-
73
- <br/>
74
-
75
- Uppercase filenames and GitHub style document paths...
76
-
77
- | **Markdown Page** | **HTML output** | **URL** |
78
- |-------------------|--------------------------|----------------|
79
- | `README.md` | `index.html` | `/` |
80
- | `ABOUT.md` | `about.html` | `/about/` |
81
-
82
- <br/>
83
-
84
- Documentation structure including subdirectories...
85
-
86
- | **Markdown Page** | **HTML output** | **URL** |
87
- |--------------------------|----------------------------------|-------------------------|
88
- | `index.md` | `index.html` | `/` |
89
- | `tutorial/quickstart.md` | `tutorial/quickstart/index.html` | `/tutorial/quickstart/` |
90
- | `tutorial/next-steps.md` | `tutorial/next-steps/index.html` | `/tutorial/next-steps/` |
91
-
92
- <br/>
@@ -1,153 +0,0 @@
1
- # Themes & Styling
2
-
3
- Styling is handled with HTML templating and regular web design.
4
-
5
- The build is made up of various web resources...
6
-
7
- * [Templates](#templates) - *The HTML templates used to render documentation pages.*
8
- * [Pages](#pages) - *The markdown files comprising the documentation.*
9
- * [Statics](#statics) - *Media assests including images, CSS, and JavaScript.*
10
-
11
- Resources are loaded either from a *theme* or from the *project documentation*. The theme system allows minor local styling overrides, or complete site customisation.
12
-
13
- * [Themes](#themes) - *Theme and documentation configuration is handled in the `mkdocs.toml` file.*
14
-
15
- ## Templates
16
-
17
- Anything in the `/templates/` directory is treated as a [Jinja template](https://jinja.palletsprojects.com/en/stable/templates/), and is used to render markdown pages. You can override templates locally and adapt them to make layout changes.
18
-
19
- The base template for rendering markdown pages is **`templates/base.html`**.
20
-
21
- ```html
22
- <html>
23
- <head>
24
- <meta charset="utf-8">
25
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
26
- <title>{{ nav.current.title or page.title }}{{ " - " ~ config.context.title if config.context.title }}</title>
27
- <link rel="icon" href="data:image/svg+xml,&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 100 100&quot;&gt;&lt;text y=&quot;.9em&quot; font-size=&quot;90&quot;&gt;{{ config.mkdocs.favicon or '📘' }}&lt;/text&gt;&lt;/svg&gt;">
28
- <link rel="stylesheet" href="{{ '/css/highlightjs.min.css' | url }}">
29
- <link rel="stylesheet" href="{{ '/css/highlightjs-copy.min.css' | url }}">
30
- <link rel="stylesheet" href="{{ '/css/theme.css' | url }}">
31
- <script src="{{ '/js/highlightjs.min.js' | url }}"></script>
32
- <script src="{{ '/js/highlightjs-copy.min.js' | url }}"></script>
33
- <script src="{{ '/js/theme.js' | url }}"></script>
34
- </head>
35
- <body>
36
- <nav class="left">
37
- {{ nav.html }}
38
- </nav>
39
- <nav class="right">
40
- {{ page.toc }}
41
- </nav>
42
- <main>
43
- {{ page.html }}
44
- {% if nav.previous or nav.next %}
45
- <div class="pagination">
46
- {% if nav.previous %}
47
- <a class="previous" href="{{ nav.previous.url }}">← {{ nav.previous.title }}</a>
48
- {% endif %}
49
- {% if nav.next %}
50
- <a class="next" href="{{ nav.next.url }}">{{ nav.next.title }} →</a>
51
- {% endif %}
52
- </div>
53
- {% endif %}
54
- </main>
55
- </body>
56
- </html>
57
- ```
58
-
59
- The following template is included in [the default theme](https://github.com/encode/mkdocs/blob/main/src/mkdocs/theme/)...
60
-
61
- * `templates/base.html`- The base template used for rendering markdown pages.
62
-
63
- The following context is passed to the template rendering...
64
-
65
-
66
- *Variable* | *Description*
67
- ---------------------|--------------------------------------
68
- `page` | The markdown page.
69
- `page.html` | The page contents, rendered as HTML.
70
- `page.text` | The text of the page, as markdown.
71
- `page.path` | The path of the source file.
72
- `page.url` | The URL from which the page is served.
73
- `page.toc` | The table of contents for the page, as HTML.
74
- `page.title` | The first heading in the table of contents.
75
- `nav` | The site navigation.
76
- `nav.html` | The site navigation, rendered into HTML.
77
- `nav.previous` | The previous page, as configured in the nav.
78
- `nav.previous.title` | The title of the previous page.
79
- `nav.previous.url` | The url of the previous page.
80
- `nav.next` | The next page, as configured in the nav.
81
- `nav.next.title` | The title of the next page.
82
- `nav.next.url` | The url of the next page.
83
- `config` | The `mkdocs.toml` configuration.
84
-
85
- ## Pages
86
-
87
- Any files ending with the `*.md` extension are treated as markdown pages, and rendered into HTML, then included in the base template.
88
-
89
- The following are treated as index pages...
90
-
91
- * `README.md` - Served as `/`.
92
- * `index.md` - Served as `/`.
93
-
94
- All other pages are lowercased, and served from a URL without the markdown extension...
95
-
96
- * `CONTRIBUTING.md` - Served as `/contributing/`.
97
-
98
- ## Statics
99
-
100
- Any files that are not Markdown pages `*.md`, or templates `/templates/*`, are treated as static media and are included in the website without modification.
101
-
102
- This can include images, stylesheets, javascript, fonts, video and audio.
103
-
104
- The default theme includes the following static media...
105
-
106
- * [`css/theme.css`](css/theme.css)
107
- * [`css/highlightjs.min.css`](css/highlightjs.min.css)
108
- * [`css/highlightjs-copy.min.css`](css/highlightjs-copy.min.css)
109
- * [`js/theme.js`](js/theme.js)
110
- * [`js/highlightjs.min.js`](js/highlightjs.min.js)
111
- * [`js/highlightjs-copy.min.js`](js/highlightjs-copy.min.js)
112
-
113
- ## Themes
114
-
115
- Themes can be packaged and distributed as part of a zip archive. The archive can the either be loaded remotely from a URL, or downloaded and included locally.
116
-
117
- Controlling how resources are loaded for the theme and documentation is handled with the `mkdocs.toml` config file.
118
-
119
- **Example configurations**
120
-
121
- *The default theme supplied by the `mkdocs` package, and the documentation served directly from the project directory. This is the default configuration...*
122
-
123
- ```toml
124
- [loaders]
125
- theme = "pkg://mkdocs/default"
126
- docs = "dir://"
127
- ```
128
-
129
- *The default theme as a `.zip` URL, and a local `docs` directory...*
130
-
131
- ```toml
132
- [loaders]
133
- theme = "https://github.com/lovelydinosaur/mkdocs-theme/archive/refs/heads/main.zip"
134
- docs = "dir://docs"
135
- ```
136
-
137
- *A theme downloaded locally, and a `docs` directory...*
138
-
139
- ```toml
140
- [loaders]
141
- theme = "dir://theme"
142
- docs = "dir://docs"
143
- ```
144
-
145
- *Both the theme and the documentation included in a single directory...*
146
-
147
- ```toml
148
- [mkdocs]
149
- theme = "dir://docs"
150
- docs = "dir://docs"
151
- ```
152
-
153
- <br/>
@@ -1,241 +0,0 @@
1
- # Writing Markdown
2
-
3
- MkDocs supports regular Markdown syntax with some Github Flavored Markdown extensions.
4
-
5
- For other references on writing in Markdown, see the [GitHub documentation](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax), the [Markdown Guide](https://www.markdownguide.org/), or the author's [original documentation](https://daringfireball.net/projects/markdown/).
6
-
7
- The rest of this page provides a reference guide to the supported markdown syntax.
8
-
9
- ## Headings
10
-
11
- ```markdown
12
- # H1
13
- ## H2
14
- ### H3
15
- #### H4
16
- ##### H5
17
- ```
18
-
19
- <h1>H1</h1>
20
- <h2 style="margin-top: 1.5rem">H2</h2>
21
- <h3>H3</h3>
22
- <h4>H4</h4>
23
- <h5>H5</h5>
24
-
25
- ## Formatting
26
-
27
- ```markdown
28
- * **Bold text**
29
- * *Italic text*
30
- * ~~Strikethrough~~
31
- * <ins>Underlined</ins>
32
- * e <sup>i π</sup> = -1
33
- * H<sub>2</sub>O
34
- ```
35
-
36
- <span></span>
37
-
38
- * **Bold text**
39
- * *Italic text*
40
- * ~~Strikethrough~~
41
- * <ins>Underlined</ins>
42
- * e <sup>i π</sup> = -1
43
- * H<sub>2</sub>O
44
-
45
- ## Lists
46
-
47
- ```markdown
48
- - First item
49
- - Second item
50
- - Third item
51
- ```
52
-
53
- <span></span>
54
-
55
- - First item
56
- - Second item
57
- - Third item
58
-
59
- ## Ordered Lists
60
-
61
- ```markdown
62
- 1. First item
63
- 2. Second item
64
- 3. Third item
65
- ```
66
-
67
- <span></span>
68
-
69
- 1. First item
70
- 2. Second item
71
- 3. Third item
72
-
73
- ## Links
74
-
75
- ```markdown
76
- See [wikipedia](https://www.wikipedia.org/).
77
- ```
78
-
79
- See [wikipedia](https://www.wikipedia.org/).
80
-
81
- ## Section links
82
-
83
- ```markdown
84
- See the [Links](#links) section.
85
- ```
86
-
87
- See the [Links](#links) section.
88
-
89
- ## Relative Links
90
-
91
- ```markdown
92
- Back to the [Homepage](index.md).
93
- ```
94
-
95
- Back to the [Homepage](index.md).
96
-
97
- ## Images
98
-
99
- ```markdown
100
- ![coder cat](img/codercat.png)
101
- ```
102
-
103
- ![coder cat](img/codercat.png)
104
-
105
- ## Inline Code
106
-
107
- ```markdown
108
- `&mdash;`
109
- ```
110
-
111
- `&mdash;`
112
-
113
- ## Code Block
114
-
115
- <pre><code class="language-markdown hljs">```json
116
- {
117
- "firstName": "John",
118
- "lastName": "Smith",
119
- "age": 25
120
- }
121
- ```</code></pre>
122
-
123
- <span></span>
124
-
125
- ```json
126
- {
127
- "firstName": "John",
128
- "lastName": "Smith",
129
- "age": 25
130
- }
131
- ```
132
-
133
- ## Horizontal Rule
134
-
135
- ```markdown
136
- ---
137
- ```
138
-
139
- ---
140
-
141
- <br/>
142
-
143
- ## Table
144
-
145
- ```markdown
146
- | Syntax | Description |
147
- | --------- | ----------- |
148
- | Header | Title |
149
- | Paragraph | Text |
150
- ```
151
-
152
- <span></span>
153
-
154
- | Syntax | Description |
155
- | --------- | ----------- |
156
- | Header | Title |
157
- | Paragraph | Text |
158
-
159
- ## Footnotes
160
-
161
- ```markdown
162
- Here's a sentence with a footnote. [^1]
163
-
164
- [^1]: This is the footnote from earlier.
165
- ```
166
-
167
- Here's a sentence with a footnote. [^1]
168
-
169
- [^1]: This is the footnote from earlier.
170
-
171
- ## Blockquote
172
-
173
- ```markdown
174
- > Rumors of my death have been greatly exaggerated.
175
- ```
176
-
177
- > Rumors of my death have been greatly exaggerated.
178
-
179
- ## Alerts
180
-
181
- ```markdown
182
- > [!NOTE]
183
- > Useful information that users should know, even when skimming content.
184
- ```
185
-
186
- > [!NOTE]
187
- > Useful information that users should know, even when skimming content.
188
-
189
- ```markdown
190
- > [!TIP]
191
- > Helpful advice for doing things better or more easily.
192
- ```
193
-
194
- > [!TIP]
195
- > Helpful advice for doing things better or more easily.
196
-
197
- ```markdown
198
- > [!IMPORTANT]
199
- > Key information users need to know to achieve their goal.
200
- ```
201
-
202
- > [!IMPORTANT]
203
- > Key information users need to know to achieve their goal.
204
-
205
- ```markdown
206
- > [!WARNING]
207
- > Urgent info that needs immediate user attention to avoid problems.
208
- ```
209
-
210
- > [!WARNING]
211
- > Urgent info that needs immediate user attention to avoid problems.
212
-
213
- ```markdown
214
- > [!CAUTION]
215
- > Advises about risks or negative outcomes of certain actions.
216
- ```
217
-
218
- > [!CAUTION]
219
- > Advises about risks or negative outcomes of certain actions.
220
-
221
- ## Emoji
222
-
223
- ```markdown
224
- :+1: This PR looks great :heart:
225
- ```
226
-
227
- :+1: This PR looks great :heart:
228
-
229
- ## Task List
230
-
231
- ```markdown
232
- - [x] Write the press release
233
- - [ ] Update the website
234
- - [ ] Contact the media
235
- ```
236
-
237
- <span></span>
238
-
239
- - [x] Write the press release
240
- - [ ] Update the website
241
- - [ ] Contact the media
@@ -1,2 +0,0 @@
1
- __title__ = "mkdocs"
2
- __version__ = "2.0.dev0"
File without changes
File without changes
File without changes
File without changes
File without changes