mirror of
https://github.com/Hopiu/llm.git
synced 2026-05-11 23:33:10 +00:00
Use cog prolog
Refs https://github.com/simonw/llm/issues/151#issuecomment-1675730608
This commit is contained in:
parent
50d3b8b25b
commit
7303bc3e34
5 changed files with 4 additions and 12 deletions
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
|
|
@ -27,8 +27,9 @@ jobs:
|
|||
pytest
|
||||
- name: Check if cog needs to be run
|
||||
run: |
|
||||
cog docs/usage.md
|
||||
cog --check docs/*.md
|
||||
cog --check \
|
||||
-p "import sys, os; sys._called_from_test=True; os.environ['LLM_USER_PATH'] = '/tmp'" \
|
||||
docs/*.md
|
||||
- name: Run Black
|
||||
run: |
|
||||
black --check .
|
||||
|
|
|
|||
2
Justfile
2
Justfile
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
# Rebuild docs with cog
|
||||
@cog:
|
||||
pipenv run cog -r docs/*.md
|
||||
pipenv run cog -r -p "import sys, os; sys._called_from_test=True; os.environ['LLM_USER_PATH'] = '/tmp'" docs/*.md
|
||||
|
||||
# Serve live docs on localhost:8000
|
||||
@docs: cog
|
||||
|
|
|
|||
|
|
@ -12,9 +12,6 @@ Example output:
|
|||
|
||||
<!-- [[[cog
|
||||
from click.testing import CliRunner
|
||||
import sys, os
|
||||
os.environ["LLM_USER_PATH"] = "/tmp"
|
||||
sys._called_from_test = True
|
||||
from llm.cli import cli
|
||||
result = CliRunner().invoke(cli, ["aliases", "list"])
|
||||
cog.out("```\n{}```".format(result.output))
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ This page lists the `--help` output for all of the `llm` commands.
|
|||
|
||||
<!-- [[[cog
|
||||
from click.testing import CliRunner
|
||||
import sys
|
||||
sys._called_from_test = True
|
||||
from llm.cli import cli
|
||||
def all_help(cli):
|
||||
"Return all help for Click command and its subcommands"
|
||||
|
|
|
|||
|
|
@ -90,12 +90,8 @@ llm models list --options
|
|||
Output:
|
||||
<!-- [[[cog
|
||||
from click.testing import CliRunner
|
||||
import os, sys
|
||||
sys._called_from_test = True
|
||||
from llm.cli import cli
|
||||
os.environ["LLM_USER_PATH"] = "/tmp"
|
||||
result = CliRunner().invoke(cli, ["models", "list", "--options"])
|
||||
del os.environ["LLM_USER_PATH"]
|
||||
cog.out("```\n{}\n```".format(result.output))
|
||||
]]] -->
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue