elidoran / cosmos-browserify

Browserify npm modules for client side in Meteor packages
MIT License
78 stars 12 forks source link

Documentation links from atmosphere are broken #39

Closed reduxdj closed 8 years ago

reduxdj commented 8 years ago

example: https://github.com/elidoran/cosmos-browserify/blob/master/#1-create-and-add-your-package

elidoran commented 8 years ago

Short Version:

Atmosphere builds the link wrong. the '/blob/master' shouldn't be there. or, when it is there, the name of the referenced file should be included like '/blob/master/README.md'

Add 'README.md' to the link you referenced and it works. Remove '/blob/master' from the link and it works.

Long Version:

On Github Markdown headers become named anchors. So, #Examples becomes:

<a id="user-content-examples" class="anchor" href="#examples" aria-hidden="true">
  <span class="octicon octicon-link"></span>
</a>

Then, in my table of contents I reference it with a relative path because they're in the same document. So, [Examples](#examples) becomes:

<a href="#examples">Examples</a>

This works great on Github.

However, Meteor/Atmosphere does the markdown processing differently and does not produce named anchors for each header. Instead, it makes the relative link I made point at the Github project. They don't point at the root of the project with the anchor name, which would work, and they don't include the name of the readme file after 'blob/master', which would work. For some reason, they put 'blob/master' without the file name and then the anchor ref, which doesn't work.

<a href="https://github.com/elidoran/cosmos-browserify/blob/master/#examples">
  Examples
</a>

They need to either remove the 'blob/master' so the path is:

<a href="https://github.com/elidoran/cosmos-browserify#examples">
  Examples
</a>

Or, if they want to point to the readme file directly, then it should be this:

<a href="https://github.com/elidoran/cosmos-browserify/blob/master/README.md#examples">
  Examples
</a>

Either way, it's been like that for as long as I can remember. I just click the package's github link and view all package readme's on Github.