Giter VIP home page Giter VIP logo

Comments (12)

nilsnolde avatar nilsnolde commented on June 26, 2024 1

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.

nilsnolde avatar nilsnolde commented on June 26, 2024

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.

pReya avatar pReya commented on June 26, 2024

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

pReya avatar pReya commented on June 26, 2024

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

nilsnolde avatar nilsnolde commented on June 26, 2024

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.

pReya avatar pReya commented on June 26, 2024

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

pReya avatar pReya commented on June 26, 2024

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

nilsnolde avatar nilsnolde commented on June 26, 2024

🤷

from wordpress-markdown-git.

ElDavoo avatar ElDavoo commented on June 26, 2024

:(

from wordpress-markdown-git.

ElDavoo avatar ElDavoo commented on June 26, 2024

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

pReya avatar pReya commented on June 26, 2024

@ElDavoo that's correct – it's intended that way. But you can still use wordpress-markdown-git for this, right?

from wordpress-markdown-git.

nilsnolde avatar nilsnolde commented on June 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.