Skip to content

Add GitLabRenderer - #316

Open
jerrykan wants to merge 3 commits into
joeyespo:masterfrom
jerrykan:gitlab-renderer
Open

Add GitLabRenderer#316
jerrykan wants to merge 3 commits into
joeyespo:masterfrom
jerrykan:gitlab-renderer

Conversation

@jerrykan

@jerrykan jerrykan commented May 4, 2020

Copy link
Copy Markdown

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

jerrykan commented May 4, 2020

Copy link
Copy Markdown
Author

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

@Lucas-C

Lucas-C commented Jun 25, 2020

Copy link
Copy Markdown

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
Copy Markdown

👎 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
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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

@verm

verm commented Apr 15, 2024

Copy link
Copy Markdown

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