diff --git a/experiments/outline-editor/editor.css b/experiments/outline-editor/editor.css index c9d0660..ac63d16 100755 --- a/experiments/outline-editor/editor.css +++ b/experiments/outline-editor/editor.css @@ -380,34 +380,34 @@ border-bottom: solid 1px rgba(0,0,0,0.1); } } - .auto.heading .auto.heading .auto.heading .auto.heading>.text, + .heading .heading .heading .heading>.text, .heading-4>.text, .heading-5>.text, .heading-6>.text { border-bottom: none; } - .auto.heading>.text, + .heading>.text, .heading-1>.text { --font-size: 2.5em; } - .auto.heading .auto.heading>.text, + .heading .heading>.text, .heading-2>.text { --font-size: 1.9em; } - .auto.heading .auto.heading .auto.heading>.text, + .heading .heading .heading>.text, .heading-3>.text { --font-size: 1.5em; } - .auto.heading .auto.heading .auto.heading .auto.heading>.text, + .heading .heading .heading .heading>.text, .heading-4>.text { --font-size: 1.3em; } - .auto.heading .auto.heading .auto.heading .auto.heading .auto.heading>.text, + .heading .heading .heading .heading .heading>.text, .heading-5>.text { --font-size: 1.1em; } - .auto.heading .auto.heading .auto.heading .auto.heading .auto.heading .auto.heading>.text, + .heading .heading .heading .heading .heading .heading>.text, .heading-6>.text { --font-size: 1em; } diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index 1eccc2b..5ae4e09 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -216,6 +216,7 @@ var attributes = { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// XXX convert auto-heading to markdown heading level and back... var blocks = { __proto__: plugin, @@ -223,6 +224,7 @@ var blocks = { return text // markdown... // style: headings... + /* XXX chose either this or auto headings -- move docs... .replace(/^(?.view')]){ var block = editor.get(e) // skip the root element??? - if(!that.__skip_local_root__ - && block === root){ + if(block.classList.contains('no-toc') + || (!that.__skip_local_root__ + && block === root)){ continue } var d = level(e, root) // down... @@ -669,7 +673,7 @@ var toc = { var list = makeTOC() for(var toc of TOCs){ toc.innerHTML = '' - toc.append(list) } + toc.append(list.cloneNode(true)) } // local tocs... for(var toc of tocs){ toc.innerHTML = '' @@ -1094,6 +1098,7 @@ var JSONOutline = { // XXX json: function(){}, + // XXX add plugin hooks... // XXX add option to customize indent size... text: function(node, indent, level){ // .text(, ) diff --git a/experiments/outline-editor/index.html b/experiments/outline-editor/index.html index ce88bc3..7712693 100755 --- a/experiments/outline-editor/index.html +++ b/experiments/outline-editor/index.html @@ -45,6 +45,8 @@ var setup = function(){ - Google Keep (editor) - - // Seems that I unintentionally implemented quite a chunk of the markdown spec ;) + - ### Index + - TOC - - ## Bugs: focused:: true @@ -141,8 +143,13 @@ var setup = function(){ |text|text|text| - - ## ToDo: - - Q: should auto-headings be exported as normal/manual markdown headings??? - - expand sub-tree on follow link... + - TOC: Q: should we have both manual and auto headings??? + - IMHO: no... + - DONE TOC: headings that do not show up in toc -- `# ...` shows up while `@ ...` does not... + - TOC: tweaking: add args like depth, ... + - ASAP: expand sub-tree on follow link... + - export auto-headings as normal/manual markdown headings... + - plugin callback on save... - Time to think about a standalone client -- at least to edit own notes as a test... - _also this would be a nice opportunity to start the move to a newer electron version_ - Might be a good idea to think how to avoid the constant selections on focus...