Skip to content

Not all headers are automatically linked #367

Closed

Description

@LPGhatguy

I have an API reference site for a project that's hosted on ReadTheDocs using mkdocs as the documentation engine. Headers that contain things like <code> blocks aren't linked, while all others seem to be.

I can reproduce this locally with a plain mkdocs install using the RTD theme.

Here's an example:
http://carbon.lpghatguy.com/en/latest/Classes/Collections.Tuple/

All three of the methods in that page should be automatically linked in the sidebar navigation, but only the one without any fancy decoration is. All of them have been given valid HTML ids, so they're possible to link, they just aren't.

The markdown for that page, which works around a couple RTD bugs and doesn't look that great, is here:
https://raw.githubusercontent.com/lua-carbon/carbon/master/docs/Classes/Collections.Tuple.md

Activity

  1. d0ugal commented on Mar 17, 2015

    @d0ugal
    Contributor

    I think I've seen this before and I think it happens when a page doesn't contain a top level # title as yours doesn't - you add it with HTML directly.

    I can't explain why it chooses the titles it does, that is strange.

  2. d0ugal commented on Apr 2, 2015

    @d0ugal
    Contributor

    Just having a look at this - I think you managed to work around the problem? The current link looks great.

    If this still needs looking into, can you comment with a link to a problem area or provide some markdown with the issue. Thanks.

  3. LPGhatguy commented on Apr 3, 2015

    @LPGhatguy
    Author

    I ended up just redoing the entire website using HTML links instead; this way, nothing gets linked at all, but I needed it for other requirements.

    However, it's still possible to reproduce:

    # Hello World (linked)
    # Hello <code>World</code> (unlinked)
  4. d0ugal commented on Apr 3, 2015

    @d0ugal
    Contributor

    Thanks - I've got a failing test case. The problem is using regular expressions to parse HTML which is never a good idea. Working on a fix.

  5. added this to the 0.12.0 milestone on Apr 3, 2015
  6. added a commit that references this issue on Apr 3, 2015
    b8dc35f
  7. d0ugal commented on Apr 3, 2015

    @d0ugal
    Contributor

    That was a pretty easy fix in the end :) Just waiting for CI to verify. Leaving this closed in favour of the PR, so check out #402 - it would be good if you could give it a test.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions