feat(xlsx): link table names in the index sheet to their sheets - #857
Open
ChrisJr404 wants to merge 1 commit into
Open
feat(xlsx): link table names in the index sheet to their sheets#857ChrisJr404 wants to merge 1 commit into
ChrisJr404 wants to merge 1 commit into
Conversation
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
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? Feel free to answer only as much as you're comfortable with 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
tableSheetNamehelper 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.