Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mkindex.pl improvements #383

Merged
merged 2 commits into from
Dec 28, 2023
Merged

Conversation

sluicing
Copy link
Contributor

Improve index generation

  • Update Makefile to regenerate 'uni.md' if the 'bookindex.md' file has changed. ( If there's a reason the Makefile is this way, let me know and I can undo this)

  • Improve 'mkindex.pl' to tTrack whether a code block with ``` has been seen, to avoid treating '# foo' comments within code blocks as sections to link to in indexes. This fixes such bad index links as
    "clone: Install GCC for x86_64,"

  • Improve 'mkindex.pl' to strip more characters that aren't legal in CSS Ids: those IDs should begin with a letter or an underscore, and should contain only letters, numbers, underscore or dash after the first char. This fixes a few IDs that contains '?', '', '!'

  • Improve 'mkindex.pl' support for header sections with explicit section IDs:

    • If a header section includes an explicit section ID, link to that instead of generating one from the header text
    • Include an explicit section id, '{#everything-curl-index}', at the top of the bookindex.md file
  • Update 'bookindex.md' with regenerated index from above improvements to 'mkindex.pl'

Notes:

@bagder
Copy link
Member

bagder commented Dec 28, 2023

Can you please rebase and force-push this? I'm afraid it has a merge conflict now.

- Update Makefile to regenerate 'uni.md' if the 'bookindex.md' file has changed
- Improve 'mkindex.pl' to:
   - Add an explicit section id, '{#everything-curl-index}', to the top of the bookindex.md file
   - Track whether a code block with ``` has been seen, to avoid treating '# foo' comments within code blocks as sections to link to in indexes.  This fixes such bad index links as
     "clone: [Install GCC for x86_64](get/win-msys2.md#install-gcc-for-x86_64),"
   - Strip more characters that aren't legal in CSS Ids: those IDs should begin with a letter or an underscore, and should contain only letters, numbers, underscore or dash after the first char.  (See https://stackoverflow.com/questions/448981/which-characters-are-valid-in-css-class-names-selectors )  This fixes a few IDs that contains '?', '\', '!'
   - Sorting seems to have been corrected for items that reference "All options", but I didn't dig into how/why too much since the result is an improvement.
- Update 'bookindex.md' with regenerated index from above improvements to 'mkindex.pl'
@sluicing
Copy link
Contributor Author

Can you please rebase and force-push this? I'm afraid it has a merge conflict now.

Fixed; let me know if you'd like other small tweaks to the PR

@bagder bagder merged commit 8eb1bf3 into curl:master Dec 28, 2023
7 checks passed
@bagder
Copy link
Member

bagder commented Dec 28, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants