Skip to content

Commit

Permalink
change documentation directory architecture to handle components on r…
Browse files Browse the repository at this point in the history
…oot directory
  • Loading branch information
FabienArcellier committed May 27, 2024
1 parent 9b00bf8 commit abc6feb
Show file tree
Hide file tree
Showing 125 changed files with 8 additions and 125 deletions.
16 changes: 8 additions & 8 deletions docs/codegen/generator_components_pages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,32 @@ import * as core from "./core.js";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const docDirectory = path.resolve(__dirname, "..", "docs");
const docComponentsDirectory = path.resolve(docDirectory, "components");
// const frameworkDirectory = path.resolve(__dirname, "..", "framework");
const componentsDirectory = path.resolve(__dirname, "..", "components");


export async function generate() {
// eslint-disable-next-line no-console
console.log("generate doc components pages into", docComponentsDirectory);
console.log("generate doc components pages into", componentsDirectory);
nunjucks.configure({ autoescape: true });

if (!fs.existsSync(docComponentsDirectory)) {
fs.mkdirSync(docComponentsDirectory);
if (!fs.existsSync(componentsDirectory)) {
fs.mkdirSync(componentsDirectory);
}

components.map((component) => {
// eslint-disable-next-line prettier/prettier
const componentPageTemplate = path.resolve(docComponentsDirectory, "component_page.mdx.tpl");
const componentPageTemplate = path.resolve(componentsDirectory, "component_page.mdx.tpl");
const page = fs.readFileSync(componentPageTemplate, "utf8");

component.low_code_usage = core.generateLowCodeUsage(component)
component.event_handler = core.generateEventHandler()

const renderedPage = nunjucks.renderString(page, component);

const componentPath = path.resolve(docComponentsDirectory, `${component.type}.mdx`);
const componentPath = path.resolve(componentsDirectory, `${component.type}.mdx`);
fs.writeFileSync(componentPath, renderedPage);
});
}

generate();
generate();
File renamed without changes.
2 changes: 0 additions & 2 deletions docs/docs/components/.gitignore

This file was deleted.

115 changes: 0 additions & 115 deletions docs/docs/components/component_page.md.tpl

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit abc6feb

Please sign in to comment.