Skip to content

Instantly share code, notes, and snippets.

View itdependsnetworks's full-sized avatar

Ken Celenza itdependsnetworks

View GitHub Profile
@mengwong
mengwong / numberHeaders
Last active December 31, 2023 15:52
number headers in Google Docs
// PROBLEM: in Google Documents, sometimes you want numbered headings, but the UI makes you a new list each time.
// INSIGHT: it's possible, but you have to script it.
// SOLUTION: this script adds OL+LI to Hs, all using the same listID
// DOWNLOAD: get the latest version of this gist from https://gist.github.com/mengwong/f597d064366f555b5f4e
// INSTALL: Go to Tools / Editor. Paste this in. Hit save. You can run it by pressing the "play" button, or from the Add-Ons menu.
//
// USAGE:
// REQUIRED: Define all your headings as actual headings and not just big bold Normal. Come on, people, learn to use paragraph styles already.
// OPTIONAL: Manually make the first H1 in the document a numbered list. We'll use that as a reference heading for all the others.
// OPTIONAL: Manually set the list style to "Decimal Outline" (the style that has 1.1.2 type numbering) ... I like this best.