Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation #9

Open
woodcox opened this issue Jun 19, 2023 · 1 comment
Open

Documentation #9

woodcox opened this issue Jun 19, 2023 · 1 comment

Comments

@woodcox
Copy link
Contributor

woodcox commented Jun 19, 2023

What do you think about auto generating some .md files to help with documentation? So that instead of saying the following in the README.md:

Most of the names follow the same naming convention as open props CSS variables, except the -- is replaced with $. You can find the values of all props by inspecting the scss files on npm.

You could have:

You can find the values of all the props in the relevant markdown file below:

This could be done by adding the following to generateScss.mjs.

const writeSCSSModule = async (moduleName, content) => {
  const outFile = path.join(__dirname, `${moduleName}.scss`);
  await fs.writeFile(outFile, content, { encoding: 'utf-8' });
};

// md codeblock
const writeMDCodeBlock = async (moduleName, content) => {
  const outFile = path.join(__dirname, `${moduleName}.md`);
  const codeBlock = '```scss\n' + content + '\n```';
  await fs.writeFile(outFile, codeBlock, { encoding: 'utf-8' });
};
// ...

// write scss & md files
  await writeSCSSModule(moduleName, generatedScss);
  await writeMDCodeBlock(moduleName, generatedScss);
// ...

It might also help to add prettier for the formatting.

@mayank99
Copy link
Owner

I'm not convinced about this. It's more work to maintain, for not much benefit. If the scss output is not super readable, then I can run prettier on it before publishing next time. Is there anything else I'm missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants