Skip to content

Instantly share code, notes, and snippets.

View marcorei's full-sized avatar

Markus Riegel marcorei

View GitHub Profile
@marcorei
marcorei / clean-toc.gs
Created March 10, 2016 12:05
Google Apps Script which cleans the Table of Content from unwanted headings.
/**
* Creates a menu entry in the Google Docs UI when the document is opened.
*
* @param {object} e The event parameter for a simple onOpen trigger. To
* determine which authorization mode (ScriptApp.AuthMode) the trigger is
* running in, inspect e.authMode.
*/
function onOpen(e) {
DocumentApp.getUi().createAddonMenu()
.addItem('Clean Table of Contents', 'cleanToC')