GithubHelp home page GithubHelp logo

ololduck / self-dot-wiki Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 1.0 891 KB

An opinionated Wiki and todo manager

Dockerfile 0.04% Python 4.01% JavaScript 94.73% CSS 0.56% Less 0.13% HTML 0.53%
wiki keyboard-shortcuts flask milligram tiddlywiki organization

self-dot-wiki's Introduction

self.wiki

documentation tests

self.wiki is a wiki and todo manager. I wanted to be able to write notes, documentation, and tasks from a simple (understand: minimal) interface, using mostly keyboard shortcuts.

Here's what my feature list draft looked like:

  • Create wikis directly from URL (ctrl+l, then type stuff, on most browsers)
    • On any URLs. i should not be restricted to naming stuff (restricted names are /todo, /**/edit, /**/edit/save, /**/edit/delete)
  • Wikis should be more or less standard extended markdown
  • Wikis should be stored on the filesystem as-is, no database or stuff like that. I should be able to read them using less when i want to.
  • Should not make calls to the outside world, except on linked stuff.
  • At least todo operations should have keyboard shortcuts
    • add
    • delete
    • update status
  • I should be able to navigate links without using weird browsers like uzbl

That's more or less it.

I looked at several other solutions, including tiddlywiki, but it was too mouse-based for my tastes.

Important security note:

self.wiki should not be publicly accessible! Any potential mean-inclined person could steal valuable secrets from your computer via this application! That is because we allow a potential attacker to request files outside of self.wiki's CONTENT_ROOT.

If you don't specify a --host argument, self.wiki will listen only on the local computer, and should therefore be safe to use.

Installation

Install using pip, using the master branch, or by picking a release in the releases tab:

pip install https://vit.am/gitea/paulollivier/self-dot-wiki/archive/master.tar.gz

Then, simply run the included script:

$ self.wiki --help
usage: self.wiki [-h] [--debug] [--host HOST] [-p PORT]

optional arguments:
  -h, --help            show this help message and exit
  --debug               Turns on debug mode
  --host HOST           address to bind on
  -p PORT, --port PORT  Port to listen on

Configuration

Configuration is kept to a minimum, and uses environment variables to achieve its goals.

Environment variable name default note
SELF_WIKI_CONTENT_ROOT ~/.self.wiki self.wiki will store its markdown files there.
SELF_WIKI_FAVICON_PATH /static/favicon.ico Path to the favicon to use. Must be relative to the CONTENT_ROOT.
SELF_WIKI_TITLE_PREFIX "self.wiki " Page <title> prefix.

Usage

After having started self.wiki, go to your navigator, open up http://localhost:4000/. Help should be available at http://localhost:4000/help.

If a page is not available, you will be redirected to its edit page, which is simply /path/to/page/edit.

Keyboard shortcuts

We make heavy use of accesskeys to navigate the page. In fact, self.wiki autogenerates those on every link present on any page.

On firefox, you can activate these keys by pressing alt+shift+key.

There are also some keyboard shortcuts available on a more general manner.

Keys Context Effect
ctrl+c n any create a new todo item
alt+shift+f any select the search box
ctrl+c d view delete current page
alt+shift+o edit send a file, sibling to the current edited file
alt+shift+s edit save current edited file

Todos

To create a todo item, use the keyboard shortcut (please see above). You will be prompted for a text that will be shown.

To mark a todo item as done (but not remove it completely), click on its text. The text will be striked, representing completion.

To delete a todo item, click on its del button.

NOTE: if a todo item is deleted, when also marked as done, we will write this item to a special page, /journal/year/month/day.md.

Search box

When the search box is selected (Alt+shift+f), starting typing will open up a suggestion list. Selecting an entry (with arrow keys+enter), and then pressing enter will open up the corresponding page. If you instead want to create a page, simply type the wanted path, and press enter.

Writing content

With the edit page opened (/page/path/edit, where /page/path is any path), you may start writing some markdown content. It is also possible to send files using alt+shift+o, which will open up a file selector, enabling you to send files.

Two type of saves are done:

  1. A browser-local save: the editor keeps a client-side save of its contents every few seconds.
  2. A backend save, every 20s. The editor's content is sent to the server, and written to the content root for safekeeping

You can trigger a manual save using alt+shift+s.

Git integration

If a .git repository is present at the root of the SELF_WIKI_CONTENT_ROOT, self.wiki will try to commit changes.

Please note that they won't be pushed or pulled to a remote repository! I might add it in the future

Advanced usage

Instead of running the included self.wiki script, you may use any WSGI-compatible server. This will increase the performance of loading the pages.

For instance, using gunicorn:

gunicorn -b localhost:4000 self_wiki:app

I have yet to run benchmarks to measure the real-world improvements.

Special thanks

This project uses many open-source libraries:

Special thanks to those.

self-dot-wiki's People

Contributors

dependabot[bot] avatar ololduck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

zhangaz1

self-dot-wiki's Issues

We need unit testing

The recent bug found with unittest (#3) convinced me to setup some unit testing, and to automate the process as much as possible.

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Document all the things

We need to write documentation regarding the following subjects:

  1. Usage, that is reading and writing content
  2. How to contribute

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.