Comments (12)
You're raising good points.
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?
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 (git-<provider>-markdownraw
?). What do you think?
Would you prefer to use a separate short code/provider (like git-gitlabwiki)
Yep, I like that better and easier to implement I guess. Feel free to skip the other providers for now (goes for both raw
and wiki
), as long as you can implement it fairly generic (as much in base classes as possible).
from wordpress-markdown-git.
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.
from wordpress-markdown-git.
@nilsnolde I might give it a try. Would you prefer to use a separate short code/provider (like git-gitlabwiki
) or to detect this from the URL structure and use the same gitlab shortcode/provider?
from wordpress-markdown-git.
@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.
from wordpress-markdown-git.
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;)
from wordpress-markdown-git.
@nilsnolde Thanks for the answer. I'll see if I can cook something up. Also, I'm "not really a PHP/WP guy" either 😄
from wordpress-markdown-git.
@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
from wordpress-markdown-git.
🤷
from wordpress-markdown-git.
:(
from wordpress-markdown-git.
@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.
from wordpress-markdown-git.
@ElDavoo that's correct – it's intended that way. But you can still use wordpress-markdown-git
for this, right?
from wordpress-markdown-git.
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
from wordpress-markdown-git.
Related Issues (20)
- 404 - Not Found for valid Jupyter notebook URLs HOT 13
- GitLab rate limited HOT 3
- Enable dynamic caching
- plugin does not respect dark mode HOT 4
- Small Typo on Readme. :)
- WP plugin taking too long HOT 5
- Support for checkbox [x] HOT 3
- Doesn't update ipynb when git is updated. HOT 7
- [Feature request] Skip a given number of lines HOT 2
- Anchor links to headers don't work HOT 1
- Gitlab local API HOT 3
- since update: error message that I reached API call limit HOT 2
- Styles are not enqueued HOT 1
- installation on PHP8.0 HOT 3
- Accessibility with Gitlab markdown flavor HOT 2
- Include a link to settings in plugin page
- Removing cache_ttl does not flush cache HOT 3
- Inline codeblocks not working correctly? HOT 2
- Deprecate this plugin HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wordpress-markdown-git.