facelessuser / MarkdownPreview

Markdown preview and build plugin for Sublime Text https://facelessuser.github.io/MarkdownPreview/
Other
405 stars 53 forks source link

Configurable GitHub/Lab host #44

Open kadrach opened 6 years ago

kadrach commented 6 years ago

It would be cool to have the GitHub/Lab host configurable, so I can use our enterprise installation of GitLab.

facelessuser commented 6 years ago

@kadrach, I'll need you to be specific, keeping in mind that I don't use the enterprise version of GitLab.

hadisfr commented 6 years ago

As I know there isn't any way to install GitHub in a separate personal host, while it's possible for GitLab (as they do in gnome).

@facelessuser Because currently we don't support project/context-specific features (#24), I think there will be no difference between result of GitLab.com API (it's a specific version of GitLab Enterprise Edition) and e.g. gitlab.gnome.com API, except privacy, while it may add some compatibility issues in the future to support multiple versions of GitLab. If we implement #24 It may be a good idea to implement this feature, too. By the way, I think it's all related to: https://github.com/facelessuser/MarkdownPreview/blob/dd608da7021043b1757d4afe4cf693d2b5f0dc0f/markdown_preview.py#L796

facelessuser commented 6 years ago

If the URL for the API is the only thing that needs to change, then I don't mind allowing that to be configured. And it may even make since to make that per project (or per some kind of dot file .markdownpreview or something. Anyways, I have no real way to test this, so if someone can verify that is all that needs to be changed, we can look into exposing that in the future.

In general, supporting the public API is my main goal. If the cost isn't too high, I don't mind supporting custom setups, but if the cost gets too high, I may decline.

Supporting multiple versions of APIs may be out of the question.

hadisfr commented 6 years ago

I got the same result by changing https://github.com/facelessuser/MarkdownPreview/blob/dd608da7021043b1757d4afe4cf693d2b5f0dc0f/markdown_preview.py#L796 to

url = "https://gitlab.gnome.org/api/v4/markdown"

It's appealing for me to read a setting file, create new instances of e.g. GitlabCompiler with new compiler_name and url and add them to parsers menu, instead of replacing the current GitLab option. But I'm not sure if it's a good idea.

kadrach commented 6 years ago

@facelessuser @hadisfr Yes this is what I was referring to. Both Gitlab Enterprise Edition and Github Enterprise can be hosted on premises (or in isolated networks). The enterprise deployments are pretty much identical to the "open world" versions, and differ only in DNS name.

facelessuser commented 6 years ago

I can see the appeal of having a way to add a custom github or gitlab to the list, let me think about an approach.

BalzGuenat commented 5 years ago

For me, it is only about not transmitting my file to a party outside the company. I would be more than content with just being able to use a different URL or host, e.g. gitlab.mycompany.com in place of gitlab.com.

facelessuser commented 5 years ago

@BalzGuenat sure, makes sense. Until this feature is developed, using the markdown (Python Markdown) is probably your best bet. You can also (if I recall) use a custom call to external, local tools such as Multi-Markdown. But yeah, whenever I squirrel away some time to get to this I will.