I've created an npm module which is hosted on npmjs.com.
Due to the structure of the module, I've split the documentation into a general readme.md
and then more specific files which are linked to from the main readme.md
:
.
├──documentation
│ ├── doc1.md
│ └── doc2.md
└── readme.md
The links in readme.md
look like this: [some text](documentation/doc1.md)
. They work perfectly fine locally and in their CodeCommit repo (and I suspect it would be fine in github as well).
However after publishing it to npm, the links become https://www.npmjs.com/package/documentation/doc1.md
, which of course is an invalid URL and leads to a 404 error.
I've tried to figure out how to get a valid url to the file in question so I can create links that lead to it, but I can't even find out how to get a direct link to the file in the package. It may also be worth noting that the package itself is a private organisation package, but I've tried the same thing on a test public package and had the same issue there, so I don't think it's relevant.
Does anyone know how to link from the root readme.md
file to another file in the same package, in a way that works in npmjs?
I've found the issue at npm community they say that it's solved, so I tried for my self to see what went wrong?
And they were right, I've missed some points so I'll write all the required steps:
Example:
{
...
"repository": {
"url": "https://github.com/lalosh/js-library-boilerplate",
"type": "git"
}
...
}
.md
suffix.Example:
We can [link](documentation/sub-doc.md) to an inner relative file