Skip to content

Commit

Permalink
Merge pull request #198 from l-atelier-des-chercheurs/merged-electron…
Browse files Browse the repository at this point in the history
…-with-dodoc

updated readme
  • Loading branch information
louis-ev authored Nov 23, 2016
2 parents 4538c02 + 2aa077f commit 368fce4
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 84 deletions.
94 changes: 32 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,64 +17,52 @@ You can find more documentation and contribute to the project [here](http://www.

##Install DoDoc

### Download the app (MacOS only for now)
### Download the app (simplest way, MacOS only for now)

Check out the latest releases: https://github.com/l-atelier-des-chercheurs/dodoc/releases

### Using a terminal
### With a terminal (a little more complicated)

_You need both [git](https://git-scm.com/downloads) and [node.js](https://nodejs.org/) to install DoDoc._

#### Windows
Follow this tutorial: http://wikistrea.fr/Comment_ouvrir_la_console_de_commande_Windows_en_mode_administrateur_%3F
#### Mac OSX
Go to Applications->Utilitaries->Terminal
Go to Applications->Utilities->Terminal
#### Linux
If you have Linux you know how to use the terminal
You should already be able to open a terminal

###Open a folder to install DoDoc
Select where you want DoDoc to be copied on your computer.
To open this folder, type ```cd path/of/the/folder```
Example : in your folder "Documents", which is on your C:/ harddrive.
Type ```cd C:/Documents```
### 1. Open/create a folder to install DoDoc
Select where you want DoDoc to be copied on your computer with the following command
```cd path/to/a/folder```

### 2. Clone the repo or download it
Clone dodoc to a `dodoc` folder:
```git clone https://github.com/l-atelier-des-chercheurs/dodoc.git```
then open that folder with ```cd dodoc```

##How to install Dodoc
### 3. Install dependencies

### Clone the repo or download it
To download the repository, click on the "Download zip" button on the dodoc Github page
Install electron dependencies
```npm install```

(Recommended - easier for Updates)
To clone the repository open the terminal, open the directory where you want to place dodoc (for example > cd C:/Documents),
and type this command
```git clone https://github.com/l-atelier-des-chercheurs/dodoc.git```
then open the dodoc directory by typing ```cd dodoc```
Then install dodoc dependencies
```cd app```
```npm install```

###Install nodejs on your computer
### 4. Run dodoc

You can install nodejs from this page [https://nodejs.org/](https://nodejs.org/)
Then, verify that it is correctly installed by typing in the terminal
```node -v```
You need a recent version of node (6 or more), so this line should return something like `Now using node v6.9.1 (npm v3.10.8)`.
Go back to the dodoc folder
```cd ../```

###Install dependencies
Then start dodoc
```npm start```

In terminal go to the dodoc directory you have just cloned or downloaded:
```cd path/of/the/dodoc/directory```
example:
```cd Pauline/sites/dodoc```

Once you are in the right directory
(the terminal says for example ```MacBook-Pro-de-Pauline-3:dodoc Pauline$``` )
Enter the command:
```npm install```

On Windows XP, if you get the following error :
```Error: Failed to replace env in config: ${APPDATA}```
you have to first set the right path to a writable folder for node. Go to C:\Program Files\nodejs\node_modules\npm and open npmrc.
Replace the line
'prefix=${APPDATA}\npm'
with
```prefix=C:\Program Files\nodejs\node_modules\npm```
## Third-party packages

###Install ffmpeg
### Install ffmpeg to make stopmotions
Official page [https://www.ffmpeg.org/](https://www.ffmpeg.org/)

####On Linux
Expand All @@ -86,35 +74,17 @@ Follow this tutorial: [http://adaptivesamples.com/how-to-install-ffmpeg-on-windo
####On Mac OSX
Follow this tutorial: [http://www.renevolution.com/how-to-install-ffmpeg-on-mac-os-x/](http://www.renevolution.com/how-to-install-ffmpeg-on-mac-os-x/)

###Run DoDoc
In the right directory (```cd path/of/the/dodoc/directory``` )
(the terminal says for example ```MacBook-de-Toto:dodoc Pauline$``` )
Run the server in the terminal (enter the following command:)
```npm start```

If all goes well your terminal should tell you to navigate to a specific URL.
Open your web-browser (recommended is Chrome) and copy-paste this URL (which should be [https://localhost:8080](https://localhost:8080)).
## Update dodoc

Your browser is going to tell you that this website is unsafe, click through the warnings to the homepage of dodoc.
###To update DoDoc with the latest version

###To update DoDoc with the latest vesrion
There are two options:
1) If you have cloned the repository, pull the modifications with the terminal:
- Go to your folder directory:
Example: ```cd dodoc```
- Pull the modifications:
```git pull```

2) If you have downloaded the zip file and you want the updated version:
- Click on the "Download zip" button to download the new version
- Copy your old version directory.
- Change the name of the old version directory (example: "Dodoc" > "DoDoc_01")
- Paste all files and directories of the freshly-downloaded docdoc directory into your copy directory and replace all existed files
As the content folder (medias, texts, etc.) is outside the app, just replace the dodoc.app or redownload the repository.

### Contributing or forking dodoc
--> 1 hackpad with spec (in french): https://hackpad.com/dodoc-5iYRCxUY8D5 <br>
--> 1 blog : http://www.lopendoc.org/dodoc/


### Debug and edit dodoc
To debug DoDoc, you can enable extra-logging with the following command:
```npm run debug```
```npm run debug```
19 changes: 0 additions & 19 deletions app/bin/dodoc-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ var dodocAPI = (function() {
sendEventWithContent: function(sendEvent, objectContent, io, socket) { return sendEventWithContent(sendEvent, objectContent, io, socket); },
decodeBase64Image : function(dataString) { return decodeBase64Image(dataString); },
writeVideoToDisk : function(pathToFile, fileExtension, dataURL) { return writeVideoToDisk(pathToFile, fileExtension, dataURL); },
createThumbnails : function(videoPath, videoFilename, pathToMediaFolder) { return createThumbnails(videoPath, videoFilename, pathToMediaFolder);},
listAllTemplates : function() { return listAllTemplates(); },
};

Expand Down Expand Up @@ -140,24 +139,6 @@ var dodocAPI = (function() {
});
}

function createThumbnails(videoPath, videoFilename, pathToMediaFolder){
return new Promise(function(resolve, reject) {
dev.logverbose('Will attempt to make a thumbnail out of a video or stopmotion with info ' + JSON.stringify({videoPath, videoFilename, pathToMediaFolder}));
var proc = ffmpeg( videoPath)
// setup event handlers
.on('end', function(files) {
console.log('screenshot was saved');
resolve();
})
.on('error', function(err) {
console.log('an error happened: ' + err.message);
reject(err.message);
})
// take 2 screenshots at predefined timemarks
.takeScreenshots({ count: 1, timemarks: [ '00:00:00'], "filename" : videoFilename + ".png"}, pathToMediaFolder);
});
}

function listAllTemplates() {
return new Promise(function(resolve, reject) {
dev.logfunction( "COMMON — listAllTemplates");
Expand Down
25 changes: 23 additions & 2 deletions app/bin/dodoc-media.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var dodocMedia = (function() {
listOneMedia : function(slugFolderName, slugProjectName, singleMediaFolderPath, mediaName) { return listOneMedia(slugFolderName, slugProjectName, singleMediaFolderPath, mediaName); },
createNewMedia : function(newMediaData) { return createNewMedia(newMediaData); },
editMediaMeta : function(editMediaData) { return editMediaMeta(editMediaData); },
createThumbnails : function(videoPath, videoFilename, pathToMediaFolder) { return createThumbnails(videoPath, videoFilename, pathToMediaFolder);},
deleteOneMedia : function(slugFolderName, slugProjectName, mediaFolder, mediaName) { return deleteOneMedia(slugFolderName, slugProjectName, mediaFolder, mediaName); },
};

Expand Down Expand Up @@ -146,7 +147,7 @@ var dodocMedia = (function() {
mdata.slugProjectName = slugProjectName;
mdata.mediaFolderPath = mediaFolder;

dodocAPI.createThumbnails( pathToFile + fileExtension, newFileName, mediaPath).then(function( mediaFolderContent) {
createThumbnails( pathToFile + fileExtension, newFileName, mediaPath).then(function( mediaFolderContent) {
resolve( mdata);
}, function(error) {
dev.error('--> Failed to make a thumbnail for a video! Error: ', error);
Expand Down Expand Up @@ -188,7 +189,7 @@ var dodocMedia = (function() {
mdata.slugFolderName = slugFolderName;
mdata.slugProjectName = slugProjectName;
mdata.mediaFolderPath = mediaFolder;
dodocAPI.createThumbnails( pathToFile + fileExtension, newFileName, mediaPath).then(function( mediaFolderContent) {
createThumbnails( pathToFile + fileExtension, newFileName, mediaPath).then(function( mediaFolderContent) {
resolve( mdata);
}, function(error) {
dev.error("Failed to make a thumbnail for a stopmotion! Error: ", error);
Expand Down Expand Up @@ -359,6 +360,26 @@ var dodocMedia = (function() {
});
}


function createThumbnails(videoPath, videoFilename, pathToMediaFolder){
return new Promise(function(resolve, reject) {
dev.logverbose('Will attempt to make a thumbnail out of a video or stopmotion with info ' + JSON.stringify({videoPath, videoFilename, pathToMediaFolder}));
var proc = ffmpeg( videoPath)
// setup event handlers
.on('end', function(files) {
console.log('screenshot was saved');
resolve();
})
.on('error', function(err) {
console.log('an error happened: ' + err.message);
reject(err.message);
})
// take 2 screenshots at predefined timemarks
.takeScreenshots({ count: 1, timemarks: [ '00:00:00'], "filename" : videoFilename + ".png"}, pathToMediaFolder);
});
}


/***************************************************************************************************/
/******************************************** private functions ************************************/
/***************************************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"homepage": "https://github.com/l-atelier-des-chercheurs/dodoc#readme",
"dependencies": {
"electron": "1.4.8",
"flags": "^0.1.3",
"fs-extra": "^1.0.0"
},
"devDependencies": {
"flags": "^0.1.3"
}
}

0 comments on commit 368fce4

Please sign in to comment.