Git Product home page Git Product logo

sheet-best-templates's Introduction

SheetBest Templates

Build Status Coverage Status

Connect Google Sheets to your HTML

With SheetBest Templates you'll be able to:

  • Use SpreadSheet data to display data on your HTML template
  • Insert data from a HTML <form> to a SpreadSheet

Usage

This project requires you to setup a Google Sheet API at SheetBest. When you get yours get back here (it looks like this: https://sheet.best/api/sheet/cf969697-682a-40e3-bad4-d54803eeeacf). We will use it on the next steps.

Add this snippet to your HTML page:

<script src="https://sbt.0soft.dev/sheet-best-templates.min.js"></script>

Then follow the instructions on for the operation that you want to do:

Display Data

To display data you just need to add data-sheet-best attribute to your HTML tag:

<div data-sheet-best="https://sheet.best/api/sheet/cf969697-682a-40e3-bad4-d54803eeeacf"></div>

Then you just need to use {{ }} templates, they will be replaced by the content on your SpreadSheet API

<div data-sheet-best="https://sheet.best/api/sheet/cf969697-682a-40e3-bad4-d54803eeeacf">
  <div>
    <h2>{{ code }}</h2>
    <div>
      <span>Price: <b>{{ price }}</b></span>
      <span>High: <b>{{ high }}</b></span>
      <span>Low: <b>{{ low }}</b></span>
    </div>
  </div>
</div>

A Google Sheet like this:

Will generate a HTML code like this:

<div data-sheet-best="https://sheet.best/api/sheet/cf969697-682a-40e3-bad4-d54803eeeacf">
  <div>
    <h2>COST</h2>
    <div>
      <span>Price: <b>273.59</b></span>
      <span>High: <b>275.36</b></span>
      <span>Low: <b>272.76</b></span>
    </div>
  </div>

  <!-- ...and so on, until... -->

  <div>
    <h2>TSLA</h2>
    <div>
      <span>Price: <b>229.31</b></span>
      <span>High: <b>231.5</b></span>
      <span>Low: <b>228.03</b></span>
    </div>
  </div>
</div>

Inserting Data

To display data you just need to add data-sheet-best attribute to a <form> tag. If your spreadsheet is setup like this:

<form data-sheet-best="https://sheet.best/api/sheet/cf969697-682a-40e3-bad4-d54803eeeacf">
  <input type="text" name="name"/>
  <input type="text" name="email"/>
  <button type="submit">submit</button>
</form>

We will automatically add the information on your SpreadSheet once the user submits the content:

License

The files included in this repository are licensed under the MIT license.

sheet-best-templates's People

Contributors

nihey avatar

Stargazers

John Gage Faulkner avatar Periklis Papanikolaou avatar Bobby P avatar  avatar Shooter avatar

Watchers

Daniel Zacarias avatar Alfredo Matos avatar Eduardo Sigrist Ciciliato avatar James Cloos avatar Francisross Soares de Oliveira avatar  avatar Cainã D'Ajuda avatar

sheet-best-templates's Issues

Missing something basic

I can get the data when I use the SheetBest API in my browser, but not when I try to get it using the follow code:
`



Question1: {{ Question1 }}
Question2: {{ Question2 }}
Question3: {{ Question3 }}
Question4: {{ Question4 }}

` I must be overlooking something very basic. Maybe you can spot my error? Thanks!

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.