Skip to main content

@dataset.sh/cmd-output

@dataset.sh/cmd-output can render console command and its output using React.

Install

yarn
yarn add @dataset.sh/cmd-output
npm
npm install @dataset.sh/cmd-output
pnpm
pnpm install @dataset.sh/cmd-output

Examples:

datafact experimental auto-doc
datafact new datafact-tutorial/hello-world -t hello-world
Click to show output

Code:

import {ConsoleCommand} from "@dataset.sh/cmd-output";

function MyPage() {
return <>
<ConsoleCommand input={'datafact experimental auto-doc'}/>
<ConsoleCommand
input={'datafact new datafact-tutorial/hello-world -t hello-world'}
output={
[`
where to create this project [./datafact-tutorial/hello-world]:
Project created successfully.
# datafact template: hello world

This dataset is built by the datafact template: \`hello-world\`,
it provides a simple collection of "Hello World" translations in various languages.
It serves as a practical example for demonstrating the functionalities of the dataset.sh library.


# Create and publish dataset

This folder contains a project created by datafact (DATAset FACTory),

You can use this project to build and publish your dataset to [dataset.sh](https://dataset.sh)

## How to modify this project

You will need to modify the following 3 files to create, build, and, publish your own dataset:

* data.py
Implement a function called \`create_data_dict\` which produce the content of your dataset.

* type.py
Provide your type annotation in the \`data_types\` dictionary in this file.

* README.md
Provide the readme document of your dataset in this file.

## Build Dataset

To build your dataset, use command:

\`\`\`shell
python project.py build
\`\`\`

## Publish Dataset

To publish your dataset, use command:

\`\`\`shell
python project.py publish
\`\`\`
`]
}

/>

</>
}