You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ Instructions: Add a subsection under `[Unreleased]` for additions, fixes, change
11
11
12
12
### Changed
13
13
14
+
- NEW BEHAVIOR: the `pretext build -g` command will not use cached versions of assets when regenerating. You can still generate assets and use the cache with `pretext generate`.
Copy file name to clipboardExpand all lines: docs/asset-generation.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,22 +26,24 @@ However, for select assets (currently `asymptote`, `latex-image`, `prefigure`, a
26
26
27
27
2. If the software to generate assets is improved (which happens with `prefigure` assets, for example), the user will not get new versions of these assets (assuming no changes are made to source).
28
28
29
+
3. Sometimes a generated asset will pull in external data, such as a `latex-image` that includes an external `.png`, or a `prefigure` diagram that uses an external data file. The hash only knows about the code in the original asset, so changing the external import will not change the hash.
30
+
29
31
## User Interface
30
32
31
33
Assets are generated (sometimes using the cache, sometimes skipping it) depending on what CLI command a user enters.
32
34
33
35
-`pretext build`. Assets will be generated only if the source has changed inside that asset type, and cached output will be copied if present.
34
-
-`pretext build -g` (`pretext build --generate`). For each asset type in source, we will request it be generated by core regardless of whether the source has changed. Will copy cached versions of assets where possible.
35
-
-`pretext build -q` (`pretext build --no-generate`). No assets will be generated (or copied from cache), even if source has changed (or hasn't been successfully generated before).
36
-
-`pretext generate`. Assets of all, or specified, types will be generated, even if source has changed. Cached versions of individual assets will be copied if possible (CHANGE?). Identical to `pretext build -g` except it allows to limit by asset type and doesn't call build.
36
+
-`pretext build -g` (`pretext build --generate`). For each asset type in source, we will request it be generated by core regardless of whether the source has changed. Will also regenerate any assets in the cache. Equivalent to running `pretext generate -f` followed by `pretext build`.
37
+
-`pretext build -q` (`pretext build --no-generate`). No assets will be generated (or copied from cache), even if source has changed (or hasn't been successfully generated before). Intended for building quickly and to avoid errors coming from missing executables (if you want to still see the non-asset parts of the document).
38
+
-`pretext generate`. Assets of all, or specified, types will be generated, even if source has changed. Cached versions of individual assets will be copied if possible. Allows to limit by asset type and doesn't call build.
37
39
-`pretext generate -q` (`pretext generate --only-changed`). Limit generation of assets to only those that have changed since last call to generate. Same as `pretext build` except you don't do a build, just generate assets, and can limit to asset type.
38
-
-`pretext generate -f` (`pretext generate --force`). Generates all assets, even if source has not changed, and does NOT copy assets from cache even if available.
40
+
-`pretext generate -f` (`pretext generate --force`). Generates all assets, even if source has not changed, and does NOT copy assets from cache even if available (they will be updated). Same behavior as `pretext build -g`, except you don't do a build, just generate assets, and can limit to asset type.
39
41
40
42
There is also a `pretext generate --clean` that deletes the .cache directory.
41
43
42
44
### Consequences
43
45
44
-
To avoid pitfall number 1, run `pretext build -g`.
46
+
To avoid pitfall number 1, run `pretext generate`.
45
47
46
-
To avoid pitfall number 2, run `pretext generate -f`.
48
+
To avoid pitfall numbers 2 or 3, run`pretext build -g` or`pretext generate -f`.
0 commit comments