Skip to content

Commit

Permalink
Featured: filter generator
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaly.basaraba committed Jan 19, 2025
1 parent d8fcd91 commit ca39aea
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions helpers/generateTextLesson.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ const videosLinks = videoQuestions
.map(q => `- [${q.title}](${q.url})`)
.join('\n');

// Counts
const levelsCount = uniqueLevels.size;
const themesCount = uniqueThemes.size;
const videosCount = videoQuestions.length;

// Convert the array of objects to Markdown format
const markdownContent = data.map(obj => {
const titleWithLink = obj.link ? `[${obj.title}](${obj.link})` : obj.title;
Expand All @@ -133,13 +138,13 @@ const markdownContent = data.map(obj => {
const readmeContent = `
# javascript-questions-pro (${totalQuestions} questions)
## [Levels](./level/)
## [Levels](./level/) (${levelsCount})
${levelsLinks}
## [Themes](./theme/)
## [Themes](./theme/) (${themesCount})
${themesLinks}
## [Tutorials with Videos](./video/)
## [Tutorials with Videos](./video/) (${videosCount})
${videosLinks}
## All questions
Expand Down

0 comments on commit ca39aea

Please sign in to comment.