UNPKG

4.62 kBMarkdownView Raw
1# React Transcript Editor
2
3<!-- _One liner_ -->
4A React component to make transcribing audio and video easier and faster.
5
6_--> Work in progress <--_
7
8<!-- _Screenshot of UI - optional_ -->
9
10## Development env
11
12 <!-- _How to run the development environment_ -->
13
14- npm > `6.1.0`
15- [Node 10 - dubnium](https://scotch.io/tutorials/whats-new-in-node-10-dubnium)
16
17Node version is set in node version manager [`.nvmrc`](https://github.com/creationix/nvm#nvmrc)
18
19<!-- _Coding style convention ref optional, eg which linter to use_ -->
20
21<!-- _Linting, github pre-push hook - optional_ -->
22
23
24## Setup
25
26<!-- _stack - optional_ -->
27<!-- _How to build and run the code/app_ -->
28
29Fork this repository + git clone + cd into folder
30
31## Usage - development
32
33<!-- git clone git@github.com:bbc/react-transcript-editor.git -->
34
35> To start the development server (with entry point `src/index.js`), run
36
37```
38npm start
39```
40
41
42## Usage - production
43
44<!-- npm install react-transcript-editor -->
45
46<!-- exampel usage - require etc.. -->
47<!-- https://www.npmjs.com/package/@bbc/react-transcript-editor -->
48
49Available on [npm - `@bbc/react-transcript-editor`](https://www.npmjs.com/package/@bbc/react-transcript-editor)
50
51```
52npm install @bbc/react-transcript-editor
53```
54
55```js
56import { TranscriptEditor } from '@bbc/react-transcript-editor';
57
58<TranscriptEditor
59 transcriptData=// Transcript json
60 mediaUrl=// string url to media file - audio or video
61 isEditable={true}// se to true if you want to be able to edit the text
62 sttJsonType={ 'bbcKaldi' }// the type of STT Json transcript supported.
63/>
64```
65
66## System Architecture
67
68<!-- _High level overview of system architecture_ -->
69
70uses [`create-component-lib`](https://www.npmjs.com/package/create-component-lib) as explaied in this [blog post](https://hackernoon.com/creating-a-library-of-react-components-using-create-react-app-without-ejecting-d182df690c6b) to setup the environment to develop this React.
71
72This uses [Create React App 2.0](https://reactjs.org/blog/2018/10/01/create-react-app-v2.html) so we are using [CSS Modules](https://github.com/css-modules/css-modules) to contain the scope of the css for this component.
73<!--
74Uses CSS grid-layout https://medium.com/samsung-internet-dev/common-responsive-layouts-with-css-grid-and-some-without-245a862f48df -->
75
76> Place everything you want to publish to npm inside `src/lib`.
77
78> Outside `src/lib` (but inside src/), you can create example web pages to test or demonstrate the usage of your components.
79
80## Documentation
81
82There's a [docs](./docs) folder in this repository.
83
84[docs/notes](./docs/notes) contains dev notes on various aspects of the project.
85
86[docs/adr](./docs/adr) contains [Architecture Decision Record](https://github.com/joelparkerhenderson/architecture_decision_record).
87
88> An architectural decision record (ADR) is a document that captures an important architectural decision made along with its context and consequences.
89
90We are using [this template for ADR](https://gist.github.com/iaincollins/92923cc2c309c2751aea6f1b34b31d95)
91
92
93## Build
94
95<!-- _How to run build_ -->
96
97> To transpile `src/lib` and create a build in the dist folder, run:
98
99```
100npm run build:component
101```
102
103## Demo
104
105Demo can be viewed at [https://bbc.github.io/react-transcript-editor](https://bbc.github.io/react-transcript-editor)
106
107<!-- https://github.com/gitname/react-gh-pages
108-->
109
110
111## build - demo
112
113This github repository uses [github pages](https://pages.github.com/) to host a demo of the component, in [docs/demo](./docs/demo)
114
115```
116npm run deploy:ghpages
117```
118
119add to git, and push to origin master to update
120
121<!-- https://help.github.com/articles/user-organization-and-project-pages/#project-pages-sites -->
122
123Alternatively If you simply want to build the demo locally in the `build` folder then just
124
125```
126npm run build:example
127```
128
129## Tests
130
131<!-- _How to carry out tests_ -->
132
133Test coverage using [`jest`](https://jestjs.io/), to run tests
134
135 ```
136 npm run test
137 ```
138
139## Deployment
140
141<!-- _How to deploy the code/app into test/staging/production_ -->
142
143To push to [npm - `@bbc/react-transcript-editor`](https://www.npmjs.com/package/@bbc/react-transcript-editor)
144
145```
146npm publish:public
147```
148
149This runs `npm run build:component` and `npm publish --access public` under the hood
150
151> Note that only `README.md` and the `dist` folders are published to npm.
152
153
154## Contributing
155
156<!-- Contributing guidance, and link to contributing code of conduct -->
157
158## Licence
159
160<!-- mention MIT Licence -->
161
162
163<!-- ## Legal Disclaimer
164
165Despite using React and Draftjs, the BBC is not promoting any FB product or other commercial interest. -->
\No newline at end of file