-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Update API docs generation script to comply with new docs format (…
…#109343) (#109781) * [ML] update deps * [ML] fix script * [ML] add header * [ML] generate header Co-authored-by: Dima Arnautov <[email protected]>
- Loading branch information
1 parent
e4fa7e4
commit f57fa6d
Showing
9 changed files
with
157 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
x-pack/plugins/ml/server/routes/apidoc_scripts/header_generator.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import * as fs from 'fs'; | ||
import * as path from 'path'; | ||
import moment from 'moment'; | ||
|
||
const getHeaderString = () => `--- | ||
id: uiMlApi | ||
slug: /ml-team/docs/ui/rest-api/ml-api | ||
title: ML API reference | ||
description: Reference documentation for the ML API. | ||
date: ${moment().format('YYYY-MM-DD')} | ||
tags: ['machine learning','internal docs', 'UI'] | ||
---`; | ||
|
||
fs.writeFileSync(path.resolve(__dirname, '..', 'header.md'), getHeaderString()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
<% if (header) { -%> | ||
<%- header %> | ||
<% } -%> | ||
|
||
<a name="top"></a> | ||
# <%= project.name %> v<%= project.version %> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
{ | ||
"extends": "../../../../../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"outDir": "./target/types" | ||
"outDir": "./target" | ||
}, | ||
"include": [ | ||
"schema_worker.ts", | ||
"schema_parser.ts", | ||
"schema_extractor.ts", | ||
"version_filter.ts" | ||
"version_filter.ts", | ||
"types.ts", | ||
"header_generator.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.