Skip to content

Commit

Permalink
simplify markdown invocations
Browse files Browse the repository at this point in the history
  • Loading branch information
drewdaemon committed Jun 7, 2024
1 parent efebbdf commit 6fde98f
Show file tree
Hide file tree
Showing 2 changed files with 1,001 additions and 1,092 deletions.
7 changes: 4 additions & 3 deletions packages/kbn-text-based-editor/scripts/generate_esql_docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ function writeFunctionDocs(functionDocs: Map<string, string>) {
),
description: (
<Markdown
readOnly
markdownContent={i18n.translate(
'textBasedEditor.query.textBasedLanguagesEditor.documentationESQL.${name}.markdown',
{
Expand All @@ -78,7 +77,9 @@ function writeFunctionDocs(functionDocs: Map<string, string>) {

const pathToDocsFile = path.join(__dirname, '../src/esql_documentation_sections.tsx');

const ast = recast.parse(fs.readFileSync(pathToDocsFile, 'utf-8'));
const ast = recast.parse(fs.readFileSync(pathToDocsFile, 'utf-8'), {
parser: require('recast/parsers/babel'),
});

const functionsList = findFunctionsList(ast);

Expand Down Expand Up @@ -134,7 +135,7 @@ function findFunctionsList(ast: any): recast.types.namedTypes.ArrayExpression {
}
return false;
},
visitProperty(astPath) {
visitObjectProperty(astPath) {
if (
n.Identifier.check(astPath.node.key) &&
astPath.node.key.name === 'items' &&
Expand Down
Loading

0 comments on commit 6fde98f

Please sign in to comment.