mirror of
				https://github.com/flynx/pWiki.git
				synced 2025-10-31 02:50:08 +00:00 
			
		
		
		
	added auto-level headings -- should these replace manual-level headings???
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									6085ba9fc8
								
							
						
					
					
						commit
						6017113e1e
					
				| @ -372,39 +372,42 @@ | |||||||
| 
 | 
 | ||||||
| :host .outline, | :host .outline, | ||||||
| .editor .outline { | .editor .outline { | ||||||
| 	.heading-1, | 	.heading { | ||||||
| 	.heading-2, |  | ||||||
| 	.heading-3, |  | ||||||
| 	.heading-4, |  | ||||||
| 	.heading-5, |  | ||||||
| 	.heading-6 { |  | ||||||
| 		margin-top: 1rem; | 		margin-top: 1rem; | ||||||
| 
 | 
 | ||||||
| 		&>.text { | 		&>.text { | ||||||
| 			font-weight: bold; | 			font-weight: bold; | ||||||
| 		} |  | ||||||
| 	} |  | ||||||
| 	.heading-1>.text, |  | ||||||
| 	.heading-2>.text, |  | ||||||
| 	.heading-3>.text { |  | ||||||
| 			border-bottom: solid 1px rgba(0,0,0,0.1); | 			border-bottom: solid 1px rgba(0,0,0,0.1); | ||||||
| 		} | 		} | ||||||
|  | 	} | ||||||
|  | 	.auto.heading .auto.heading .auto.heading .auto.heading>.text, | ||||||
|  | 	.heading-4>.text, | ||||||
|  | 	.heading-5>.text, | ||||||
|  | 	.heading-6>.text { | ||||||
|  | 		border-bottom: none; | ||||||
|  | 	} | ||||||
| 
 | 
 | ||||||
|  | 	.auto.heading>.text, | ||||||
| 	.heading-1>.text { | 	.heading-1>.text { | ||||||
| 		--font-size: 2.5em; | 		--font-size: 2.5em; | ||||||
| 	} | 	} | ||||||
|  | 	.auto.heading .auto.heading>.text, | ||||||
| 	.heading-2>.text { | 	.heading-2>.text { | ||||||
| 		--font-size: 1.9em; | 		--font-size: 1.9em; | ||||||
| 	} | 	} | ||||||
|  | 	.auto.heading .auto.heading .auto.heading>.text, | ||||||
| 	.heading-3>.text { | 	.heading-3>.text { | ||||||
| 		--font-size: 1.5em; | 		--font-size: 1.5em; | ||||||
| 	} | 	} | ||||||
|  | 	.auto.heading .auto.heading .auto.heading .auto.heading>.text, | ||||||
| 	.heading-4>.text { | 	.heading-4>.text { | ||||||
| 		--font-size: 1.3em; | 		--font-size: 1.3em; | ||||||
| 	} | 	} | ||||||
|  | 	.auto.heading .auto.heading .auto.heading .auto.heading .auto.heading>.text, | ||||||
| 	.heading-5>.text { | 	.heading-5>.text { | ||||||
| 		--font-size: 1.1em; | 		--font-size: 1.1em; | ||||||
| 	} | 	} | ||||||
|  | 	.auto.heading .auto.heading .auto.heading .auto.heading .auto.heading .auto.heading>.text, | ||||||
| 	.heading-6>.text { | 	.heading-6>.text { | ||||||
| 		--font-size: 1em; | 		--font-size: 1em; | ||||||
| 	} | 	} | ||||||
|  | |||||||
| @ -229,6 +229,12 @@ var blocks = { | |||||||
| 			.replace(/^(?<!\\)###\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-3'])) | 			.replace(/^(?<!\\)###\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-3'])) | ||||||
| 			.replace(/^(?<!\\)##\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-2'])) | 			.replace(/^(?<!\\)##\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-2'])) | ||||||
| 			.replace(/^(?<!\\)#\s+(.*)$/, this.style(editor, elem, ['heading', 'heading-1'])) | 			.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'])) | ||||||
| 			// style: list...
 | 			// style: list...
 | ||||||
| 			//.replace(/^(?<!\\)[-\*]\s+(.*)$/m, style('list-item'))
 | 			//.replace(/^(?<!\\)[-\*]\s+(.*)$/m, style('list-item'))
 | ||||||
| 			.replace(/^\s*(.*)(?<!\\):\s*$/, this.style(editor, elem, 'list')) | 			.replace(/^\s*(.*)(?<!\\):\s*$/, this.style(editor, elem, 'list')) | ||||||
|  | |||||||
| @ -141,14 +141,6 @@ var setup = function(){ | |||||||
|         |text|text|text| |         |text|text|text| | ||||||
|   - |   - | ||||||
| - ## ToDo: | - ## ToDo: | ||||||
|   - FEATURE dunamic headings -- level depends on number of headings above..c |  | ||||||
|     - syntax: |  | ||||||
| 	  ``` |  | ||||||
| 	  @ Heading |  | ||||||
| 	  ``` |  | ||||||
|     - would be logical to: |  | ||||||
| 	  - only first top level heading is level 1 |  | ||||||
| 	  - subsequent top level headings all level 2 |  | ||||||
|   - Time to think about a standalone client -- at least to edit own notes as a test... |   - 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_ |     - _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... |   - Might be a good idea to think how to avoid the constant selections on focus... | ||||||
| @ -158,7 +150,6 @@ var setup = function(){ | |||||||
|     - DONE set/unset class |     - DONE set/unset class | ||||||
|     - add animation |     - add animation | ||||||
|     - make this extensible from client... |     - make this extensible from client... | ||||||
|   - Q: Make the heading level depend on its depth?? |  | ||||||
|   - Q: When moving up/down between nodes do we want to place the caret relative to markdown (current) or to view? (see: `CARET_V_MOVE`) |   - Q: When moving up/down between nodes do we want to place the caret relative to markdown (current) or to view? (see: `CARET_V_MOVE`) | ||||||
|   - Q: Should tables be text-based markdown or higher-level? |   - Q: Should tables be text-based markdown or higher-level? | ||||||
|     collapsed:: true |     collapsed:: true | ||||||
| @ -267,6 +258,18 @@ var setup = function(){ | |||||||
|       - `<editable/>` -- field marker |       - `<editable/>` -- field marker | ||||||
|       - each child node will copy the template and allow editing of only fields |       - each child node will copy the template and allow editing of only fields | ||||||
|       - not clear how to handle template changes... |       - not clear how to handle template changes... | ||||||
|  |   - DONE FEATURE dynamic headings -- level depends on number of headings above... | ||||||
|  |     - DONE Experimental syntax: | ||||||
|  |       ``` | ||||||
|  |       @ Heading | ||||||
|  |       ``` | ||||||
|  |     - Target syntax: | ||||||
|  |       ``` | ||||||
|  |       # Heading | ||||||
|  |       ``` | ||||||
|  |     - would be logical to (???): | ||||||
|  |       - only first top level heading is level 1 | ||||||
|  |       - subsequent top level headings all level 2 | ||||||
|   - DONE `.json(..)`, `.data(..)`, ... should be signature compatible with `.get(..)` (???) |   - DONE `.json(..)`, `.data(..)`, ... should be signature compatible with `.get(..)` (???) | ||||||
|   - DONE Q: Should we use `HTMLTextAreaElement.autoUpdateSize(..)` or handle it globally in setup??? |   - DONE Q: Should we use `HTMLTextAreaElement.autoUpdateSize(..)` or handle it globally in setup??? | ||||||
|     collapsed:: true |     collapsed:: true | ||||||
| @ -462,6 +465,14 @@ var setup = function(){ | |||||||
|     - The formatting mostly adheres to the markdown spec with a few minor differences |     - The formatting mostly adheres to the markdown spec with a few minor differences | ||||||
|     - |     - | ||||||
|     - Styles: |     - Styles: | ||||||
|  |       - Automatic Headings | ||||||
|  |         - @ Heading 1 | ||||||
|  |           - @ Heading 2 | ||||||
|  |             - @ Heading 3 | ||||||
|  |               - @ Heading 4 | ||||||
|  |                 - @ Heading 5 | ||||||
|  |                   - @ Heading 6 | ||||||
|  |       - Manual Headings | ||||||
|         - # Heading 1 |         - # Heading 1 | ||||||
|         - ## Heading 2 |         - ## Heading 2 | ||||||
|         - ### Heading 3 |         - ### Heading 3 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user