docs: format and wording tweak for color schemes

This commit is contained in:
Wez Furlong committed 2020-10-20 00:55:35 -07:00
1 parent 2c5275142a
commit 83c52ef27a
2 files changed
+14 -6

No files matched your search

+12 -5
View File
@@ -47,12 +47,14 @@ class Gen(object):
for page in children:
idx.write(f" - [{page.title}]({page.title}.md)\n")
def image_dimensions(filename):
out = subprocess.check_output(["identify", filename])
fields = out.split()
while fields[0] != b'PNG':
while fields[0] != b"PNG":
fields = fields[1:]
return [int(x) for x in fields[1].split(b'x')]
return [int(x) for x in fields[1].split(b"x")]
class GenColorScheme(object):
def __init__(self, title, dirname, index=None):
@@ -78,16 +80,20 @@ class GenColorScheme(object):
img = os.path.basename(img)
title = os.path.basename(img).rsplit(".", 1)[0]
idx.write(f"# {title}\n")
idx.write(f"<img width=\"{width}\" height=\"{height}\" src=\"{img}\" alt=\"{title}\">\n\n")
idx.write(
f'<img width="{width}" height="{height}" src="{img}" alt="{title}">\n\n'
)
idx.write("To use this scheme, add this to your config:\n")
idx.write(f"""
idx.write(
f"""
```lua
return {{
color_scheme = "{title}",
}}
```
""")
"""
)
index_filename = f"{self.dirname}/index.md"
index_page = Page(self.title, index_filename, children=children)
@@ -99,6 +105,7 @@ return {{
upper = page.title.upper()
idx.write(f" - [{upper}]({page.title}/index.md)\n")
TOC = [
Page(
"wezterm",
+2 -1
View File
@@ -10,7 +10,8 @@ return {
}
```
You can find a list of available color schemes in [The Color Schemes Section](../colorschemes/index.md).
You can find a list of available color schemes and screenshots
in [The Color Schemes Section](../colorschemes/index.md).
The `color_scheme` option takes precedence over the `colors` section below.