Giter Site home page Giter Site logo

notes.txt's Introduction

Notes.txt: Command-line Notes application

notes.txt is a simple command-line note managing application.

Warning
This is preview release of the program. I only released it to collect ideas on how it can be improved. Your data should be relatively save as everything is stored inside a git repository.

LICENSE

Copyright © 2013, Qball Cow and contributors All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  • Neither the name of Qball Cow nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY Qball Cow 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Qball Cow BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Motivation

Notes.txt was written because I wanted a simple application to takes notes. It had to be command-line and version controlled. A quick search did not turn anything up, so I decided to write one myself. It tries to re-use as much as possible. Therefor it reuses the following tools:

  • asciidoc: For markup of each note.

  • git: For version control.

  • bash: To put everything together.

  • find: Find files.

  • grep: Search in files.

  • nm-online: Check if online (optional).

  • sed: Automatic edit notes.

  • vim: Note editor. (configurable)

  • md5sum: Check if file changed.

Notes.txt will do the following things:

  • Allow you to quickly search through your notes.

  • View each note in the browser.

  • Commit changes when changed on edit.

  • Delete notes.

  • Push/Pull from remote repository, if online.

  • Organize notes.

  • Bash Tab completion.

  • Export note to html

Installation

Notes.txt installation needs the following files installed:

  • notes.sh: The main script.

  • includes/*.inc: Helper files with the actual functions.

  • config: The configuration file.

A good installation would be:

  • notes.sh → ~/.local/bin/

  • includes → ~/.local/share/notes/

  • config → ~/.notes.config

The first two locations can be configured in the config file. The configuration file should always be in this location.

There is an included makefile that will install notes.sh for you.

make install

Setting up Notes repository

Notes.txt by default assumes the Notes repository is a checkout from a remote git repository and it can push/pull. If this is note desirable, set HAS_INET=0 in config. Then it will not automatically push/pull.

cd ~/
git clone <remoterepo> Notes

Or create a new one:

mkdir ~/Notes
git init .

Commands

  • add: Add an item.

    notes.sh add <Project>
  • remove: Remove an item

    notes.sh remove <id>
  • view: View the html rendering of the note

    notes.sh view <id>

It is also possible to search:

    notes.sh view <search regex>
---------------------------------
If multiple items match, it will display a list.
NOTE: If you view a note that is being edited, the temporary file
will be build and displayed.

 * 'edit': Edit an item
[source,bash]
--------------------------
    notes.sh edit <id>
--------------------------
It is also possible to search:
[source,bash]

notes.sh edit <search regex>

If multiple items match, it will display a list.

  • list: List items

    notes.sh list <search regex>

A generated list looks like:

ID Project      Description
-- ------------ -----------------------------------------
1  Prive.Gmpc   Keybindings Review
2  Prive.Notes  Notes.txt: Command-line Notes application
3  Prive.Others Headphone Research
4  Prive.Others RSS Alternatives
  • export: Export an item

    notes.sh export <id> <format> <file>

What format is supported depends on the backend. Asciidoc support html, docbook, wordpress and more. You can specify additional backends in the config file. The raw format is special, and copies the input format.

  • push: Push local changes to remote git

    notes.sh push
  • pull: Pull local changes to remote git

    notes.sh pull
  • clean: Clean out all the temporary files

    notes.sh clean
  • move: Move a note to another project

    notes.sh move <id> <Project>

Download

You can download the program from github: here

Feedback

You can report bugs on github: here

Features requests are welcome. Do keep in mind I am trying to keep this program as simple as possible. If something more complex is needed I advice you to look at org-mode or desktop wiki applications.

Bash auto-complete

There is an auto-complete functions in notes.autocomplete.

Note
Most of the auto-complete code is build-in. This can be called by putting --complete in front of the arguments.

notes.txt's People

Contributors

davedavenport avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

notes.txt's Issues

Feedback

I really like the idea, as a matter of fact, I was thinking of something similar. I really like the idea of Todo.txt, they did a great job on that project. The idea of recognizing a syntax is cool and very organized. I also like how they only require one file + config which is very minimal and convenient. I don't like having git as a requirement, what if I don't want to use git?
Overall I like the idea :)

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.