clenup and notes....

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-10-14 15:46:42 +03:00
parent ea00679b9f
commit ec04205bfa
3 changed files with 38 additions and 24 deletions

View File

@ -408,6 +408,14 @@ editor .outline .block:focus {
}
/*---------------------------------------------------------- Done ---*/
.editor .outline .block.DONE>.view {
text-decoration: line-through;
opacity: 0.5;
}
/*--------------------------------------------------- Highlightes ---*/
.editor .outline .highlight {

View File

@ -26,8 +26,17 @@ var atLine = function(elem, index){
//---------------------------------------------------------------------
// Plugins...
// general helpers and utils...
var plugin = {
encode: function(text){
return text
.replace(/(?<!\\)&/g, '&amp;')
.replace(/(?<!\\)</g, '&lt;')
.replace(/(?<!\\)>/g, '&gt;')
.replace(/\\(?!`)/g, '\\\\') },
// XXX make this more generic...
style: function(editor, elem, style, code=undefined){
style = [style].flat()
@ -43,7 +52,6 @@ var plugin = {
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var attributes = {
@ -89,6 +97,8 @@ var blocks = {
.replace(/^\s*(?<!\\)>\s+(.*)$/m, this.style(editor, elem, 'quote'))
.replace(/^\s*(?<!\\)((\/\/|;)\s+.*)$/m, this.style(editor, elem, 'comment'))
.replace(/^\s*(?<!\\)NOTE:?\s*(.*)$/m, this.style(editor, elem, 'NOTE'))
.replace(/^\s*(?<!\\)DONE\s+(.*)$/m, this.style(editor, elem, 'DONE'))
.replace(/^(.*)\s*(?<!\\)DONE\s*$/m, this.style(editor, elem, 'DONE'))
.replace(/^\s*(?<!\\)XXX\s+(.*)$/m, this.style(editor, elem, 'XXX'))
.replace(/^(.*)\s*(?<!\\)XXX$/m, this.style(editor, elem, 'XXX')) } ,
}
@ -100,13 +110,6 @@ var blocks = {
var quoted = {
__proto__: plugin,
encode: function(text){
return text
.replace(/(?<!\\)&/g, '&amp;')
.replace(/(?<!\\)</g, '&lt;')
.replace(/(?<!\\)>/g, '&gt;')
.replace(/\\(?!`)/g, '\\\\') },
// can be used in:
// <string>.replace(quoted.pattern, quoted.handler)
quote_pattern: /(?<!\\)`(?=[^\s])(([^`]|\\`)*[^\s])(?<!\\)`/gm,

View File

@ -41,6 +41,8 @@ var setup = function(){
- Tomboy
- Bonsai
-
- // Seems that I unintentionally implemented quite a chunk of the markdown spec ;)
-
- ## Bugs:
- BUG: ASAP: editor: `-` at start of line is interpreted as block marker...
- need to either:
@ -102,21 +104,21 @@ var setup = function(){
block text
- NOTE: this is only a problem if making list-items manually -- disable???
- empty item height is a bit off...
- ~Q: can we edit code in a code block directly? (a-la Logseq)~
- ~"percentage complete" in parent blocks with todo's nested~
- ~`.editor .outline:empty` view and behavior...~
- ~editor: semi-live update styles~
- ~do a better expand/collapse icons~
- ~loading from DOM -- fill textarea~
- ~focus management~
- ~mouse/touch controls~
- ~navigation~
- ~expand/collapse subtree~
- ~shift subtree up/down~
- ~create node~
- ~edit node~
- ~serialize/deserialize~
- ~add optional text styling to nodes~
- DONE Q: can we edit code in a code block directly? (a-la Logseq)
- DONE "percentage complete" in parent blocks with todo's nested
- DONE `.editor .outline:empty` view and behavior...
- DONE editor: semi-live update styles
- DONE do a better expand/collapse icons
- DONE loading from DOM -- fill textarea
- DONE focus management
- DONE mouse/touch controls
- DONE navigation
- DONE expand/collapse subtree
- DONE shift subtree up/down
- DONE create node
- DONE edit node
- DONE serialize/deserialize
- DONE add optional text styling to nodes
-
- ## Refactoring:
- Plugin architecture
@ -185,9 +187,10 @@ var setup = function(){
- // C-style comment
- ; ASM-style comment
- XXX Highlight
- DONE Done
- Basic inline *bold*, _italic_ and ~striked~
- Marking ==text==
- Code
- Code:
- Inline quoting `html <b>code</b>`
- code blocks
```javascript