Skip to content

Improved ratio and relative length docs#5750

Merged
laurmaedje merged 7 commits intotypst:mainfrom
Andrew15-5:ratio-and-rel-docs
Apr 7, 2025
Merged

Improved ratio and relative length docs#5750
laurmaedje merged 7 commits intotypst:mainfrom
Andrew15-5:ratio-and-rel-docs

Conversation

@Andrew15-5
Copy link
Contributor

@Andrew15-5 Andrew15-5 commented Jan 24, 2025

Since we don't have a way to test the docs on the docs page (unlike rust docs) or docs on how link to different stuff work, I have no idea if all my links are valid.

I think I mentioned everything from #3098 OP in one way or another. Although, I am not sure what I should write for the relative length. And which part of the patch should be in which of the two files.

Closes #3098.

Copy link
Contributor

@PgBiel PgBiel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is a great start. I've added some notes, and I urge others to comment as well if they have further suggestions.

Comment on lines +12 to +14
/// setting the width or height of a container (e.g., [block], [rect], etc.),
/// thus it is used as a part of a [relative length](relative) (because
/// internally containers use relative length for width and height fields):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like something like this might be better:

Suggested change
/// setting the width or height of a container (e.g., [block], [rect], etc.),
/// thus it is used as a part of a [relative length](relative) (because
/// internally containers use relative length for width and height fields):
/// setting the width or height of a container (e.g., [block], [rect], etc.),
/// as it can be used as part of a [relative length]($relative) to represent
/// a certain percentage of the surrounding container's - or the current
/// page's, if there isn't one - corresponding dimension. For example:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nnoo, it sounds very complex and weird. Why there is "-" before "or"? "container's" what? I completely don't understand the "if there isn't one - corresponding dimension" part. Corresponding to what? There is no way there is nothing outside: there is always page dimensions, if there is no other container wrappers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it a little in the new commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is resolved, mark it as so.

Andrew15-5 and others added 2 commits January 28, 2025 03:01
Co-authored-by: PgBiel <9021226+PgBiel@users.noreply.github.com>
Co-authored-by: PgBiel <9021226+PgBiel@users.noreply.github.com>
@Andrew15-5
Copy link
Contributor Author

#5750 (comment):

I also wanted to ask what is the best way to show math stuff in the docs.

I think this should be moved to the contribution docs. Maybe the docs site can use MathML or something else for inline and potentially block math. Of course, the math syntax should be the one of Typst. I want to make a separate issue about this.

@Andrew15-5 Andrew15-5 requested review from PgBiel and laurmaedje March 22, 2025 06:44
@laurmaedje laurmaedje added the docs Improvements or additions to documentation label Mar 24, 2025
@laurmaedje
Copy link
Member

Thanks!

I shuffled some stuff around and, in the end, changed things up quite a bit, but I think what you added is still there, just some things in different shape.

@laurmaedje laurmaedje enabled auto-merge April 7, 2025 19:44
@laurmaedje laurmaedje added this pull request to the merge queue Apr 7, 2025
Merged via the queue into typst:main with commit 43c3d5d Apr 7, 2025
7 checks passed
@Andrew15-5 Andrew15-5 deleted the ratio-and-rel-docs branch April 7, 2025 21:01
@Andrew15-5
Copy link
Contributor Author

Looks nice. Really want to see how it looks in the rendered docs now. ;)

hongjr03 pushed a commit to hongjr03/typst that referenced this pull request Apr 16, 2025
Co-authored-by: PgBiel <9021226+PgBiel@users.noreply.github.com>
Co-authored-by: Laurenz <laurmaedje@gmail.com>
YDX-2147483647 added a commit to YDX-2147483647/typst that referenced this pull request Sep 11, 2025
YDX-2147483647 added a commit to YDX-2147483647/typst that referenced this pull request Sep 15, 2025
YDX-2147483647 added a commit to YDX-2147483647/typst that referenced this pull request Oct 3, 2025
YDX-2147483647 added a commit to YDX-2147483647/typst that referenced this pull request Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve ratio / relative length docs

3 participants