-
Notifications
You must be signed in to change notification settings - Fork 14
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
[feature request] support for gitlab wiki pages #23
Comments
Sounds helpful. I won’t work in that direction myself (no use for us), but I’d be happy to review a PR if you wanna give it a shot. |
@nilsnolde I might give it a try. Would you prefer to use a separate short code/provider (like |
@nilsnolde Sorry, this is slightly off topic, but I'm very interested in your reasoning: When you started this plugin, why did you chose to get the Git content via the API and not the regular raw web view that Gitlab/Github offer? (e.g. https://raw.githubusercontent.com/gis-ops/wordpress-markdown-git/master/README.md) Wouldn't it be easier to use the web view, because you don't need to parse and split the URLs and just request the given URL directly? Would you be open to accepting a PR, that adds a "direct/raw" shortcode or parameter, which does exactly that? Just requests the given URL and sends it to the GitHub API to be parsed? This would also allow to embed Markdown files outside of git repos. |
You're raising good points.
Not sure (why I didn't think of that before) ;) Indeed that would eliminate a lot of the complexity, esp from provider specific implementations! Now it's a little late to change without breaking anything, but I'd be happy to have the direct/raw view and maybe eventually change it all to that logic. Be aware of private repos though, all providers differ here again in auth specifics. But surely easier than the current URL parsing/splitting! Long story short: definitely would welcome that. Probably (for now) also best to have separate shortcodes for that (
Yep, I like that better and easier to implement I guess. Feel free to skip the other providers for now (goes for both |
btw, feel free to change code as well if you feel there would be more elegant ways to do stuff. not really a PHP/WP guy here, this repo powers our tutorials section, that's the only reason it exists;) |
@nilsnolde Thanks for the answer. I'll see if I can cook something up. Also, I'm "not really a PHP/WP guy" either 😄 |
@nilsnolde Sorry, but adjusting your plugin seemed like a lot of work. So I decided to create a new plugin on my own, which is a much simpler version of your concept. Hope you don't mind. https://github.com/pReya/wordpress-external-markdown/tree/main#readme |
🤷 |
:( |
thing is, private wiki pages are not supported this way, you still need to auth. |
@ElDavoo that's correct – it's intended that way. But you can still use |
maybe you can cherry pick @pReya work into a PR here. as he mentioned it's a little more involved, but not too hard if you know php a bit. again, it's fair enough to only implement for now for gitlab, leaving github/bitbucket for others to contribute if they need it |
Aside from regular markdown files, Gitlab also supports wiki pages, which behave a little differently from regular repo files. There's a separate API endpoint for wiki pages: https://docs.gitlab.com/ee/api/wikis.html
Would be great if these could be embedded as well, since these often contain static markdown content which is a good candidate to embed in a website.
The text was updated successfully, but these errors were encountered: