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

Link to more precise "What is Git" page in section 3.1 ("Branches in a Nutshell") #1506

Merged
merged 2 commits into from
Aug 28, 2020

Conversation

tfiers
Copy link
Contributor

@tfiers tfiers commented Aug 28, 2020

Section 3.1, "Branches in a Nutshell" talks about snapshots and hashes, and refers to this page for more info on them. These topics don't appear on that page however. The author is probably referring to section 1.3, "What is Git". This page is from the same chapter as is currently linked, but I think a more precise link would help the casual reader more.

This PR changes the link to point to section 1.3, "What is Git", instead of to the entire chapter, which takes the reader to section 1.1, "About Version Control".

Changes

  • Add ID ([[_what_is_git]]) to section 1.3
  • Link to this ID in section 3.1

@tfiers
Copy link
Contributor Author

tfiers commented Aug 28, 2020

(Install step in CI fails, seems unrelated to this PR)

@HonkingGoose
Copy link
Contributor

(Install step in CI fails, seems unrelated to this PR)

That's right, you're not breaking something here! 👍

In a nutshell: The Travis CI is broken because the kindlegen dependency cannot be installed anymore. See #1496 and #1497 for more info.

@ben ben merged commit 9ece3ec into progit:master Aug 28, 2020
@tfiers tfiers deleted the patch-1 branch August 28, 2020 18:29
@tfiers
Copy link
Contributor Author

tfiers commented Aug 28, 2020

Huh, these internal links seem broken in the .html and .pdf of the release of this PR:


Not sure why, as I've used the same syntax as here and here, eg.

@ben @HonkingGoose any idea why this seems to not work?

@tfiers tfiers restored the patch-1 branch August 28, 2020 18:43
@tfiers
Copy link
Contributor Author

tfiers commented Aug 28, 2020

OK, found the likely problem: asciidoctor/asciidoctor-epub3#139

Still strange why it works on the other pages anyway

@HonkingGoose
Copy link
Contributor

I've tried comparing what you did with other known working examples by doing a plain-text comparison and trying to think of issues. But cannot actually figure it out, because I cannot get a proper build tool-chain working on my end... 😞

I don't know what causes this issue. So you'll have to wait until @ben or @jnavila can chime in on why this happens.

@tfiers
Copy link
Contributor Author

tfiers commented Aug 28, 2020

Yeah, can't get build toolchain to work locally either (on Windows). Might continue trying on Windows Subsystem for Linux.

One difference with my patch versus the other pages is that, coincidentally, in my two edited paragraphs there are in both cases _ marks for emphasis in the text after the links. This is not the case after the #_getting_git_on_a_server link here eg.

Relevant line from Travis build btw:

asciidoctor: WARNING: progit.asc: invalid reference to unknown anchor: <em>what_is_git

@HonkingGoose
Copy link
Contributor

That does seem to be a new error that was not there before though.
And if other sections are also broken I would expect more errors like that showing up.

@tfiers
Copy link
Contributor Author

tfiers commented Aug 28, 2020

At a first look there do not seem to be any other paragraphs in the book where a _ emphasis mark follows an internal link, within the same paragraph. So seems like we discovered a rare bug here.

@jnavila
Copy link
Member

jnavila commented Aug 28, 2020

You shouldn't use anchor names starting with "_", because these are reserved for automatically generated links. The automatically generated links are made from the text of the title in lower case with spaces converted to underscores, prefixed with an underscore, which happens to be exactly the chosen anchor name. So, I guess, there's a clash in anchor definitions, which leads to no anchor created. Change the anchor name for ch_what_is_git, and it will work.

@HonkingGoose
Copy link
Contributor

Thanks for chiming in @jnavila! And I learned something new today! 😄

@tfiers
Copy link
Contributor Author

tfiers commented Aug 28, 2020

For future reference: after testing, it seems like it doesn't matter what the anchor is called (whether it matches the auto ID or not): as long as it starts with an underscore and there's some _emphasis_ in the same paragraph following a reference to that anchor, we'll get the error.

@HonkingGoose
Copy link
Contributor

What a weird error. 😕

Let's hope we can get rid of this after bumping us to Asciidoctor 2. And that our improved build system that I'm working on can help catch such error before deploying them to master. But that's for the future, so I'm making no claims of success on neither of those. 😄

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.

4 participants