-
Notifications
You must be signed in to change notification settings - Fork 630
staves:0.1.0 #2589
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
staves:0.1.0 #2589
Conversation
Hello, and thank you for your feedback. We recently revamped the docs to include more information, and it's very valuable to get some comments from someone making a Typst package for the first time. I'll try to answer everything.
It's true that this could be more explicit. I think the section on imports in
This is a technical limitation in
You are indeed supposed to have these two git repositories on your machine.
That's a bit unfortunate :( Let's hope this PR will get merged soon.
I can't really help here, as I have never used showman personally. I would advise you to open specific issues on the dedicated repository to discuss these points.
The motivation for splitting the docs into multiple files was that there was just to much information for it to be put linearly in a single document, that some of it was not really depending on any particular reading order, and that some pieces of information are more extra tips to make your life easier than requirements. We still wanted to list to most important aspects of package authoring in the
Yes, this is the approach for Typst packages. I think you might be biased by other packaging systems you already knew here. However, it may be worth it to be a bit more explicit about the expected submission process in the docs. |
I think a way to make it clear would to be to have some examples, as code files, not code snippets. Simple: A folder (e.g. docs/example/simple/) which contains just Medium: A folder with at least two Complex: Just point to a real package, e.g. Cetz, as you already do. The key thing here is that a user should be able to see wholistically all the files they need, and all the steps they need. e.g. I still can't figure out how to actually install a package locally. The README says:
But when I do that, I get "package not found". Is there something missing from the instructions? Note that
How do I install my package locally to test it? What have I done wrong? Why did I'm also still confused about the import syntax. Can you confirm that it is:
For images, will |
Having the three example packages as you suggested sound like a good idea, thanks.
This is a known issue when using Snap, access to the local package directory doesn't work as expected.
It is normal that you had to create that directory: the package cache ( Regarding the import syntax: it works just like in the terminal (or most other programming languages), paths starting with a For the |
That's not working for me. What am I doing wrong? My terminal output from earlier was about doing that for
|
The bug with the Snap package affects the whole |
Ah yes, of course. You did say that, I missed it. Sorry. I'll try installing with |
I'm still working on this. Since documentation needs to be in markdown, but I want to use variables within the library to write the docs, I'm writing my own implementation of showman. I've also found some bugs in the core functionality that I need to fix. I don't have much time at the moment to work on this. It might be another month or two until I'm ready. |
Thank you for the update. We generally try to only keep active PRs open in this repository, so if you don't see yourself finishing it in less than one or two weeks, it would be better to close it for now, yes. |
I am submitting
Description: This Typst package is used to draw musical scales. It draws 5 lines, clefs, key signatures, and then a series of notes. The series can be predefined (e.g. B flat major), or a custom scale.
I have read and followed the submission guidelines and, in particular, I
typst.toml
file with all required keysREADME.md
with documentation for my packageLICENSE
file or linked one in myREADME.md
exclude
d PDFs or README images, if any, but not the LICENSEMy repo is: https://github.com/mdavis-xyz/staves-typst
Packaging
I am confident in the functionality of the package itself. However I have really struggled to understand how to package it to submit to this repo. I found the instructions to be spread out over too many different places, lacking crucial details. I read all the instructions I could find multiple times, but I'm still confused. So consider this a draft, and please tell me what to do.
How do I configure the imports?
/src/core.typ
or./src/core.typ
or@preview/staves:0.1.0/core
or what? I have no idea. I checked documentation.md, resources.md and tips.md. None of those mention how to do imports. One mentions that in the README you should import from@preview
in code blocks shown to the user.However I tried running
typst-package-check check
. It throws an error for my import of cetz:#import "@preview/cetz:0.3.4"
. "failed to download package (All packages are supposed to be present in thepackages
repository, or in the local cache.)" It's not clear what this error is for. The code compiles fine withtypst watch docs/docs.typ docs/docs.pdf --root $(pwd)
andtypst watch src/test.typ src/test.pdf --root $(pwd)
. So it seems the typst compiler can downloadcetz
, buttypst-package-check
says it can't. I think there's just something big I'm not understanding about what the local cache is. (Was I supposed to checkout mymdavis-xyz/staves-typst
repo into~/.local/share
?) I do not understand what "present in thepackages
repository" is referring to. My understanding is that I'm supposed to have two git repos cloned to my machine. One with my code mdavis-xyz/staves-typst, and then also this repo (typst/packages). But if I'm compiling code instaves-typst
, how doestypst-package-check
know which other folder on my laptop is the clone of typst/packages?I ran
typos
on this as suggested by the tips, but it flags every import as a typo, because the.typ
file extension is considered a typo of "typo". (A recent PR is still openI tried running
showman
but that didn't work. It seems like an issue with howshowman
is installed bypip
.I tried reading the docs from showman, to figure out what my README should look like. In particular, how to link to images, and where to save images. It's not clear. For now my README.md is a stub. The real docs are in
docs/docs.typ
. Once the showman bug is solved, I'll update this pull request with aREADME.md
that matchesdocs/docs.typ
. In the mean time, please tell me what to do with my imports.Sorry for the long rant. I'm just trying to communicate how difficult it was for me as a newcomer to understand what is required of me. In particular, the way that each instruction markdown file branches off into several others made it easy to get lost, miss stuff, and read things in the wrong order. It was hard to see the big picture. If there was just a single markdown file to read from top to bottom to follow the 'golden path', that would be much easier.
Additionally, I was also confused for a long time about the overall approach to packaging. I was expecting something like
pypi
, where you have only one git repo for your package, and you upload a zip of code files somewhere. Typst uses a different approach. My understanding now is that it is one monorepo, plus a second per-package repo, joined with append-only copy-pasting a subset of files, without pull requests between the two repos, nor a common commit tree. I'm sure there are good reasons for that. It's just not clear for a newcomer that this is the approach. The way it's phrased in the topREADME.md
describes this approach, but in a way that I only find clear in hindsight.Once I've got a better idea of how this process works, I'm happy to rearrange and add to the documentation, if you want.