• Stars
    star
    124
  • Rank 288,207 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Lens - open science content creation and display

No longer maintained. Use http://github.com/substance/texture instead.

Lens (editable edition)

This is an evolution of eLife Lens, developed by Substance. It comes with a Writer component for web-based authoring and a new Reader component for displaying of scientific content.

Read about the backgrounds of this project:

Important note: This project is at an experimental state. It is also not compatible with JATS/NLM at this stage, as it reads a simplified custom XML format. We will add support for JATS import + export at a later time.

Install dev version

Clone the repository.

$ git clone https://github.com/substance/lens.git

Navigate to the source directory.

$ cd lens

Install dependencies via npm

$ npm install

Start the dev server

$ npm run start

And navigate to http://localhost:5000

To create a new demo bundle do this:

$ npm run bundle

Usage

To embed Lens Reader:

var LensReader = require('lens/LensReader');
var LensArticle = require('lens/model/LensArticle');
var Component = require('substance/ui/component');
var $$ = Component.$$;

var doc = LensArticle.fromXml(LENS_XML);

Component.mount($$(LensReader, {
  doc: doc
}), document.body);

To embed Lens Writer:

var LensWriter = require('lens/LensWriter');
var LensArticle = require('lens/model/LensArticle');
var Component = require('substance/ui/component');
var $$ = Component.$$;

var doc = LensArticle.fromXml(LENS_XML);

Component.mount($$(LensWriter, {
  doc: doc,
  onUploadFile: function(file, cb) {
    console.log('custom file upload handler in action...');
    var fileUrl = window.URL.createObjectURL(file);
    cb(null, fileUrl);  
  },
  onSave: function(doc, changes, cb) {
    console.log('custom save handler in action...', doc.toXml());
    cb(null);
  }
}), document.body);

Make sure to also include the stylesheets into your app. We provide entry points at styles/lens-writer.sass and styles/lens-reader.sass. Lens requires a module bundler, such as Browserify or Webpack.

More Repositories

1

substance

A JavaScript library for web-based content editing.
JavaScript
2,741
star
2

texture

A visual editor for research.
JavaScript
1,000
star
3

substance-legacy

Towards open digital publishing
JavaScript
930
star
4

data

A uniform interface for domain data (deprecated)
JavaScript
655
star
5

surface

A building block for web-based text editors
JavaScript
166
star
6

examples

Learn Substance by example.
JavaScript
155
star
7

dar

Reproducible Document Archive
82
star
8

document

Substance Document Model
JavaScript
52
star
9

simple-writer

All you need to get started with Substance editor development.
JavaScript
28
star
10

io

IO is a minimal publishing system based on Pandoc, Substance and eLife Lens. It powers substance.io
CSS
28
star
11

chronicle

A git inspired versioning API.
JavaScript
27
star
12

operator

Operational Transformation for strings, arrays and objects.
JavaScript
26
star
13

letterpress

Cross Media Publishing for Substance documents
Haskell
23
star
14

notes

Real-time collaborative notes editing.
JavaScript
21
star
15

dot

Decentralized Operational Transformation (DOT)
JavaScript
16
star
16

forms

Web forms with Substance.
JavaScript
14
star
17

collab-writer

Realtime collaboration example.
JavaScript
14
star
18

store

Substance Document Storage Layer
JavaScript
13
star
19

regexp

Use Regular Expressions in Javascript with a comprehensible interface.
JavaScript
9
star
20

journal-old

Run a journal based on Substance (WIP)
JavaScript
7
star
21

commander

A substantial keyboard event mapper based on Mousetrap and inspired by Sublime.
JavaScript
7
star
22

application

Build Substance apps using Views, Controllers and Modules (CommonJS)
JavaScript
7
star
23

example-editor

Substance Example Editor
JavaScript
7
star
24

util

General Purpose Utils
JavaScript
6
star
25

converter

Pandoc in — Substance out and the other way round.
JavaScript
6
star
26

ui

Substance user interface components (deprecated)
JavaScript
6
star
27

screwdriver

Command line utility to manage Substance applications.
Python
6
star
28

nodes

Common node types for Substance.Article implementations.
JavaScript
6
star
29

chef-tutorial

Our internal Chef tutorial.
Ruby
5
star
30

test

Substance testing facility.
JavaScript
5
star
31

compiler

Takes a Substance document as an input and turns it into a web publication ready to be self-hosted
JavaScript
5
star
32

client

Substance Client API
JavaScript
5
star
33

bundler

Simple high-level build tool.
JavaScript
5
star
34

substance-website-legacy

Substance Website
JavaScript
4
star
35

pages

Static site generator.
JavaScript
4
star
36

tutorial

The official Substance Tutorial for developers.
JavaScript
4
star
37

archivist-writer

Archivist Writer based on the latest Substance
JavaScript
4
star
38

dar-server

Filesystem backend for document archives
JavaScript
4
star
39

texture-jats

JavaScript
3
star
40

library

Where Substance Documents feel at home.
JavaScript
3
star
41

archivist-composer

A composer for interviews, used by the archivist project
JavaScript
2
star
42

website

The new Substance website
JavaScript
2
star
43

docs

Substance API Docs
HTML
2
star
44

code

Substance Developer Resources
JavaScript
2
star
45

article

Substance Document Reference Implementation
JavaScript
2
star
46

replicator

Replication between two Data.Stores.
JavaScript
2
star
47

shell

Substance Native Shell
Ruby
2
star
48

webhook-tasks

A custom service which builds API docs et. al. triggered by github webhooks.
Shell
2
star
49

legacy-docs

Substance documentation repository. You're contributions are welcome!
2
star
50

sourcedata-smartfigure-editor

SourceData FigurePackages.
JavaScript
2
star
51

sublime

A custom sublime integration that helps us dealing with our many modules
Python
2
star
52

electron-environment

Environment for web development based on electron.
JavaScript
1
star
53

spellchecker

JavaScript
1
star
54

hub

Experimental server for realtime collab
JavaScript
1
star
55

writer-old

Substance Writer Component
JavaScript
1
star
56

substance.github.com

Substance website
JavaScript
1
star
57

server-utils

Substance server utilities
JavaScript
1
star
58

legacy-composer

JavaScript
1
star
59

archivist-interview

Archivist Article Format
JavaScript
1
star
60

console

Interactive Console to playfully manipulate a Substance document.
JavaScript
1
star
61

starter-legacy

A minimal Substance editor for learning Substance.
JavaScript
1
star
62

ember-cli-substance

Ember-CLI integration of Substance.
JavaScript
1
star
63

react-example

A minimal react project.
JavaScript
1
star
64

scientist-pandoc

A minimal document authoring solution for scientists, based on Pandoc Markdown
1
star
65

archivist-indexer

Archivist indexer based on ElasticSearch
JavaScript
1
star