 		var currentHtml: String = ""
 		var inlineHtml: [String] = []
 		var output: String = ""
+		var outputIsValid: Bool = false
 	}
 
 	private struct SavedCacheEntry: Codable, FetchableRecord, TableRecord, PersistableRecord {

				}
				continue
			}
			guard chunk.chunkType == .code else { continue }
			let currentHtml = htmlForChunk(chunkNumber: chunkNumber)
			if chunkInfo[chunkNumber].currentHtml != currentHtml {
				if let changedIndex = changedChunks.firstIndex(where: { $0 == chunkNumber }) {

		}
		changedChunks.sort()
	}
	
	/// Called to notify a chunk will be execute. Invalidates the output of all code chunks that foillow
	/// - Parameter chunkIndex: the chunkIndex
	public func willExecuteChunk(chunkIndex: Int) {
		precondition(chunkInfo.indices.contains(chunkIndex))
		// invalidate all future code chunks
		for idx in chunkIndex...chunkInfo.count where chunkInfo[idx].type == .code {
			chunkInfo[idx].outputIsValid = false
		}

	}
	
	/// Reports if the specified's output is valid and doesn't need updating
	/// - Parameter number: the chunk number
	/// - Returns: true if the otuput is known to be valid
	public func isChunkOutputValid(chunkIndex: Int) -> Bool {
		chunkInfo[chunkIndex].outputIsValid
	}
	
	private func inlineHtmlFor(chunk: RmdDocumentChunk, parent: RmdDocumentChunk) -> String {
		// just return nothing if not code
		guard chunk.isInline else { return "" }
		guard chunk.chunkType == .inlineCode else {
			// for inline equations, just return the source
			return document.string(for: chunk)
		}
		// TODO: generate actual code. need to be able to tell what context to use
		let parHTML = document.string(for: chunk, type: .outer)
		return parHTML
	}
