Code Monkey home page Code Monkey logo

standard-notes-indent-editor's Introduction

Standard Notes Indent Editor

This is a text editor for the encrypted note taking app https://standardnotes.org/.

A simple text editor that makes it easy to write and read nested notes.

Online demo with explanations: https://maxlap.github.io/standard-notes-indent-editor/demo.html

The demo shows everything nicely, but compared to a basic text editor:

  • Press Tab to indent the line (or selected lines) with 2 spaces (even if in the middle of the line).
  • Press Shift + Tab removes 2 spaces from the beginning of line (or selected lines).
  • Enter creates a new line with the same indentation as the current line.
  • Empty lines are smaller than a normal line, giving you more control over spacing.
  • Lines can wrap.
  • When lines wrap, they will align with the same indentation as the first line.
  • Stars (*), dashes (-), greater than (>) and plus (+) are considered part of indentation. This means:
    • Lines wrap until after those characters too.
    • Pressing Enter copies the *->+ along with the spaces.
    • Indentation uses a fixed-width font, so it always align nicely.
  • Numbered lists (lines starting with 1. then 2.) are also considered indentation, and numbers will auto-increment on "Enter".
  • Lines that wrap are shown as paragraph of around 50 characters wide. This keeps them from being super large and hard to read
  • Lines that wrap are slightly closer together vertically.
  • Lines starting with a number sign (#) are headers, shown as bold and bigger text.
  • Things that look like web addresses are highlighted, and can be ctrl+clicked to open in a new tab.
  • You can use backticks (`) to put code in a line, this will look similar to Markdown, but the backticks are not hidden: `code`
  • Text between triple backticks ``` (they must be at the end of lines) is shown as a blocks of code. Again, this will look similar to Markdown, but without the box:
    ```
    function hello() {
      console.log('hello world')
    }
    ```
    
  • Pressing Ctrl + D duplicates the selection or the current line if no selection.
  • Pressing Ctrl + Shift + Up and Ctrl + Shift + Down will move the selected lines up and down.

How to install

In Standard Notes (either browser or desktop), click Extension, then Import Extension, paste this link: https://listed.to/p/eUPdNELfEu, press Enter.

You should then be able to select the Indent Editor in your list of editors.

The goals

  • A simple text editor that makes it easy to write and read nested notes.
  • Be your main text & notes editor

This means:

  • Grouping things help: natural indentation, lists and vertical spacing handling
  • Splitting lines is troublesome: long lines wrap nicely.
  • What you see come from the text: no formatting buttons or commands.
  • See your text: Every character is displayed, nothing is hidden.
  • Not locked in: The text will look fine in any other editor, you wouldn't lose anything.

Supporting the editor

If you enjoy the editor, please consider hitting the sponsor button at the top of the page to encourage my work.

Basic of how to dev:

Clone the repo.

Install the dependencies:

npm install

To run the server to try out the editor:

python3 -m http.server 8080

To update dist/ files which are sent as editor, run:

grunt

You can use the demo to just try out the editor:

http://localhost:8080/demo.html

To refresh your editor with the modified version, the way that always work is to open the Chrome console, then right-click the refresh icon and do a "Empty cache and hard reload". Other ways of doing hard refreshes may work, but the cache clearing has sometimes been necessary for me.

You can also try it in StandardNotes (but it's more painful to do so):

Import the local test extension if you didn't already. Do it from the desktop app because otherwise, it's a http call within a https one which is refused by your browser. This is the link to the extension:

http://localhost:8080/local_ext.json

Once the app is imported, you can test it from:

  • the browser app: It's possible it wont work until you allow Mixed Content in the page page. Search online for how to enable it for your browser.
  • the desktop app. I have no idea how often the desktop will refresh the extensions, so that may be painful except as last validation.

standard-notes-indent-editor's People

Contributors

17prime avatar christianhans avatar maxlap 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

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

rhjp ghedamat

standard-notes-indent-editor's Issues

Bug: Line wrapping not working on big screens

Thank you for this wonderful sn editor!

As I understand the auto line wrapping function correctly, then all chars that passes the ~50 chars mark, should wrap into a paragraph.

  • When I typing a long line on my ipad, it wraps around the 50th char.
  • When I typing a long line on my surface 6, it wraps around the 50th char.
  • But, when i typing a long line on my Desktop PC with a 32" monitor, the line wrap accours, when a natural wrap happens, while reaching the end of the line (around 200+ chars)

So i think this is a bug.

Support for ordered lists

This editor is fantastic.

Have you considered adding supprt for ordered lists?

So starting a line with "1. " the editor would use the same indenting and line spacing as with un-ordered lists and when you start a new line it would automatically type "2. " at the start. Then, if you were to insert or delete an item the rest of the items would re-number themselves automatically.

Marking text as title using # not working

Just tried out this editor and everything is working perfectly except the title feature you described in the readme:

Lines starting with a number sign (#) are headers, shown as bold and bigger text.

image

I expected those lines starting with # to be bold. Is this correct?

No License?

The repo appears to be lacking a LICENSE file telling us all the ways we can use and abuse your code :)

[Feature Request] Some simple Markdown parsing

Heya, stumbled upon your editor and it's rockin'! The default editor's text wrap not respecting indents annoyed me to no end. Just had a couple wishes regarding parsing some markdown features:

  1. text snippets,
2. code blocks
  1. Some rough heading parsing (#, ##, ###, etc), such as bolding the letters. Size differences for the headings would be even better!

If I have some time, I can take a shot at it too! Thanks again for this editor.

Ajouter licence

Bonjour!

L'extension semble géniale :)

Est-ce qu'une licence libre pourrait être assignée au code svp?

Merci!

Press return twice to end a list

Hi,

Great editor, I love it. It is slowly becoming my editor of choice.

When making a list, pressing return creates a bullet point. What do you think if pressing return directly again, deletes the current empty bullet point and creates a new line.

At the moment, to exit a list, you need to press return, then press backspace twice to delete the empty bullet point and then press return again.

Cheers,

Mobile doesn't have autocomplete/suggested

On Android at least it doesn't correct words as I type or have suggestions for what I'm typing. Seems to treat it as a dumb input. It seems like it's an issue with the app, but I don't run into this with any of the other custom editors.

It also happens in a browser (Firefox Preview) on the demo.

Block quote support

Another idea would be to add block quote support.

So instead of "> " being an un-ordered list it denotes a block quote, providing better compatibility with markdown. The editor would dim the "> " symbol, darken the text that comes after it and draw a vertical line between the two.

What do you think?

Feature Request: Monospaced Font

I think, formating plaintext with a monospaced font is alot easier.
Currently, i add tripple ''' to the text, to format some parts of it, but this is not comfortable as it could.

So please add a way to respect the global sn monofont switch.
Thanks.

Add Spell Check

Not sure how feasible with Code Mirror. Would be still nice to have Spell Check eventually.

Unable to add new lines to note via Android app

Using the indent editor on the official Standard Notes android app, I have run into an issue when using it to edit notes. If I place the cursor at the end of a line, whether it contains content or not, I would expect that pressing enter/return would insert a new line below. However, what happens is that when pressing enter/return the cursor moves to the next line but then returns to the end of the previous line, and I am unable to insert a new line. This does not appear to happen if you press enter/return when there is no content within the note.

All configuration settings for indent left to defaults.

Android app version: 3.6.23 (3000300)
Standard notes API version: 1.24.0 (self-hosted)

Monospaced font does not use the default one?

On my Standard Notes app on Windows, without any theme installed, the Plain Editor uses Consolas 11 as the font. But if switching to the Indent Editor and enabling the monospace font, the font becomes some other bigger, wider font (maybe Courier New, 12?).

Personally I prefer Consolas 11, but at the very least this is inconsistent with the Standard Notes default.

Default Editor

Thanks for this extension. Is it possible to make it the default editor? I've just imported many notes from another app and does it require manually setting the Editor for each?

new config doesn't work well with dark theme

Just a note to point out that the new config page appears with dark text on a dark background when using a dark theme (just testing with Slate Theme on Desktop 3.4.1), requiring one to turn off the theme to read it.

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.