Skip to content
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

More docs automation #2923

Merged
merged 18 commits into from
Jan 7, 2024
Merged

More docs automation #2923

merged 18 commits into from
Jan 7, 2024

Conversation

OAGr
Copy link
Contributor

@OAGr OAGr commented Jan 4, 2024

This does a few small things:

  • Now, definitions can accept interactiveExamples, which are like examples, but they get shown in the SquiggleEditor.
  • Changes to SquiggleEditor to make it nicer to work in the documentation.
  • Converts the rest of the API/ files to be auto-generated.
  • Small distributions with x-labels were messed up, fixes this a bit.
  • Changes BuiltIn Documentation to Common, and pulls out some parts of it into String and the new Boolean namespace. (Note: We might want this to be called Bool instead)
  • generateModulePages now also generates the _meta.json page, which means that all of /Api/ is now generated.

Copy link

vercel bot commented Jan 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
squiggle-website ✅ Ready (Inspect) Visit Preview Jan 7, 2024 4:52pm
3 Ignored Deployments
Name Status Preview Updated (UTC)
quri-hub ⬜️ Ignored (Inspect) Visit Preview Jan 7, 2024 4:52pm
quri-ui ⬜️ Ignored (Inspect) Visit Preview Jan 7, 2024 4:52pm
squiggle-components ⬜️ Ignored (Inspect) Visit Preview Jan 7, 2024 4:52pm

Copy link

changeset-bot bot commented Jan 4, 2024

⚠️ No Changeset found

Latest commit: d19e9d4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

sweep-ai bot commented Jan 4, 2024

Apply Sweep Rules to your PR?

  • Apply: All docstrings and comments should be up to date.
  • Apply: Ensure that all variables and functions have descriptive names.
  • Apply: Avoid using magic numbers or hard-coded values in the code.

Copy link

codecov bot commented Jan 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ceb2869) 69.78% compared to head (a877654) 69.84%.
Report is 2 commits behind head on main.

❗ Current head a877654 differs from pull request most recent head d19e9d4. Consider uploading reports for the commit d19e9d4 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2923      +/-   ##
==========================================
+ Coverage   69.78%   69.84%   +0.05%     
==========================================
  Files         119      120       +1     
  Lines        6762     6765       +3     
  Branches     1443     1444       +1     
==========================================
+ Hits         4719     4725       +6     
+ Misses       2035     2032       -3     
  Partials        8        8              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@berekuk berekuk left a comment

Choose a reason for hiding this comment

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

Margin issue in docs is pretty bad, and the multiplier for charts is confusing (but I think it's not new?).

packages/components/src/components/ui/FnDocumentation.tsx Outdated Show resolved Hide resolved
packages/website/turbo.json Show resolved Hide resolved
packages/squiggle-lang/src/fr/list.ts Outdated Show resolved Hide resolved
@@ -16,6 +16,7 @@ export type CodeEditorProps = {
lineWrapping?: boolean;
errors?: SqError[];
sourceId?: string;
fontSize?: number;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think size?: "normal" | "small", like we use in other components, would be better (editor size is not just about its font size, and I'm not even sure that modifying font size on top level makes sense), but nbd for now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is getting too complicated for me to review properly, and I trust that you checked it manually for corner cases.

One comment, though: ideally, height passed from the outside should be the height of the main frame, right?

But it can be a bit hard to do because useCanvas needs fixed height to initialize context, and drawAxes can increase the suggested padding (I don't think that happens often with the vertital padding, though).

So one idea for future improvements is to precalculate the height, based on inner height + necessary vertical padding for samples+title+axes in advance, maybe with the invisible canvas if we need to measure text size, and then use that in useCanvas call.

const showAxisTitles = height > 30;
const shownXAxisTitle = showAxisTitles && !!plot.xScale.title;
const showXAxis = height > 15;
const nonTitleHeight = Math.max(height - (showXAxis ? 20 : 0), 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This line looks sketchy to me, not sure where 20 is coming from, probably the dependency on the internals of InnerDistributionsChart?

@OAGr OAGr merged commit aa0eb4a into main Jan 7, 2024
6 of 7 checks passed
@OAGr OAGr deleted the more-docs-automation branch January 7, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants