All Projects → curvenote → schema

curvenote / schema

Licence: MIT license
Typed schema for writing reactive scientific documents.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to schema

noteworthy
Markdown editor with bidirectional links and excellent math support, powered by ProseMirror. (In Development!)
Stars: ✭ 178 (+947.06%)
Mutual labels:  prosemirror, text-editor
bangle.dev
Collection of higher level rich text editing tools. It powers the local only note taking app https://bangle.io
Stars: ✭ 541 (+3082.35%)
Mutual labels:  prosemirror, text-editor
editor
An interactive scientific editor built with ProseMirror, React and Redux - by Curvenote.
Stars: ✭ 157 (+823.53%)
Mutual labels:  prosemirror, science-communication
tree-sitter-legesher-python
✨ Legesher's Python grammar for Tree-Sitter 🌳
Stars: ✭ 40 (+135.29%)
Mutual labels:  text-editor
ce
Coma Editor - my personal editor
Stars: ✭ 20 (+17.65%)
Mutual labels:  text-editor
pro-writer
Minimal yet Pro Writer 🚀
Stars: ✭ 22 (+29.41%)
Mutual labels:  text-editor
WordIDE
A tool that helps you write code in your favorite IDE: your word processor!
Stars: ✭ 37 (+117.65%)
Mutual labels:  text-editor
Smart-Text-Editor
The text editor that requires only a browser and a keyboard!
Stars: ✭ 60 (+252.94%)
Mutual labels:  text-editor
ax-editor
Ax is a code editor with syntax highlighting that runs in your terminal written completely in Swift.
Stars: ✭ 42 (+147.06%)
Mutual labels:  text-editor
x-studio.github.io
This is the issues tracking, roadmap, docs src repo of the x-studio IDE. Copyright © 2014-2022 Simdsoft Limited
Stars: ✭ 92 (+441.18%)
Mutual labels:  text-editor
BCO Specification
Repository for support of the IEEE 2791-2020 standard. Please see our home page for communications/publications:
Stars: ✭ 17 (+0%)
Mutual labels:  science-communication
goneovim
A GUI frontend for neovim.
Stars: ✭ 1,721 (+10023.53%)
Mutual labels:  text-editor
Kodis
Kodis is an Android based Code Text Editor
Stars: ✭ 18 (+5.88%)
Mutual labels:  text-editor
am-editor
A rich text collaborative editor framework that can use React and Vue custom plug-ins. 一个富文本实时协同编辑器框架,可以使用React和Vue自定义插件。
Stars: ✭ 542 (+3088.24%)
Mutual labels:  text-editor
prosemirror-react-typescript-example
Minimal boilerplate to start a project with ProseMirror, React, TypeScript
Stars: ✭ 67 (+294.12%)
Mutual labels:  prosemirror
zee
A modern text editor for the terminal written in Rust
Stars: ✭ 1,120 (+6488.24%)
Mutual labels:  text-editor
JCEditor
📝 Text editor created in Java
Stars: ✭ 33 (+94.12%)
Mutual labels:  text-editor
dead-simple-text
Minimalist plain text editor for the web
Stars: ✭ 34 (+100%)
Mutual labels:  text-editor
vulcan
A minimalistic text editor designed for both ordinary use and software development
Stars: ✭ 46 (+170.59%)
Mutual labels:  text-editor
dotstail
This Repo helps you make a look alike text-overflow ellipsis for multiple lines using JS.
Stars: ✭ 16 (-5.88%)
Mutual labels:  text-editor

@curvenote/schema

@curvenote/schema on npm MIT License CI

Schema for interactive scientific writing, with translations to MyST flavoured markdown, LaTeX, and HTML.

@curvenote/schema in curvenote.com

Overview & Goals

  • Provide a typed schema for writing reactive scientific documents using @curvenote/components
    • Uses Web Components in the rendered HTML output for non-standard components
    • Uses standard html for all other compnents, with no styling enforced
  • Interoperability with CommonMark markdown and MyST
    • Through fromMarkdown and toMarkdown methods
  • Provide components for WYSIWYG editing of reactive documents

Choices

  • The internal representation for the library is a ProseMirror Document structure (that can be rendered as JSON)
  • markdown-it is used parse and tokenize markdown content

Schema

The schema has Nodes and Marks where Nodes are basically a block of content (paragraph, code, etc.), and Marks are inline modifications to the content (bold, emphasis, links, etc.). See the ProseMirror docs for a visual explanation.

Overview of Nodes

Overview of Marks

  • link
  • code
  • em
  • strong
  • superscript
  • subscript
  • strikethrough
  • underline
  • abbr

Simple Example

This moves from markdown --> JSON --> HTML. The JSON is the intermediate representation for @curvenote/editor.

import { Schema, nodes, marks, fromMarkdown, toHTML } from '@curvenote/schema';
import { JSDOM } from 'jsdom';

const schema = new Schema({ nodes, marks });

const content = '# Hello `@curvenote/schema`!';
const doc = fromMarkdown(content, schema);

console.log(doc.toJSON());
>> {
    "type": "doc",
    "content": [
      {
        "type": "heading",
        "attrs": { "level": 1 },
        "content": [
          { "type": "text", "text": "Hello " },
          {
            "type": "text",
            "marks": [ { "type": "code" } ],
            "text": "@curvenote/schema"
          },
          { "type": "text", "text": "!" }
        ]
      }
    ]
  }

// Assuming we are in node, just use `document` if in a browser!
const { document } = new JSDOM('').window;

// Now move the document back out to html
const html = toHTML(doc, schema, document);

console.log(html);
>> "<h1>Hello <code>@curvenote/schema</code>!</h1>"

Roadmap

  • Integrate other @curvenote/components as nodes
  • Improve equation and start to go to/from various MyST syntax for this
  • Add figure properties (name, width, caption etc.)
  • Provide citations, probably bring in a bibtex parser
    • Introduce citation and reference component to curvenote/components or article
  • Add overlaping roles/directives with MyST (e.g. see executablebooks/meta#70) for pointers
    • Add the necessary pieces to curvenote/components that are not basic html (MyST uses sphinx for the heavy lifting, cross-refs etc.)
  • Provide other sereializers from the document strucutre (e.g. latex or simple html without curvenote/components, possibly idyll)

See also:

  • Idyll Lang has a different markdown-like serialization with very similar base components to curvenote - see curvenote/article#8 for a comparison.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].