Open jerrykan opened 4 years ago
Thought I would add a --renderer
option while I was at it, just to fill out the proof of concept a bit.
I do not maintain this repo, but thanks for this PR that adds a useful feature !
I've just tested it and it works fine:
pip install --user git+https://github.com/jerrykan/grip.git@gitlab-renderer
grip -b --renderer=gitlab
:-1: Do not merge. This breaks configuration. :-1:
The GitLab rendering works but this, as it is, breaks the ability to use ~/.grip/settings.py
for configuration.
The renderer ends up getting instantiated before the settings are read.
This change even affected the GitHub renderer as well.
Also, if --renderer
is added as an option there should also be a way to configure it in the configuration file.
@ericfrederich yeah, this was only meant as a proof-of-concept. I didn't want to spend too much time on it if there was no chance of it being merged.
Unfortunately is seem the projects doesn't seem to have been active for a while, so :shrug:
I think it's a worthy feature. I'd like to render my Markdown stuff locally without making commits and without sending confidential information over the internet to GitHub. We host our own GitLab. I'd be in support of this.
Thanks for this PR. I found that KaTeX is not being rendered. Is that a supported feature?
GitLab now requires authentication to access the MarkDown API. Adding PRIVATE-TOKEN
to GitLabRenderer
in renderers.py
fixes the issue. You'll need to create an API token.
Otherwise this works great! Hopefully it makes it in officially one day. Thank you.
An initial attempt at creating a renderer using the GitLab API. Authentication has not yet been implemented, so the
--context
option can only be used with public repositories.This is mainly meant as some initial work to see if there is interest in the feature. I assume the next steps would be to implement some sort of
--renderer
options to enable theGitLabRenderer
, add support for authentication, and tests.