Closed tiensonqin closed 3 years ago
should we support this for org-mode too?
Yes, I think.
the current implementation count tabs as spaces, is it problematic?
Maybe treat 1 \<space> as 1 level and 1 \<tab> as 4 levels ?
should we support ordered lists as bullets too?
I think it's not necessary yet? not sure.
Ok, let's ignore the ordered list and enable this for org mode too.
Maybe treat 1
as 1 level and 1 as 4 levels ?
How about ignoring whether it's a space or a tab? After all, we need to recalculate the levels because the user's input might have discontinuous levels, for example:
- level 1
- level 2
Level 2 here should be treated as level 3 because it has 8 spaces before the -
, and 4 spaces as a tab are very common.
Ideally, the parser should walk through the ast and recalculate the levels, and then logseq doesn't need to care about whether it's a tab or spaces.
Level 2 here should be treated as level 3 because it has 8 spaces before the -
according to this PR, it will be level 9? level = length(spaces)+1. But I think 'ignoring whether it's a space or a tab' makes sense, users should only use spaces(or tabs) on one single page.
By the way, it looks like this PR is not formatted. ( make fmt
)
@RCmerci There's one problem if we support ordered lists as bullets in org mode, because we extended the list with heading's features like priorities, properties, keywords, scheduled/deadlines, etc. It'll be hard to use for existing org mode users especially when they need to use Emacs too.
according to this PR, it will be level 9? level = length(spaces)+1.
Yes, this PR doesn't recalculate the levels yet, I'm doing some experiments with this and logseq's frontend :smile:
By the way, it looks like this PR is not formatted. ( make fmt )
Is it possible to make this automatically?
Is it possible to make this automatically?
yes, adding 'dune build @fmt --auto-promote' before 'dune build' will be fine.
And for emacs config : (add-hook 'before-save-hook #'ocamlformat-before-save nil t)
@RCmerci There's one problem if we support ordered lists as bullets in org mode, because we extended the list with heading's features like priorities, properties, keywords, scheduled/deadlines, etc. It'll be hard to use for existing org mode users especially when they need to use Emacs too.
Oh, I forgot this ... it looks like we'd better ignore org-mode currently..
Is this PR ready to be merged?
@RCmerci Let's fix the conflicts and merge this PR!
Some questions: