Refactor icon comment generation to conditionally include category and tags in markdown table based on icon type, enhancing clarity and organization.
This commit is contained in:
parent
bccc80e934
commit
39b30d7109
|
|
@ -55,8 +55,8 @@ function generateIconsTable(icons, type) {
|
|||
|
||||
const typeName = type === 'outline' ? 'Outline' : 'Filled'
|
||||
let markdown = `### ${typeName} Icons (${icons.length})\n\n`
|
||||
markdown += `| Icon | Name | Category | Tags |\n`
|
||||
markdown += `|------|------|------|------|\n`
|
||||
markdown += `| Icon | Name ${type === 'outline' ? '| Category | Tags ' : ''}|\n`
|
||||
markdown += `|------|------${type === 'outline' ? '|------|------' : ''}|\n`
|
||||
|
||||
icons.forEach(iconPath => {
|
||||
const iconName = basename(iconPath, '.svg')
|
||||
|
|
@ -67,7 +67,7 @@ function generateIconsTable(icons, type) {
|
|||
const tags = data.tags || []
|
||||
|
||||
// Use GitHub raw file URL - GitHub Comments support external image URLs
|
||||
markdown += `| <img src="${rawUrl}" width="240" height="240" alt="${iconName}" /> | \`${iconName}.svg\` | ${category || '❌ No category'} | ${tags.join(', ') || '❌ No tags' } |\n`
|
||||
markdown += `| <img src="${rawUrl}" width="240" height="240" alt="${iconName}" /> | \`${iconName}.svg\`${type === 'outline' ? ` | ${category || '❌ No category'} | ${tags.join(', ') || '❌ No tags' }` : ''}|\n`
|
||||
})
|
||||
markdown += `\n`
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue