| 1234567891011121314151617181920212223242526272829303132333435363738 |
- // ==============================================================================
- // VOC 验证报告 · Ch4 定位与话术 · 5 子章(快照模式)
- // 详见 ch2-package.js 头部说明。
- // ==============================================================================
- const fs = require('fs');
- const path = require('path');
- let _snapshot = null;
- function getSnapshot() {
- if (!_snapshot) {
- _snapshot = JSON.parse(fs.readFileSync(
- path.join(__dirname, '..', '_slides-snapshot.json'), 'utf8',
- ));
- }
- return _snapshot;
- }
- function fromSnapshot(id, slideNum) {
- const sec = getSnapshot()[id];
- if (!sec) {
- return `<section class="report-section" id="${id}" data-slide-num="${slideNum}"><div class="section-inner"><h2 class="text-h1">[Missing] ${id}</h2></div></section>`;
- }
- return sec.html.replace(/data-slide-num="[^"]+"/, `data-slide-num="${slideNum}"`);
- }
- function renderPositioning1DMY({ slideNum } = {}) { return fromSnapshot('positioning-1', slideNum); }
- function renderPositioning2Safety({ slideNum } = {}) { return fromSnapshot('positioning-2', slideNum); }
- function renderPositioning3Antidote({ slideNum } = {}) { return fromSnapshot('positioning-3', slideNum); }
- function renderPositioning4Social({ slideNum } = {}) { return fromSnapshot('positioning-4', slideNum); }
- function renderPositioning5Channel({ slideNum } = {}) { return fromSnapshot('positioning-5', slideNum); }
- module.exports = {
- renderPositioning1DMY,
- renderPositioning2Safety,
- renderPositioning3Antidote,
- renderPositioning4Social,
- renderPositioning5Channel,
- };
|