@ulu/sassdoc-to-markdown
Version:
A flexible SCSS documentation tool that generates clean, customizable Markdown from your Sass stylesheets. It leverages SassDoc for data extraction and offers various configuration options to tailor the output to your specific needs
29 lines (25 loc) • 665 B
JavaScript
import { table, headline } from "@ulu/markdown-output-utils";
const config = {
formatCell: (header, data) => {
return header === "type" ? `\`${ data }\`` :
header === "name" && data !== "@content" ? `$${ data }` :
data ? data.toString().trim() : "";
}
}
export default ({ item, headlineLevel }) => {
const { parameter, content } = item.data;
if (parameter) {
const rows = [ ...parameter ];
if (content) {
rows.push({
name: "@content",
type: "content block",
description: content
});
}
return `
${ headline("Parameters", headlineLevel) }
${ table(rows, config) }
`;
}
}