GithubHelp home page GithubHelp logo

rtjoa / modular-documents Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 1.25 MB

Create and share module-based, notebook-like documents.

Home Page: https://modular-documents.netlify.app/

HTML 4.01% JavaScript 74.57% SCSS 21.42%
firebase react

modular-documents's People

Contributors

advaithg avatar austinlaw8 avatar gishki23 avatar nareha avatar rtjoa avatar

Watchers

 avatar

modular-documents's Issues

Add history stack, undo, and unsaved changes warning

For document editing, add a history stack for when the array of module data's changes, then use this to add undo, and an unsaved changes on closing the page when there are outstanding changes.

Note: #29 should be addressed first.

"Unsaved changes" warning

  • Create state.unsaved in Document module, and set to false on doc load and save
  • In setData, moveModuleUp, moveModuleDown, deleteModule, and addModule, set state.unsaved to true
  • Give navigation warning if state.unsaved is true

Implement document visibility

Let user choose between three levels of visibility for documents they own (currently, this is always 0)

  • 0: only owner can see
  • 1: anyone with link can see
  • 2: searchable from explore page

Robust document searching

Allow modules to be searched by whether the query is a substring of the title, rather than just if the title starts with the query.

Maybe also have modules store "searchText" tailored to their type, and look for matches in that.

Design backend

  • Choose DB service
  • Design API endpoints & DB structure

Add module versioning

Each module should have a integer version number associated with it.

When we change how the data for a module is represented, we increment its version number, and add a function to upgrade the version.

For example, say TextModule starts at version 1, and its data looks like {text: "Lorem ipsum"}:

// TextModule.js
TextModule.version = 1;

When we add a 'font_family' property to text modules, we increment the version to 2 and define a function to dictate how we upgrade from version 1 to 2:

// TextModule.js
TextModule.version = 2;
// TextModuleUpgrader.js
const UPGRADE_FUNCTIONS = {
  2: (data) => ({...data, 'font_family': 'Arial'});
}

If, in another update, we decide to represent text data as HTML, then we could do the following:

// TextModule.js
TextModule.version = 3;
// TextModuleUpgrader.js
const UPGRADE_FUNCTIONS = {
  2: (data) => ({...data, 'font_family': 'Arial'});
  3: (data) => `<p style="font-family:${data['font_family']}">${data['text'}</p>`;
}

Then, if need to render/edit a Text Module from version 1, we set its data to UPGRADE_FUNCTIONS[3](UPGRADE_FUNCTIONS[2](data)).

Add document liking

Users should be able to like others documents so we have a way to sort the explore page by quality.

It would also be cool to be able to sort by "Top" (most likes) and "Hot" (formula like this).

Some other considerations about document discovery:

  • Perhaps we also have different types of likes, such as useful/interesting/funny
  • With just basic liking, we could implement recommendations, e.g. "Documents you might be interested in"
  • Document tagging, by the creators (e.g. most articles) and/or the consumers (e.g. Steam games)

Design Pages

  • Welcome
  • Edit document
  • View document
  • My documents
  • Explore

Standardize module text formatting

At least Markdown should apply almost wherever the modules can contain text. Combining it with code block and LaTeX parsing (removing the need for individual modules for those) would be nice too.

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.