Skip to content

Commit

Permalink
Separate functions into different pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
etefera committed Sep 8, 2020
1 parent 82e7287 commit 038b5f1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,51 +26,43 @@ function tableByType(type) {
return table(t);
}

const README = `---
title: "Functions Catalog"
linkTitle: "Functions Catalog"
weight: 6
type: docs
description: >
Catalog of Config Functions.
---
<!---
DO NOT EDIT. Generated by: "cd catalog; npm run gen-docs"
-->
This repository documents a catalog of functions implementing the
[Configuration Functions Specification][spec].
Run functions either imperatively or declaratively by following the
[Functions User Guide].
Implement configuration functions using any toolchain such as the
[Typescript SDK][ts sdk] or [Golang Libraries][go libs].
const descriptions = {
"source": `
A Source Function takes no \`input\`:
## Sources
{{< png src="images/source" >}}
See [definition of source functions][source].
Instead, the function typically produces the \`output\` by reading configurations
from an external system (e.g. reading files from a filesystem).`,
"sink": `
A Sink Function produces no \`output\`:
${tableByType('source')}
{{< png src="images/sink" >}}
## Sinks
See [definition of sink functions][sink].
${tableByType('sink')}
## Validators
Instead, the function typically writes configurations to an external system
(e.g. writing files to a filesystem).
`
}

${tableByType('validator')}
const name = process.argv[2]

## Generators
const README = `---
title: "${name} Functions Catalog"
linkTitle: "${name} Functions Catalog"
weight: 7
type: docs
description: >
Catalog of ${name} Functions.
---
<!---
DO NOT EDIT. Generated by: "cd ../catalog; npm run gen-docs"
-->
${tableByType('generator')}
${descriptions[name.toLowerCase()] || ""}
## Transformers
## ${name} functions
${tableByType('transformer')}
${tableByType(name.toLowerCase())}
## Next Steps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "Apache-2.0",
"main": "index_generator.js",
"scripts": {
"gen-docs": "node index_generator.js > ../_index.md"
"gen-docs": "node index_generator.js Source > ../sources/_index.md; node index_generator.js Sink > ../sinks/_index.md; node index_generator.js Generator > ../generators/_index.md; node index_generator.js Transformer > ../transformers/_index.md; node index_generator.js Validator > ../validators/_index.md"
},
"dependencies": {
"markdown-table": "^1.1.3"
Expand Down

0 comments on commit 038b5f1

Please sign in to comment.