Forem: Support for dotnetfiddle.net

Created on 21 Sep 2020  路  21Comments  路  Source: forem/forem

Is your feature request related to a problem? Please describe.

As a writer that blogs mainly about .NET and C#, I would like to be able to embed dotnetfiddle.net in my posts.

It might be a frustrating experience for users to exit the post to check or run code examples.

I would ask to expand the support that already exists for jsfiddle.net to include dotnetfiddle.net and maybe even other languages.

Describe alternatives you've considered

The current alternative is to use gists to include code snippets and link the users to external dotnetfiddle.net links.

liquid tags easy ready for dev feature request

Most helpful comment

Hi, apologies for the delay :pray: , we have exams :sweat_smile: . I'm positive I'll be able to file a PR by the weekend. Thanks and apologies again :sweat_smile:

All 21 comments

Thanks for the issue! We'll take your request into consideration and follow up if we decide to tackle this issue.

To our amazing contributors: issues labeled type: bug are always up for grabs, but for feature requests, please wait until we add a ready for dev before starting to work on it.

To claim an issue to work on, please leave a comment. If you've claimed the issue and need help, please ping @forem/oss and we will follow up within 3 business days.

For full info on how to contribute, please check out our contributors guide.

Hey @citizen428, I'm relatively new here. Could you point me in the right direction so that I could start working on this? Thanks :pray:

Hi @ShubhankarKG, thanks for expressing interest in helping out, I will assign you this issue.

Some pointers:

  1. Liquid tags are defined in app/liquid_tags and their corresponding specs in spec/liquid_tag.
  2. All Liquid tags inherit from LiquidTagBase, which is defined in app/liquid_tags/liquid_tag_base.rb if you want to have a look at it.
  3. The view of a Liquid tag can be found in a Rails partial, named app/views/liquids/_[tag_name].html.erb, in this case app/views/liquids/_dotnetfiddle.html.erb.
  4. Please also update the documentation in app/views/pages/_editor_guide_text.html.erb and explain how the Liquid tag works.

@Link2Twenty's PR for the JSFiddle tag can serve as inspiration for your work.

It's worth noting since I built the tag it's become standard practice to build the iFrame in a html.erb view.

@mariocsee's PR for updating the JSFiddle tag can show a path for using ActionController

Yes, that was the second point in my list above. I should probably have linked the follow up PR too, thanks for adding it!

Hi, apologies for the delay :pray: , we have exams :sweat_smile: . I'm positive I'll be able to file a PR by the weekend. Thanks and apologies again :sweat_smile:

@ShubhankarKG no worries, please take your time and good luck for the exams! :)

Update: I have created the necessary files, but I'm not able to log in to add a snippet to see if my solution looks good. Is there a default username/password so that I can log in to the development env ?

Thanks.

@ShubhankarKG no but you can log-in with Twitter / GitHub the same way you do on dev.to

Awesome, thanks

On attempting to login, I get a Github 404 page, unfortunately.

Are you using Gitpod? I noticed I couldn't log in to that.

Nope, I'm on my local machine

@ShubhankarKG can you provide additional details? Screenshot of the error? Is there anything logged in your JS console?

Same errors from Gitpod

Facebook:
facebook error

Twitter:
twitter error

@ShubhankarKG have you configured the GitHub keys? https://docs.dev.to/backend/auth-github/
@Link2Twenty have you configured the Facebook keys? https://docs.dev.to/backend/auth-facebook/

Yup, that was it, apologies.

Hey everyone, one final request, I was going to commit and this happened

error [email protected]: The engine "node" is incompatible with this module. Expected version "12.18.x". Got "12.19.0"
error Commands cannot run with an incompatible environment.

Any suggestios would be great

My suggestion would be to bump the node version under engines in package.json to 12.19.x or something similar and see how the change goes.

This change should technically work, however as there may be reasons a dependency is held back I will defer to more experienced community members on the matter.

@ShubhankarKG Our Node dependency is currently locked to 12.18 (see .nvmrc). To get rid of this warning you need to use a Node version manager like nvm (assumed by our documentation), n or fnm to install the correct version. Please consult our installation docs and follow the instructions for your operating system.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benhalpern picture benhalpern  路  54Comments

treeternity picture treeternity  路  22Comments

omenking picture omenking  路  30Comments

SeanKilleen picture SeanKilleen  路  32Comments

lightalloy picture lightalloy  路  34Comments