Giter Site home page Giter Site logo

popcodeorg / popcode Goto Github PK

View Code? Open in Web Editor NEW
186.0 20.0 138.0 15.81 MB

An HTML/CSS/JavaScript editor for use in the classroom

License: MIT License

JavaScript 90.51% CSS 4.30% HTML 3.05% Shell 0.31% Dockerfile 0.15% Python 1.69%
classroom editor education web-development

popcode's Introduction

Popcode

Popcode is a simple HTML/CSS/JavaScript editing environment for use in the classroom. It's a lot like JSBin, JSFiddle, or CodePen, but it focuses on giving specific, immediate, human-friendly feedback when the code contains errors.

Project status

Build Status Dependency Status License

Popcode is the official editing environment for the Code Nation Intro to Web Development program in the 2019–2020 school year.

Try it out

You can try out Popcode at https://popcode.org.

Table of Contents

Features

  • Edit HTML, CSS, and JavaScript in the browser; in-browser preview updates as you type.
  • Get immediate, comprehensive, easy-to-understand feedback about problems in your code.
  • Errors can't be ignored. If there are any errors in the code, the live preview is replaced by an error list.
  • JavaScript runtime errors are also reported in human-friendly language, with annotations in the source code pointing out the source of the problem.
  • One-click login using GitHub account; all work is saved remotely to Firebase when logged in.
  • Pop out preview of web page in its own window.
  • Export to GitHub gist.
  • Import starter code from a GitHub gist.

About validation

The validation system is the main point of this project. Most syntax checkers, linters, and style enforcers tend to provide feedback using language that is geared toward experienced coders, not beginners. Thus, providing a translation of error messages into plain English for students is the overriding concern of this project.

Popcode tends toward strict enforcement of lint and code style, even when enforced style decisions are arbitrary, under the philosophy that giving students one right way to do it eliminates ambiguity and aids the learning process.

Technical details

Popcode uses React to render views, Redux to manage application state, Ace as the code editor, Webpack to package the client-side application, and Babel to compile modern JavaScript for compatibility with legacy browser versions.

Popcode detects mistakes in student code using slowparse, htmllint, HTML Inspector, Rework CSS, PrettyCSS, stylelint, jshint, and esprima.

Contributing

Popcode is an all-volunteer project and contributions are welcome. I encourage first-time contributors to start with the Getting Started guide, which gives a friendly and detailed breakdown of each step toward contributing your first pull request.

Quick Start

If you want to get involved but don’t have a specific idea of how, check the good first issue and help wanted labels. If you already have an idea you’re passionate about, go for it.

Popcode comes with a batteries-included development environment built on nodeenv. You will need to have Python installed; any version 2.7+ will work. To set up the environment, run:

$ tools/setup.py

This will install node and yarn in an isolated environment in the nodeenv directory of the project root. It won’t interfere with any system-wide installation of those tools.

Once setup is complete, to run a development server, run:

$ tools/yarn.py start

This will start a server on http://localhost:3000

To start tests in watch mode, run:

$ tools/yarn.py autotest

Check the "scripts" section of package.json for other useful tools.

Developing in VS Code

Popcode comes with a robust custom VS Code configuration, which is automatically enabled by tools/setup.py. If you use VS Code, you can:

  • Run the Show Recommended Extensions command to easily install extensions that improve the Popcode developer experience
  • Start a server, run tests, and more by typing task into the Quick Open bar to autocomplete the task to run
  • Debug either your development environment or a Jest test by typing debug into the Quick Open bar

Using other editors

Popcode uses tools like Prettier, ESLint, and Stylelint to automatically format code. We recomment setting up editor plugins to auto-format on save; alternatively, you can run tools/yarn.py lintfix before committing to format and autofix lint. Popcode’s official VS Code integration (with recommended extensions installed) does this out of the box.

Alternative development environments (advanced)

There is no requirement that you use the official development environment to work on Popcode; you’ll mostly just need the right versions of Node and Yarn installed on your machine (check the "engines" section of package.json for the current versions).

Developer Reference

Popcode endeavors to use up-to-date technologies and code conventions to make development as pleasant as possible. Below are links to reference documentation on the major tools:

License

Popcode is distributed under the MIT license. See the attached LICENSE file for all the sordid details.

Contributors

Thanks to

These companies generously offer Popcode access to paid tiers of their excellent services, free of charge:

BrowserStack Bugsnag

Contact

Feel free to email me at [email protected] if you have any questions.

You can find our Slack team, including our #dev channel, here.

popcode's People

Contributors

aduros avatar ajgreenb avatar alecmerdler avatar alessbell avatar alexpelan avatar carolchau avatar catrope avatar chasestarr avatar codewritingcow avatar demc avatar ericandrewlewis avatar gangstertim avatar greenberga avatar harry1064 avatar inlinestyle avatar joshling1919 avatar jwang1919 avatar kinduff avatar leo-alexander avatar maggiewalker avatar omardeleo avatar outoftime avatar pwjablonski avatar raingerber avatar razzius avatar renovate-bot avatar renovate[bot] avatar tenyoung795 avatar v avatar wylieconlon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

popcode's Issues

Non-straight-quotes in HTML should produce more useful error message

In our class today a student's chromebook was, for some reason, set to use the international keyboard setting.

As a result she got an error nag about needing to use "s for her href attribute because the double-quotes were typed with international characters. The tag was visibly correct. Switching the chromebook to US Keyboard setting fixed the issue with visibly different " characters in the IDE.

HTML validation

At the very least: syntax validation, check that tags exist, etc. This may actually be pretty difficult? Le sigh.

Hopefully htmllint can do something useful.

User Feedback

Submitter: Phil
Email: [email protected]
Hi, I am trying to export to gist, but it keeps on opening a new tab and not exporting it.

When I try to open up a gist in popcode, it goes to popcode, but there is no code in there. Am I doing something wrong?

Thanks loads,

Phil

User Feedback

Submitter: Tom Bijesse
Email: [email protected]
Hey Mat,

I'm not sure why but I just exported a gist and I am not getting the link at the top of the page that I would see before. It is also exporting anonymously.

Any idea why that might be happening?

Support popular transpilers/next versions

The editor should support popular transpilers, especially those that are transpiling next code into currently-supported code:

Next code

  • CSS4 via cssnext
  • ES2015 via Babel

Abstraction languages

  • SASS
  • LESS
  • CoffeeScript
  • ClojureScript

Etc

TypeError in /

https://trello.com/c/ZFxwJa5O/121-typeerror-in

Enter this in CSS

img src ="https://s3.amazonaws.com/creativeallies/snapshots/000/123/983/original/Lifehouse_Seven_v2.jpg?141854206";

i,img src ="https://s3.amazonaws.com/creativeallies/snapshots/000/123/983/original/Lifehouse_Seven_v2.jpg?141854206";

i,

Error in Popcode

TypeError in /
Uncaught TypeError: Cannot read property 'type' of null

View on Bugsnag

Stacktrace

https://popcode.org/compiled/application.js:1 - Object.n.parse

View full stacktrace

User Feedback

Submitter: Carol
Email: [email protected]
Hi Popcode!

I'm Carol and I was trying to go through three questions that I had saved as gist to my class, but when I clicked the 'Load Project" button on the left side panel, it wasn't responsive. My Macbook Air was connected to the SmartBoard so what we suspect happened was that since I was connected to the SmartBoard, the screen resolution was reduced, and the image with the white ghost-like thing with two black eyes ( id="Pop1___0" ) blocked the space of the panel and did not let me click on the labels.

I just wanted to bring up this issue I had. Asides from that, we've been using popcode for a few classes now and it's pretty neat!

-- Carol

Templates

Educators should be able to pass out a URL to a class full of students; following the URL should yield a new/private document that uses the educator’s template (starter code). Flow is something like this:

  • Educator creates a page and saves it to GitHub
  • Educator can generate a “template link” which just points at the GitHub gist ID/SHA
  • Opening that template link reads data out of the GitHub gist into a new page

Save to local storage / restore from local storage

  • Save current work to local storage (this should happen automatically with some reasonable debounce/throttle)
  • Restore page you were last editing when you visit again
  • Create new page
  • View list of saved pages
  • Open saved page for editing

Note that this is only using local storage; no need for server persistence (YET)

Multiple projects

  • Ability to create a new project
  • Ability to switch to a previous project

Chrome not updated error

we don't always have control over the school computers. what's the latest version of chrome supported/can we try to support some of the minor older versions? is safari or firefox better for handling pop code?

Don’t show preview if there are validation errors

If there are any validation errors, the preview should be replaced by a list of the errors, making it impossible to ignore them.

Clicking on an error should focus the corresponding line in the editor.

While we’re in there, this would be a good time to debounce validation checks, put a overlay/throbber on top of the preview while we’re validating, etc.

Save to GitHub gist / restore from GitHub gist

Ideally we’d like to have the browser client communicating directly with GitHub with no need for a server intermediary. Do we have the technology?

  • Auth with GitHub
  • Save current work to a GitHub gist (should just happen automatically if you are authed when you save to local storage).

User Feedback

Submitter: Erica
Email: [email protected]
Too many students exporting as a gist at the same time gave me error 404 messages on Github. Might not be a popcode error.

Show warnings if code isn't indented properly

It would be great if students were advised on proper indentation in an automated fashion. It would help them get in the habit of formatting code cleanly much sooner, and help them find obvious bugs in their own code.

From our conversation over Slack, it sounds like we could infer what indentation type the code is primarily using, and enforce that everywhere in the code.

Maybe we wouldn't want to block the page from loading when indentation errors are present, but instead add a warning annotation to the line that's improperly indented.

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.