Fix guide editor issues 4-10
Template tests / tests (pull_request) Has been cancelled
Template tests / tests (push) Has been cancelled

This commit is contained in:
Iisyourdad
2026-06-12 11:07:57 -05:00
parent d966ac762d
commit f88ff0259e
22 changed files with 598 additions and 174 deletions
+18 -1
View File
@@ -5,6 +5,7 @@ const path = require('node:path');
const { slugify } = require('../core/util');
const { encodePng } = require('../core/png');
const { renderStepImage } = require('../core/renderast');
const { orderedBlocks, blockText } = require('../core/blocks');
/**
* Shared exporter helpers: every image-bearing exporter renders annotated
@@ -50,6 +51,22 @@ function renderAllImages(ast) {
return result;
}
function stepBlocks(step) {
return step.blocks || orderedBlocks(step);
}
function codeBlockText(block) {
return blockText(block);
}
const LEVEL_LABEL = { info: 'Note', warn: 'Warning', error: 'Important', success: 'Tip' };
module.exports = { guideSlug, imagesDirName, writeStepImages, renderAllImages, LEVEL_LABEL };
module.exports = {
guideSlug,
imagesDirName,
writeStepImages,
renderAllImages,
stepBlocks,
codeBlockText,
LEVEL_LABEL,
};