
JavaScript-Based Spreadsheet-Like Formulas in Google Docs - MikaelMayer
https://chrome.google.com/webstore/detail/formulas-for-google-docs/kgjbgmonlnhglokmfnpnklegakfknbeh
======
lazyasciiart
FYI, on my phone that link takes me to a generic Chrome page saying "You can
add new features to Chrome by installing extensions. Visit the Chrome Web
Store on your desktop computer...". It would be better to post the blog
article (and maybe make a more obvious "get it here" button somewhere in the
article for people skimming :))

~~~
MikaelMayer
Thanks. I added a link to the beginning of the blog post.

[https://mikaelmayer.github.io/blog/2019-02-13-google-docs-
fo...](https://mikaelmayer.github.io/blog/2019-02-13-google-docs-
formulas.html)

------
chrisweekly
Related tangent: I like how, in his introduction to Mobx, author MWestrate
uses the analogy of spreadsheets (data cells, formulas) to explain mobx
observables and computeds.

~~~
zwkrt
I explain lots of programming concepts to friends/family in terms of Excel.
Truly a wonderful program.

~~~
dmitriid
I've seen/heard it called "The biggest and most successful reactive
programming tool in the world". Nothing else comes even close.

~~~
giancarlostoro
My coworker also calls it the most abused software in the world. Some people
do things that are amazing, and sometimes scary to software engineers.

------
threatofrain
I'm a bit averse to newly created accounts linking to nondescript plugins.

Here's a blog post discussing the plugin:

[https://mikaelmayer.github.io/blog/2019-02-13-google-docs-
fo...](https://mikaelmayer.github.io/blog/2019-02-13-google-docs-
formulas.html)

> Have you ever wished you could synchronize content within one Google doc? Do
> you need temporary placeholders that you will replace later? Do you want to
> generate text? Do you miss spreadsheets in docs?

> If you answered yes to one of these questions, this Google doc extension is
> for you. It enables you to define names (a.k.a. variables) anywhere in the
> document, and to insert computations that produce rich text anywhere in the
> document.

~~~
MikaelMayer
> I'm a bit adverse ...

Besides (what I consider) the introduction of the article, what else do you
consider "stilted" advertising language and how can I improve my writing?

~~~
threatofrain
I shouldn't have been so harsh, as I was initially scanning against suspicious
submissions. I criticized the language because I thought it sounded like a
kind of advertising from TV.

------
kenips
Wrong link?

------
abrichr
What do users without the extension see? e.g. would they see "=name is out!"
or "MySoft 1.0 beta is out!"?

~~~
mayerwin
The extension isn't just a Javascript overlay, it actually modifies the
document in real-time while storing a full understanding of the document
structure behind the scene, in the document itself (thanks to the Google Docs
API). So other users would see "=name is out!" if this is what you've chosen
to show on your own interface, or "MySoft 1.0 beta is out!" otherwise. If they
have installed the extension, they would be able to access the document
structure information, see placeholders and change variables as they like.

------
amelius
So by creating a table inside the text document, you can essentially make a
spreadsheet?

~~~
MikaelMayer
Indeed! However, without range support like A1:A10 or relative references.
Besides, values should be defined in order (top-bottom, left-right)

Try to create a 2x2 table like this:

=(/ _A1=_ /”Hello”) =(/ _B1=_ /”World”)

    
    
                  =(A1 + “ “ + B1)
    

Click on Evaluate formula, tadaa. I just fixed a bug to make it work, the
publication might take up to 24h.

------
phonon
Source available?

~~~
MikaelMayer
The source is a Google Script. When I try to create a shareable link, either
by obtaining the share link or advanced share options, I get the error "Sorry,
an internal error has occurred and your request has not been processed.". I'll
let you know when it's working again and I'll post the link here.

~~~
wffurr
Use clasp to manage your apps script project and push to Google apps script
from a local git repo which you can also push to GitHub.

[https://codelabs.developers.google.com/codelabs/clasp/#0](https://codelabs.developers.google.com/codelabs/clasp/#0)

~~~
MikaelMayer
Thanks for the tool. Unfortunately, this makes run-test lifecycle painful -- I
just want to launch a procedure and view the result in a Google docs, not git
commit -am message and then git push and then refresh and then launch a
procedure -- so I'm likely not going to use it

~~~
wffurr
I was using an older version of this and was able to push directly to Google
Apps Script / Docs from the repo with uncommitted changes for testing, and
then only commit and push to git when I was happy with it.

I wrote stubs for the relevant apps script APIs and was able to run tests
locally as well: [https://github.com/wffurr/safe-contract-
validator/blob/maste...](https://github.com/wffurr/safe-contract-
validator/blob/master/mock_apps_script.js)

~~~
MikaelMayer
Thanks, I finally managed to make Clasp work. Here is the source code of the
latest nightly version:

[https://github.com/MikaelMayer/Sketch-n-
Script](https://github.com/MikaelMayer/Sketch-n-Script)

