Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi committed Jan 6, 2023
1 parent 4ea1e2c commit d777fd4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 26 deletions.
33 changes: 10 additions & 23 deletions packages/docs/docs/tutorials/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,19 @@ being called.
You can also run each example locally. It should be noted that `Cornerstone3D` is a
monorepo and contains three packages (`core`, `tools`, `streaming-image-volume`). Examples
for each of these packages are included in the `examples` directory inside each package.
To run the example you need to change directory to the package root and run `yarn run example ExampleName` (this is a limitation
and we will be working on a better solution to run examples from the root of the monorepo).
You can run each example by using its name as an argument to the `example` script. For instance,
It should be noted that the example name is not case sensitive, and even it can
suggest the name of the example you are looking for if you make a typo.

```bash

1. Clone the repository
2. `yarn install`
3. Run example
- For `core` examples:
```bash
cd packages/core
yarn run example ExampleName
# for instance:
# yarn run example volumeAPI
```
- For `tools` examples:
```bash
cd packages/tools
yarn run example ExampleName
# for instance:
# yarn run example petCt
```
- For `streaming-image-volume` examples:
```bash
cd packages/streaming-image-volume
yarn run example ExampleName
```
3. `yarn run example petct` // this should be run from the root of the repository

```

:::note Important
Example names are case sensitive, and they match their folder name
Use the root of the repository as the working directory when running the example.
Previously, you had to run the example in each package directory. This is no longer the case.
:::
2 changes: 2 additions & 0 deletions utils/ExampleRunner/example-runner-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ if (configuration.examples) {
validPath(rootPath),
validPath(exBasePath)
);

// console.log('conf', conf);
shell.ShellString(conf).to(webpackConfigPath);
shell.cd(exBasePath);
shell.exec(`webpack serve --progress --config ${webpackConfigPath}`);
Expand Down
6 changes: 3 additions & 3 deletions utils/ExampleRunner/template-config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const path = require('path');

const csRenderBasePath = path.resolve('../core/src/index');
const csToolsBasePath = path.resolve('../tools/src/index');
const csRenderBasePath = path.resolve('packages/core/src/index');
const csToolsBasePath = path.resolve('packages/tools/src/index');
const csStreamingBasePath = path.resolve(
'../streaming-image-volume-loader/src/index'
'packages/streaming-image-volume-loader/src/index'
);

module.exports = function buildConfig(
Expand Down

0 comments on commit d777fd4

Please sign in to comment.