Giter Site home page Giter Site logo

document's Introduction

Substance.js Build Status

Substance is a JavaScript library for web-based content editing. It provides building blocks for realizing custom text editors and web-based publishing system. It is developed to power our online editing platform Substance.

Development

Install the dev dependencies.

npm install

Run the dev server.

npm start

Navigate to http://localhost:4001/test for the running the browser test suite. The test suite is rebuilt as you make changes to the source files.

To run the test-suite headless.

$ npm test

document's People

Contributors

andreypopp avatar michael avatar obuchtala avatar oliver7654 avatar vectorsize avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

document's Issues

Support incremental updates for document properties

Should probably look like this. We need this to store a slug on the document, plus title, abstract etc. Everything that is directly attached to the document.

doc.apply(["set", {username: "michael", name: "hello-world"}]);

Uncaught TypeError: Cannot read property 'util'

I get the following output in the console when visiting index.html:

Uncaught TypeError: Cannot read property 'util' of undefined document.js:17
Uncaught ReferenceError: Substance is not defined 

Clarify the atomic parts and data types of the model

There is already a standard format for "arbitrary digital documents" that "doesn't make any assumptions on a concrete type or structure": it's called bitstream, based on zeroes and ones. An there is another, calles Unicode strings, based in UCS characters. And there is XML, based on XML elements, attributed and text nodes. Or SQL with tables, columns, and data types. What I try to say is: the Substance Document Model is not better or worse to encode digital documents than any other technology. It depends on what you mean by "document" and which kinds of elements are better supported than others. From the current documentation your basic assumptions with atomic parts, data types etc. are not quite clear. Is the general structure a (connected) graph, a tree, a sequence? Which kinds of elements exist (strings, nodes, connections...)? Which predefined building blocks exist? For instance if I want do model documents with sections, paragraphs, characters, and a set of markup types, do I have to define them all on my own and manually map them to existing definitions in other document formats (HTML, Markdown, LaTeX...)? If there are no predefined data types, then substance looks like nothing more (or even less) than a content-agnostic data structuring language such as XML, JSON, or RDF. If there are too many predefined types, it is just another document format, such as TEI, HTML, ODT etc. But it's somewhere in between, right?

Inclusive/exclusive behavior

Link: non-inclusive (both sides)
Idea,Question, Error: non inclusive (both sides)

strong, em: right-inclusive (except you enter text at pos 0, then it's also left inclusive)

Overlap business:

em and strong are mutually exclusive, while markers (question,idea,..) can be combined with them. However question/idea/error are mutually exclusive too.

We need a default transform method, that can be overridden by the application.

Nesting of headings

Since the Substance Document model is a "sequence of content nodes", and not a graph, I'm having trouble trying to figure out how I could have deeper level (h2,h3..) nodes in this model.

Any ideas?

Cannot publish with GitHub Pages

Very cool project! I was not able to publish with GitHub Pages when I tried the "Publish" function. I got the note that "Repo does not exist" and when I clicked "Create" I got the error "Could not create repository.". However, when I check my repositories, I see the "new" repo I just "created" (contains only the README.md). I get the same errors when I try to create the just "created" repo. It might be an issue on my side, but just wanted to let you know. Keep it up!

Specify head/branch name on operation level

By being explicit about the branch/head the operation should be applied, we can avoid additional commands for switching branches, and we don't need to create a branch with no new ops, before we can start applying operations on it.

Think about this:

doc.apply({
  op: ["insert", {id: "text:5", "type": "text"}],
  sha: abcdef, // optional: sha is generated on demand if not specified
  head: 'patch-michael'
});

It will dynamically create a reference to the patch branch, once it has been applied to the document.

Just an idea.... let's find out if this works well.

Multi-level content arrangement

I understand from the documentation that the content's layout is pre-defined by the system instead having to be determined by the user and also noticed that the current Substance Document Model implementation makes use of a Heading and Text as main types. This make sense for a one-level document only.

When a user is willing to have a Text in a 3rd level of the document is she breaking the "layout is for the system" rule?

How is the current Document Model feasible for a multi-level arrangement of content elements?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.