Qownnotes: Alternative ordered list syntax

Created on 2 Sep 2019  路  6Comments  路  Source: pbek/QOwnNotes

Hey,

first of all - thank you for the application. I use it almost daily and it helps keep things organized :)

Quite often I need to work with large ordered (numbered) lists. Quite often things get ugly when I need to add a new item between two other items. Usually, this means that I have to "fix" the numbers of the following lines.

Markdown supports an alternative syntax for numbered lists. Each line can start with 1.. The render engine converts it later to a regular numbered list.

The rendering part works. It's not possible to set the editor to use this syntax for new list items.

Would it be possible to add an option in settings which could enable this syntax?

Expected behaviour

Create first list item:

1. Foo

Go to next line. This should create another item:

1. Foo
1. _

Actual behaviour

1. Foo

[enter]

1. Foo
2. _

Steps to reproduce

Written in the previous section

Help wanted Scripting Feature

All 6 comments

first of all - thank you for the application. I use it almost daily and it helps keep things organized :)

Thank you for your kind words!

Markdown supports an alternative syntax for numbered lists. Each line can start with 1.. The render engine converts it later to a regular numbered list.

Markdown doesn't care at all what numbers are used. They all just get converted to list items in ordered lists in html (which don't have manual numbering).

Phew, lists like...

1. test
1. sdfsdf
1. sdfsdfsd
1. asdas
1. sdfsd

...look ugly.

You rather would want to write a custom action (see https://docs.qownnotes.org/en/develop/scripting/README.html) that could re-number the list items in the selected text.

You need a few lines of code in a custom action for the note edit context menu that gets the currently selected text, checks every line if the line starts with a number and a point and overwrites the number with the correct number. In the end you can use Write text to the note text edit to get your updated text into your note again.

I can help you if you want to attempt such a script. :smiley:
And later you can make a pull requests on https://github.com/qownnotes/scripts.

@pbek can't promise anything yet I'll try to look at this :)

Superbly done, works great! Thank you! :clap: I guess we can close this then. :smile:

Was this page helpful?
0 / 5 - 0 ratings