Giter Club home page Giter Club logo

edith's Introduction

Edith

A quick small wiki, perfect for pasting quick texts or code and sharing it between friends.

Don’t worry about saving, it saves at every key stroke. Think of it as a magic zero-UI Web notepad.

Try it out at https://edit.sunfox.org/any-page-name.

Usage

  • /any-page-name: type what you want, it’s saved automagically!
  • /any-page-name.txt: raw text version.
  • /any-page-name.html: HTML version through the Markdown syntax.
  • /any-page-name.remark: Slideshow version using Remark.
  • /any-page-name.graphviz: Graph version of the dot syntax using Viz, see WebGraphViz for examples.

Keyboard shortcut cltr-e switches from edit mode to HTML mode.

Favicon

Animated screenshot of the Favicon changing as the page updates

The favicon changes as the page updates and is also an indicator that the page is currently saving or not.

REST

Edith is also a RESTful API. So go ahead and try to PUT or DELETE on these URLs.

Install it yourself

Clone it locally:

$ git clone https://github.com/sunny/edith.git
$ cd edith

Using Docker

Build the image:

$ docker build . -t edith

Run it:

$ docker run --rm -p 8888:80 edith

Now you can access Edith from http://localhost:8888/

Using a local web server

Make the data directory writable:

$ chmod a+w data

Run it with a web server that interprents PHP and points all 404s to index.php:

  • PHP’s built-in server for development:

    $ php -S localhost:8888 index.php
  • Apache:

    You can use the example htaccess.

    $ cp htaccess.example .htaccess
  • nginx:

    Add the following directive to your nginx configuration:

    try_files $uri $uri/ @rewrites;
    location @rewrites {
      rewrite ^ /index.php last;
    }
    

Further use

Configuration

Copy config.example.php to config.php and read the examples to use your own configuration file.

Read-only pages

To make pages read-only, make them non-writable on disk:

$ chmod -w data/foo.txt

They will then be shown using the HTML representation through Markdown instead.

To deactivate the creation of new pages, make the data directory itself non-writable.

URLs

You may use any file name you like as long as it doesn’t end like a representation (.txt or .html).

If you prefer /page.js/txt URLs instead of /page.js.txt, the config file has a setting for you.

Contributing

You are welcome to contribute by adding issues and forking the code on GitHub.

Licence

Edith is released under the MIT License.

edith's People

Contributors

andrewten45 avatar knuton avatar ook avatar sukuasoft avatar sunny 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  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

edith's Issues

Dark mode

It would be nice to have a dark mode that simply uses the user’s preference.

No need for a UI to switch modes, it would just use the browser’s preference, using @media (prefers-color-scheme: dark) {.

(node) sys is deprecated. Use util instead.

(node) sys is deprecated. Use util instead.
Cakefile#1 is using require('sys') which has been deprecated in Node 4.0.0.

- {print} = require 'sys'
+ {print} = require 'util'

Store encrypted data

The idea would be to encrypt data in the browser, so that Edith never sees the passphrase, nor the secret that was typed.

If you don’t know the secret you can still clear the page so that nobody can “own” a page.

Usage

To encrypt: go to /foo.crypt (A) and type a secret in a password input at the top of the page. In the bottom textarea you can type a message, with the usual autosave on every keystroke (B). Instead of sending the typed text, the JavaScript will use the password to encrypt the data on the client-side and then send the encrypted blob of data to the server.

To decrypt: go to /foo.crypt again and you will see an empty passphrase input and encrypted text (C). On every keystroke in the password field, the data will be decrypted using that key (D). If you type the correct password that only you know (not even edith does), the data will be correctly decrypted (E). You can now read the text, or modify it and have it save on every keystroke.

If you visit the page (/foo) you would only see the encrypted text (F).

Behavior that has yet to be defined:

  • What happens if you type text before typing a password?
  • What happens when you change the key while you are editing the page?

Mockups

A (going to /foo.crypt):

🔑 [              ]

B (same page after filling both the page):

🔑 [•••••••       ]

This is the top secret message!

C (same page but with no key):

🔑 [              ]

���&�?=�;�⏾E��~�;�#�����-XdMe�e��X ���8[ДJME�����R��HvYO}�zJfs�+ئ�Q���T{���=�B�yu

D (same page but with wrong key):

🔑 [•             ]

M9�b�)����80��M-�\����a!~�"�ԶfE����:b\�Ô#�O�?I?�!#ƺ7c�qX�XHj���f�}pC��B���BΜR~3

E (same page but with wrong key):

🔑 [•••••••       ]

This is the top secret message!

F (going to /foo):

���&�?=�;�⏾E��~�;�#�����-XdMe�e��X ���8[ДJME�����R��HvYO}�zJfs�+ئ�Q���T{���=�B�yu

Support markdown extra

In order to render table for example

First title | Second title
------------- | ------------
data       | data     
data       | data     
First title Second title
data data
data data

Protect page editing with a password

Write a user and a password at the top of the textarea to protect the page from editing with a HTTP Basic Auth.
A solution with one line :

user: my_username, password: my_password
content of the file…

A solution with a YAML Front Matter like Jekyll :


---
user: my_username
password: my_password

---
content of the file…

These credentials must be invisible from all others representations.

Work offline

Saving should be done as soon as you are back online so that you can use the app offline.

Snappy requests

Instead of saving every 2 seconds Edith should try to save at every text input (keystroke), waiting for the previous ajax requests to be done to send a new one.

Remember caret position

On save, save the position where you were typing in the editor (for example in localStorage). This way, on page reload you can place the caret at the same place and continue typing where you were before.

Use ACE

The ACE editor has good features for Edith including:

  • syntax highlighting (if there is an extension like .js, .md, …)
  • good looking themes
  • indent and outdent with soft tabs
  • highlight matching parentheses
  • displays hidden characters
  • drag and drop text using the mouse
  • code folding
  • multiple cursors and selections

In order to be a good fit for Edith, the editor should be as transparent as possible.

Configuration to protect some pages

Add a configuration constant that allows developers to specify a list of page names that cannot be modified.

This would help protect the index page from getting modified.

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.