Support custom GitHub url
g12i opened this issue · comments
Subject of the feature
Hello! It would be nice to add a support for an Enterprise GitHub, by providing custom base URL.
If not provided, it could be read from package.json and default to https://github.com
The logic would be
- if provided in
options.baseUrl
explicitly, use it - if provided full URL in
options.repository
, extract and use it - if provided full URL in
package.json
, extract and use it - if not provided default to https://github.com
Expected behaviour
var vfile = require('to-vfile')
var remark = require('remark')
var github = require('remark-github')
remark()
.use(github, { baseUrl: 'https://whatever-entreprise-github.company' } )
.process(vfile.readSync('example.md'), function(err, file) {
if (err) throw err
console.log(String(file))
})
Alternatives
I see none.
I'm happy to create a PR, if that is something you find useful. I'd need an information, what's the minimum Node.js version we target, to see if I can use some built-in helpers.
I’m up for that!
I don’t have access to GHE, so I can’t be of much help here. However, remark-validate-links also supports GH, GHE, Gitlab, Bitbucket, and such, so that may be of help.
For what we support: the code is written in basically ES3. I’d say make sure to follow the style of existing code, I can help with that by reviewing the PR!
Hi! This was closed. Team: If this was fixed, please add phase/solved
. Otherwise, please add one of the no/*
labels.