Documentation, documentation, documentation…

I have published working documentation in GitHub for OfficeJS.dialogswlEmoticon-hotsmile.png

If you click that link, you will see the README.md at the bottom of the repository has all the usage details, some sample code and example images of each dialog type supported in the library. But, you can also see a prettier version here:

https://davecra.github.io/OfficeJS.dialogs/

I have never used GitHub for documentation before. It uses a format called Markdown. It is actually very easy to learn and use. I spent about 3 hours and knocked out that document you see and it has:

  • Linked images from this blog
  • A Table of Contents with hyperlinks to different sections
  • Inline hyperlinks to different places in the documentation
  • A sorts of formatting including Headings.

Anyway, as I was building that documentation, I found a few minor bugs – and actually one really big one. I will likely be posting v1.0.6 pretty soon.

The big one: If you try to use the CDN for OfficeJS.dialogs, you will not see anything. The reason is that the HTML page that I use is not in “your” domain. For the Office.context.ui.displayDialogAsync() method to work, the URL to show the INITIAL file, needs to be from the same domain as your code. I totally face palmed wlEmoticon-confusedsmile.png on this one. So, I am going to provide a method:

OfficeJS.dialogs.Initialize(url);

You will call this first if you will be using the CDN. The URL will be an HTML page on your site that has some specific JavaScript (I will provide) to initially load your page, but then update with the OfficeJS.dialogs.html from the CDN. Or, at least that is the idea.

In the meantime, I suggest using NPM to install locally to your solution as per my blog post here:

npm load officejs.dialogs

Leave a Reply