PanDocElectron
1 Introduction
PanDocElectron can be used to convert different input formats of text documents in a variaty of output formats and download files from Wikipedia/Wikiversity. There are two main Input Formats:
Main Ouput Formats are:- Office Documents like LibreOffice that is able to load Open Document Formats and Microsoft Office Word Documents as well
- Presentations with e.g. RevealJS (Press "F" in Reveal for Fullscreen Presentation) or DZSlides as alternative for Microsoft PowerPoint or LibreOffice Impress Documents.
- Presentations with Audio Comments: Audio comments can be added to all slides of RevealJS and DZSlides Presentations (Output Format: audioplayer) or with a PDF-document as input format with Outputformat audioslides. Tutorial PDF to Audioslides by Jörg Rapp
- Documents are converted by PanDoc
- PanDocElectron frees the user from knowing and setting the parameters from the command line (see Downloads on the right).
Electron is more or less a browser, that has full access to your filesystem. So Electron/Atom allows to write multiplattform applications just with HTML and Javascript, than runs on:
Operating Systems - Latest Update
- Linux (see section 2.2)
- MacOSX (see section 2.3)
- Windows (see section 2.4)
1.1 Software Requirements
The following software packages are needed to use PanDoc and PanDocElectron.
- PanDocElectron the Graphical User Interface for PanDoc
- PanDoc the core tool for converting documents, the swiss army knife for document processing developed by John MacFarlane.
- ImageMagick to convert PDF-Slides into web-based Presentation with Audio Comments. ImageMagick is used to create multiple PNG-File as slides from the PDF document.
- LaTeX for PDF conversion and processing Latex input files. Convert from a latex document and convert the source into WikiMedia output for Wikiversity.
- Templates Download Support Files and Templates
for all Operating Systems and unzip the folder into your folder Documents/PanDoc
-
git to download and update the sources of Electron Applications (see http://git-scm.com/ for installing the software git)
-
Ghostscript, an interpreter for the PostScript language and for PDF
-
npm to install pre-build packages of Electron as a runtime environment. (npm is installed as part of NodeJS)
-
nodejs allows with Javscript reading and writing files to the filesystem in Electron (installer NodeJS and NPM).
For running and testing the
Electron
applications in general (like PanDocElectron) it is necessary to install the Electron environment on your Desktop Computer. With electron you download the application that is designed as cross-plattform application and install the Electron Framework for your operating system (OS).
Full installation guides for Linux, MacOSX and Windows are given in section 2.2, section 2.3 and section 2.4.
Start PanDocElectron and adjust path to convert and pandoc according to your installation and save your config by pressing the
save config button. The config loads all previous settings including the last filename that was converted by PanDoc.
1.2 Additional Features of PanDocElectron - Audioslides
With PanDocElectron you can use a PDF-export of LibreOffice Impress or Powerpoint to extract the slides as PNG images
and copy an audio comment (audio0.mp3, audio1.mp3, ...) into the audio-folder of the PanDocElectron project.
If you choose in PanDocElectron the export format audioslides, you will get a web based presentation that plays
e.g. the audio comment audio3.mp3 in folder audio for the slide img3.png in folder images of
your PanDocElectron project.
Record your audio comments with Audacity and MP3 Encoder Audacity.
1.3 WikiPedia and Wikiversity Downloads
With PanDocElectron you can download articles and presentations from
-
Wikipedia and
-
Wikiversity
to process these files with PanDocElectron. Wikiversity is designed for educational content. A special slide format (PanDocElectron-SLIDE) with less
content per section(=slide in presenation). This allows a tailored processing of slides for a presenation from Wikivesity into a RevealJS presentation.
1.4 PanDoc Projects
Electron
applications in general (like PanDocElectron) it is necessary to install the Electron environment on your Desktop Computer. With electron you download the application that is designed as cross-plattform application and install the Electron Framework for your operating system (OS).1.3 WikiPedia and Wikiversity Downloads
With PanDocElectron you can download articles and presentations from
-
Wikipedia and
-
Wikiversity
to process these files with PanDocElectron. Wikiversity is designed for educational content. A special slide format (PanDocElectron-SLIDE) with less
content per section(=slide in presenation). This allows a tailored processing of slides for a presenation from Wikivesity into a RevealJS presentation.
1.4 PanDoc Projects
PanDocElectron uses a project based approach for conversion. A project is a subdirectory of Documents/Pandoc/
e.g. Documents/Pandoc/MyProject
.
This file contains the input files and the generated output files by PanDoc. In general the input files are mainly WikiMedia-Files Documents/Pandoc/MyProject/MyProject.wiki
.
- WikiMedia are provided on Wikiversity.
- WikiMedia is regarded as main input format for content, other input formats are possible due to your source content you want to process.
1.5 PanDocElectron Filename Convention for converted files in Project
Normally the basename of the input file is the same as the directory name, but this is optional. You can have more than one input file in one directory. From the input document you create output documents in several formats. To distinguish output formats it is necessary to have some filename rules. We use the input file MyProject.wiki
in the input format WikiMedia
as an example.
- convert
MyProject.wiki
into DOCX File, creates a filenameMyProject.docx
. - convert
MyProject.wiki
into DOCX File with a 2 Column Layout, creates a filenameMyProject_docx2col.docx
. - convert
MyProject.wiki
to HTML File, creates a filenameMyProject.html
. - convert
MyProject.wiki
to HTML presentation, creates a filenameMyProject_reveal.html
. - convert
MyProject.wiki
to RevealJS presentation, creates a filenameMyProject_reveal.html
.
The basic version of output format get the standard extension odt
, docx
or html
.
To avoid overwriting the files with the same file extensions (e.g. `html`), default filenames are expanded with the output format (eg. _reveal
for RevealJS format as an output format with the file extension .html
.
1.6 Project subdirectories
In a PanDocElectron Project 4 subdirectories are created.
-
config
contains the configuration for "Title" and "Author" of the project. Config files share the same basename. E.g. the corresponding config file forMyProject.wiki
isconfig/MyProject.wiki
. -
images
contains images of the HTML-document, LaTeX, WikiMedia, Markdown input files and the exported slides from an input PDF presentation. -
audio
contains the MP3 audio comments for a slide or other audio files used in the documents. -
video
contains videos used in presentations or in WikiMedia. Default video format iswebm
andogg
because they can be used for streaming in web browsers and in Wikiversity. Use Firefox Plugin for converting videos in your base format FireOGG.
1.7 Software Development with Atom/Electron
- npm installs packages in
node_modules
. If you have installed electron-prebuilt
in that folder on a Mac then do not sync the content in your github repository because other users e.g. on a Windows Machine might get confused as the software will create error messages due to the non-matching Operating System (OS).
- Install Atom (https://atom.io/) as Editor for Software Development in
node_modules
. If you have installed electron-prebuilt
in that folder on a Mac then do not sync the content in your github repository because other users e.g. on a Windows Machine might get confused as the software will create error messages due to the non-matching Operating System (OS).2 Installation
This section describes the installation of the electron developing environment for PanDocElectron.2.1 Install Script
- Linux: Install Script Linux - Debian/Ubuntu/Mint
- MacOSX: Install Script MacOSX - Apple Mac
on a Linux System (Debian based like Ubuntu, Mint, ...) or with
sh install_linux.sh
on MacOSX with installed HomeBrew.
sh install_mac.sh
Legacy Mode: If installation fails with message WARN This failure might be due to the use of legacy binary "node" please install the NodeJS-Legacy package
sudo apt-get install nodejs-legacy
2.2 Linux - Electron Framework
2.2.1 Install GIT
GIT as version control system is used to update PanDocElectron
sudo apt-get install git
2.2.2 Install NPM
The node package manager (NPM) is necessary for installation of electron.
sudo apt-get install npm
2.2.3 Install NodeJS
As a next step it necessary to install NodeJS on your system.
https://nodejs.org/en/download/package-manager/
E.g. on Ubuntu/Linux install NodeJS for version 6 or higher:
sudo apt-get install curl
curl is now installed. We use curl to download the installer for NodeJS.
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
Now we install nodejs
sudo apt-get install -y nodejs
2.2.4 Installation of PanDocElectron
When git is installed on your operting system, you can download PanDocElectron with the following command in the shell:
cd Documents
resp.cd /path/to/Documents
Download/clone PanDocElectron:
git clone https://github.com/niebert/PanDocElectron.git
Download/clone the MathJax and Reveal Files for offline use of presentations:
When git is not installed, you can download the following zip-file and unzip the file in your Documents folder.
git clone https://github.com/niebert/PanDoc.git
PanDoc.zip
2.2.5 Install Build essentials on Linux
Finally it is necessary to install the build essentials on the Linux system with:
sudo apt-get install -y build-essential
2.2.6 Install Electron as Runtime Environment for PanDocElectron
Change directory to PanDocElectron and install prebuilt Electron binaries for your operating system:
cd PanDocElectron
resp.cd /path/to/application/PanDocElectron
npm install electron-prebuilt --save-dev
rm -R node_modules/*
npm install && npm start
2.2.7 Install LaTeX
LaTeX is needed to convert the Documents.
-
for apt-get based Linux-Distributions (debian, ubuntu etc.):
sudo apt-get install texlive-full
-
for openSuSE:
sudo zypper install texlive-scheme-full
-
for Fedora, Redhat:
sudo yum install texlive-scheme-full
2.2.8 Install ImageMagick on Linux
ImageMagick is needed to convert the PDF documents into PNG files as slides.
-
for apt-get based Linux-Distributions (debian, ubuntu etc.):
sudo apt-get install imagemagick imagemagick-doc
-
for openSuSE:
sudo zypper install imagemagick imagemagick-doc
-
for Fedora, Redhat:
sudo yum install imagemagick imagemagick-doc
2.2.9 Install additional Packages for PanDocElectron
Install necessary modules for PanDocElectron:
cd PanDocElectron
resp.cd /path/to/application/PanDocElectron
npm install mkdirp
Now install the dependencies and test the first run of PanDocElectron:
npm install && npm start
2.2.10 Install PanDoc on Linux
The main package used by PanDocElectron is PanDoc itself
sudo apt-get install pandoc pandoc-citeproc
2.2.11 Optional: Install Atom Editor to Modify the PanDocElectron
PanDocElectron is a HTML/Javascript Application that can be modified and tailored to your needs with a minor HTML/Javascript knowledge. The Atom Editor is recommended as developing environment together with electron: Download and install from the following website:
2.2.12 Get PanDocElectron started
PanDocElectron and PanDoc are now installed. To start PanDocElectron :
cd PanDocElectron
resp.cd /path/to/application/PanDocElectron
npm start
2.3 MacOSX - Electron Framework
This section describes the installation of the electron developing environment for PanDocElectron. If you just want to use the software, follow the Guide. The following command assumes, that HomeBrew to be installed on your MacOSX. If not please follow the HomeBrew installation guide
2.3.1 Install GIT on MacOSX
GIT as version control system is used to update PanDocElectron
brew install git
2.3.2 Install NPM on MacOSX
The node package manager (NPM) is necessary for installation of electron.
brew install npm
2.3.3 Install NodeJS on MacOSX
As a next step it necessary to install NodeJS on your system.
- https://nodejs.org/en/ use MacOSX-Installer
Opening Windows in your Electron Application needs XQuartz. Please install XQuartz DMG on your MacOSX:
brew install wine mono
2.3.4 Installation of PanDocElectron
When git installed on your operting system, you can download PanDocElectron with the following command in the shell:
cd Documents
resp.cd /path/to/Documents
Download/clone PanDocElectron:
git clone https://github.com/niebert/PanDocElectron.git
Download/clone the MathJax and Reveal Files for offline use of presentations:
git clone https://github.com/niebert/PanDoc.git
2.3.5 Install Electron as Runtime Environment for PanDocElectron
Change directory to PanDocElectron and install prebuilt Electron binaries for your operating system:
cd PanDocElectron
resp.cd /path/to/application/PanDocElectron
rm -R node_modules/*
npm install electron-prebuilt --save-dev
Now install the dependencies and test the first run of PanDocElectron:
npm install && npm start
2.3.6 Install ImageMagick on MacOSX
ImageMagick is needed to convert the PDF documents into PNG files as slides.
Furthermore install Ghostscript which is needed for converting a PDF file into convert several PNG images.
brew install imagemagick
brew install ghostscript
2.3.7 Install LaTeX on MacOSX
LaTeX is needed to convert the Documents.
- Install MacTeX https://tug.org/mactex/
2.3.8 Install PanDoc on Linux
The main package used by PanDocElectron is PanDoc itself
brew install pandoc
2.3.9 Optional: Install Atom Editor to Modify the PanDocElectron
PanDocElectron is a HTML/Javascript Application that can be modified and tailored to your needs with a minor HTML/Javascript knowledge. The Atom Editor is recommended as developing environment together with electron: Download and install from the following website:
2.3.10 XCode for MacOSX
Please install Xcode form the AppStore for your MacOSX system as developer environment:
- https://developer.apple.com/xcode/download
- The X-Server on MacOSX is implemented by XQuartz. Install XQuartz on your MacOSX with DMG-Installer.
2.3.11 Optional: Install Atom Editor to Modify the PanDocElectron
PanDocElectron is a HTML/Javascript Application that can be modified and tailored to your needs with a minor HTML/Javascript knowledge. The Atom Editor is recommended as developing environment together with electron: Download and install from the following website:
2.4 PanDocElectron on Windows
2.4.1 Install GIT on Windows
Download GIT from
- https://git-scm.com/download/win and install GIT with windows installer.
2.4.2 Install NPM on Windows
The node package manager (NPM) is necessary for installation of electron.
Now you are able to install Electron on you system
2.4.3 Installation of PanDocElectron
Open Shell on Windows (e.g. press "Win-R," type "cmd" and press "Enter" to open a Command Prompt session using just your keyboard. When git is installed on your operting system, you can download PanDocElectron with the following command in the shell:
cd /D %userprofile%
Download/clone PanDocElectron:
git clone https://github.com/niebert/PanDocElectron.git
Download/clone the MathJax and Reveal Files for offline use of presentations:
resp. your location where you store your documents:
cd documents
git clone https://github.com/niebert/PanDoc.git
2.4.4 Install Electron as Runtime Environment for PanDocElectron
Change directory to PanDocElectron and install prebuilt Electron binaries for your operating system:
cd PanDocElectron
resp.cd \path\to\application\PanDocElectron
rmdir node_modules/* /s /q
npm install electron-prebuilt --save-dev
npm install mkdirp
Now install the dependencies and test the first run of PanDocElectron:
npm install && npm start
2.4.5 Install ImageMagick on Windows
ImageMagick is needed to convert the PDF documents into PNG files as slides.
- Download PanDoc Support Files and Templates and unzip the folder in your Documents/PanDoc Folder. The zip-file contains the binaries of PanDoc and ImageMagick for Windows in WinOS. The folder WinOS can be delete on Linux and MacOSX.
- or (Aternative) Installation Binaries for ImageMagick are available on ImageMagick.org
2.4.6 Install LaTeX on Windows
LaTeX is needed to convert the Documents.
- MikTex Installation http://miktex.org/download
2.4.7 Install PanDoc on Windows
The main package used by PanDocElectron is PanDoc itself
- Download PanDoc Support Files and Templates and unzip the folder in your Documents/PanDoc Folder. The zip-file contains the binaries of PanDoc and ImageMagick for Windows.
- or Alternative http://pandoc.org/installing.html
2.4.8 Install Ghostscript on Windows
Ghostscript is needed for the conversion from pdf to images. Please select the appropriate version from the following page and install it
2.4.9 Optional: Install Atom Editor to Modify the PanDocElectron
PanDocElectron is a HTML/Javascript Application that can be modified and tailored to your needs with a minor HTML/Javascript knowledge. The Atom Editor is recommended as developing environment together with electron: Download and install from the following website:
3 Tutorials
3.1 Audio Slides
Audio Slides are HTML presentations that have recorded audio comments for each slide. The following tutorial by J. Rapp guides you in creating Audio slides with PanDocElectron.- Audio-Slides Tutorial by J. Rapp
- Demo Slides of an Audio Presentation (Summerschool University of Koblenz-Landau). Press [F] for fullscreen mode of audio slides and cursor keys to navigate in presentation.
- Download ZIP-File Audio Slides (Summerschool University of Koblenz-Landau).
3.2 Application of PanDocElectron in Wikiversity
As demo application of Open Educational Resources a small introduction to the application of PanDocElectron with Wikiversity is provided on Wikiversity PanDocElectron-SLIDE, that contains some links to sample presentations in the domain Mathemtatics/ Introduction to Functional Analysis (German).3.3 Update PanDoc Support Files and PanDocElectron
Software (PanDocElectron) and the support files (PanDoc) may change from time to time, due to- debugging efforts of developers,
- optimization of code,
- implemenation of new features,
- improvement of templates
To update the PanDoc Support Files with GIT open the terminal change to the directory where the PanDoc support files are stored
The pull the changes from the remote directory.
cd Documents/PanDoc
git pull origin master
Remark: This is possible if and only if you installed the PanDoc support files with GIT. Otherwise rename your old folder (e.g. Documents/PanDoc to Documents/PanDoc_Backup and download and unzip PanDoc Support Files in your Documents folder and copy your PanDocElectron projects in Documents/PanDoc_Backup back into Documents/PanDoc. Instead of using the ZIP-file of PanDoc support files you can install GIT and clone the repository of the support files with
This will make updates much easier for upcoming releases. PanDocElectron Application Update
git clone https://github.com/niebert/PanDoc.git
To update the PanDoc Support Files with GIT open the terminal change to the directory where the application PanDocElectron was installed, e.g.
The pull the changes from the PanDocElectron remote repository of the application call the following git command:
cd Documents/PanDocElectron
git pull origin master
git clone https://github.com/niebert/PanDocElectron.git
Remark: This is possible if and only if you installed the PanDocElectron with GIT or the script on Linux or Mac. Otherwise rename your old folder (e.g. Documents/PanDocElectron to Documents/PanDocElectron_Backup and download and unzip the binaries from the PanDocElectron in your Documents folder and copy your PanDocElectron projects in Documents/PanDoc_Backup back into Documents/PanDocElectron. An call
Then you will be able to use PanDocElectron with the new version. It is always recommended to keep a copy of the old release of PanDocElectron in PanDocElectron_Backup until you are sure the new version has no bugs on your operating system. Switching back to the prior release is easy by deleting PanDocElectron folder and rename PanDocElectron_Backup back to PanDocElectron. Instead of using GIT for version control you can install binaries of PanDocElectron from SourceForge. Please keep in mind, that the binaries on SourceForge may not be up to date in comparison to master branch of PanDocElectron. on GitHub.
npm install
4 Developer Information
4.1 Developer Quickstart
- Create the first App in Electron
- Install a Quick Start Electron Application. Use the install support for this:
Clone the Quick Start repository first
git clone https://github.com/electron/electron-quick-start
Go into the repository`
cd electron-quick-start
`
Now install the dependencies and run
npm install && npm start
Install necessary modules for PanDocElectron:
Now you can run the Electron application by using the command
npm install mkdirp
in the directory of your application. The following shell script can be used on Linux and MacOSX:
npm start
Replace /home/usershome/Documents/PanDocElectron by the path to your PanDocElectron Application. If you want to start your Electron application from anywhere in the directory tree, if you installed your application globally (e.g. npm install -g pandocelectron then PanDocElectron can be started with pandocelectron from anywhere in the directory tree.
#!/bin/sh
cd /home/usershome/Documents/PanDocElectron
npm start
4.2 Electron Builder Packager
Packages can helpful for users to avoid installations of the Electron Framework and Installation Procedure. The binaries are created with electron-packager-interactive with Electron 1.2.2.
sudo npm install -g electron-packager-interactive
"devDependencies": {
"electron-prebuilt": "1.2.7"
},
See electron-packager-interactive or Multiplattform Build with Electron for further details. `