Skip to content

Enable -D rustdoc::broken-intra-doc-links#507

Merged
apoelstra merged 3 commits intorust-bitcoin:masterfrom
tcharding:12-21-docs
Dec 23, 2022
Merged

Enable -D rustdoc::broken-intra-doc-links#507
apoelstra merged 3 commits intorust-bitcoin:masterfrom
tcharding:12-21-docs

Conversation

@tcharding
Copy link
Copy Markdown
Member

@tcharding tcharding commented Dec 21, 2022

Make an effort to do some docs improvements without touching the whole codebase.

  • Patch 1: Trivial, because I can't help myself.
  • Patch 2: Clean up docs on a private method in preparation for duplicating in public docs
  • Patch 3: Fix broken links and enable -D rustdoc::broken-intra-doc-links in CI

I'm in no way across this codebase, there may be other problems with docs that show up in this PR but the PR is an attempt at improving the docs without going too wild - both for my sanity and that of reviewers.

@tcharding tcharding changed the title Do some docs improvements (incl. enabling -D rustdoc::broken-intra-doc-links) Enabling -D rustdoc::broken-intra-doc-links Dec 21, 2022
@tcharding tcharding changed the title Enabling -D rustdoc::broken-intra-doc-links Enable -D rustdoc::broken-intra-doc-links Dec 21, 2022
/// Descriptor context for [`Policy`] compilation into a [`crate::Descriptor`].
pub enum DescriptorCtx<Pk> {
/// [Bare][`Descriptor::Bare`]
/// See docs for [`crate::Descriptor::Bare`].
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not super happy with all the crate::s here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Does anyone remember how to import a type just for the docs build, we do it someplace else but I can't find it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Its

#[cfg(doc)]
use Foo;

@apoelstra
Copy link
Copy Markdown
Member

Needs rebase.

- Improve rendered headers by removing the empty `# Introduction`
  section
- Add full stops
The docs for `enumerate_policy_tree` are referenced by other functions
but because `enumerate_policy_tree` is private we cannot link to the
docs of this method.

In preparation for duplicating the docs in multiple places; improve the
docs on `enumerate_policy_tree` by doing:

- Separate brief and long sections
- Fix links
@tcharding
Copy link
Copy Markdown
Member Author

I rebased but I'd prefer to import Descriptor instead of using crate::Descriptor everywhere.

Currently we have a bunch of broken links in our docs. Fix all the
broken links an add `-D rustdoc::broken-intra-doc-links` to the docs
build in CI.

There are a few other improvements scattered through this PR, I tried to
find a balance between scope creep and obvious errors in the diff.
@tcharding
Copy link
Copy Markdown
Member Author

Used #[cfg(doc] imports to improve the docs (remove crate:: prefix).

Copy link
Copy Markdown
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK ebaa31b

@apoelstra apoelstra merged commit 6ed008f into rust-bitcoin:master Dec 23, 2022
@tcharding
Copy link
Copy Markdown
Member Author

oh, how did that merge? Did you fix the formatting issue?

@apoelstra
Copy link
Copy Markdown
Member

What formatting issue?

@apoelstra
Copy link
Copy Markdown
Member

Oh, I see, cirrus is gated on rustfmt, and I didn't bother checking it locally. I'll fix it.

apoelstra added a commit to apoelstra/rust-miniscript that referenced this pull request Dec 23, 2022
sanket1729 added a commit that referenced this pull request Dec 29, 2022
f0f7fd6 fix formatting after #507 (Andrew Poelstra)

Pull request description:

  I merged #507 without checking CI, and it turns out there was a rustfmt issue. FIx that.

ACKs for top commit:
  tcharding:
    ACK f0f7fd6
  sanket1729:
    ACK f0f7fd6

Tree-SHA512: 909d0a118c0e36f40b7aa6f0d6c7718b1b77b00acbb07ae0183a26e107a24f477debebc701545a8295a31dc589b9f40174a44a0c6e935ecab445c447078c3784
heap-coder added a commit to heap-coder/rust-miniscript that referenced this pull request Sep 27, 2025
…tra-doc-links`

ebaa31bca7e80f02751e3435907b3aad99d74168 Enable usage of -D rustdoc::broken-intra-doc-links (Tobin C. Harding)
16b6c7629b3b8d6ca9c0fe016795d9ccb485ac96 Improve docs on enumerate_policy_tree (Tobin C. Harding)
90dc76664282e7632f02ab42e87a9cd7294e8398 Do trivial cleanup to main lib docs (Tobin C. Harding)

Pull request description:

  Make an effort to do some docs improvements without touching the whole codebase.

  - Patch 1: Trivial, because I can't help myself.
  - Patch 2: Clean up docs on a private method in preparation for duplicating in public docs
  - Patch 3: Fix broken links and enable `-D rustdoc::broken-intra-doc-links` in CI

  I'm in no way across this codebase, there may be other problems with docs that show up in this PR but the PR is an attempt at improving the docs without going too wild - both for my sanity and that of reviewers.

ACKs for top commit:
  apoelstra:
    ACK ebaa31bca7e80f02751e3435907b3aad99d74168

Tree-SHA512: 6982f615fe6565f0defca30a4d4f4e077f9bcf446c1ed5f86cb15986c6b1d6f95a34cbd0d9b9c6096ccb932767aa71f99011931f612cc33c69709c79857679a0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants