Skip to content
This repository was archived by the owner on Dec 8, 2025. It is now read-only.

Commit 36a6dc1

Browse files
committed
generate markdown pages for all services, including infrastructure
1 parent e2011da commit 36a6dc1

1 file changed

Lines changed: 29 additions & 4 deletions

File tree

compiler/src/specgen.ts

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,20 +182,45 @@ export function preludeFiles(specs?: jdspec.ServiceSpec[]) {
182182
}
183183

184184
function specToMarkdown(info: jdspec.ServiceSpec): string {
185-
if (ignoreSpec(info)) return undefined
186-
187185
const { status, camelName } = info
188-
const reserved: Record<string, string> = { switch: "sw" }
189186

187+
const reserved: Record<string, string> = { switch: "sw" }
190188
const clname = upperCamel(camelName)
191189
const varname = reserved[camelName] || camelName
192190
const baseclass = info.extends.indexOf("_sensor") >= 0 ? "Sensor" : "Role"
193191

192+
if (status === "deprecated") {
193+
return `---
194+
pagination_prev: null
195+
pagination_next: null
196+
hide_table_of_contents: true
197+
---
198+
# ${clname}
199+
200+
The [${info.name} service](https://microsoft.github.io/jacdac-docs/services/${info.shortId}/) is deprecated and not supported in DeviceScript.
201+
202+
`
203+
}
204+
205+
if (ignoreSpec(info)) {
206+
return `---
207+
pagination_prev: null
208+
pagination_next: null
209+
hide_table_of_contents: true
210+
---
211+
# ${clname}
212+
213+
The [${info.name} service](https://microsoft.github.io/jacdac-docs/services/${info.shortId}/) is used internally by the runtime
214+
and is not directly programmable in DeviceScript.
215+
216+
`
217+
}
218+
194219
let r: string[] = [
195220
`---
196221
pagination_prev: null
197222
pagination_next: null
198-
---
223+
---
199224
# ${clname}
200225
`,
201226
status !== "stable" && info.shortId[0] !== "_"

0 commit comments

Comments
 (0)