UNPKG

4.67 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
41Visit [http://localhost:3006](http://localhost:3006)
42
43
44## Usage - production
45
46<!-- npm install react-transcript-editor -->
47
48<!-- exampel usage - require etc.. -->
49<!-- https://www.npmjs.com/package/@bbc/react-transcript-editor -->
50
51Available on [npm - `@bbc/react-transcript-editor`](https://www.npmjs.com/package/@bbc/react-transcript-editor)
52
53```
54npm install @bbc/react-transcript-editor
55```
56
57```js
58import { TranscriptEditor } from '@bbc/react-transcript-editor';
59
60<TranscriptEditor
61 transcriptData=// Transcript json
62 mediaUrl=// string url to media file - audio or video
63 isEditable={true}// se to true if you want to be able to edit the text
64 sttJsonType={ 'bbcKaldi' }// the type of STT Json transcript supported.
65/>
66```
67
68## System Architecture
69
70<!-- _High level overview of system architecture_ -->
71
72uses [`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.
73
74This 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.
75<!--
76Uses CSS grid-layout https://medium.com/samsung-internet-dev/common-responsive-layouts-with-css-grid-and-some-without-245a862f48df -->
77
78> Place everything you want to publish to npm inside `src/lib`.
79
80> Outside `src/lib` (but inside src/), you can create example web pages to test or demonstrate the usage of your components.
81
82## Documentation
83
84There's a [docs](./docs) folder in this repository.
85
86[docs/notes](./docs/notes) contains dev notes on various aspects of the project.
87
88[docs/adr](./docs/adr) contains [Architecture Decision Record](https://github.com/joelparkerhenderson/architecture_decision_record).
89
90> An architectural decision record (ADR) is a document that captures an important architectural decision made along with its context and consequences.
91
92We are using [this template for ADR](https://gist.github.com/iaincollins/92923cc2c309c2751aea6f1b34b31d95)
93
94
95## Build
96
97<!-- _How to run build_ -->
98
99> To transpile `src/lib` and create a build in the dist folder, run:
100
101```
102npm run build:component
103```
104
105## Demo
106
107Demo can be viewed at [https://bbc.github.io/react-transcript-editor](https://bbc.github.io/react-transcript-editor)
108
109<!-- https://github.com/gitname/react-gh-pages
110-->
111
112
113## build - demo
114
115This github repository uses [github pages](https://pages.github.com/) to host a demo of the component, in [docs/demo](./docs/demo)
116
117```
118npm run deploy:ghpages
119```
120
121add to git, and push to origin master to update
122
123<!-- https://help.github.com/articles/user-organization-and-project-pages/#project-pages-sites -->
124
125Alternatively If you simply want to build the demo locally in the `build` folder then just
126
127```
128npm run build:example
129```
130
131## Tests
132
133<!-- _How to carry out tests_ -->
134
135Test coverage using [`jest`](https://jestjs.io/), to run tests
136
137 ```
138 npm run test
139 ```
140
141## Deployment
142
143<!-- _How to deploy the code/app into test/staging/production_ -->
144
145To push to [npm - `@bbc/react-transcript-editor`](https://www.npmjs.com/package/@bbc/react-transcript-editor)
146
147```
148npm publish:public
149```
150
151This runs `npm run build:component` and `npm publish --access public` under the hood
152
153> Note that only `README.md` and the `dist` folders are published to npm.
154
155
156## Contributing
157
158<!-- Contributing guidance, and link to contributing code of conduct -->
159
160## Licence
161
162<!-- mention MIT Licence -->
163
164
165<!-- ## Legal Disclaimer
166
167Despite using React and Draftjs, the BBC is not promoting any FB product or other commercial interest. -->
\No newline at end of file