Skip to content

Documentation for local packages is misleading WRT custom paths #5936

Open

Description

@cady-b

Freikugel brought this to our attention on Discord: Typst › support › Creating local package template 🗪

Currently, packages are said to live in {data-dir}/typst/packages/{namespace}/{name}/{version}. So if --package-path or TYPST_PACKAGE_PATH is given to the CLI, one might expect to have to create /typst/packages/ within to match this pattern. That is not the case; in the default package path (which typst-kit calls the "standard system package data directory"), /typst/packages is joined to {data-dir} presumably only to differentiate itself from other software.

To be a resource for all users, that distinction could be made clearer. I.e. with the path spec being changed to accommodate an arbitrary FsPackages root: {package-path}/{namespace}/{name}/{version}, and a more detailed explanation of the default given afterward:

- Here, `{data-dir}` is
+ The default `{package-path}` is `typst/packages` within the system's application data directory

The example below suggesting "local" as a namespace may then also use {package-path}, and the sentence below that explaining precedence I'm honestly not sure how to fix in a neat way, maybe with "local package directory"? 😅


I'm also opening an issue instead of a PR because I'm unsure weather for what I called {package-path}, we should follow the convention of "dir" used in other parts of the README or "path" used in the CLI. Though typst compile --help does say --package-path is of type <DIR>, this is probably harder to find and associate. #4588 previously suggested deciding on one term to use throughout, but as far as I can tell, this hasn't happened yet.

I'm also not super set on the rest of the wording, which is getting quite convoluted. Though I've tried contributing my suggested fix with the clearest & least fluffy wording I could come up with, I'd be happy to discuss other ideas or make way for a larger rewrite of the section of course! :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions