mirror of
https://github.com/daylinmorgan/yartsu.git
synced 2025-02-22 15:35:49 -06:00
fix(#4): demo takes precedence
This commit is contained in:
parent
a14608d21c
commit
c888fa53f9
4 changed files with 23 additions and 77 deletions
|
@ -1,55 +0,0 @@
|
|||
<div id="top"></div>
|
||||
|
||||
# Themes
|
||||
|
||||
Available themes:
|
||||
|
||||
- [cat-mocha](#cat-mocha)
|
||||
- [cat-macchiato](#cat-macchiato)
|
||||
- [cat-frappe](#cat-frappe)
|
||||
- [cat-latte](#cat-latte)
|
||||
- [dracula](#dracula)
|
||||
- [gruvbox-dark](#gruvbox-dark)
|
||||
- [gruvbox-light](#gruvbox-light)
|
||||
- [nord](#nord)
|
||||
- [dimmed_monokai](#dimmed/monokai)
|
||||
- [monokai](#monokai)
|
||||
- [night-owlish](#night-owlish)
|
||||
- [rich-default](#rich-default)
|
||||
|
||||
## cat-mocha
|
||||

|
||||
<p align="right">(<a href="#top">back to top</a>)</p>
|
||||
## cat-macchiato
|
||||

|
||||
<p align="right">(<a href="#top">back to top</a>)</p>
|
||||
## cat-frappe
|
||||

|
||||
<p align="right">(<a href="#top">back to top</a>)</p>
|
||||
## cat-latte
|
||||

|
||||
<p align="right">(<a href="#top">back to top</a>)</p>
|
||||
## dracula
|
||||

|
||||
<p align="right">(<a href="#top">back to top</a>)</p>
|
||||
## gruvbox-dark
|
||||

|
||||
<p align="right">(<a href="#top">back to top</a>)</p>
|
||||
## gruvbox-light
|
||||

|
||||
<p align="right">(<a href="#top">back to top</a>)</p>
|
||||
## nord
|
||||

|
||||
<p align="right">(<a href="#top">back to top</a>)</p>
|
||||
## dimmed_monokai
|
||||

|
||||
<p align="right">(<a href="#top">back to top</a>)</p>
|
||||
## monokai
|
||||

|
||||
<p align="right">(<a href="#top">back to top</a>)</p>
|
||||
## night-owlish
|
||||

|
||||
<p align="right">(<a href="#top">back to top</a>)</p>
|
||||
## rich-default
|
||||

|
||||
<p align="right">(<a href="#top">back to top</a>)</p>
|
|
@ -31,9 +31,10 @@ plugins:
|
|||
enable_creation_date: true
|
||||
|
||||
markdown_extensions:
|
||||
- def_list
|
||||
- pymdownx.highlight:
|
||||
anchor_linenums: true
|
||||
- pymdownx.inlinehilite
|
||||
- pymdownx.snippets
|
||||
- pymdownx.superfences
|
||||
- pymdownx.tabbed:
|
||||
alternate_style: true
|
||||
|
|
|
@ -4,32 +4,26 @@ THEME_MD="./docs/themes.md"
|
|||
|
||||
themes=$(yartsu --list-themes | tail -n +5 | cut -d' ' -f 3)
|
||||
|
||||
newline() {
|
||||
echo >>"$THEME_MD"
|
||||
}
|
||||
|
||||
mkdir -p ./docs/themes
|
||||
rm -f ./docs/themes/*
|
||||
rm -f $THEME_MD
|
||||
yartsu -o docs/themes/list.svg -- yartsu --list-themes
|
||||
|
||||
echo '<div id="top"></div>' >>$THEME_MD
|
||||
newline
|
||||
echo "# Themes" >>$THEME_MD
|
||||
newline
|
||||
cat >>"$THEME_MD" <<EOF
|
||||
# Themes
|
||||
|
||||
printf "Available themes:\n\n" >>$THEME_MD
|
||||
<p align='center'>
|
||||
<img src="/yartsu/themes/list.svg" width="50%">
|
||||
</p>
|
||||
|
||||
for theme in $themes; do
|
||||
echo "- [$theme](#${theme//_//})" >>$THEME_MD
|
||||
done
|
||||
newline
|
||||
See below for example outputs of each.
|
||||
EOF
|
||||
|
||||
for theme in $themes; do
|
||||
url="docs/themes/${theme}.svg"
|
||||
cat >>"$THEME_MD" <<EOF
|
||||
## $theme
|
||||

|
||||
<p align="right">(<a href="#top">back to top</a>)</p>
|
||||
=== "$theme"
|
||||

|
||||
EOF
|
||||
yartsu --theme "$theme" -o "$url" --demo -t "yartsu --theme ${theme} --demo"
|
||||
done
|
||||
|
|
|
@ -106,13 +106,19 @@ def main() -> None:
|
|||
else:
|
||||
cmd = None
|
||||
|
||||
if args.input:
|
||||
parsed_input = Text.from_ansi(args.input.read())
|
||||
|
||||
elif args.demo:
|
||||
console = Console(file=io.StringIO(), record=True, force_terminal=True)
|
||||
if args.demo:
|
||||
console = Console(
|
||||
file=io.StringIO(),
|
||||
record=True,
|
||||
force_terminal=True,
|
||||
color_system="truecolor",
|
||||
legacy_windows=False,
|
||||
)
|
||||
parsed_input = make_test_card() # type: ignore
|
||||
|
||||
elif args.input:
|
||||
parsed_input = Text.from_ansi(args.input.read())
|
||||
|
||||
title = args.title or cmd or "yartsu"
|
||||
|
||||
if args.width:
|
||||
|
|
Loading…
Add table
Reference in a new issue