Skip to content

Commit 6bcf4ef

Browse files
fix: readme
1 parent aab750f commit 6bcf4ef

2 files changed

Lines changed: 31 additions & 28 deletions

File tree

‎README.md‎

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,48 @@
1717
</h3>
1818

1919
## What
20-
> **Have you ever got lost in a big or unknown codebase?** This tool will help you to solve that, as well as increase your development speed and quality of application architecture you build.
20+
> **Have you ever got lost in a big or unknown codebase?** This tool will help you to solve that. Also, it will increase your development speed and give more knowledge about your application architecture.
2121
>
22-
>**How it works?** You run `codecrumbs` command for a codebase, it analyzes source code and build its visual representation. Put a codecrumb-comment and codebase state will be reflected by visual client in browser on the fly.
22+
>**How it works?** You run `codecrumbs` command for a codebase, it analyzes source code and build its visual representation. Write down a codecrumb-comment and codebase state will be reflected by visual client in browser on the fly.
2323
>
2424
>-[@bliashenko](https://twitter.com/bliashenko)
2525
2626
## Demo
27-
Check out [**standalone version running here**](https://codecrumbs.io/) with defined trail of codecrumbs.
27+
Check out the example of [**standalone version running here**](https://codecrumbs.io/).
2828

2929
[<img src="/docs/codecrumbs-ui.png" width="800"/>](https://codecrumbs.io/)
3030

3131
## Get started
3232
#### Install and run
3333
>Pre-condition: update/install `NodeJS` version to be >= *8.11.1*
3434
35-
Install ```codecrumbs``` globally or in ```devDependencies```:
36-
```yarn add codecrumbs -D```
35+
1) Install ```codecrumbs``` *globally* (```yarn global codecrumbs```) or to *devDependencies* (```yarn add codecrumbs -D```)
36+
2) Run ```codecrumbs -d project-src-dir -e project-src-dir/index.js```. Change parameters to match your project:```-d``` is *directory with source code*, ```-e``` is *entry point file* .
37+
3) Go to [http://localhost:2018](http://localhost:2018/#) in the browser to check it out.
3738

38-
Add command with **entry file** and **source directory** to ```scripts``` section in your ```package.json```. Change ```-e``` (entry point file), ```-d``` (directory) params to match paths inside your project.
39-
```javascript
40-
// package.json
41-
...
42-
"scripts": {
43-
"start:cc": "codecrumbs -e src/index.js -d src"
44-
}
45-
46-
```
47-
48-
Run ```yarn start:cc``` from the terminal. Go to [http://localhost:2018/#](http://localhost:2018/#) in the browser to check it out.
4939
#### CLI
50-
-- TBD --
40+
Parameter | Description | Example
41+
--- | --- | ---
42+
```-e```, ```--entry``` | Path to project source entry point file | ```-e src/app.js```
43+
```-d```, ```--dir``` | Path to project source code directory | ```-d src```
44+
```-p```, ```--port``` | Port for Codecrumbs client (optional, default *2018*) | ```-p 2019```
45+
```-n```, ```--projectName``` | Project name alias (optional, default same as ```-d``` value) | ```-n my-hello-world```
46+
```-f```, ```--parserFallback``` | AST parser fallback, applicable only for JavaScript project, use it when @babel-parse fails (optional, default *false*) | ```-f true```
5147

5248
## Features
53-
#### Breadcrumbs
54-
Write ```//cc:here is breadcrumb``` to put a simple breadcrumb in the code. ```cc``` (stands for "codecrumb") is the prefix which used by the parser, and ```here is breadcrumb``` is a title of our first breadcrumb.
55-
> Note: current version supports single line comments only.
49+
#### Breadcrumbs and trail of breadcrumbs
50+
Leave breadcrumb in code by writing down a comment: ```//cc:[parameters;]```.
51+
52+
```cc``` (stands for "CodeCrumb") is a prefix which used by the parser; check example of parameters in the table below:
53+
54+
Example | Description | Use case
55+
--- | --- | ---
56+
```//cc:remember place``` | simple breadcrumb, ```remember place``` is a title of our first breadcrumb | Mark an important place to not forget where it was
57+
```//cc:here is bug;well, seems like a bug in logic``` | simple breadcrumb, ```well, seems like a bug in logic``` is details for breadcrumb, separated by ```;``` | Add extra information, will be rendered in popups
58+
```//cc:signin#3;enable route``` | trail of breadcrumbs,```signin``` is the **trail ID**, ```#3``` is order **number of step**, ```enable route``` is a title describing the step. | A sequence of codecrumbs, use to describe some data flow (e.g. user login, or form submit, etc.).
59+
```//cc:signin#1;firebase sign in;+2;do call to firebase with credentials``` | trail of breadcrumbs,```+2``` is number of lines to highlight, separated by ```;``` | Use number of lines to highlight the code related to breadcrumb
5660

57-
#### Trail of breadcrumbs
58-
Also, you can create “trail of breadcrumbs” — basically, a sequence of codecrumbs which follow some data flow (e.g. user login, or form submit, etc.).
59-
To create a codecrumb as part of a trail you write: ```//cc:signin#3;enable route``` where ```signin``` is the **trail ID**, ```#3``` is order **number of step**, ```enable route``` is a title describing the step.
61+
> Note: current version supports single line comments only.
6062
6163
<img src="/docs/live-changes.gif" width="800"/>
6264

@@ -80,12 +82,12 @@ So let’s say you put together some trail of codecrumbs describing some importa
8082
The tool (codecrumbs) allows us to learn, document and explain a codebase much faster. The ultimate goal is to have many case studies hosting at [https://codecrumbs.io](https://codecrumbs.io/). **The library of projects "explained with codecrumbs", the place for collaborative learning**. More features around that coming soon, stay tuned.
8183

8284
## Support
83-
Any support is very much appreciated! 👍 😘 ❤️
84-
8585
**Sponsors**: contact me if you want to become a sponsor ☺️
8686

8787
**Friends**: if you like this project, please, put a :star: or tweet about it. Thanks!
8888

89+
Any support is very much appreciated! 👍 😘 ❤️
90+
8991
## Contribute
9092
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the [owner](https://github.com/Bogdan-Lyashenko/) of this repository before making a change. Ideas and suggestions are welcome.
9193
To start development environment, clone the repo & run:
@@ -96,4 +98,5 @@ yarn && yarn start
9698
## WIP
9799
Next features are developing:
98100
- **eject codecrumbs** - ability to remove all "breadcrumbs" from source code in "one click"
101+
- **data transferring between cc trail steps**
99102
- **VS Code extension** - some neat features right inside the code editor. Checkout [the repo here](https://github.com/Bogdan-Lyashenko/vs-code-codecrumbs).

‎cli/index.cli.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ const colors = require('colors');
66
const server = require('../src/server');
77

88
program
9-
.option('-e, --entry [entryFile]', 'Specify path to entry point file. E.g. `./src/app.js`')
9+
.option('-e, --entry [entryFile]', 'Specify path to entry point file. E.g. `src/app.js`')
1010
.option(
1111
'-d, --dir [projectDir]',
12-
'Specify path to project source code directory. E.g. `./src`',
12+
'Specify path to project source code directory. E.g. `src`',
1313
''
1414
)
1515
.option(
1616
'-w, --webpack [webpackConfigFile]',
17-
'Specify path to webpack config file. E.g. ./webpack.config.js'
17+
'Specify path to webpack config file. E.g. webpack.config.js'
1818
)
1919
.option('-p, --port [defaultPort]', 'Specify port for Codecrumbs client. E.g. 3333', 2018)
2020
.option('-f, --parserFallback [astParserFallback]', 'Use AST parser fallback')

0 commit comments

Comments
 (0)