Compare commits

...

5 Commits

Author SHA1 Message Date
7904e8c42e notes/tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-12-18 17:21:55 +03:00
430a6ce78d notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-12-18 17:18:42 +03:00
71a00a66d6 ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-12-18 17:14:00 +03:00
1fd273a240 ...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-12-18 17:12:14 +03:00
e4a1d538ef working on attrs...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-12-18 17:08:20 +03:00
3 changed files with 35 additions and 5 deletions

View File

@ -414,6 +414,18 @@
}
/*----------------------------------------------------------- TOC ---*/
:host .outline,
.editor .outline {
.toc>.view,
.TOC>.view {
padding-top: 0px;
padding-bottom: 0px;
}
}
/*--------------------------------------------------------- Quote ---*/
:host .outline .quote>.text,

View File

@ -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(<text>, 'all'[, <elem>])
// -> <elem>
//
parseBlockAttrs: function(text, keep=false, elem={}){
// XXX move to config...
__code_attrs__: false,
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,

View File

@ -144,9 +144,19 @@ 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
- Q: should this be completely handled by a plugin???
- `.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(..)`: add data attributes to code if missing...
- do we need `.__code_attrs__` / `.__view_attrs__`???
- handle attr delete correctly -- i.e. if shown attr removed from code -> delete attr...
- BUG? can't set `''` as attr value -- parser??
- might be a good idea to render plugins in a separate block shown with code...
- _when attr added to code -> transfer to attrs block..._
- this will help with caret transfer to be more predictable...
- 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 +277,9 @@ var setup = function(){
- `<editable/>` -- 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