Skip to content

Commit 6588951

Browse files
Set up mkdocs
1 parent 7750b53 commit 6588951

File tree

9 files changed

+909
-326
lines changed

9 files changed

+909
-326
lines changed

docs/.pages

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
nav:
2+
- Home: index.md
3+
- Learn: learn
4+
- How it works: how.md
5+
- API: api.md
6+
- Compatibility: compatibility.md
7+
- Credits: credits.md
8+
- Licenses: licenses.md

docs/api.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# API
2+
3+
::: pyhtml.create_tag
4+
5+
::: pyhtml.Tag
6+
options:
7+
members:
8+
- children
9+
- attributes
10+
- render
11+
- "_get_tag_name"
12+
- "_get_default_attributes"
13+
- "_get_tag_pre_content"
14+
- "_escape_children"

docs/assets/logo.png

79.2 KB
Loading

docs/how.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ problem with the following steps:
1010
2. Parse the markdown to gather all tag names and descriptions, discarding
1111
garbage data and obsolete tags.
1212

13-
3. Use data from a YAML configuration file ([`meta/tags.yml`](meta/tags.yml))
13+
3. Use data from a YAML configuration file ([`meta/tags.yml`](https://github.com/COMP1010UNSW/pyhtml-enhanced/blob/main/meta/tags.yml))
1414
to gather information on suggested attributes and base classes to use for
1515
each tag.
1616

docs/index.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# `<PyHTML/>`
22

3-
A library for building HTML documents with a simple and learnable syntax,
4-
inspired by (and similar to)
5-
[Cenk Altı's PyHTML library](https://github.com/cenkalti/pyhtml), but
6-
with improved documentation and type safety.
3+
Build HTML documents in Python with a simple and learnable syntax.
74

85
## Usage
96

10-
Consider visiting the [learn PyHTML page](./learn).
7+
* [Learn PyHTML](./learn/index.md)
8+
* [View the cheatsheet](./learn/cheatsheet.md)
119

1210
```py
1311
>>> import pyhtml as p

docs/stylesheets/extra.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
:root>* {
2+
/* Fix up the primary colours */
3+
--md-primary-fg-color: #ffcd29 !important;
4+
--md-accent-fg-color: #ffcd29 !important;
5+
--md-primary-fg-color--light: #ffe08a !important;
6+
--md-primary-fg-color--dark: #ad7a0b !important;
7+
--md-accent-fg-color--light: #ffc38a !important;
8+
--md-accent-fg-color--dark: #ad740b !important;
9+
--md-typeset-a-color: #ffc853 !important;
10+
}
11+
12+
.md-header {
13+
/* Text colour on header */
14+
color: #ffffff !important;
15+
}
16+
17+
/* Search box background */
18+
@media screen and (min-width: 60em) {
19+
.md-search__form {
20+
background-color: #ffffff42 !important;
21+
}
22+
}
23+
24+
/* Search icon color */
25+
.md-search__icon {
26+
color: #ececec !important;
27+
}
28+
29+
div.md-header__topic:first-child {
30+
font-weight: normal;
31+
}
32+
33+
div.doc-contents:not(.first) {
34+
padding-left: 2rem;
35+
border-left: 0.1rem solid var(--md-typeset-table-color);
36+
}

mkdocs.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
site_name: PyHTML
2+
site_description: Documentation for PyHTML
3+
repo_name: "COMP1010UNSW/PyHTML-Enhanced"
4+
repo_url: https://github.com/COMP1010UNSW/pyhtml-enhanced
5+
copyright: © 2024 COMP1010 UNSW
6+
7+
# Build to a temporary directory
8+
site_dir: site
9+
10+
theme:
11+
name: material
12+
palette:
13+
- media: "(prefers-color-scheme: dark)"
14+
scheme: slate
15+
primary: orange
16+
toggle:
17+
icon: material/lightbulb-outline
18+
name: Switch to light mode
19+
- media: "(prefers-color-scheme: light)"
20+
scheme: default
21+
primary: orange
22+
toggle:
23+
icon: material/lightbulb
24+
name: Switch to dark mode
25+
logo: assets/logo.png
26+
favicon: assets/logo.png
27+
icon:
28+
repo: fontawesome/brands/github
29+
code: fontawesome/solid/code
30+
features:
31+
- navigation.tracking
32+
- navigation.instant
33+
- navigation.instant.prefetch
34+
- content.code.copy
35+
36+
plugins:
37+
- awesome-pages:
38+
collapse_single_pages: true
39+
- section-index
40+
- autorefs
41+
- mkdocstrings:
42+
handlers:
43+
python:
44+
paths:
45+
- pyhtml
46+
options:
47+
show_source: false
48+
show_signature_annotations: true
49+
separate_signature: true
50+
members_order: source
51+
show_root_heading: true
52+
- search
53+
54+
## Not using mkdocs scripts since we need to do a ton of pre-build stuff
55+
## Maybe I'll try and get this working some point
56+
# - gen-files:
57+
# scripts:
58+
# - scripts/generate_pages.py
59+
60+
markdown_extensions:
61+
- toc:
62+
title: Contents
63+
toc_depth: 2
64+
- admonition
65+
- pymdownx.details
66+
- pymdownx.highlight:
67+
anchor_linenums: true
68+
line_spans: __span
69+
pygments_lang_class: true
70+
- pymdownx.inlinehilite
71+
- pymdownx.snippets
72+
- pymdownx.superfences
73+
74+
extra_css:
75+
- stylesheets/extra.css
76+
77+
docs_dir: docs

0 commit comments

Comments
 (0)