rtjoa / modular-documents Goto Github PK
View Code? Open in Web Editor NEWCreate and share module-based, notebook-like documents.
Home Page: https://modular-documents.netlify.app/
Create and share module-based, notebook-like documents.
Home Page: https://modular-documents.netlify.app/
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.
state.unsaved
in Document module, and set to false
on doc load and savesetData
, moveModuleUp
, moveModuleDown
, deleteModule
, and addModule
, set state.unsaved
to true
state.unsaved
is true
Let user choose between three levels of visibility for documents they own (currently, this is always 0)
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.
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))
.
Let modules call functions to get/set server data associated with that module specifically. This would allow poll modules, and for modules to persist data for individual users.
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:
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.
We should only store each module's data
, not its tempData
or editing
properties.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.