Fix guide editor issues 4-10
This commit is contained in:
+18
-1
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user