Extension:GoogleDocTag

The GoogleDocViewer extension adds the &lt;doc&gt; tag for embedding a Google Doc in view, edit, or published mode (provided that the user is currently logged into their Google account and has access to the document).

Installation

 * 1) Copy GoogleDocViewer.php to the new file GoogleDocViewer.php in your MediaWiki extensions directory.
 * 2) Enable the extension by adding this line to the bottom of your LocalSettings.php:

Usage
Google Doc URLs are structured like this: docs.google.com/a/ /document/ ?id=. To embed this document, use:
 *   site= mode= title="My Title"/> 
 *  Example:  

2/27/2013 changes
The new version submitted below uses the new Google Drive URLs.

You have to Publish To Web each document first (File|Publish to web), then take the key out of the provided iframe code - or out of the URL. For spreadsheets, you want the 'HTML to embed in a page' option from the dropbox.

You then need to specify the type as "spreadsheet" or "file" for this to work properly. The default is set to file.

Spreadsheets greatly benefit from having the width set at 100% and the height set to something explicit in pixels.

Options

 * id (required)
 * mode (edit|view|pub)
 * width
 * height
 * title
 * site

Alternate version options

 * type (document|spreadsheet)
 * literal (a|b|c|d or other - docs.google.com/ / /...)
 * don't support site option
 * added options check by asset function
 * 10/02/12 Fixed for new docs URL

Source of GoogleDocViewer.php
'.               ' '; return $html; } ?>

Alternate version of GoogleDocViewer.php with spreadsheet support
'.               ' '; break; case 'spreadsheet': $html = ' '.               ' '; break; default: return ' Name of document type is not correct! ';           break; }       return $html; } ?>

Alternate version of GoogleDocViewer.php with spreadsheet support compatible with Google Drive
'.               ' '; break; case 'spreadsheet': $html = ' '.               ' '; break; default: return ' Name of document type is not correct! ';           break; }       return $html; } ?>