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

=doc #1290 Remove custom anchors at the start of the page #1308

Merged
merged 2 commits into from
Jul 26, 2017

Conversation

jonas
Copy link
Member

@jonas jonas commented Jul 26, 2017

Paradox does not verify them which makes them hard to maintain and removing them will make it easier to merge the Java and Scala documentation by avoiding to need to fix a lot of additional anchors.

Refs: #1290

Paradox does not verify them which makes them hard to maintain and
removing them will make it easier to merge the Java and Scala
documentation by avoiding to need to fix a lot of additional anchors.

Generated with:

    anchors=$(find docs/src/main/paradox/ -name "*.md" | xargs -n 1 head -1 | sed -n 's#<a id="\(.*\)"></a>#\1#p')
    files=$(find docs/src/main/paradox/ -name "*.md")
    # Remove fragments from links
    for id in $anchors; do sed -i "s/#$id[)]/)/" $files; done
    # Remove top-level page anchors
    for id in $anchors; do sed -i "/^<a.id=.$id.><.a>$/d" $files; done
@akka-ci akka-ci added validating PR that is currently being validated by Jenkins tested PR that was successfully built and tested by Jenkins and removed validating PR that is currently being validated by Jenkins labels Jul 26, 2017
@akka-ci
Copy link

akka-ci commented Jul 26, 2017

Test PASSed.

Copy link
Member

@jrudolph jrudolph left a comment

Choose a reason for hiding this comment

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

Were those anchors ever useful at all? Good to see those gone.

LGTM

Copy link
Member

@jlprat jlprat left a comment

Choose a reason for hiding this comment

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

LGTM, only 3 files with trailing whitespaces!

Good job! I hope you did it with some regex expressions!

|Directive | Description |
|---------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|@ref[authenticateBasic](security-directives/authenticateBasic.md) | Wraps the inner route with Http Basic authentication support using a given `Authenticator<T>` |
|@ref[authenticateBasicAsync](security-directives/authenticateBasicAsync.md) | Wraps the inner route with Http Basic authentication support using a given `AsyncAuthenticator<T>` |
Copy link
Member

Choose a reason for hiding this comment

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

Remove trailing spaces

Copy link
Member Author

Choose a reason for hiding this comment

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

I was not able to find any trailing spaces here nor for the two other cases you pointed out. How can I reveal them? git show doesn't display a red box at the end of the line as it normally does for trailing spaces.

|directive | behavior |
Copy link
Member

Choose a reason for hiding this comment

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

Remove trailing space

|directive | behavior |
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 there is a trailing space here

@raboof
Copy link
Member

raboof commented Jul 26, 2017

Cool! I see you also removed them from the @refs, did you make sure not to remove references to headings in the middle of the target page?

@jonas
Copy link
Member Author

jonas commented Jul 26, 2017

@raboof I used this script to do most of the work. It only considers anchors present at the start of any page.

anchors=$(find docs/src/main/paradox/ -name "*.md" | xargs -n 1 head -1 | sed -n 's#<a id="\(.*\)"></a>#\1#p')
files=$(find docs/src/main/paradox/ -name "*.md")
# Remove fragments from links
for id in $anchors; do sed -i "s/#$id[)]/)/" $files; done
# Remove top-level page anchors
for id in $anchors; do sed -i "/^<a.id=.$id.><.a>$/d" $files; done

Copy link
Member

@raboof raboof left a comment

Choose a reason for hiding this comment

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

Jup that looks good, nice!

@jlprat
Copy link
Member

jlprat commented Jul 26, 2017

Regarding my trailing spaces comments, I think it was just github diff UI that fooled me.

@raboof raboof merged commit ab77447 into akka:master Jul 26, 2017
@raboof
Copy link
Member

raboof commented Jul 26, 2017

@jonas ah didn't notice it was in the commit message, too - neat!

@jonas jonas deleted the remove-anchors branch July 26, 2017 13:46
@jonas
Copy link
Member Author

jonas commented Jul 26, 2017

@jlprat 👍 . There are tons of trailing spaces in the documentation though and it might be good to remove them at some point.

@jonas
Copy link
Member Author

jonas commented Jul 26, 2017

@jrudolph The page-level anchors were never useful, but there because we had to convert all RST references and anchors for correct cross-referencing. I was considering adding some checks to paradox but that never happened.

@raboof
Copy link
Member

raboof commented Jul 26, 2017

Checking references (lightbend/paradox#120) and removing trailing whitespace scalariform-style (lightbend/paradox#103) would indeed be nice!

@jrudolph
Copy link
Member

@jonas cool, thanks for the clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tested PR that was successfully built and tested by Jenkins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants