Skip to content
This repository was archived by the owner on Sep 11, 2021. It is now read-only.

Latest commit

 

History

History
60 lines (35 loc) · 2.58 KB

code-snippet-publishing-guide.md

File metadata and controls

60 lines (35 loc) · 2.58 KB

Guide to Publishing Code Snippets

Prototyping and coding is an iterative, explorative and collaborative activity. When it comes to reaching out to technical support, customers, peers or the crowd, you may need to share code snippets that illustrate a prototype or an encountered problem.

The snippet is a small block of code that works on its own without necessity for the other party to install the entire environment. With free online services it has become really easy to exchange JavaScript snippets with other people.

Thus, the purpose of the code snippet is to prototype a project, to localize an issue, or a bug, and jointly evolve your project.

This quick tutorial will help you publish a code snippet to get across to the NEXT team.

JavaScript Sandboxes

A lot of companies and Internet services provide web-based JavaScript sandboxes for free. In general, they provide three code editors: HTML, CSS and JavaScript, as well as a pane to render the result in. You can save, share, "fork" (that is, copy) and even like and comment on the snippets.

Here's a short list of most known sandboxes:

There are many more others, so choose the one you prefer.

Create New NEXT Snippet on Codepen

We normally use Codepen for the examples we share in our support group and mailer, as well as for the published tutorials.

To start, open http://codepen.io in your favorite web browser.

Initialize a pen

First, hit "New Pen":

Three panels (HTML, CSS, JS) will show up:

Include NeXt library files

Press "Settings" button to reveal the window.

Tap the CSS tab and add https://abdvl.github.io/src/dist/css/next.css as an external CSS file.

Switch to the JavaScript tab and add https://abdvl.github.io/src/dist/js/next.js as an external JS source.

Start coding

Now you can start writing code of your snippet in the JS text editor.

Save content

Don't forget to save your code before you copy the link and close the tab.

Share Link

Great, you've created the snippet! Now that it runs on your system, you're welcome to copy the link to the webpage and share with us :)