subconsciousnetwork / subtext

Markup for note taking
Apache License 2.0
271 stars 20 forks source link

Thought on line-breaking #2

Open gretchenfrage opened 3 years ago

gretchenfrage commented 3 years ago

(copy/pasted from https://gist.github.com/gordonbrander/9ff60443ddb28e0403b0c6b41a473cd8)

Here's a thought I have on line-breaking.

It's nice to be able to break up a paragraph into multiple lines, especially since some text editors don't line-wrap. Markdown lets you do this, by requiring a double-newline to separate paragraphs. Although your logic here with blocks seems more homogenized, particularly with how you treat each list item as an independent block, which might complicate it a little. But I still think an approach could be made to work.

If you added a rule along the lines of:

The content of a block can continue for multiple lines, until encountering a line that is empty or that starts with a sigil. The selected lines are concatenated together with spaces in-between.

They you could do a variety of things like:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore
eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.

- Foo bar baz
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
- Line1

And it would be divided into blocks properly.

bburns commented 1 year ago

It's nice to be able to break up a paragraph into multiple lines, especially since some text editors don't line-wrap.

I guess that is the original reason for the way html and then markdown handle newlines?

I always found this feature odd though - if I'm taking notes I want the rendered version to look like what I wrote, not to merge all the lines together!

There are hacks like adding two spaces to the end of a line to indicate a new line, but I think having each line stand on its own makes the most sense.

If we wanted to be able to continue lines, could add backslashes at end of line, as in shell (ugly), or ^ as in windows (weird), or ?

gretchenfrage commented 1 year ago

I think it would be no great loss to elide this ability, especially if one is tending to use a subconscious-specialized text editor rather than, say, vim or sublime text.

Nevertheless, to suggest a syntax, one could do something along the lines of, make whitespace characters a sigil denoting that the current line is a continuation of the previous line. That would allow this:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
    incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
    nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
    consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
    cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
    non proident, sunt in culpa qui officia deserunt mollit anim id est
    laborum.

Which looks decent in my opinion.