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

Implement codegen of doclinks #6850

Merged
merged 25 commits into from
Jul 11, 2024
Merged

Implement codegen of doclinks #6850

merged 25 commits into from
Jul 11, 2024

Conversation

emilk
Copy link
Member

@emilk emilk commented Jul 10, 2024

What

You can now write doclinks in the docstrings of our .fbs files. Example:

/// See also [archetypes.Image].
table Tensor { … }

The links will be transformed to the appropriate form for the codegen target (Rust doclinks are different from those of Python, C++/doxygen, and website/markdown).

Only links to types are currently supported.

Link checking is not done by the codegen, but the output is checked implicityly by cargo doc, lychee etc.

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

@emilk emilk added 📖 documentation Improvements or additions to documentation 🧑‍💻 dev experience developer experience (excluding CI) codegen/idl include in changelog labels Jul 10, 2024
Copy link

github-actions bot commented Jul 10, 2024

Deployed docs

Commit Link
4277cb2 https://landing-6z6w63u2x-rerun.vercel.app/docs

@emilk emilk marked this pull request as draft July 10, 2024 19:10
@emilk emilk marked this pull request as ready for review July 10, 2024 19:26
@jprochazk
Copy link
Member

Does this add speculative-link markers on doclinks for unreleased types?

@emilk
Copy link
Member Author

emilk commented Jul 11, 2024

Does this add speculative-link markers on doclinks for unreleased types?

If the links are relative, maybe I don't have to 😬

@emilk emilk marked this pull request as draft July 11, 2024 13:20
@emilk
Copy link
Member Author

emilk commented Jul 11, 2024

To get ?speculative-link to work I need to do some major pluimbing

@emilk emilk marked this pull request as ready for review July 11, 2024 13:49
@emilk
Copy link
Member Author

emilk commented Jul 11, 2024

Ok, ?speculative-links is properly handled now. It required a lot of plumbing.

Probably best to review all this commit-by commit

@jprochazk jprochazk self-requested a review July 11, 2024 13:51
Comment on lines +159 to +163
all_objects: &Objects,
kind: ObjectKind,
order: u64,
prelude: &str,
objects: &[&Object],
Copy link
Member

@jprochazk jprochazk Jul 11, 2024

Choose a reason for hiding this comment

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

nit: some unfortunate naming: all_objects and objects

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, I gave up here

@emilk emilk merged commit 636ec50 into main Jul 11, 2024
39 of 40 checks passed
@emilk emilk deleted the emilk/codegen-doclinks branch July 11, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen/idl 🧑‍💻 dev experience developer experience (excluding CI) 📖 documentation Improvements or additions to documentation include in changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doclinks in docstrings in generated code
2 participants