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

Not generating anchors for Bitbucket #74

Closed
ncipollina opened this issue Jul 25, 2019 · 4 comments
Closed

Not generating anchors for Bitbucket #74

ncipollina opened this issue Jul 25, 2019 · 4 comments

Comments

@ncipollina
Copy link

When using this documentation generator for Bitbucket, it is generating the links, but not the anchor tags for an item that it links to. For example in one of my classes, it's generating the following for the constructor at the top of the file:

* [constructor](handler.md#markdown-header-constructor)

But there is no anchor tag on the actual constructor. The constructor documentation looks like this:

###  constructor

\+ **new Handler**(`controller`: `TController`, `event`: `APIGatewayEvent`): *[Handler](handler.md)*

Defined in handlers/base.handler.ts:14

**Parameters:**

Name | Type |
------ | ------ |
`controller` | `TController` |
`event` | `APIGatewayEvent` |

**Returns:** *[Handler](handler.md)*

In order for the link to work in bitbucket, it should look like this:

### <a name="markdown-header-constructor"></a> constructor
@tgreyuk
Copy link
Member

tgreyuk commented Jul 25, 2019

Interesting the example looks ok to me and this is an accepted implementation as per https://community.atlassian.com/t5/Bitbucket-questions/Markdown-internal-links-support-in-Bitbucket-Server/qaq-p/595033 .

Also the anchor tags are escaped on bitbucket cloud:
image

Are you running on Bitbucket server or cloud?

@ncipollina
Copy link
Author

In our instance, it's Bitbucket server.

@tgreyuk
Copy link
Member

tgreyuk commented Jul 26, 2019

@nilennoct ok thanks. After looking into this it appears that Bitbucket server does not auto assign ids to headers.

What I have done is introduce a new argument in 2.1.0 namedAnchors that should solve your use case?

--namedAnchors
Use HTML named anchors as fragment identifiers for engines that do not automatically assign header ids.

I hope this solves your problem.

Thanks...

@ncipollina
Copy link
Author

@tgreyuk, this did the trick! Thanks for the quick response!

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

No branches or pull requests

2 participants