Skip to content

Lists and headings related issues and feature proposals #41

@lethefrost

Description

@lethefrost

Hi there @SpacePiggy17 @k4a-l , thanks for the work on #37 . I believe there are some issues with this PR:

  1. some logs you guys forgot to remove from debugging
      console.log({
        principleText,
        leadingMarkersRegExp,
        chunk,
        m: removed.match(leadingMarkersRegExp),
        removed
      });
  2. and in the settings description it uses the term "headers", where the accurate term is "headings" (many people use these two terms interchangeably! This is a common confusion). "Header" in typesetting is a concept corresponding to "footer", appearing at the top of a page; In programming, it also refers to the part associated with function or method declarations/signatures, such as C/C++ header files. "Heading" is the term for describing documents' titles and subtitles.

Also, I wish we could have something more:

  1. Currently, it only works for bullet/unordered lists starting with - , and doesn't work in bullet lists starts with * or + . It doesn't work for numbered/ordered lists syntaxes 1. or 1) or checkbox lists either. For checkbox lists starting with - [ ], it breaks the checkbox syntax by inserting # in between - and [ ] (making - # [ ] contents).
    • Even the original Heading Shifter before this PR, the style remover feature on converting a line to a heading, doesn't work for + , * (if italic remover is turned on, it's recognized and get removed as italic syntax), 1) , and all checkbox syntaxes.
    • I hope to extend the scope to cover the aforementioned lists.
  2. I do love this idea of using the same shortcuts of setting heading levels to control list indentation levels as well, but I personally don't need the heading syntaxes inside lists items. I hope we can add an option to control whether the shortcuts insert #s into the list items, or only act on setting the indentation to a certain level.
  3. I hope we can create a seamless and continuous shifting experience between lists and headings. For example, if we set an upper limit of heading level (like the current "lower limit of heading" setting), on any heading shifting action where a heading will be indented beyond that upper limit, it is converted into a list; And vice versa, outdenting a first level list item will make it a heading at current level (or 1 level deeper than the current, can be configured).

For example, outdenting on the following list will produce:

Original:

- H1.1
  - H2.1
  - H2.2
    - H3
- H1.2

Outdented once:

# H1.1
- H2.1
- H2.2
  - H3
# H1.2

Outdented twice:

# H1.1
## H2.1
## H2.2
- H3
# H1.2

And if we have an upper limit of H6, then an example of indenting could be like:

Original:

# H1
## H2
### H3
#### H4
##### H5
###### H6

Indented once:

## H1
### H2
#### H3
##### H4
###### H5
- H6

Indented twice:

### H1
#### H2
##### H3
###### H4
- H5
  - H6

I had made some local scripts to do this years ago, but I was too lazy to clean my code and write descriptions so I procrastinated for years and never publish it, but I use it every day, and I believe this could be very useful to many of you too. I think it would be a good fit to integrate into your Heading Shifter now, since starting from this #37 PR its functionality scope starts to involve and interact with lists. If you'd like, I'd be happy to make some PRs for all the aforementioned fixes or new features. Please let me know what you think about them☺️ Thanks for any comments or feedback!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions