113 Commits

Author SHA1 Message Date
Timothée Mazzucotelli
60c5866a00 docs: Fix formatting 2020-12-30 05:43:22 +00:00
Jairo Llopis
c7b9f21f83 Advise users to never edit manually the copier answers file
This keeps happening once and again, and confuses users.

Let's clarify it here in the docs.

I also fix some broken links and update deps BTW.
2020-12-18 10:09:46 +00:00
Nikolaus Schlemm
ef7ddd274e fixed typo
"-f" makes more sense and matches https://github.com/copier-org/copier/blob/master/copier/cli.py#L138 ;)
2020-10-31 12:03:43 +00:00
Jairo Llopis
dfb7688910 Explain how to use multiple templates for the same project
This is very cool and it doesn't seem to be clearly explained anywhere.
2020-10-17 11:20:37 +00:00
Jairo Llopis
56bddd080e Remove --only-diff flag
This flag was not working fine, after all.

Also, the only difference between `copier copy` and `copier update` is that copying should ignore subproject history, while updating should respect it.

Thus, the real CLI reflection of the `only_diff` option is whether you're using `copier copy` or `copier update`. Well, that's how it is now.

Besides all this, the real behavior of `only_diff=False` wasn't being tested. Fixed also, and updated docs.

Fixes #270.
2020-09-18 11:21:04 +00:00
Jairo Llopis
b479cb9804 Make exclude extend if called from CLI/API
When adding the `exclude` option from CLI/API, it extends the definitions found in `copier.yml`.

When adding it in `copier.yml`, it replaces the defaults.

Fixes #215, which explains that it was very unexpected that excluding some extra things included a lot of other things by accident.
2020-09-18 10:55:09 +00:00
Jairo Llopis
57d138caea Copier will only cleanup the folder if it created it
It's OK that Copier deletes the destination folder by default when Copier created it. After all, if something failed, you probably don't want that dangling folder around.

However, if the folder existed before (which is always true if you're updating), Copier should not delete it. Yes, this will leave garbage there, but it will be better than removing what is no garbage by accident.

Apart from enforcing this new behavior, a new `--no-cleanup` CLI flag is exposed to `copier copy` to disable this behavior altogether. The flag is not available for `copier update` because it will never work there, as explained above.

This patch fixes #262 and closes #264.
2020-09-17 20:10:31 +00:00
Jairo Llopis
6e7cff8b37 Allow multidoc copier.yml with glob include
Before this patch, using `!include` was a bit absurd because it would fail under any useful scenario:

- Including with a glob.
- Trying to include more than 1 file.

Now all those are supported, and they can coexist. Besides, the patch is quite simple, which makes it more attractive.

Fix #237.
2020-09-05 11:22:42 +00:00
Jairo Llopis
d6324eb7a4 Fix admonitions
Little bug that made these docs look like code instead of normal docs.
2020-08-13 12:14:48 +00:00
Jairo Llopis
1e464dad0f Add --prereleases support
Before this patch, Copier didn't ignore prereleases when detecting latest template tag.

This is mostly a bug because there's no way to safely upgrade a template to the latest non-prerelease tag automatically.

This a behavioral change that probably didn't hit anybody out there, but enough to make a new big release.
2020-08-13 11:45:18 +00:00
Jairo Llopis
8be4bbe93a Better docs for CLI
- Add `only_diff` docs.
- Link CLI docs with those from configuration.
- Add link on `copier --help` to the docs.
- Include `copier --help-all` in the online docs.
2020-08-13 10:17:23 +00:00
Jairo Llopis
cdb563a96d Add 4-space indentation to .md files
Mkdocs uses `python-markdown`, and [they say](https://python-markdown.github.io/#differences):

> The syntax rules clearly state that when a list item consists of multiple paragraphs, “each subsequent paragraph in a list item must be indented by either 4 spaces or one tab” (emphasis added). However, many implementations do not enforce this rule and allow less than 4 spaces of indentation. The implementers of Python-Markdown consider it a bug to not enforce this rule.

As we were using 2 spaces for markdown files (which looks better in source code), some indented lists were not displaying properly in the docs page.

Thus I change the setting to 4 spaces. Prettier will now enforce them, and mkdocs will display things properly.
2020-08-10 12:59:07 +00:00
Jairo Llopis
a456f59b7a A little polish on docs
- Prepare for a new release.
- Add configuring page, with more explicit docs and examples for each option.
- Remove configuration stuff from creation page.
- Comparisons are ugly, so remove them from the index page.
2020-08-10 11:27:52 +00:00