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

Stop using deprecated update-munge-docs.sh for TOC generation. #247

Merged
merged 1 commit into from
Jan 25, 2017

Conversation

david-mcmahon
Copy link
Contributor

@david-mcmahon david-mcmahon commented Jan 12, 2017

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 12, 2017
@david-mcmahon david-mcmahon changed the title WIP: Stop using deprecated update-munge-docs.sh for TOC generation. Stop using deprecated update-munge-docs.sh for TOC generation. Jan 12, 2017
@saad-ali
Copy link
Member

FWIW this worked flawlessly for me and @jessfraz for the 1.5.2 and 1.4.8 releases

LGTM

@david-mcmahon
Copy link
Contributor Author

@ixdy any comments here? I'd like to get this one in soon.

# Generate a (github) markdown TOC between BEGIN/END tags
# @param file The file to update in place
#
common::mdtoc () {
Copy link
Member

Choose a reason for hiding this comment

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

I'm a little sad that we've converted tested Go code to untested shell. :\

anchor=${anchor//[\.\?\*\,\/()]/}
# Keep track of dups and identify
((count[$anchor]++)) ||true
((${count[$anchor]}>1)) && anchor+="-${count[$anchor]}"
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PTAL.

# Keep track of dups and identify
if [[ -n ${count[$anchor]} ]]; then
((count[$anchor]++)) ||true
((${count[$anchor]}>0)) && anchor+="-${count[$anchor]}"
Copy link
Member

Choose a reason for hiding this comment

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

I think this conditional might not be necessary - $count[$anchor] should always be greater than zero, since it was incremented on the previous line, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, that was a vestige of the earlier logic. Thanks. Removed.

anchor=${anchor//[\.\?\*\,\/()]/}
# Keep track of dups and identify
if [[ -n ${count[$anchor]} ]]; then
((count[$anchor]++)) ||true
Copy link
Member

Choose a reason for hiding this comment

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

probably don't need the ||true, though it does no harm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Still needed. Thank you "set -e"!

Copy link
Member

@ixdy ixdy left a comment

Choose a reason for hiding this comment

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

I'm guessing someone should update the CHANGELOG with the fix, since the header links are incorrect right now.

@david-mcmahon
Copy link
Contributor Author

@ixdy if the links are functional and it's just a matter of labeling, we can leave this until the next release which will update the TOC.

@david-mcmahon david-mcmahon merged commit 4b8d193 into kubernetes:master Jan 25, 2017
@ixdy
Copy link
Member

ixdy commented Jan 25, 2017

@david-mcmahon the links are wrong - they take you to the wrong section.

@ixdy
Copy link
Member

ixdy commented Jan 25, 2017

well, some are.

e.g. on https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG.md, if you click "Client Binaries" for 1.4.8, you instead end up under 1.5.1.

k8s-github-robot pushed a commit to kubernetes/kubernetes that referenced this pull request Jan 30, 2017
Automatic merge from submit-queue (batch tested with PRs 39832, 40660)

Complete *-munge-docs.sh deprecation.

**What this PR does / why we need it**:\
Complete *-munge-docs.sh deprecation.
TOC generation now handled by kubernetes/release#247

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
ref #38309

**Special notes for your reviewer**:

cc @bgrant0607 @thockin
marpaia pushed a commit to marpaia/release that referenced this pull request Feb 21, 2019
…raft

Add latest release notes to draft document
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants