diff --git a/convert.go b/convert.go index 1238556..1edf6ac 100644 --- a/convert.go +++ b/convert.go @@ -185,12 +185,19 @@ func ConvertString(writer io.Writer, notebookString string) error { "convertPrompt": convertPrompt, "convertInput": convertInput, "convertOutput": convertOutput, + "getCellClasses": func(cell cell) string { + return "cell cell-" + cell.CellType + }, + "getOutputClasses": func(output output) string { + outputTypeClass := strings.ReplaceAll(output.OutputType, "_", "-") + return "output output-" + outputTypeClass + }, }) t, err = t.Parse(`
{{ $fileExtension := .fileExtension }} {{ range .notebook.Cells }} -
+
{{ .ExecutionCount | convertPrompt }} @@ -204,7 +211,7 @@ func ConvertString(writer io.Writer, notebookString string) error {
{{ .ExecutionCount | convertPrompt }}
-
+
{{ . | convertOutput }}