Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace update-docs-help.py script with cog #1598

Closed
simonw opened this issue Jan 14, 2022 · 1 comment
Closed

Replace update-docs-help.py script with cog #1598

simonw opened this issue Jan 14, 2022 · 1 comment

Comments

@simonw
Copy link
Owner

simonw commented Jan 14, 2022

I introduced cog in #1594 - I can use this to replace the older update-docs-help.py mechanism:

@pytest.mark.parametrize(
"name,filename",
(
("serve", "datasette-serve-help.txt"),
("package", "datasette-package-help.txt"),
("publish heroku", "datasette-publish-heroku-help.txt"),
("publish cloudrun", "datasette-publish-cloudrun-help.txt"),
),
)
def test_help_includes(name, filename):
expected = (docs_path / filename).read_text()
runner = CliRunner()
result = runner.invoke(cli, name.split() + ["--help"], terminal_width=88)
actual = f"$ datasette {name} --help\n\n{result.output}"
# actual has "Usage: cli package [OPTIONS] FILES"
# because it doesn't know that cli will be aliased to datasette
expected = expected.replace("Usage: datasette", "Usage: cli")
assert expected == actual, "Run python update-docs-help.py to fix this"

@simonw
Copy link
Owner Author

simonw commented Jan 14, 2022

There are four places in the documentation that use .. literalinclude:: at the moment which I can replace - I can actually just link directly to the new https://docs.datasette.io/en/latest/cli-reference.html page instead of embedding the help directly.

@simonw simonw closed this as completed in 3664ddd Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant