GithubHelp home page GithubHelp logo

Comments (2)

matthewborden avatar matthewborden commented on August 17, 2024

I had a PR that didn't get merged a while back for code snippets: #29. The branch no longer exists. However, the diffs are still available and could be used to implement the functionality.

Squire has the functionality to display images. However to upload them you would want to integrate your UI with a library like http://fineuploader.com/, http://www.dropzonejs.com/, or ProgerXP/FileDrop.

from squire.

neilj avatar neilj commented on August 17, 2024

Uploading images is left to the integration (and how you handle this will depend on what you are building; you may need to upload them to your server, and then get back a URL, or you might just want to insert base64). Once you have a URL, you can use the insertImage method to insert it into Squire. This returns a reference to the returned image, so you can also generate a preview from the local file first, then upload it, then update the src with the uploaded one. It all depends on your requirements really.

Inserting code snippets again depends on what you want. If you want to be able to edit them in a code mirror like environment (with syntax highlighting, code-completion etc.), this will require some complicated custom integration. Otherwise, you can just use the insertElement method to insert a <pre><code> block with the code in it.

from squire.

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.