MarkdownPreview icon indicating copy to clipboard operation
MarkdownPreview copied to clipboard

Configurable GitHub/Lab host

Open kadrach opened this issue 6 years ago • 8 comments

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

kadrach avatar Aug 30 '18 00:08 kadrach

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

facelessuser avatar Aug 30 '18 01:08 facelessuser

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

hadisfr avatar Aug 30 '18 03:08 hadisfr

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.

facelessuser avatar Aug 30 '18 04:08 facelessuser

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.

hadisfr avatar Aug 30 '18 04:08 hadisfr

@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.

kadrach avatar Aug 30 '18 05:08 kadrach

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.

facelessuser avatar Aug 30 '18 05:08 facelessuser

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.

BalzGuenat avatar Jul 22 '19 16:07 BalzGuenat

@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.

facelessuser avatar Jul 22 '19 16:07 facelessuser