mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-23 15:36:52 +00:00
Merge branch 'master' into parameterised-transclusions
This commit is contained in:
commit
b5e4b21707
6
core/images/mastodon.tid
Normal file
6
core/images/mastodon.tid
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
title: $:/core/images/mastodon
|
||||||
|
tags: $:/tags/Image
|
||||||
|
|
||||||
|
<svg width="22pt" height="22pt" class="tc-image-mastodon tc-image-button" viewBox="0 0 128 128">
|
||||||
|
<path d="M112.716,76.735C111.231,85.764 99.411,95.646 85.836,97.561C78.757,98.559 71.787,99.476 64.355,99.073C52.201,98.415 42.61,95.646 42.61,95.646C42.61,97.044 42.683,98.374 42.829,99.619C44.409,113.79 54.723,114.639 64.493,115.035C74.354,115.434 83.134,112.163 83.134,112.163L83.539,122.695C83.539,122.695 76.642,127.071 64.355,127.875C57.58,128.315 49.167,127.674 39.369,124.61C18.118,117.965 14.463,91.202 13.904,64.048C13.733,55.985 13.839,48.383 13.839,42.024C13.839,14.257 29.238,6.118 29.238,6.118C37.002,1.905 50.326,0.134 64.177,-0L64.517,-0C78.369,0.134 91.701,1.905 99.465,6.118C99.465,6.118 114.864,14.257 114.864,42.024C114.864,42.024 115.057,62.511 112.716,76.735ZM96.7,44.179C96.7,37.307 95.219,31.847 92.245,27.807C89.177,23.767 85.16,21.696 80.174,21.696C74.403,21.696 70.034,24.316 67.146,29.556L64.337,35.118L61.529,29.556C58.64,24.316 54.271,21.696 48.501,21.696C43.514,21.696 39.497,23.767 36.43,27.807C33.455,31.847 31.974,37.307 31.974,44.179L31.974,77.8L43.249,77.8L43.249,45.167C43.249,38.288 45.699,34.796 50.599,34.796C56.017,34.796 58.733,38.938 58.733,47.128L58.733,64.99L69.941,64.99L69.941,47.128C69.941,38.938 72.657,34.796 78.075,34.796C82.975,34.796 85.425,38.288 85.425,45.167L85.425,77.8L96.7,77.8L96.7,44.179Z"/>
|
||||||
|
</svg>
|
68
core/modules/parsers/wikiparser/rules/parsermode.js
Normal file
68
core/modules/parsers/wikiparser/rules/parsermode.js
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
/*\
|
||||||
|
title: $:/core/modules/parsers/wikiparser/rules/parsermode.js
|
||||||
|
type: application/javascript
|
||||||
|
module-type: wikirule
|
||||||
|
|
||||||
|
Wiki pragma rule for parser mode specifications
|
||||||
|
|
||||||
|
```
|
||||||
|
\parsermode block
|
||||||
|
\parsermode inline
|
||||||
|
```
|
||||||
|
|
||||||
|
\*/
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
/*jslint node: true, browser: true */
|
||||||
|
/*global $tw: false */
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
exports.name = "parsermode";
|
||||||
|
exports.types = {pragma: true};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Instantiate parse rule
|
||||||
|
*/
|
||||||
|
exports.init = function(parser) {
|
||||||
|
this.parser = parser;
|
||||||
|
// Regexp to match
|
||||||
|
this.matchRegExp = /^\\parsermode[^\S\n]/mg;
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Parse the most recent match
|
||||||
|
*/
|
||||||
|
exports.parse = function() {
|
||||||
|
// Move past the pragma invocation
|
||||||
|
this.parser.pos = this.matchRegExp.lastIndex;
|
||||||
|
// Parse whitespace delimited tokens terminated by a line break
|
||||||
|
var reMatch = /[^\S\n]*(\S+)|(\r?\n)/mg,
|
||||||
|
parserMode = undefined;
|
||||||
|
reMatch.lastIndex = this.parser.pos;
|
||||||
|
var match = reMatch.exec(this.parser.source);
|
||||||
|
while(match && match.index === this.parser.pos) {
|
||||||
|
this.parser.pos = reMatch.lastIndex;
|
||||||
|
// Exit if we've got the line break
|
||||||
|
if(match[2]) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Process the token
|
||||||
|
if(match[1]) {
|
||||||
|
parserMode = match[1];
|
||||||
|
}
|
||||||
|
// Match the next token
|
||||||
|
match = reMatch.exec(this.parser.source);
|
||||||
|
}
|
||||||
|
// Process the tokens
|
||||||
|
if(parserMode !== undefined) {
|
||||||
|
if(parserMode === "block") {
|
||||||
|
this.parser.parseAsInline = false;
|
||||||
|
} else if(parserMode === "inline") {
|
||||||
|
this.parser.parseAsInline = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// No parse tree nodes to return
|
||||||
|
return [];
|
||||||
|
};
|
||||||
|
|
||||||
|
})();
|
@ -48,6 +48,8 @@ var WikiParser = function(type,text,options) {
|
|||||||
this.sourceLength = this.source.length;
|
this.sourceLength = this.source.length;
|
||||||
// Flag for ignoring whitespace
|
// Flag for ignoring whitespace
|
||||||
this.configTrimWhiteSpace = options.configTrimWhiteSpace !== undefined ? options.configTrimWhiteSpace : false;
|
this.configTrimWhiteSpace = options.configTrimWhiteSpace !== undefined ? options.configTrimWhiteSpace : false;
|
||||||
|
// Parser mode
|
||||||
|
this.parseAsInline = options.parseAsInline;
|
||||||
// Set current parse position
|
// Set current parse position
|
||||||
this.pos = 0;
|
this.pos = 0;
|
||||||
// Start with empty output
|
// Start with empty output
|
||||||
@ -84,7 +86,7 @@ var WikiParser = function(type,text,options) {
|
|||||||
// Parse any pragmas
|
// Parse any pragmas
|
||||||
var topBranch = this.parsePragmas();
|
var topBranch = this.parsePragmas();
|
||||||
// Parse the text into inline runs or blocks
|
// Parse the text into inline runs or blocks
|
||||||
if(options.parseAsInline) {
|
if(this.parseAsInline) {
|
||||||
topBranch.push.apply(topBranch,this.parseInlineRun());
|
topBranch.push.apply(topBranch,this.parseInlineRun());
|
||||||
} else {
|
} else {
|
||||||
topBranch.push.apply(topBranch,this.parseBlocks());
|
topBranch.push.apply(topBranch,this.parseBlocks());
|
||||||
|
@ -136,13 +136,9 @@ function _removeOne(list,value) {
|
|||||||
// we need to know if the FIRST value is the last in the list, not the last.
|
// we need to know if the FIRST value is the last in the list, not the last.
|
||||||
if(next !== undefined) {
|
if(next !== undefined) {
|
||||||
if(typeof list.prev[next] === "object") {
|
if(typeof list.prev[next] === "object") {
|
||||||
if(prev === undefined) {
|
// Nothing special needed for first since list.prev[next][0] will be 'undefined'
|
||||||
// Must have been first, and 'i' would be 0.
|
|
||||||
list.prev[next].shift();
|
|
||||||
} else {
|
|
||||||
var i = list.prev[next].indexOf(value);
|
var i = list.prev[next].indexOf(value);
|
||||||
list.prev[next][i] = prev;
|
list.prev[next][i] = prev;
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
list.prev[next] = prev;
|
list.prev[next] = prev;
|
||||||
}
|
}
|
||||||
|
@ -20,15 +20,16 @@ caption: {{$:/language/ControlPanel/Basics/Caption}}
|
|||||||
\end
|
\end
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
|
|
||||||
|
|tc-max-width tc-edit-max-width|k
|
||||||
|<<lingo Version/Prompt>> |''<<version>>'' |
|
|<<lingo Version/Prompt>> |''<<version>>'' |
|
||||||
|<$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link> |<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |
|
|<$link to="$:/SiteTitle"><<lingo Title/Prompt>></$link> |<$edit-text tiddler="$:/SiteTitle" default="" tag="input"/> |
|
||||||
|<$link to="$:/SiteSubtitle"><<lingo Subtitle/Prompt>></$link> |<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> |
|
|<$link to="$:/SiteSubtitle"><<lingo Subtitle/Prompt>></$link> |<$edit-text tiddler="$:/SiteSubtitle" default="" tag="input"/> |
|
||||||
|<$link to="$:/status/UserName"><<lingo Username/Prompt>></$link> |<$edit-text tiddler="$:/status/UserName" default="" tag="input"/> |
|
|<$link to="$:/status/UserName"><<lingo Username/Prompt>></$link> |<$edit-text tiddler="$:/status/UserName" default="" tag="input"/> |
|
||||||
|<$link to="$:/config/AnimationDuration"><<lingo AnimDuration/Prompt>></$link> |<$edit-text tiddler="$:/config/AnimationDuration" default="" tag="input"/> |
|
|<$link to="$:/config/AnimationDuration"><<lingo AnimDuration/Prompt>></$link> |<$edit-text tiddler="$:/config/AnimationDuration" default="" tag="input"/> |
|
||||||
|<$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link> |<<lingo DefaultTiddlers/TopHint>><br> <$edit tag="textarea" tiddler="$:/DefaultTiddlers" class="tc-edit-texteditor"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
|
|<$link to="$:/DefaultTiddlers"><<lingo DefaultTiddlers/Prompt>></$link> |<<lingo DefaultTiddlers/TopHint>><br> <$edit class="tc-edit-texteditor" tiddler="$:/DefaultTiddlers"/><br>//<<lingo DefaultTiddlers/BottomHint>>// |
|
||||||
|<$link to="$:/language/DefaultNewTiddlerTitle"><<lingo NewTiddler/Title/Prompt>></$link> |<$edit-text tiddler="$:/language/DefaultNewTiddlerTitle" default="" tag="input"/> |
|
|<$link to="$:/language/DefaultNewTiddlerTitle"><<lingo NewTiddler/Title/Prompt>></$link> |<$edit-text tiddler="$:/language/DefaultNewTiddlerTitle" default="" tag="input"/> |
|
||||||
|<$link to="$:/config/NewJournal/Title"><<lingo NewJournal/Title/Prompt>></$link> |<$edit-text tiddler="$:/config/NewJournal/Title" default="" tag="input"/> |
|
|<$link to="$:/config/NewJournal/Title"><<lingo NewJournal/Title/Prompt>></$link> |<$edit-text tiddler="$:/config/NewJournal/Title" default="" tag="input"/> |
|
||||||
|<$link to="$:/config/NewJournal/Text"><<lingo NewJournal/Text/Prompt>></$link> |<$edit tiddler="$:/config/NewJournal/Text" tag="textarea" class="tc-edit-texteditor" default=""/> |
|
|<$link to="$:/config/NewJournal/Text"><<lingo NewJournal/Text/Prompt>></$link> |<$edit tiddler="$:/config/NewJournal/Text" class="tc-edit-texteditor" default=""/> |
|
||||||
|<$link to="$:/config/NewTiddler/Tags"><<lingo NewTiddler/Tags/Prompt>></$link> |<$vars currentTiddler="$:/config/NewTiddler/Tags" tagField="text">{{||$:/core/ui/EditTemplate/tags}}<$list filter="[<currentTiddler>tags[]] +[limit[1]]" variable="ignore"><$button tooltip={{$:/language/ControlPanel/Basics/RemoveTags/Hint}}><<lingo RemoveTags>><$action-listops $tiddler=<<currentTiddler>> $field="text" $subfilter={{{ [<currentTiddler>get[tags]] }}}/><$action-setfield $tiddler=<<currentTiddler>> tags=""/></$button></$list></$vars> |
|
|<$link to="$:/config/NewTiddler/Tags"><<lingo NewTiddler/Tags/Prompt>></$link> |<$vars currentTiddler="$:/config/NewTiddler/Tags" tagField="text">{{||$:/core/ui/EditTemplate/tags}}<$list filter="[<currentTiddler>tags[]] +[limit[1]]" variable="ignore"><$button tooltip={{$:/language/ControlPanel/Basics/RemoveTags/Hint}}><<lingo RemoveTags>><$action-listops $tiddler=<<currentTiddler>> $field="text" $subfilter={{{ [<currentTiddler>get[tags]] }}}/><$action-setfield $tiddler=<<currentTiddler>> tags=""/></$button></$list></$vars> |
|
||||||
|<$link to="$:/config/NewJournal/Tags"><<lingo NewJournal/Tags/Prompt>></$link> |<$vars currentTiddler="$:/config/NewJournal/Tags" tagField="text">{{||$:/core/ui/EditTemplate/tags}}<$list filter="[<currentTiddler>tags[]] +[limit[1]]" variable="ignore"><$button tooltip={{$:/language/ControlPanel/Basics/RemoveTags/Hint}}><<lingo RemoveTags>><$action-listops $tiddler=<<currentTiddler>> $field="text" $subfilter={{{ [<currentTiddler>get[tags]] }}}/><$action-setfield $tiddler=<<currentTiddler>> tags=""/></$button></$list></$vars> |
|
|<$link to="$:/config/NewJournal/Tags"><<lingo NewJournal/Tags/Prompt>></$link> |<$vars currentTiddler="$:/config/NewJournal/Tags" tagField="text">{{||$:/core/ui/EditTemplate/tags}}<$list filter="[<currentTiddler>tags[]] +[limit[1]]" variable="ignore"><$button tooltip={{$:/language/ControlPanel/Basics/RemoveTags/Hint}}><<lingo RemoveTags>><$action-listops $tiddler=<<currentTiddler>> $field="text" $subfilter={{{ [<currentTiddler>get[tags]] }}}/><$action-setfield $tiddler=<<currentTiddler>> tags=""/></$button></$list></$vars> |
|
||||||
|<$link to="$:/config/AutoFocus"><<lingo AutoFocus/Prompt>></$link> |{{$:/snippets/minifocusswitcher}} |
|
|<$link to="$:/config/AutoFocus"><<lingo AutoFocus/Prompt>></$link> |{{$:/snippets/minifocusswitcher}} |
|
||||||
|
@ -117,15 +117,15 @@ title: $:/core/ui/ImportListing
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</$reveal>
|
</$reveal>
|
||||||
<tr>
|
<$reveal type="match" text="yes" state=<<previewPopupState>> tag="tr">
|
||||||
<td colspan="3">
|
<td colspan="3">
|
||||||
<$reveal type="match" text="yes" state=<<previewPopupState>> tag="div">
|
|
||||||
<$list filter="[{$:/state/importpreviewtype}has[text]]" variable="listItem" emptyMessage={{$:/core/ui/ImportPreviews/Text}}>
|
<$list filter="[{$:/state/importpreviewtype}has[text]]" variable="listItem" emptyMessage={{$:/core/ui/ImportPreviews/Text}}>
|
||||||
<$transclude tiddler={{$:/state/importpreviewtype}}/>
|
<div>
|
||||||
|
<$transclude tiddler={{$:/state/importpreviewtype}}/>
|
||||||
|
</div>
|
||||||
</$list>
|
</$list>
|
||||||
</$reveal>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</$reveal>
|
||||||
</$list>
|
</$list>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -4,6 +4,6 @@ key: ((advanced-search))
|
|||||||
|
|
||||||
\whitespace trim
|
\whitespace trim
|
||||||
<$navigator story="$:/StoryList" history="$:/HistoryList">
|
<$navigator story="$:/StoryList" history="$:/HistoryList">
|
||||||
<$action-navigate $to="$:/AdvancedSearch"/>
|
<$action-navigate $to="$:/AdvancedSearch" $scroll="yes"/>
|
||||||
<$action-sendmessage $message="tm-focus-selector" $param="""[data-tiddler-title="$:/AdvancedSearch"] .tc-search input""" preventScroll="true"/>
|
<$action-sendmessage $message="tm-focus-selector" $param="""[data-tiddler-title="$:/AdvancedSearch"] .tc-search input""" preventScroll="true"/>
|
||||||
</$navigator>
|
</$navigator>
|
||||||
|
36
editions/test/tiddlers/tests/data/pragmas/Parsermode.tid
Normal file
36
editions/test/tiddlers/tests/data/pragmas/Parsermode.tid
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
title: Pragmas/Parsermode
|
||||||
|
description: parsermode pragma
|
||||||
|
type: text/vnd.tiddlywiki-multiple
|
||||||
|
tags: [[$:/tags/wiki-test-spec]]
|
||||||
|
|
||||||
|
title: Output
|
||||||
|
|
||||||
|
{{AlwaysInline}}
|
||||||
|
|
||||||
|
{{AlwaysBlock}}
|
||||||
|
|
||||||
|
{{AlwaysInline}}{{AlwaysBlock}}
|
||||||
|
|
||||||
|
+
|
||||||
|
title: AlwaysInline
|
||||||
|
|
||||||
|
\parsermode inline
|
||||||
|
! Not Heading
|
||||||
|
|
||||||
|
Text with ''bold''
|
||||||
|
+
|
||||||
|
title: AlwaysBlock
|
||||||
|
|
||||||
|
\parsermode block
|
||||||
|
! Heading
|
||||||
|
|
||||||
|
Text with ''bold''
|
||||||
|
+
|
||||||
|
title: ExpectedResult
|
||||||
|
|
||||||
|
! Not Heading
|
||||||
|
|
||||||
|
Text with <strong>bold</strong><h1 class="">Heading</h1><p>Text with <strong>bold</strong></p><p>! Not Heading
|
||||||
|
|
||||||
|
Text with <strong>bold</strong><h1 class="">Heading</h1><p>Text with <strong>bold</strong></p>
|
||||||
|
</p>
|
@ -137,6 +137,21 @@ describe("LinkedList class tests", function() {
|
|||||||
compare(pushTop(newPair(["C", "X", "A", "A"]), "X")); // CAAX
|
compare(pushTop(newPair(["C", "X", "A", "A"]), "X")); // CAAX
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("can remove all instances of a multi-instance value #7059", function() {
|
||||||
|
// Remove duplicate items when one or more items between the duplicates
|
||||||
|
// are not removed and the first of those duplicates is not the first item.
|
||||||
|
// These tests used to fail prior to the fix to #7059
|
||||||
|
compare(remove(newPair(["A", "A", "C", "B", "A"]), ["A", "C", "A", "A"])); // B
|
||||||
|
compare(remove(newPair(["A", "A", "C", "B", "A"]), ["C", "A", "A", "A"])); // B
|
||||||
|
compare(remove(newPair(["A", "A", "C", "B", "A"]), ["A", "A", "A"])); // CB
|
||||||
|
compare(remove(newPair(["A", "A", "C", "B", "A"]), ["A", "A", "A", "C"])); // B
|
||||||
|
compare(remove(newPair(["A", "A", "B", "A"]), ["A", "A", "A"])); // B
|
||||||
|
compare(remove(newPair(["A", "A", "B", "A"]), ["A", "A", "A", "B"])); //
|
||||||
|
compare(remove(newPair(["C", "A", "B", "A"]), ["C", "A", "A"])); // B
|
||||||
|
compare(remove(newPair(["C", "A", "B", "A", "C"]), ["C", "A", "A", "C"])); // B
|
||||||
|
compare(remove(newPair(["B", "A", "B", "A"]), ["B", "A", "A"])); // B
|
||||||
|
});
|
||||||
|
|
||||||
it("can handle particularly nasty pushTop pitfall", function() {
|
it("can handle particularly nasty pushTop pitfall", function() {
|
||||||
var pair = newPair(["A", "B", "A", "C"]);
|
var pair = newPair(["A", "B", "A", "C"]);
|
||||||
pushTop(pair, "A"); // BACA
|
pushTop(pair, "A"); // BACA
|
||||||
|
@ -0,0 +1,81 @@
|
|||||||
|
created: 20220817153236691
|
||||||
|
modified: 20221010074314452
|
||||||
|
tags: [[Tables in WikiText]]
|
||||||
|
title: Tables in WikiText CSS Utility Classes
|
||||||
|
type: text/vnd.tiddlywiki
|
||||||
|
|
||||||
|
~WikiText tables can be styled by applying CSS classes. For basic information on wiktext tables and how to style them, see [[Tables in WikiText]].
|
||||||
|
|
||||||
|
{{Table Classes, Captions, Headers and Footers}}
|
||||||
|
|
||||||
|
As seen above, the resulting table is left aligned and grows to fit the content. This is the browser default layout behaviour for tables. To get another behaviour, various CSS classes can be added into the "`k` row".
|
||||||
|
|
||||||
|
! Utility Classes
|
||||||
|
|
||||||
|
{{Utility Classes}}
|
||||||
|
|
||||||
|
! Examples
|
||||||
|
|
||||||
|
The following examples apply the style classes to tables but the "General Utility Classes" can as well be used on DIVs or other [[HTML block elements|HTML Block Elements]]
|
||||||
|
|
||||||
|
!! Centred Table
|
||||||
|
|
||||||
|
To center a table horizontally, use `tc-center`:
|
||||||
|
|
||||||
|
<<wikitext-example-without-html src:"""|tc-center|k
|
||||||
|
|This is a caption |c
|
||||||
|
|Cell1 |Cell2 |
|
||||||
|
|Cell3 |Cell4 |
|
||||||
|
|Header|Header|h
|
||||||
|
|Footer|Footer|f
|
||||||
|
""">>
|
||||||
|
|
||||||
|
!! Centred Table, 80% Width
|
||||||
|
|
||||||
|
To add empty left and right margins to a table that is otherwise full-tiddler-width, you can use `tc-max-width-80`
|
||||||
|
|
||||||
|
<<wikitext-example-without-html src:"""|tc-center tc-max-width-80|k
|
||||||
|
|This is a caption |c
|
||||||
|
|Cell1 |<<.lorem>> |
|
||||||
|
|<<.lorem>> |Cell4 |
|
||||||
|
|Header|Header|h
|
||||||
|
""">>
|
||||||
|
|
||||||
|
!! Table with Maximum Width
|
||||||
|
|
||||||
|
To expand a table to full tiddler width, use `tc-max-width`
|
||||||
|
|
||||||
|
<<wikitext-example-without-html src:"""|tc-max-width|k
|
||||||
|
|Header|Header|h
|
||||||
|
|Cell1 |Cell2 |
|
||||||
|
|Cell3 |Cell4 |
|
||||||
|
""">>
|
||||||
|
|
||||||
|
!! Table with First Column Minimum Width
|
||||||
|
|
||||||
|
The following example shows a simple "form" where the first columns width is adjusted to its content by means of `tc-first-col-min-width`
|
||||||
|
|
||||||
|
<<wikitext-example-without-html src:"""|tc-max-width tc-first-col-min-width|k
|
||||||
|
|Header|Header|h
|
||||||
|
|Cell1 |<$edit-text tiddler="$:/temp/test-table-input" tag="input" field="test"/> |
|
||||||
|
|Cell3 |<$edit-text tiddler="$:/temp/test-table-input" field="text"/> |
|
||||||
|
""">>
|
||||||
|
|
||||||
|
!! Table with Maximum Width ~TextWidgets
|
||||||
|
|
||||||
|
Here, the previous "form" is styled further to give the [[TextWidget]]s full width by adding the class `tc-edit-max-width`
|
||||||
|
|
||||||
|
<<wikitext-example-without-html src:"""|tc-max-width tc-first-col-min-width tc-edit-max-width|k
|
||||||
|
|Header|Header|h
|
||||||
|
|Cell1 |<$edit-text tiddler="$:/temp/test-table-input" tag="input" field="test"/> |
|
||||||
|
|Cell3 |<$edit-text tiddler="$:/temp/test-table-input" field="text"/> |
|
||||||
|
""">>
|
||||||
|
|
||||||
|
!! Table with No Borders
|
||||||
|
|
||||||
|
The following is a table with maximum width. It contains [[TextWidget]]s with maximum width. The first column is set to be minimum width. Further, all links in the first column are set to __not__ line break (wrap) regardless of window resize.
|
||||||
|
|
||||||
|
<<wikitext-example-without-html src:"""|tc-max-width tc-first-col-min-width tc-edit-max-width tc-table-no-border tc-first-link-nowrap|k
|
||||||
|
| Cell1|<$edit-text tiddler="$:/temp/test-table-input" tag="input" field="test"/> |
|
||||||
|
|^ [[Link to a tiddler]]<br>some more text|<$edit-text tiddler="$:/temp/test-table-input" field="text"/> |
|
||||||
|
""">>
|
@ -0,0 +1,9 @@
|
|||||||
|
created: 20220818091959523
|
||||||
|
modified: 20220818092101307
|
||||||
|
tags: Definitions
|
||||||
|
title: HTML Block Elements
|
||||||
|
type: text/vnd.tiddlywiki
|
||||||
|
|
||||||
|
<<<
|
||||||
|
HTML (Hypertext Markup Language) elements historically were categorized as either "block-level" elements or "inline-level" elements. Since this is a presentational characteristic it is nowadays specified by CSS in the Flow Layout. A Block-level element occupies the entire horizontal space of its parent element (container), and vertical space equal to the height of its contents, thereby creating a "block".
|
||||||
|
<<< https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements
|
@ -8,7 +8,7 @@ The default representation of dates is a compact string such as `202110021538020
|
|||||||
|
|
||||||
The display format for this string can be controlled with a template. For example, transcluding the `modified` field automatically applies a template to display the date as `Sat Oct 02 2021 17:40:50 GMT+0200 (Central European Summer Time)`. A few widgets and filter operators allow you to manually specify a template, for example the ViewWidget:
|
The display format for this string can be controlled with a template. For example, transcluding the `modified` field automatically applies a template to display the date as `Sat Oct 02 2021 17:40:50 GMT+0200 (Central European Summer Time)`. A few widgets and filter operators allow you to manually specify a template, for example the ViewWidget:
|
||||||
|
|
||||||
`<$view field=modified format=date template=“DDth mmm YYYY 0hh:0mm:0ss” />`
|
`<$view field=modified format=date template="DDth mmm YYYY 0hh:0mm:0ss" />`
|
||||||
|
|
||||||
The date string is processed with the following substitutions:
|
The date string is processed with the following substitutions:
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ You can calculate the difference between two dates by doing the following:
|
|||||||
|
|
||||||
Here is an example of calculating the number of days that passed between creation and last modification of current tiddler:
|
Here is an example of calculating the number of days that passed between creation and last modification of current tiddler:
|
||||||
|
|
||||||
* Fields `modified` and `created` contain their respective datetimes in the format `YYYYMMDDHHMMSSmmm` so convert them to timestamps
|
* Fields `modified` and `created` contain their respective datetimes in the format `[UTC]YYYY0MM0DD0hh0mm0ssXXX` so convert them to timestamps
|
||||||
* `86400000` is the number of milliseconds in a day (1000 * 60 * 60 * 24)
|
* `86400000` is the number of milliseconds in a day (1000 * 60 * 60 * 24)
|
||||||
|
|
||||||
<$macrocall $name=".example" n="0" eg="""<$let
|
<$macrocall $name=".example" n="0" eg="""<$let
|
||||||
|
@ -27,6 +27,9 @@ Unlike conventional online services, TiddlyWiki lets you choose where to keep yo
|
|||||||
<a href="https://twitter.com/TiddlyWiki" class="tc-btn-big-green" style="border-radius:4px;background-color:#5E9FCA;" target="_blank" rel="noopener noreferrer">
|
<a href="https://twitter.com/TiddlyWiki" class="tc-btn-big-green" style="border-radius:4px;background-color:#5E9FCA;" target="_blank" rel="noopener noreferrer">
|
||||||
{{$:/core/images/twitter}} Twitter
|
{{$:/core/images/twitter}} Twitter
|
||||||
</a>
|
</a>
|
||||||
|
<a rel="me" href="https://fosstodon.org/@TiddlyWiki" class="tc-btn-big-green" style="border-radius:4px;background-color:#2b90d9;" target="_blank" rel="noopener noreferrer">
|
||||||
|
{{$:/core/images/mastodon}} Mastodon
|
||||||
|
</a>
|
||||||
<a href="https://github.com/Jermolene/TiddlyWiki5" class="tc-btn-big-green" style="border-radius:4px;background-color:#444;" target="_blank" rel="noopener noreferrer">
|
<a href="https://github.com/Jermolene/TiddlyWiki5" class="tc-btn-big-green" style="border-radius:4px;background-color:#444;" target="_blank" rel="noopener noreferrer">
|
||||||
{{$:/core/images/github}} ~GitHub
|
{{$:/core/images/github}} ~GitHub
|
||||||
</a>
|
</a>
|
||||||
|
17
editions/tw5.com/tiddlers/pragmas/Pragma_ _parsermode.tid
Normal file
17
editions/tw5.com/tiddlers/pragmas/Pragma_ _parsermode.tid
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
created: 20221123223127425
|
||||||
|
modified: 20221123223127425
|
||||||
|
tags: Pragmas
|
||||||
|
title: Pragma: \parsermode
|
||||||
|
type: text/vnd.tiddlywiki
|
||||||
|
|
||||||
|
The ''\parsermode'' [[pragma|Pragmas]] adjusts whether the remaining text is parsed in block mode or inline mode. See [[WikiText Parser Modes]] for details of parser modes.
|
||||||
|
|
||||||
|
```
|
||||||
|
\parsermode block|inline
|
||||||
|
```
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```
|
||||||
|
\parsermode inline
|
||||||
|
```
|
@ -183,9 +183,9 @@ div.content {
|
|||||||
.tc-btn-download {
|
.tc-btn-download {
|
||||||
padding: 10px 30px;
|
padding: 10px 30px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background: #1462ff;
|
background: <<colour "download-background">>;
|
||||||
border: none;
|
border: none;
|
||||||
box-shadow: 0 2px 2px 0 #4a74c9;
|
box-shadow: 1px 2px 2px 0 <<colour muted-foreground>>;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
@ -195,5 +195,5 @@ div.content {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tc-btn-download:active {
|
.tc-btn-download:active {
|
||||||
background: #1475ff;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
created: 20220819100636227
|
||||||
|
modified: 20220819101309072
|
||||||
|
tags: [[Tables in WikiText]]
|
||||||
|
title: Table Classes, Captions, Headers and Footers
|
||||||
|
type: text/vnd.tiddlywiki
|
||||||
|
|
||||||
|
Table CSS classes, captions, headers and footers can be specified as special pseudo-rows. The following example:
|
||||||
|
|
||||||
|
* `|myclass anotherClass|k` assigns the CSS classes "myclass" and "anotherClass" to the table
|
||||||
|
* `|This is a caption |c` gives the table the caption "This is a caption"
|
||||||
|
* `|Header|Header|h` adds a header row of cells with the text "Header"
|
||||||
|
* `|Footer|Footer|f` adds a footer row of cells with the text "Footer"
|
||||||
|
|
||||||
|
<<wikitext-example-without-html src:"""|myclass anotherClass|k
|
||||||
|
|This is a caption |c
|
||||||
|
|Cell1 |Cell2 |
|
||||||
|
|Cell3 |Cell3 |
|
||||||
|
|Header|Header|h
|
||||||
|
|Footer|Footer|f
|
||||||
|
""">>
|
@ -1,6 +1,6 @@
|
|||||||
caption: Tables
|
caption: Tables
|
||||||
created: 20130914132100000
|
created: 20130914132100000
|
||||||
modified: 20220513115945053
|
modified: 20220819103416274
|
||||||
tags: WikiText
|
tags: WikiText
|
||||||
title: Tables in WikiText
|
title: Tables in WikiText
|
||||||
type: text/vnd.tiddlywiki
|
type: text/vnd.tiddlywiki
|
||||||
@ -66,17 +66,7 @@ To merge a table cell with the one above, use the special cell text `~`. To merg
|
|||||||
|
|
||||||
! Table Classes, Captions, Headers and Footers
|
! Table Classes, Captions, Headers and Footers
|
||||||
|
|
||||||
Table CSS classes, captions, headers and footers can be specified as special pseudo-rows. The following example:
|
{{Table Classes, Captions, Headers and Footers}}
|
||||||
|
|
||||||
* assigns the CSS classes "myclass" and "anotherClass" to the table
|
|
||||||
* gives the table the caption "This is a caption"
|
|
||||||
* adds a header row of cells with the text "Header"
|
|
||||||
* adds a footer row of cells with the text "Footer"
|
|
||||||
|
|
||||||
<<wikitext-example-without-html src:"""|myclass anotherClass|k
|
More examples can be found at: [[Tables in WikiText CSS Utility Classes]]
|
||||||
|This is a caption |c
|
|
||||||
|Cell1 |Cell2 |
|
|
||||||
|Cell3 |Cell3 |
|
|
||||||
|Header|Header|h
|
|
||||||
|Footer|Footer|f
|
|
||||||
""">>
|
|
||||||
|
20
editions/tw5.com/tiddlers/wikitext/Utility Classes.tid
Normal file
20
editions/tw5.com/tiddlers/wikitext/Utility Classes.tid
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
created: 20220818093624828
|
||||||
|
modified: 20221010074235929
|
||||||
|
tags: WikiText
|
||||||
|
title: Utility Classes
|
||||||
|
type: text/vnd.tiddlywiki
|
||||||
|
|
||||||
|
<<.from-version "5.2.4">> The following outlines a few predefined CSS classes intended to make it simpler to style [[HTML block-elements|HTML Block Elements]] and [[wikitext tables|Tables in WikiText CSS Utility Classes]].
|
||||||
|
|
||||||
|
!! General Utility Classes
|
||||||
|
|
||||||
|
|`tc-center` |Centres a block-element to the middle of the container |
|
||||||
|
|`tc-max-width `|Expands a block-element to use the maximum width of the container |
|
||||||
|
|`tc-max-width-80`|Sets the width of a block-element to use 80% of the maximum container width. This setting is useful with the `tc-center` class |
|
||||||
|
|`tc-edit-max-width `|Expands [[TextWidget]]s to use the maximum available width. See [[ControlPanel -> Info -> Basics|$:/core/ui/ControlPanel/Basics]]|
|
||||||
|
|`tc-first-link-nowrap` |Ensures that any links in the first table column will never wrap to the next line |
|
||||||
|
|
||||||
|
!! Table Utility Classes
|
||||||
|
|
||||||
|
|`tc-table-no-border` |Removes the borders of a table |
|
||||||
|
|`tc-first-col-min-width` |The first column of a table will take up minimal possible width. It adapts to the content |
|
@ -10,7 +10,7 @@ In order to display Tiddlers (usually the text field), the WikiText parser reads
|
|||||||
* ''block mode'' - the parser will recognise only [[block mode WikiText|Block Mode WikiText]] punctuation
|
* ''block mode'' - the parser will recognise only [[block mode WikiText|Block Mode WikiText]] punctuation
|
||||||
* ''inline mode'' - the parser will recognise only [[inline mode WikiText|Inline Mode WikiText]]
|
* ''inline mode'' - the parser will recognise only [[inline mode WikiText|Inline Mode WikiText]]
|
||||||
|
|
||||||
The parser [[transitions between these modes|WikiText parser mode transitions]] based on the text it encounters. In addition, there are [[places where the parser ignores WikiText|Places where the parser ignores WikiText]] punctuation.
|
The parser [[transitions between these modes|WikiText parser mode transitions]] based on the text it encounters. In addition, there are [[places where the parser ignores WikiText|Places where the parser ignores WikiText]] punctuation. The parser mode can also be set directly with the [[Pragma: \parsermode]].
|
||||||
|
|
||||||
<<.tip "The concept of inline vs block also exists for standard HTML elements. For HTML, these [[two layout modes|https://www.w3schools.com/html/html_blocks.asp]] determine if the output flows together on the same line or not.
|
<<.tip "The concept of inline vs block also exists for standard HTML elements. For HTML, these [[two layout modes|https://www.w3schools.com/html/html_blocks.asp]] determine if the output flows together on the same line or not.
|
||||||
<p>Most [[block mode WikiText|Block Mode WikiText]] corresponds to [[block level HTML elements|https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements]] and most [[inline mode WikiText|Inline Mode WikiText]] corresponds to [[inline level HTML elements|https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements]]. However, for Wikitext the two modes are just as important for determining which syntax will be recognised by the parser as they are for determining how the output will flow.</p>">>
|
<p>Most [[block mode WikiText|Block Mode WikiText]] corresponds to [[block level HTML elements|https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements]] and most [[inline mode WikiText|Inline Mode WikiText]] corresponds to [[inline level HTML elements|https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements]]. However, for Wikitext the two modes are just as important for determining which syntax will be recognised by the parser as they are for determining how the output will flow.</p>">>
|
@ -326,7 +326,7 @@ table {
|
|||||||
}
|
}
|
||||||
|
|
||||||
table th, table td {
|
table th, table td {
|
||||||
padding: 0 7px 0 7px;
|
padding: 4px 6px 4px 6px;
|
||||||
border-top: 1px solid <<colour table-border>>;
|
border-top: 1px solid <<colour table-border>>;
|
||||||
border-left: 1px solid <<colour table-border>>;
|
border-left: 1px solid <<colour table-border>>;
|
||||||
}
|
}
|
||||||
@ -357,11 +357,36 @@ Table utility classes
|
|||||||
width: 1%;
|
width: 1%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Utility classes work well with tables but also for other containers
|
||||||
|
*/
|
||||||
|
|
||||||
/* First link A element will not wrap */
|
/* First link A element will not wrap */
|
||||||
.tc-first-link-nowrap:first-of-type a {
|
.tc-first-link-nowrap:first-of-type a {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Move the table to the center of the container */
|
||||||
|
.tc-center {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tc-max-width {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tc-max-width-80 {
|
||||||
|
max-width: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Allow input and textarea to look like the ControlPanel inputs */
|
||||||
|
.tc-edit-max-width input,
|
||||||
|
.tc-edit-max-width textarea {
|
||||||
|
width: 100%;
|
||||||
|
padding: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
CSV parser plugin
|
CSV parser plugin
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user