Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitLabRenderer #316

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

jerrykan
Copy link

@jerrykan jerrykan commented May 4, 2020

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 the GitLabRenderer, add support for authentication, and tests.

jerrykan added 3 commits May 2, 2020 21:29
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.
There are now multiple backends that can be used, so picking one using
`render_backend` would seem to be more useful than having a binary
"offline or not" option.
Provide the ability to make use of the alternate backend renderers like
GitLabRenderer.
@jerrykan
Copy link
Author

jerrykan commented May 4, 2020

Thought I would add a --renderer option while I was at it, just to fill out the proof of concept a bit.

@Lucas-C
Copy link

Lucas-C commented Jun 25, 2020

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

@ericfrederich
Copy link

👎 Do not merge. This breaks configuration. 👎

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.

@jerrykan
Copy link
Author

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

@ericfrederich
Copy link

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.

@MarcelRobitaille
Copy link

Thanks for this PR. I found that KaTeX is not being rendered. Is that a supported feature?

@verm
Copy link

verm commented Apr 15, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants