From 2aa077f1b3d440a09c5b103df26250e4860193c1 Mon Sep 17 00:00:00 2001 From: Louis Eveillard Date: Wed, 23 Nov 2016 18:29:09 +0100 Subject: [PATCH] updated readme --- README.md | 94 ++++++++++++++---------------------------- app/bin/dodoc-api.js | 19 --------- app/bin/dodoc-media.js | 25 ++++++++++- package.json | 2 +- 4 files changed, 56 insertions(+), 84 deletions(-) diff --git a/README.md b/README.md index 9fbdedfcd..38123dd3b 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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
--> 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``` \ No newline at end of file diff --git a/app/bin/dodoc-api.js b/app/bin/dodoc-api.js index 09e21744c..45b455b33 100644 --- a/app/bin/dodoc-api.js +++ b/app/bin/dodoc-api.js @@ -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(); }, }; @@ -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"); diff --git a/app/bin/dodoc-media.js b/app/bin/dodoc-media.js index e2135e11d..17fa385e6 100644 --- a/app/bin/dodoc-media.js +++ b/app/bin/dodoc-media.js @@ -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); }, }; @@ -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); @@ -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); @@ -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 ************************************/ /***************************************************************************************************/ diff --git a/package.json b/package.json index 2fc28dd43..c218a5d22 100644 --- a/package.json +++ b/package.json @@ -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" } }