Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
coordt committed Jan 25, 2023
1 parent 37289c9 commit 1a1c1f6
Show file tree
Hide file tree
Showing 13 changed files with 83 additions and 7 deletions.
Empty file removed .gitchangelog.rc
Empty file.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,5 @@ flake8-errors.txt
RELEASE.txt
site-packages
reports
temp.py
todo.txt
4 changes: 2 additions & 2 deletions cookie_composer/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import rich_click as click

from cookie_composer.commands.add import add_cmd
from cookie_composer.commands.auth import auth_cli
from cookie_composer.commands.authn import auth
from cookie_composer.commands.create import create_cmd
from cookie_composer.commands.link import link_cmd
from cookie_composer.commands.update import update_cmd
Expand All @@ -24,7 +24,7 @@ def cli():
pass


cli.add_command(auth_cli, name="auth")
cli.add_command(auth)


@cli.command()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@


@click.group()
def auth_cli():
def auth():
"""Authenticate cookie-composer to a service."""
pass


@auth_cli.command()
@auth.command()
@click.option(
"-p",
"--git-protocol",
Expand Down Expand Up @@ -61,7 +61,7 @@ def login(git_protocol: str, service: str, scopes: str, with_token: click.File):
# pass


@auth_cli.command()
@auth.command()
@click.option(
"-h",
"--service",
Expand Down
2 changes: 1 addition & 1 deletion cookie_composer/composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class LayerConfig(BaseModel):
"""Directory within a git repository template that holds the cookiecutter.json file."""

checkout: Optional[str]
"""The branch, tag or commit to use if template is a git repository."""
"""The branch, tag or commit to tell Cookie Cutter to use."""

password: Optional[str]
"""The password to use if template is a password-protected Zip archive."""
Expand Down
Binary file added docsrc/_static/img/authorize-composer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docsrc/_static/img/authorize-done.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion docsrc/_static/img/composer-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docsrc/_static/img/device-activation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docsrc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ API Reference

~commands
~merge_files
~authentication
~cc_overrides
~composition
~data_merge
~diff
~exceptions
~git_commands
~layers
Expand Down
50 changes: 50 additions & 0 deletions docsrc/how-to/access-private-templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Accessing templates in private repositories

Cookie composer can integrate with some third-party services in order to access private repositories.

```{note}
Currently only GitHub is supported.
```

## GitHub

At your terminal, enter `cookie-composer auth login`:

```console
$ cookie-composer auth login
First copy your one-time code: A25E-0A58
Then visit https://github.com/login/device in your browser, and paste the code when prompted.
Press Enter to open github.com in your browser...
```

Copy the one-time code (`A25E-0A58` in this example), and press Enter or Return to open your browser to the correct page.

You will arrive at a page similar to this:

![Activate the device](/_static/img/device-activation.png)

Paste the code (or enter each character individually) and press the continue button.

You will see an authorization page, similar to:

![Authorize cookie-composer](/_static/img/authorize-composer.png)

Press the "Authorize callowayproject" button to allow cookie-composer read-only access to your repositories.

Then you will see:

![All done!](/_static/img/authorize-done.png)

And you can close the browser window.

Your terminal will now look like:

```console
$ cookie-composer auth login
First copy your one-time code: A25E-0A58
Then visit https://github.com/login/device in your browser, and paste the code when prompted.
Press Enter to open github.com in your browser...
Waiting for authorization.............Authenticated to GitHub
```

Now when you provide any GitHub template link, Cookie Composer is able to access them as you with read-only access.
8 changes: 8 additions & 0 deletions docsrc/how-to/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# How To...

```{toctree}
---
maxdepth: 2
---
access-private-templates
```
1 change: 1 addition & 0 deletions docsrc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ hidden:
installation
tutorial/index
topic-guides/index
how-to/index
cli
api
contributing
Expand Down

0 comments on commit 1a1c1f6

Please sign in to comment.