mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-29 10:00:08 +00:00
disabled manual headings + notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
29650ba7c9
commit
d5950dc742
@ -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;
|
||||
}
|
||||
|
||||
@ -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(/^(?<!\\)######\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-6']))
|
||||
.replace(/^(?<!\\)#####\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-5']))
|
||||
.replace(/^(?<!\\)####\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-4']))
|
||||
@ -230,11 +232,12 @@ var blocks = {
|
||||
.replace(/^(?<!\\)##\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-2']))
|
||||
.replace(/^(?<!\\)#\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-1']))
|
||||
// XXX EXPERIMENTAL
|
||||
// XXX rename css class to "heading"
|
||||
// XXX chose either this or manual headings...
|
||||
// XXX if this is used change syntax to '#'
|
||||
//.replace(/^(?<!\\)#\s+(.*)$/, this.style(editor, elem, ['heading']))
|
||||
.replace(/^(?<!\\)@\s+(.*)$/, this.style(editor, elem, ['heading', 'auto']))
|
||||
.replace(/^(?<!\\)@+\s+(.*)$/, this.style(editor, elem, ['heading', 'auto']))
|
||||
/*/
|
||||
// XXX EXPERIMENTAL
|
||||
.replace(/^(?<!\\)#+\s+(.*)$/, this.style(editor, elem, ['heading']))
|
||||
.replace(/^(?<!\\)@+\s+(.*)$/, this.style(editor, elem, ['heading', 'no-toc']))
|
||||
//*/
|
||||
// style: list...
|
||||
//.replace(/^(?<!\\)[-\*]\s+(.*)$/m, style('list-item'))
|
||||
.replace(/^\s*(.*)(?<!\\):\s*$/, this.style(editor, elem, 'list'))
|
||||
@ -640,8 +643,9 @@ var toc = {
|
||||
for(var e of [...root.querySelectorAll('.block.heading>.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(<indent>, <level>)
|
||||
|
||||
@ -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...
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user