Code Monkey home page Code Monkey logo

mnemonic's Introduction

This repository contains the source-code for www.codesections.com, the personal website and blog of Daniel Long Sockwell (a lawyer-turned-programmer with an interest web development, open source, and making things as simple as possible).

The site is built with Gutenberg, the fastest and best static site generator. It is hosted by Netlify, which provides high-speed hosting for static sites.

License

The source code of the site is licensed under the MIT License. Any code posted to the site is likewise licensed under the MIT License unless otherwise specified. The non-code content is licensed under the Creative-Commons Attribution 4.0 International License.

Contributing

As this is a personal blog, I do not anticipate many contributions. However, I welcome pull requests for typo fixes, code improvements, or any other suggested changes.

mnemonic's People

Contributors

codesections 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mnemonic's Issues

Migrate to `failure` crate for error handling

As mn grows, it's error-handling code is getting increasingly complex. Additionally, it should be even more complex than it is—there are still several places where values are being unwrapped where they should be returning Results. This was fine for a quick prototype, but needs to be fixed. (This was the root cause of #18, which was an extremely bad bug to have, even in a pre-1.0.0 release).

To fix this, it is time to migrate the codebase to failure. This will slightly slow the pace of updates—including those needed to fully implement #16 and to begin to implement #13. But it will only get harder to do later, when there is more error code to transition, so the present seems like the best time.

Command `make install` does not work On MacOS

Running

$ git clone $MNEMONIC
$ cd mnemonic
$ sudo make install
find: illegal option -- t
usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]
       find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]
install -m 0755 -v ./target/release/mn /usr/local/bin/mn
install: ./target/release/mn -> /usr/local/bin/mn
cp /mn.1 /usr/local/share/man/man1/mn.1
cp: /mn.1: No such file or directory
make: *** [install] Error 1

I thought this had to do with the Cargo build, but it seems to be about install the manpages.

Anyways, I think I will use this to replace my usage of MacOS Notes.App, thanks for making it!

revise to use sub-command architecture

My initial thought was that mn was simple/minimalist enough that it should use flags rather than sub-commands. However, the discussion in #3 and #4 are causing me to rethink this decision: it seems like it would be better to have the syntax of mn rm -f NAME instead of mn --rm -f, and having an mn edit sub-command would let us have syntax like mn edit --set-filetype

Interactive Error Handling

Hi, I just found mn and it looks quite useful, thanks for creating this and sharing it!

One papercut I ran across in using it was creating my initial data. I'm unable to edit something before I add it, and although the message sounds like it will be interactive, it actually just exits with an error code.

❯ mn edit notes
notes not found.  Would you like to add it to Mnemonic?
❯ ...

Would you be interested in a Pull Request to make this experience interactive?

  1. Prompt the user [y/n]
  2. The "no" case would exit without an error code
  3. The "yes" case would potentially
    a. Run the add command
    b. Run the edit command

Better way to sync mnemonics

Hi and thanks for the great work. I would like to "sync" my notes between computers so I would like to use a custom path to store my mnemonics. Is this feasible? And if so, how can I achieve this?

Feature request: Configuration files

mn is getting more powerful, and we should let users take advantage of that power with custom configurations (rather than by passing command-line flags).

Ideally, we would have both global config values and per-file config values set in frontmatter.

These values should be configurable from the command line with syntax similar to git config

Rename sub-command

I am using mnemonic 0.2.1
It would be nice to have a rename sub-command that change name motes to notes without copy it :)

A few non-critical issues with `--rm` command

  • If the user enters an invalid response to the confirmation prompt, future valid responses aren't recognized. BUG
  • The --rm command should allow users to delete more than one file at a time. feature request
  • The --rm command should have a -f flag that prevents the confirmation prompt. feature request

New command fails on MacOS

After running cargo install mn I am unable to create a new entry using the tool.

=> mn -n note                                              
The file /Users/username/Library/Application Support/mn/note.md does not exist.

I checked, and the mn directory was missing, so I created it and tried again, with the same issue.

=> mkdir /Users/username/Library/Application\ Support/mn
=> mn -n note                                             
The file /Users/username/Library/Application Support/mn/note.md does not exist.

Just to confirm, I also created the file, then tried again, with a reasonable response.

=> touch /Users/username/Library/Application\ Support/mn/note.md
=> mn -n note                                                     
note already exists.  Did you mean to edit it instead?

Add ability to output text without formatting.

I would like to use this application to keep commands that I need to use semi-frequently, but dont want to store an alias for.

So I can do:

▶ $(mn command)

And it will execute that command. However, this currently doesnt work, as formatting bytes are added to the output. Could we have some flag to disable formatted output?

Perhaps something like:

▶ $(mn -q command)

panic after installation

I just installed mn and do

mn list 
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

and back-trace:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:1009:5
stack backtrace:
   0:     0x55fb7133a423 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h00d1e05a61bd440b
                               at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x55fb71334cc8 - std::sys_common::backtrace::_print::hc0d53aca8da62f75
                               at src/libstd/sys_common/backtrace.rs:71
   2:     0x55fb71339472 - std::panicking::default_hook::{{closure}}::h46d30bcc4bfff149
                               at src/libstd/sys_common/backtrace.rs:59
                               at src/libstd/panicking.rs:211
   3:     0x55fb713391dd - std::panicking::default_hook::h017696c2a8b7b16f
                               at src/libstd/panicking.rs:227
   4:     0x55fb71339b20 - std::panicking::rust_panic_with_hook::h8cbdfe43764887be
                               at src/libstd/panicking.rs:491
   5:     0x55fb713396a1 - std::panicking::continue_panic_fmt::h3d3c5a833c00a5e1
                               at src/libstd/panicking.rs:398
   6:     0x55fb71339585 - rust_begin_unwind
                               at src/libstd/panicking.rs:325
   7:     0x55fb71352a3c - core::panicking::panic_fmt::h4d67173bc68f6d5a
                               at src/libcore/panicking.rs:95
   8:     0x55fb711053b9 - core::result::unwrap_failed::h6e467703d0e0a567
   9:     0x55fb710fea3b - mn::state::State::from_config_file::h611230c844c1bf53
  10:     0x55fb71104186 - mn::main::hc8aea7800c70629f
  11:     0x55fb71103572 - std::rt::lang_start::{{closure}}::h22125b5942599dfd
  12:     0x55fb71339522 - std::panicking::try::do_call::h69790245ac2d03fe
                               at src/libstd/rt.rs:59
                               at src/libstd/panicking.rs:310
  13:     0x55fb7134c0c9 - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:102
  14:     0x55fb71339ef3 - std::rt::lang_start_internal::h540c897fe52ba9c5
                               at src/libstd/panicking.rs:289
                               at src/libstd/panic.rs:398
                               at src/libstd/rt.rs:58
  15:     0x55fb711046e1 - main
  16:     0x7ff8d9772222 - __libc_start_main
  17:     0x55fb710ce1cd - _start
  18:                0x0 - <unknown>

I think it's due to some configuration file that is missing?

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.