documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Add a linter that Tutorials index page includes all tutorials

Open Eric-Arellano opened this issue 9 months ago • 6 comments

~~The Tutorials index page is going to list all tutorials twice: ~~

  1. ~~By task~~
  2. ~~By tool~~

~~We need to ensure that every file in tutorials/ shows up exactly once in both sections in tutorials/index.mdx.~~

~~This check will be similar to checkPatternsIndex.ts, but I think their implementation diverges enough that it's going to be clearer to create a dedicated check.~~

~~At a minimum, verify the URL is identical. If it isn't too hard, also verify the title is the same (relates to https://github.com/Qiskit/documentation/issues/2489).~~

Ensure this check is added to CI and the ./check script.


EDIT (by @frankharkins): This issue has changed since Eric's original comment, the main difference being that those sections will no longer exist, and we no longer need to list each tutorial exactly twice.

Eric-Arellano avatar Mar 20 '25 20:03 Eric-Arellano

Hi @Eric-Arellano, I’d like to take this on! I’ll work on adding a linter to ensure all tutorials in tutorials/ appear in both sections of index.mdx, with URL matching and possibly title checks.

Gyan-max avatar Apr 04 '25 13:04 Gyan-max

Hey Gyan, thanks! We still need to add a little more information to this for how exactly it will work. I'll coordinate with Frank if we think this would be a good issue to work on, along with adding more instructions.

Eric-Arellano avatar Apr 04 '25 13:04 Eric-Arellano

Sure, thankyou for the clarification.

Gyan-max avatar Apr 04 '25 14:04 Gyan-max

Hi @Gyan-max, I've added a script to check the links in https://github.com/Qiskit/documentation/pull/2978, however, it doesn't check titles. Once #2978 is merged, it would be great if you could adapt the script to also check titles. I recommend you:

  1. Add a new capturing group to the regex
  2. Use Python's json module to get the title from each notebook
  3. Add an extra check that the capture group matches the title from the notebook

frankharkins avatar Apr 11 '25 11:04 frankharkins

Hi @Gyan-max, I've added a script to check the links in #2978, however, it doesn't check titles. Once #2978 is merged, it would be great if you could adapt the script to also check titles. I recommend you:

  1. Add a new capturing group to the regex
  2. Use Python's json module to get the title from each notebook
  3. Add an extra check that the capture group matches the title from the notebook

Sure,

let #2978 be merged, then i'll adapt the script and modify it to check for title

Gyan-max avatar Apr 11 '25 13:04 Gyan-max

Hi @Gyan-max, the requirements of this issue have changed a bit since we created it. I've added a script in #3140 that will close this issue completely. Sorry for the confusion. Maybe you could take another look at #2764?

frankharkins avatar May 19 '25 13:05 frankharkins