Skip to content

feat(xlsx): link table names in the index sheet to their sheets - #857

Open
ChrisJr404 wants to merge 1 commit into
k1LoW:mainfrom
ChrisJr404:xlsx-index-sheet-hyperlinks
Open

feat(xlsx): link table names in the index sheet to their sheets#857
ChrisJr404 wants to merge 1 commit into
k1LoW:mainfrom
ChrisJr404:xlsx-index-sheet-hyperlinks

Conversation

@ChrisJr404

Copy link
Copy Markdown

Closes #506.

The "Tables of" index sheet in the xlsx output lists every table name, but they were plain text. This turns each name into a HYPERLINK("#'<sheet>'!A1", "<name>") formula so you can click a table in the index and jump straight to its sheet. Handy once a schema has more than a handful of tables.

A couple of small things to keep the links valid:

The target sheet name is single quoted, so names with spaces still resolve, and I pulled the existing 31 character truncation out into a tableSheetName helper that both the index link and the table sheet use, so a long name links to the same sheet it actually creates. Any embedded quote gets doubled per Excel's rules.

I added a test that renders a schema (including a name with a space and one over 31 chars), unzips the result and checks the formulas land in the index sheet. There was no test file for this package before.

The "Tables of" sheet listed each table name as plain text. This sets a
HYPERLINK formula on the name instead so you can click through to that
table's own sheet, which makes navigating larger xlsx docs much easier.
Sheet names are single quoted and truncated to 31 characters the same way
the table sheets are named, so links keep working for names with spaces or
names longer than the Excel sheet-name limit.

Closes k1LoW#506
@k1LoW

k1LoW commented Sep 1, 2026

Copy link
Copy Markdown
Owner

@ChrisJr404 Thank you for the PR!

It was an issue that had been left untouched for three years, so this is a huge help. I appreciate that you even wrote tests for it.

I have just one question. When I looked at your account, I saw that you've submitted PRs to hundreds of repositories in just a few months, which seems beyond human capability (I'm guessing you might be using AI to help). I have no intention of blaming you at all. I'm just genuinely curious. Why, and through what mechanism, are you keeping this up?
I'd especially love to know the "why."

Feel free to answer only as much as you're comfortable with 👍

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.

Add Hyperlinks to "Tables of" Sheet for Sheets in Excel Output

2 participants