Skip to content

Conversation

@bnbarham
Copy link
Contributor

@bnbarham bnbarham commented Jul 1, 2025

Add a tool for automatically generating the doc indices for notes,
groups, and features.

@bnbarham
Copy link
Contributor Author

bnbarham commented Jul 1, 2025

So I promised I would add verification for this, but after doing that I realized it was only a few lines off of just generating the files instead and thus... here we are 😅

Interested in opinions here as to if:

  1. We should add a test case for checking the diff matches after running generate-doc-index.swift
  2. This should stay as a script or move into a package
  3. If the headers should be pulled from the files themselves (ie. take up to ## Topics) rather than inline in the tool

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

This is very nice, thank you!

@DougGregor
Copy link
Member

My thoughts on your questions.

  1. I like the idea of adding a test case that checks the diff so we don't forget to update it.
  2. Script is fine, no need to introduce a package
  3. The headers shouldn't change that often, so I think it's best to leave them in the tool as-is.

Copy link
Contributor

@artemcm artemcm left a comment

Choose a reason for hiding this comment

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

Nice

@DougGregor
Copy link
Member

I don't consider the implementation of (1) to be blocking committing this. It's a great step forward, thank you!

Copy link
Contributor

@cachemeifyoucan cachemeifyoucan left a comment

Choose a reason for hiding this comment

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

LGTM.

I don't know how the swift doc webpage is generated. The alternative to add a test is to make the index generation part of the build steps for the docs.swift.org, but I agree this is not a blocking change.

@bnbarham bnbarham force-pushed the generate-doc-index branch from 1815bb0 to 6a9bc52 Compare July 1, 2025 22:19
@bnbarham
Copy link
Contributor Author

bnbarham commented Jul 1, 2025

@swift-ci please test

@bnbarham
Copy link
Contributor Author

bnbarham commented Jul 1, 2025

Thanks for the input everyone!

I don't consider the implementation of (1) to be blocking committing this. It's a great step forward, thank you!

Easy to add, done.

Script is fine, no need to introduce a package
The headers shouldn't change that often, so I think it's best to leave them in the tool as-is.

Sounds fair to me, thanks 🙇‍♂️

The alternative to add a test is to make the index generation part of the build steps for the docs.swift.org

I did consider that, but it's nice to be able to generate the docs locally when writing them. We could have a docs preview script that generates + starts the docc server though 🤔. For now I've just added the validation in. If it gets too annoying, happy to change.

@bnbarham
Copy link
Contributor Author

bnbarham commented Jul 1, 2025

@swift-ci please test macOS platform

@bnbarham bnbarham force-pushed the generate-doc-index branch from 6a9bc52 to 59094e9 Compare July 3, 2025 05:45
@bnbarham
Copy link
Contributor Author

bnbarham commented Jul 3, 2025

@swift-ci please test

1 similar comment
@bnbarham
Copy link
Contributor Author

bnbarham commented Jul 3, 2025

@swift-ci please test

@bnbarham bnbarham force-pushed the generate-doc-index branch from 59094e9 to e70c8d3 Compare July 7, 2025 20:57
Add a tool for automatically generating the doc indices for notes,
groups, and features.
@bnbarham bnbarham force-pushed the generate-doc-index branch from e70c8d3 to 5ee9133 Compare July 7, 2025 20:59
@bnbarham
Copy link
Contributor Author

bnbarham commented Jul 7, 2025

@swift-ci please test

@bnbarham bnbarham merged commit 044e97b into swiftlang:main Jul 8, 2025
5 checks passed
@bnbarham bnbarham deleted the generate-doc-index branch July 8, 2025 20:43
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.

4 participants