Giter Site home page Giter Site logo

officedev / script-lab Goto Github PK

View Code? Open in Web Editor NEW
695.0 56.0 154.0 15.44 MB

Create, run and share your code directly from Office

License: MIT License

JavaScript 2.39% HTML 3.56% CSS 0.26% TypeScript 92.74% Batchfile 1.05%
office-addin typescript code-editor script-lab

script-lab's Introduction

Script Lab, a Microsoft Garage project

Experiment with the Office JavaScript API without leaving Excel, Outlook, Word, or PowerPoint!

Get Script Lab in Excel, Word, and PowerPoint, or Script Lab for Outlook, free from Microsoft AppSource.

Read the blog post on the future of Script Lab.

Topics

What is Script Lab?

Wouldn't it be crazy if you could launch Excel, click to open a small code window, and then instantly start writing and executing JavaScript that interacts with your spreadsheet?

Script lab is a tool for anyone who wants to learn about writing Office Add-ins for Excel, Outlook, Word, or PowerPoint. The focus is the Office JavaScript API, which is the technology you need for building Office Add-ins that run across platforms. Maybe you're an experienced Office developer and you want to quickly prototype a feature for your add-in. Or maybe you've never tried writing code for Office and you just want to play with a sample and tweak it to learn more. Either way, Script Lab is for you.

Script Lab has three main features:

  • Code in a pane beside your spreadsheet.
    • IntelliSense is there while you type so you can easily discover and use the Office JavaScript objects and methods. Script Lab uses the Monaco editor, the same tech that powers VS Code, so it's beautiful and lightweight.
    • Samples are pre-installed with Script Lab, so you don't have to start from scratch
    • Your can use any TypeScript features like arrow functions, template strings, and async/await (i.e., a good chunk of ES6 and ES7 features). But it's not only script: your snippets can also use HTML, CSS, and references to external libraries and data on the web.
  • Run the code in another pane beside the editor.
    • Execution can include logic, API calls to Office, UI in the pane, and even output to a console.
    • Every time you make a code change you can refresh the editor and run the new version in seconds.
  • Share your snippets.
    • If you create a snippet you'd like to share, you can copy it to your clipboard, save it as a GitHub gist. Then send the gist link to someone else to use on their computer.
    • The Import feature lets you load other people's snippets.

Script Lab works in Office 2013 or later on Windows, Office on the web, or Office on Mac.

You can get Script Lab right now for free from Microsoft AppSource! It works for Excel, Word, and PowerPoint.

If you're interested in developing for Outlook, you can get Script Lab for Outlook, also free from AppSource.

Script Lab is a Microsoft Garage project that began at a hackathon. You can read the story of the original Script Lab creation on the Garage website.

Here's a 1-minute teaser video:

Script Lab teaser video showing Script Lab being used in Excel to make charts, Word, and Powerpoint Online.

Get Started

Explore Office JavaScript API using Script Lab

This 10-minute demo explains how to use the main features:

Michael Saunders demos Script Lab

Import someone else's snippet, or export your own

Script Lab is built around sharing. If someone gives you a URL to a GitHub Gist, simply open Script Lab, use the hamburger menu at the top left to see the menu, and choose "Import" category (either on the left or top, depending on the available screen space). Then, enter the URL of the Gist, and click the "Import" button at the bottom of the screen. In just these few clicks, you will be able to view and run someone else's snippet!

Import tab within the "Hamburger" menu showing a text box to import a URL, GitHub gist ID, or snippet YAML

Conversely, to share your snippet with someone, choose the "Copy to clipboard" button with the open snippet. You can share as a public GitHub Gist, or you can paste the snippet from the clipboard, and share it from there.

Report a bug, or suggest a feature

To report a bug, create a new issue. Please provide as much detail as you can, tell us: the operating system, the Office build number, and your browser (if you're using Office on the web).

If you have a suggestion for a feature, please feel free to file it under "issues" as well, and we will tag it appropriately. The more detail, the better! (see more at CONTRIBUTING.md).

If you have a question, please ask it on Stack Overflow and tag your questions with office-js and scriptlab.

Stay up-to-date

Contribute to Script Lab

There are a bunch of ways you can contribute to Script Lab:

  • File bugs & suggestions (see Report a bug, or suggest a feature).
  • Contribute new samples, or improve existing one. Please submit a pull request to the office-js-snippets repo; more info in the README of that repo.
  • Spread the word! Whether through writing a blog post (examples), recording a video, tweeting about us, or sharing snippets with colleagues or the StackOverflow community -- we want more of the world to use Script Lab!
  • Help improve the documentation. If you feel like this README or the CONTRIBUTING.md doc could use more details, please send a pull request!

Rate and review

Leave a star-rating and (optionally) a review blurb for Script Lab on the Office Store review page.

We'd prefer you report issues on GitHub.

Articles & FAQs

External media coverage

Code of conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

script-lab's People

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  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

script-lab's Issues

Deployment: N-1 versioning

UPDATED Nov 6 2018, feel free to ignore some of the other comments that were from earlier days

Need to:

  • Spin up a CDN (similar to "scriptlab.azureedge.net") to be able to experiment outside of production.
  • For any copied assets (monaco editor), ensure that get copied into a versioned folder number (e.g.,
    https://script-lab.azureedge.net/libs/monaco-editor-0-10-0/.... That way we can update dependencies in the future.
  • Ensure that older assets continue to be copied for X amount of time. That way, an older HTML page (served off of the CDN) doesn't end up referencing removed JS files. Maintain a JSON file with assets and their dates, and remove as needed. Script Lab today already does most of this.
  • Experiment with whether need any cache settings in the CDN or in meta tags of the HTML pages or in server configuration, etc.
    • HTML should probably just "never cache" (or should it?...)
    • JS files should all get hashes via webpack and then should be always-cache.
    • Use "web.config" so specify this (?)

React Cleanup

Go through each React component, and delete any unused props, apply same convention to all components, share typings.

Update gist

This feature relies on #18. Once a snippet has been exported as a gist, it should be able to be updated. (Have changes be pushed to it.)

For dev.office.com

  • Embedding view
  • Browsable samples gallery
  • Port over the "Open in Script Lab" logic

[Note, perhaps we can get someone from Keith's team to chip in on this one, too]

Delete functionality on backstage

It would be great to have a delete button on the backstage so we can delete snippets faster and possibly even delete multiple snippets at once.

Import a snippet

Be able to import a snippet via a url, or directly pasting in the YAML

Export snippet as gist

This feature is the ability to publish a snippet as a gist, both publicly and secretly.

View all shared gists

This requires #15 to be completed so that metadata can be fetched for a user's shared gists. (Both public and secret.)

Theming / Host Detection

Un-hard-code the theming to be based on which Office host the client is in.
Also, allow the user to toggle some settings such as light vs. dark, and editor color schemes.

Refactor to use <Only /> component

Got frustrated with having to put:

{ someConditionThatDeterminesIfShouldRender && <ComponentToRenderConditionally /> }

Instead thought this looked a lot cleaner and clear on intentions:

const Only = ({ when, children }) => (when ? children : null)

yielding code that looks like:

<Only when={someConditionThatDeterminesRendering}>
  <ComponentToRenderConditionally />
</Only>

Apply this refactoring to other areas that have aforementioned pattern.

Remove Github.js

We don't need this dependency, and we can just manually make the calls..

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.