mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
refactor(tools,client): remove head and tail logic (#66524)
This commit is contained in:
@@ -10,11 +10,9 @@ const props = {
|
||||
contents: '',
|
||||
editableRegionBoundaries: [0, 2],
|
||||
ext: 'html',
|
||||
head: '',
|
||||
id: '',
|
||||
key: 'indexhtml',
|
||||
name: 'index',
|
||||
tail: ''
|
||||
name: 'index'
|
||||
}
|
||||
],
|
||||
stepNum: 5,
|
||||
|
||||
@@ -33,8 +33,6 @@ export interface ChallengeSeed {
|
||||
contents: string;
|
||||
ext: string;
|
||||
editableRegionBoundaries: number[];
|
||||
head?: string;
|
||||
tail?: string;
|
||||
}
|
||||
|
||||
// Build the base markdown for a step
|
||||
@@ -56,20 +54,8 @@ function getStepTemplate({
|
||||
})
|
||||
.join('\n');
|
||||
|
||||
const seedHeads = challengeSeeds
|
||||
.filter(({ head }) => head)
|
||||
.map(({ ext, head }) => getCodeBlock(ext, head))
|
||||
.join('\n');
|
||||
|
||||
const seedTails = challengeSeeds
|
||||
.filter(({ tail }) => tail)
|
||||
.map(({ ext, tail }) => getCodeBlock(ext, tail))
|
||||
.join('\n');
|
||||
|
||||
const stepDescription = `step ${stepNum} instructions`;
|
||||
const seedChallengeSection = getSeedSection(seedTexts, 'seed-contents');
|
||||
const seedHeadSection = getSeedSection(seedHeads, 'before-user-code');
|
||||
const seedTailSection = getSeedSection(seedTails, 'after-user-code');
|
||||
|
||||
const demoString = isFirstChallenge
|
||||
? `
|
||||
@@ -99,10 +85,7 @@ ${stepDescription}
|
||||
Test 1
|
||||
|
||||
${getCodeBlock('js')}
|
||||
# --seed--` +
|
||||
seedChallengeSection +
|
||||
seedHeadSection +
|
||||
seedTailSection
|
||||
# --seed--` + seedChallengeSection
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user