diff --git a/experiments/outline-editor/editor.css b/experiments/outline-editor/editor.css index ac63d16..7305857 100755 --- a/experiments/outline-editor/editor.css +++ b/experiments/outline-editor/editor.css @@ -414,6 +414,18 @@ } +/*----------------------------------------------------------- TOC ---*/ + +:host .outline, +.editor .outline { + .toc>.view, + .TOC>.view { + padding-top: 0px; + padding-bottom: 0px; + } +} + + /*--------------------------------------------------------- Quote ---*/ :host .outline .quote>.text, diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index 54d01eb..4220468 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -920,6 +920,7 @@ var JSONOutline = { // block render... // XXX PRE_POST_NEWLINE can we avoid explicitly patching for empty lines after pre??? + __view_attrs__: false, __code2html__: function(code, elem={}){ var that = this @@ -937,7 +938,7 @@ var JSONOutline = { }[stage] return that.threadPlugins(meth, text, that, elem) } - elem = this.parseBlockAttrs(code, elem) + elem = this.parseBlockAttrs(code, this.__view_attrs__, elem) code = elem.text // stage: pre... @@ -1012,12 +1013,14 @@ var JSONOutline = { // .parseBlockAttrs(, 'all'[, ]) // -> // - parseBlockAttrs: function(text, keep=false, elem={}){ + // XXX move to config... + __code_attrs__: true, + parseBlockAttrs: function(text, keep=!!this.__code_attrs__, elem={}){ if(typeof(keep) == 'object'){ elem = keep keep = typeof(elem) == 'boolean' ? elem - : false } + : this.__code_attrs__ } var system = this.__block_attrs__ var clean = text // XXX for some reason changing the first group into (?<= .. ) @@ -1568,6 +1571,8 @@ var Outline = { : this._updateViewSize(view, code) }, //*/ + // Update node from data... + // // NOTE: this does not internally handle undo as it would be too // granular... // NOTE: to remove an attribute set it's value to null, undefined, diff --git a/experiments/outline-editor/index.html b/experiments/outline-editor/index.html index e237d5e..7f0b91a 100755 --- a/experiments/outline-editor/index.html +++ b/experiments/outline-editor/index.html @@ -144,9 +144,15 @@ var setup = function(){ - - ## ToDo: - attributes: need to show/hide the attributes -- option? - - TOC: Q: should we have both manual and auto headings??? - - IMHO: no... + attr::value + - `.parseBlockAttrs(..)` -- add hook to plugins to handle output... + - _plugin will need to get the call context -- can be called when handling for view or code_ + - `.parseBlockAttrs(..)` render (code) attrs in data but not in code... + - do we need `.__code_attrs__` / `.__view_attrs__`??? + - handle attr delete correctly -- i.e. sown attr removed from code -> delete attr... + - BUG? can't set '' as attr value -- parser?? - TOC: tweaking: add args like depth, ... -- as attributes... + - TOC: should it be persistently generated as code and be serializable? - ASAP: expand sub-tree on follow link... - export auto-headings as normal/manual markdown headings... - add plugin callback on `.text(..)` / ... @@ -267,6 +273,9 @@ var setup = function(){ - `` -- field marker - each child node will copy the template and allow editing of only fields - not clear how to handle template changes... + - DONE TOC: Q: should we have both manual and auto headings??? + collapsed:: true + - IMHO: no... - DONE attributes: need a way to remove attributes from editor -- `null` or `undefined` special values?? - DONE attributes: `.data(..)`: read in element attributes... collapsed:: true