Commit cc17ae4b authored by Alexandros Georgantas's avatar Alexandros Georgantas
Browse files

Initial commit

Pipeline #9884 failed with stages
in 12 seconds
set -e
use node
"parser": "babel-eslint",
"env": {
"es6": true,
"browser": true
"extends": ["pubsweet"],
"rules": {
"prefer-destructuring": ["error", {
"VariableDeclarator": {
"array": false,
"object": true
"AssignmentExpression": {
"array": false,
"object": false
}, {
"enforceForRenamedProperties": false
"global-require": 0,
"jsx-a11y/anchor-is-valid": 0,
"jsx-a11y/click-events-have-key-events": 0,
"jsx-a11y/label-has-for": 0,
"jsx-a11y/no-static-element-interactions": 0,
"import/no-dynamic-require": 0,
"import/no-extraneous-dependencies": 0,
"import/no-named-as-default": 0,
"import/no-named-as-default-member": 0,
"import/prefer-default-export": 0,
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-param-reassign": 0,
"no-shadow": 0,
"no-underscore-dangle": 0,
"react/forbid-prop-types": 0,
"react/no-unused-prop-types": 0,
"react/no-unused-state": 0,
"react/prop-types": 0,
"react/require-default-props": 0,
"sort-keys": 0
"singleQuote": true,
"semi": false,
"printWidth": 80,
"trailingComma": "all"
# Editoria
## 1.3.0
#### Wax
* Search / find and replace
* Notes pane is hidden if there are no notes in the document
* Note callouts work with track changes
* Track changes previous / next navigation
* Copy / cut and paste works with track changes
* Indicator for how many items exist in a collapsed comment discussion
* Performance improvements
* Find and Replace a single match and undo throws an Error
* Undo / Redo Notes on certain Occasions throws an Error
* Opening an Empty Chapter Save is Enabled and modal is triggered if you try to go back without any change in the Editor
* if Track Changes is on, user cannot remove an image
* Remove additions on cut operation in track changes if done from the same user
* With track Changes on if you accept a deleted note and undo throws an error
* With track Changes on if you delete a whole paragraph and undo throws an error
* Navigate Through Notes with left and right arrow
* Toggle on /off Native Spell Checker
* Full screen mode
* Track Spaces
* Image Captions
* Change note icon in the toolbar
* Add keyboard shortcuts for accept & reject track changes
* Small Caps
#### Maintenance
* Switch to using yarn instead of npm by default
* React 16
* Upgrade to latest pubsweet client
* Clean up component prop types and refs
* Switch to Postgres
* Docker container for the DB provided via yarn start:services
## 1.2.0
* Upgrade to latest Pubsweet server, client, and components
* Introduce password reset
#### Book Builder
* Preview exported book in Vivliostyle Viewer
* Chapters keep track of their own numbering (independently from parts) in the Body
* Renaming of fragments has been removed in favour of using the title tag in Wax
* Drag and drop fixes
#### Wax Editor
* Can now style multiple blocks/paragraphs at once, including lists
* Keyboard shortcuts
* Turn track changes on/off => ctrl/cmd+y
* Hide / show tracked changes => ctrl/cmd+shift+y
* Comments => ctrl/cmd+m
* Save => ctrl/cmd+s
* New Title style (which will also rename the fragment in the book builder)
* New Subtitle style
* New Bibliography Entry style
* Revamped track changes UI: Tools are now in the toolbar instead of inline, and line height in the document has been reduced
* Surface doesn't lose focus any more unless the user clicks outside of Wax
* Paragraph indentation
## 1.1.4
#### Wax Editor
* Fix for unsaved changes warning
## 1.1.3
* New design for the book builder, the dashboard and the theme
#### Dashboard
* Renamed 'remove' button to 'delete' for consistency with the book builder
* Double clicking on a book will take you to the book builder for that book, instead of opening the renaming interface
* The position of 'Edit' and 'Rename' actions have been swapped ('Edit' now comes first)
* Books now appear in alphabetical order
#### Book Builder
* Fixed issue with fragments disappearing when uploading multiple files
* Renamed 'Front Matter' and 'Back Matter' to 'Frontmatter' and 'Backmatter'
#### Wax Editor
* Introduce layouts
* Accept configuration options (`layout` and `lockWhenEditing`)
* It is now broken down into separate modules for better separation of concerns
* Pubsweet integration
* React integration
* Core
* Diacritics work within notes
### Editoria 1.0, July 2017
Editoria was started as a collaboration between UCP and Coko, initial funding came from the Mellon Foundation.
Those involved in conceptualising, designing, and building Editoria (including the Wax Editor) from 0 to 1.0 include:
* Erich van Rijn
* Catherine Mitchell
* Kate Warne
* Cindy Fulton
* Lisa Schiff
* Justin Gonder
* Juliana Froggatt
* Adam Hyde
* Kristen Ratan
* Yannis Barlas
* Christos Kokosias
* Julien Taquet
* Alex Theg
* Alexandros Georgantas
* Giannis Kopanas
MIT License
Copyright (c) 2017 The Regents of the University of California
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
\ No newline at end of file
# Editoria
This is the Editoria monorepo.
It consists of the main Editoria application, as well as the different [Pubsweet]( components and helper libraries that the app is made of.
This application is being developed by the [Coko Foundation](, for the [University of California Press](
For more information, visit the project's [website]( or our [chat channel](
For the editor that Editoria uses, see its related project [Wax](
## Roadmap
The current features on our list are the following:
|Module |Description |In progress |Done |Issue|
|:---- |--- |:---: |:---: |:---:|
|Export|Paged.js exporter | ✔ | | |
|Export|Paged.js CSS file editing | | | |
|Editor |Copy Paste within the editor fix | | | |
|Editor |Upgrade to latest Substance | | | wax/wax#188|
|System |E2E Tests | | |#95, #96|
|BookBuilder |Per instance configurability | | | |
|System |Authsome mode for Book Sprints | |✔ | #146|
|System | Edit Lock | |✔ | #117|
|System |Use docker containers for deployments | |✔ |#89|
|System |Logger | |✔ |#106|
|System |Env variables | |✔ |#104|
|System |Fix polling problem | |✔ |#132|
|Book builder |Redesign component state tool | |✔ |#55|
|Book builder |Drag and Drop perfomance issue | |✔ |#131|
|Book builder |Export EPUB | |✔ |#79|
|Book builder |Filenames for single uploads | |✔ |#112|
|BookBuilder |Create RFC for the chapters' reordering | |✔ | #145 |
|Editor |Code Block | |✔ | wax/wax#174|
|Editor |Add ornament style | |✔ | wax/wax#178|
|Export |Notes at the end of the book | |✔ | #78|
|Export |Fix links | |✔ | #100|
|Export |Fix image captions | |✔ | #113|
## Get up and running
Get your copy of the repository.
git clone
cd editoria
Make sure you use you use `node >= 8.3`.
### nvm
To determine which version of Node you are running type `node -v`.
If the version is not 8.3 or greater you will need to use nvm to prescribe a specific node version. Installation of nvm is covered here
Once nvm is installed use the command `nvm install 8.3`
For further information on how to use nvm see
### Install yarn
npm install -g yarn
You should also have `yarn 1.3.2` or higher installed (out-of-date versions may cause installation errors).
### Install Docker and docker-compose
Instalation instructions can be found:
Prefer latest stable version of docker (18.x.x) and docker-compose (1.2x.x)
### Install Dependencies
Install all dependencies and navigate to the editoria app folder.
cd packages/editoria-app
Create a `config/local-development.json` file.
Edit that to enter your database secret, as well as to connect to [INK](
In this file, add the following:
"pubsweet-server": {
"secret": "<your-secret-here>"
"pubsweet-component-ink-backend": {
"inkEndpoint": "< your-ink-api-endpoint >",
"email": "< your-ink-email >",
"password": "< your-ink-password >",
"recipes": {
"editoria-typescript": "< editoria-typescript-recipe-id >"
We recommend using a demo instance of INK hosted by Coko in your initial Editoria setup. Please contact the team on in order to get the required credentials and information.
If you do want to run your own instance of [INK](, be sure that:
* the `<your-ink-api-endpoint>` in `local-development.json` ends with a trailing slash
* if INK is running as a service on a port, ensure it is on port `3000`
* If INK and Editoria are on the same server, Editoria should be set to run on another port than `3000`, AND the `postgres` docker component for INK should run on a different port (`4321` instead of `5432`for instance).
Again, if you need to test editoria, asking for the credentials will be the fastest way to be set up.
Create environment files for each profile of the application under `editoria-app/config`.
eg. `editoria-app/config/development.env`
Within your environment files, export the variables you want:
export PUBSWEET_SECRET='' (*) (**)
export POSTGRES_USER='' (*) (***) (used by both docker-compose.yml and pubsweet server)
export POSTGRES_PASSWORD='' (*) (***) (by from both docker-compose.yml and pubsweet server)
export POSTGRES_HOST='' (-)
export POSTGRES_DB='' (*) (***) (used by both docker-compose.yml and pubsweet server)
export POSTGRES_PORT='' (*) (***) (used by both docker-compose.yml and pubsweet server)
export SERVER_PORT='' (**)
export INK_ENDPOINT='' (*) (**)
export INK_USERNAME='' (*) (**)
export INK_PASSWORD='' (*) (**)
export INK_EDITORIA_TYPESCRIPT='' (*) (**)
export MAILER_USER='' (*) (**)
export MAILER_PASSWORD='' (*) (**)
export MAILER_SENDER='' (*) (**)
export MAILER_HOSTNAME='' (*) (**)
export PASSWORD_RESET_URL='' (*) (**)
export PASSWORD_RESET_SENDER='' (*) (**)
export NODE_ENV='' (**)
(*)Required for the application to be functional
(-) Optional
(**) This key-value pairs could be either declared as env variables or either in the corresponding config file e.g. `local-development.json`, `development.json`, etc
(***) These fields should by any means exist in the env source file for the correct initialization of the docker container which holds the database of the application
Import the environment variables into the current shell session:
source <your-env-file>
Get the database docker container up and running:
yarn start:services
Create a database and enter credentials for an admin user account (a postgres db should already be up and running):
yarn resetdb
Follow the prompts to enter user credentials and complete the database setup.
_**Note**: If you want to use a non-default database, see [Pubsweet development setup](
You're good to go. Open a separate terminal in the same folder and run the app with:
yarn server
Clean your docker cache and containers before the first time you run the application (under editoria-app) or if changes occur in either env variables, docker-compose.yml, local-development, local-production, etc.:
docker-compose down
docker-compose rm -fv
rm -rf data
## Developer info
see also the [Pubsweet wiki]( for developer notes.
## FAQ
### I'm getting user errors running `yarn start:services` or `yarn server`
It's crucial to use the same user when installing Editoria and running the Editoria database services. These commands are:
* Running `yarn` from Editoria's root directory. This installs Editoria and its dependencies
* Running `yarn start:server` for the first time sets up a database to use with Editoria. This configures a database that expects that the same user that is running this command has also run `yarn` from Editoria's root directory.
If you see user errors running `yarn start:services` or `yarn server`, your best bet is to clear the existing data and start the install anew, as the same user.
First, delete all the Docker data:
docker-compose down
docker-compose rm -fv
rm -rf data
Then, follow the steps for a clean install.
### When running `yarn start:services`, I get a `Bind for failed: port is already allocated` error
Something (probably postgres) is already running on the port that the Docker database services try to use (5432). Solution for Ubuntu:
1. `lsof -i tcp:5432`: lists the processes running on port 5432
2. `kill -9 {PID}`: kills (gracelessly) the process. Get the PID from the output of the above step.
This should free up the port so the Docker database services can run on it.
### I've made changes on my `<profile>.env` file, how can these changes be applied?
To be sure that your changes in `<profile>.env` are registered, you need to reset your docker containers and source `<your-env-file>`. To do so, you can follow these steps:
* Kill any running instances of Editoria app
* On editoria-app root folder perform:
docker-compose down
docker-compose rm -fv
`docker-compose down` will unmount the docker container
`docker-compose rm -fv` will remove the container and it's anonymous volumes.
`rm -rf data` will delete the content from your database
* Now you could run `source <your-env-file>` and start again the services and server
### Which are the absolute required key-value pairs for an env file?
These values are needed in order the docker container which hosts the PostrgesDB of the application to be initialised correctly.
### I am facing issues when trying to boot-up the application which are related to INK API
Ink is the process manager developped by Coko. Editoria uses Ink mainly to convert Microsoft Word .docx into proper HTML to be used in Editoria (among other things).
Since it has been one of the requirements from the begginning, running Editoria means that you need to have access to an instance of INK before runnning it, thus the appropriate configuration should be in place in order for Editoria to start properly.
INK's configuration could either be placed in:
* `local.development.json`
* `development.json`
* `<profile>.env`
Please contact the team on in order to get the required credentials
### How can I access the epub file?
EPUB files are created and stored in the `uploads` directory (`editoria/packages/editoria-app/uploads`) every time the book is exported with the "EXPORT BOOK" button on the top right of the book. Be sure to sort by created date to ensure you're getting the most recent file.
### Does the HTML out of Editoria support accessibility including the use of Alt tags?
We are working with Benetech to fully understand and plan for accessibility. This development is on our development roadmap.
### Does Editoria support multiple languages?
Yes. Editoria supports any language supported by the user’s browser. Editoria also supports special characters. This said, language support is an area that needs thorough testing for the many edge cases and rare cases that exist. This is an ideal opportunity for a community member to show leadership and help organize and optimize.
### Does Editoria include an asset manager for images and multimedia files that may need to be inserted into text?
This is on our development roadmap.
### Can Editoria integrate with other tools and services?
Yes. Editoria’s architecture is all API-orientated and can be easily extended for third party service integration. For more information, visit
### Can notes be moved to backmatter (rather than footnotes)?
At this moment no, but it is on the Editoria roadmap. Options will include same page, back of book, or margin notes.
### What’s the cost to use Editoria?
Using the code to create an instance of Editoria truly is free. Our hope is that organizations that find it useful, will contribute the customizations and additional development code back so that others can use it. We also hope that adopters will help organize and attend community gatherings and participate in discussion and problem solving with the community.
### Does Editoria generate and export EPUB3?
Yes, currently however it is not available via the user interface. This is on our development roadmap.
### Can Editoria export BITS XML (or other) for chapter files and books?
It can. The first conversion is from .docx to HTML, and from there, it’s up to presses to decide what to do with the highly structured, source HTML.
### Can I use Editoria for journals workflow?
It’s possible, but would not be ideal. Coko has developed an open-source tool that is optimized for journals workflow, called xPub. xPub, like Editoria, is modular, so that organizations can develop their own non-hardcoded workflows, mixing and matching modules that other organizations have developed and shared, or create and integrate their own. More at
### How do my .docx filenames affect how they upload?
Using the "Upload Word Files" button, you can upload multiple .docx files with one click. A few file naming conventions provide useful controls for how the Word files are uploaded:
* .docx files that begin with "a" go into Frontmatter
* .docx files that beegin with "w" go into Backmatter
* files that start with any other letters go into the Body
* By default, files in the Body are regular, numbered chapters. Frontmatter and backmatter components are always unnumbered.
* a "00" anywhere in filename will make it an unnumbered chapter (only in Body)
* "pt0" anywhere in filename will upload the .docx as a Part (only in Body)
\ No newline at end of file
"lerna": "2.4.0",
"packages": [
"version": "independent"
"author": "Collaborative Knowledge Foundation",
"description": "Monorepo grouping all the different parts of the UCP project",
"devDependencies": {
"babel-eslint": "^8.0.3",
"babel-preset-es2015": "^6.24.1",
"eslint": "^4.13.1",
"eslint-config-pubsweet": "^0.0.6",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jest": "^21.4.2",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-node": "^5.2.1",
"eslint-plugin-prettier": "^2.3.1",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-standard": "^3.0.1",
"lerna": "^2.5.1",
"lint-staged": "^6.0.0",
"prettier": "^1.8.2",
"stylelint": "^8.2.0",
"stylelint-config-prettier": "^2.0.0",
"stylelint-config-pubsweet": "^0.0.3"
"license": "MIT",
"name": "ucp-monorepo",
"private": true,
"repository": {
"type": "git",
"url": ""
"scripts": {
"bootstrap": "lerna bootstrap",
"clean": "lerna clean",
"publish": "lerna publish",
"updated": "lerna updated",
"test": "lerna run test"
"version": "0.0.0",
"dependencies": {
"babel-preset-stage-0": "^6.24.1"
"workspaces": [
"presets": [
\ No newline at end of file
\ No newline at end of file
"parser": "babel-eslint",
"env": {
"es6": true,
"browser": true
"extends": ["pubsweet"],
"rules": {
"import/no-dynamic-require": 0,
"import/no-extraneous-dependencies": 0,
"sort-keys": 0
"overrides": [
"files": ["test/**/*.test.js"],
"globals": {
"fixture": true,
"text": true
# Created by,node
### OSX ###
# Icon must end with two \r
# Thumbnails
# Files that might appear in the root of a volume
# Directories potentially created on remote AFP share
Network Trash Folder
Temporary Items
### Node ###
# Logs
# Runtime data
# Directory for instrumented libs generated by jscoverage/JSCover