Skip to content

Commit 3f15ad5

Browse files
committed
some fine tuning
1 parent 8e569eb commit 3f15ad5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/format/html/format-html-notebook.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const kQuartoNbClass = "quarto-notebook";
4646
const kQuartoCellContainerClass = "cell-container";
4747
const kQuartoCellDecoratorClass = "cell-decorator";
4848

49+
// Post processes the notebook and adds 'notebook' style affordances
4950
export function notebookViewPostProcessor() {
5051
return (doc: Document): Promise<HtmlPostProcessResult> => {
5152
doc.body.classList.add(kQuartoNbClass);
@@ -80,6 +81,7 @@ export function notebookViewPostProcessor() {
8081
};
8182
}
8283

84+
// Processes embeds within an HTML page and emits notebook previews as apprpriate
8385
export async function processNotebookEmbeds(
8486
doc: Document,
8587
format: Format,
@@ -98,6 +100,7 @@ export async function processNotebookEmbeds(
98100
let count = 1;
99101
const services = renderServices();
100102

103+
// Emit links to the notebooks inline (where the embedded content is located)
101104
const linkedNotebooks: string[] = [];
102105
for (const nbDivNode of notebookDivNodes) {
103106
const nbDivEl = nbDivNode as Element;
@@ -168,6 +171,7 @@ export async function processNotebookEmbeds(
168171
}
169172
}
170173

174+
// Emit global links to the notebooks
171175
if (global) {
172176
const containerEl = doc.createElement("div");
173177
containerEl.classList.add("quarto-alternate-notebooks");
@@ -248,6 +252,7 @@ function notebookViewConfig(
248252
};
249253
}
250254

255+
// Renders an HTML preview of a notebook
251256
async function renderHtmlView(
252257
path: string,
253258
options: NotebookViewOptions,

0 commit comments

Comments
 (0)