Compare commits
26 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
96f149feaa | ||
![]() |
a1c946db9e | ||
![]() |
04272c3973 | ||
![]() |
1f56f68448 | ||
![]() |
3e9ecd4b70 | ||
![]() |
7be018ea3f | ||
![]() |
8fb496bbfe | ||
dcac80c5ac | |||
![]() |
4875f7c1f5 | ||
![]() |
f0bd41f65a | ||
![]() |
d3f6216837 | ||
![]() |
e14709be40 | ||
bdeaac5d03 | |||
![]() |
4acff2731a | ||
3b1f91bcb0 | |||
![]() |
572c3d0316 | ||
![]() |
4a6e4e7bc0 | ||
![]() |
35ca2b896e | ||
![]() |
0705c55e77 | ||
![]() |
f8edb70065 | ||
![]() |
218705bdc9 | ||
![]() |
48a8789c4d | ||
![]() |
48ab7f9514 | ||
![]() |
f2d9a2abe6 | ||
![]() |
cb55a967d0 | ||
![]() |
52c0daedbb |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@ venv/
|
||||
cli_docs/_build/
|
||||
dist/
|
||||
build/
|
||||
.pypi_token
|
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
||||
Copyright © 2021 Soren Bjornstad.
|
||||
Copyright © 2021-2022 Soren Bjornstad and the tzk community.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
|
13
README.md
13
README.md
@@ -19,7 +19,7 @@ Some basic knowledge of [TiddlyWiki](https://tiddlywiki.com)
|
||||
|
||||
|
||||
Documentation / Installation
|
||||
============================
|
||||
----------------------------
|
||||
|
||||
Find a live version of the edition on the web with further instructions
|
||||
at https://sobjornstad.github.io/tzk/.
|
||||
@@ -28,3 +28,14 @@ You can find the documentation for the CLI
|
||||
versioning with Git,
|
||||
and creating public and other derivative versions of the wiki)
|
||||
at https://tzk.readthedocs.io/en/latest/.
|
||||
|
||||
|
||||
Video walkthrough
|
||||
-----------------
|
||||
|
||||
Since tzk is still in an alpha state,
|
||||
general instructions on how to use it are somewhat lacking at the moment.
|
||||
To fill in the gap in the meantime,
|
||||
I recorded an hour-long walkthrough showing how you might take notes using tzk;
|
||||
you can select individual sections to watch if that's longer than you want.
|
||||
[Watch the video on YouTube](https://www.youtube.com/watch?v=9X_T-DVie8o).
|
||||
|
@@ -18,9 +18,9 @@ copyright = '2021 Soren Bjornstad'
|
||||
author = 'Soren Bjornstad'
|
||||
|
||||
# The short X.Y version
|
||||
version = "0.1.2"
|
||||
version = "0.3.0"
|
||||
# The full version, including alpha/beta/rc tags
|
||||
release = "0.1.2"
|
||||
release = "0.3.0"
|
||||
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
19811
docs/index.html
19811
docs/index.html
File diff suppressed because one or more lines are too long
@@ -1,7 +1,9 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
. venv/bin/activate
|
||||
rm -rf build/
|
||||
rm -f dist/*
|
||||
mkdir -p dist
|
||||
python setup.py sdist bdist_wheel
|
||||
twine upload dist/*
|
||||
TWINE_PASSWORD=$(cat .pypi_token) twine upload --username '__token__' dist/*
|
||||
|
@@ -4,6 +4,7 @@
|
||||
# docs
|
||||
sphinx==3.5.4 # newer versions display function names in the wrong color?
|
||||
sphinx_rtd_theme==0.5.2
|
||||
Jinja2<3.1 # https://github.com/readthedocs/readthedocs.org/issues/9038
|
||||
|
||||
# dev tools
|
||||
build
|
||||
|
2
setup.py
2
setup.py
@@ -9,7 +9,7 @@ with open("README.md", "r") as fh:
|
||||
|
||||
setuptools.setup(
|
||||
name="tzk",
|
||||
version="0.1.2",
|
||||
version="0.3.0",
|
||||
author="Soren I. Bjornstad",
|
||||
author_email="zettelkasten@sorenbjornstad.com",
|
||||
description="Build tool for TiddlyWiki Zettelkasten",
|
||||
|
@@ -13,6 +13,8 @@ from tzk import tw
|
||||
from tzk.util import (BuildError, fail, numerize, require_dependencies, pushd,
|
||||
TZK_VERSION)
|
||||
|
||||
VERSION_INFO = f"tzk version {TZK_VERSION}"
|
||||
|
||||
|
||||
class CliCommand(ABC):
|
||||
"""
|
||||
@@ -83,6 +85,12 @@ class ListenCommand(CliCommand):
|
||||
|
||||
@classmethod
|
||||
def setup_arguments(cls, parser: argparse.ArgumentParser) -> None:
|
||||
parser.add_argument(
|
||||
"--host",
|
||||
metavar="HOST",
|
||||
help="Host to listen on.",
|
||||
default=str(cm().listen_host or "127.0.0.1"),
|
||||
)
|
||||
parser.add_argument(
|
||||
"-p", "--port",
|
||||
metavar="PORT",
|
||||
@@ -109,6 +117,7 @@ class ListenCommand(CliCommand):
|
||||
tw.exec(
|
||||
[
|
||||
("listen",
|
||||
f"host={args.host}",
|
||||
f"port={args.port}",
|
||||
f"username={args.username}",
|
||||
f"password={args.password}")
|
||||
@@ -180,7 +189,7 @@ class VersionCommand(CliCommand):
|
||||
pass
|
||||
|
||||
def execute(self, args: argparse.Namespace) -> None:
|
||||
print(f"tzk version {TZK_VERSION}")
|
||||
print(VERSION_INFO)
|
||||
|
||||
|
||||
class BuildCommand(CliCommand):
|
||||
@@ -385,6 +394,7 @@ def launch():
|
||||
# go there before doing anything else.
|
||||
if (not os.path.exists("tzk_config.py")
|
||||
and os.environ.get('TZK_DIRECTORY')
|
||||
and len(sys.argv) > 1
|
||||
and sys.argv[1] != "init"): # we can't init an existing TZK_DIRECTORY
|
||||
try:
|
||||
os.chdir(os.environ['TZK_DIRECTORY'])
|
||||
@@ -401,11 +411,17 @@ def launch():
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
description=f"TiddlyZettelKasten {TZK_VERSION} CLI\n"
|
||||
f"Copyright (c) 2021 Soren Bjornstad.\n"
|
||||
f"Copyright (c) 2021-2022 Soren Bjornstad and the tzk community.\n"
|
||||
f"MIT license; see https://github.com/sobjornstad/tzk/blob/master/LICENSE for details.",
|
||||
epilog="For full documentation, see https://tzk.readthedocs.io/en/latest/.",
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter
|
||||
)
|
||||
parser.add_argument(
|
||||
"--version",
|
||||
action="version",
|
||||
version=VERSION_INFO,
|
||||
help=VersionCommand.help
|
||||
)
|
||||
|
||||
subparsers = parser.add_subparsers()
|
||||
for command in sorted(CliCommand.__subclasses__(), key=lambda i: i.__name__):
|
||||
|
205
tzk/builders.py
205
tzk/builders.py
@@ -13,13 +13,14 @@ information about the defined products without actually running any build steps.
|
||||
from collections.abc import Mapping
|
||||
from contextlib import contextmanager
|
||||
import functools
|
||||
import itertools
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
from typing import Callable, Dict, List, Optional, Set, Sequence, Tuple
|
||||
from typing import Callable, Dict, Generator, List, Optional, Set, Sequence, Tuple
|
||||
|
||||
from tzk import git
|
||||
from tzk import tw
|
||||
@@ -359,8 +360,165 @@ def _private_people_replacement_table(
|
||||
}
|
||||
|
||||
|
||||
def _privatize_line(line: str, replacement_table: Dict[str, str],
|
||||
replace_link_text: bool = False) -> Optional[str]:
|
||||
"""
|
||||
Given a line and a table of replacements to make, replace all instances
|
||||
of all private people defined in the replacement table.
|
||||
|
||||
Basics:
|
||||
>>> _privatize_line("MsAlice is a test person.", {'MsAlice': 'A.'})
|
||||
'[[A.|PrivatePerson]] is a test person.'
|
||||
|
||||
>>> _privatize_line("This woman, known as MsAlice, is a test person.", \
|
||||
{'MsAlice': 'A.'})
|
||||
'This woman, known as [[A.|PrivatePerson]], is a test person.'
|
||||
|
||||
>>> _privatize_line("[[MsAlice]] is a test person.", {'MsAlice': 'A.'})
|
||||
'[[A.|PrivatePerson]] is a test person.'
|
||||
|
||||
>>> _privatize_line("When we talk about [[MsAlice]] in the middle of a " \
|
||||
"sentence, that's fine too.", {'MsAlice': 'A.'})
|
||||
"When we talk about [[A.|PrivatePerson]] in the middle of a sentence, that's fine too."
|
||||
|
||||
Content inside a macro:
|
||||
>>> _privatize_line('''Text with a footnote.''' \
|
||||
'''<<fnote "Here's my footnote about MsAlice.">>''', \
|
||||
{'MsAlice': 'A.'})
|
||||
'Text with a footnote.<<fnote "Here\\'s my footnote about [[A.|PrivatePerson]].">>'
|
||||
|
||||
Links with different text and target:
|
||||
>>> _privatize_line("We can talk about [[Alice|MsAlice]] " \
|
||||
"with different text.", {'MsAlice': 'A.'})
|
||||
'We can talk about [[Alice|PrivatePerson]] with different text.'
|
||||
|
||||
Multiple replacements with different people:
|
||||
>>> _privatize_line("We can have [[MsAlice]] and MrBob talk to each other " \
|
||||
"in the same line.", {'MsAlice': 'A.', 'MrBob': 'B.'})
|
||||
'We can have [[A.|PrivatePerson]] and [[B.|PrivatePerson]] talk to each other in the same line.'
|
||||
|
||||
Multiple replacements with the same person:
|
||||
>>> _privatize_line("We can have MsAlice talk to herself (MsAlice) " \
|
||||
"in the same line.", {'MsAlice': 'A.'})
|
||||
'We can have [[A.|PrivatePerson]] talk to herself ([[A.|PrivatePerson]]) in the same line.'
|
||||
|
||||
>>> _privatize_line("Likewise [[MsAlice]] can do it with brackets " \
|
||||
"([[MsAlice]]).", {'MsAlice': 'A.'})
|
||||
'Likewise [[A.|PrivatePerson]] can do it with brackets ([[A.|PrivatePerson]]).'
|
||||
|
||||
>>> _privatize_line('We can talk about [[Alice|MsAlice]] lots of ways, ' \
|
||||
'like MsAlice and [[MsAlice]].', {'MsAlice': 'A.'})
|
||||
'We can talk about [[Alice|PrivatePerson]] lots of ways, like [[A.|PrivatePerson]] and [[A.|PrivatePerson]].'
|
||||
|
||||
Replacements with alternate link text:
|
||||
>>> _privatize_line('We can talk about [[Alice|MsAlice]] and [[Bob|MrBob]] as well', \
|
||||
{'MsAlice': 'A.', 'MrBob': 'B.'}, replace_link_text=True)
|
||||
'We can talk about [[A.|PrivatePerson]] and [[B.|PrivatePerson]] as well'
|
||||
|
||||
|
||||
We don't want to replace places where a CamelCase match is a substring of another
|
||||
word. This is expected to yield no output because there's nothing to replace:
|
||||
>>> _privatize_line("But an EmbeddedCamelWithMsAliceInIt isn't her.", \
|
||||
{'MsAlice': 'A.'})
|
||||
"""
|
||||
def iteroccurrences(needle: str) -> Generator[int, int, None]:
|
||||
"""
|
||||
Iterate over the start indices of occurrences of substring
|
||||
``needle`` in the line /line/ in outer scope.
|
||||
|
||||
(We have to use outer scope because it can be changed while we're iterating
|
||||
and the generator is only bound to arguments once.)
|
||||
"""
|
||||
idx = -1
|
||||
while True:
|
||||
idx = line.find(needle, idx + 1)
|
||||
if idx == -1:
|
||||
return
|
||||
else:
|
||||
additional_increments = yield idx
|
||||
if additional_increments is not None:
|
||||
idx += additional_increments
|
||||
|
||||
def anchored_at_one_end(start_index: int, end_index: int) -> bool:
|
||||
return start_index == 0 or end_index == len(line)
|
||||
|
||||
def is_camelcase_link(start_index: int, end_index: int) -> bool:
|
||||
return (anchored_at_one_end(start_index, end_index)
|
||||
or (line[start_index-1] != '[' and line[end_index] != ']'))
|
||||
|
||||
def is_bare_bracketed_link(start_index: int, end_index: int) -> bool:
|
||||
return (not anchored_at_one_end(start_index, end_index)
|
||||
and line[start_index-2:start_index] == '[['
|
||||
and line[end_index:end_index+2] == ']]')
|
||||
|
||||
def is_textual_bracketed_link(start_index: int, end_index: int) -> bool:
|
||||
return (not anchored_at_one_end(start_index, end_index)
|
||||
and line[start_index-1] == '|'
|
||||
and line[end_index:end_index+2] == ']]')
|
||||
|
||||
dirty = False
|
||||
increment_iterator_by = 0
|
||||
for replace_person, replace_initials in replacement_table.items():
|
||||
iterator = iteroccurrences(replace_person)
|
||||
try:
|
||||
while True:
|
||||
# NOTE: the "end" index is one after the last index in the string,
|
||||
# as is needed for slice notation.
|
||||
if increment_iterator_by:
|
||||
start_idx = iterator.send(increment_iterator_by)
|
||||
increment_iterator_by = 0
|
||||
else:
|
||||
start_idx = next(iterator)
|
||||
end_idx = start_idx + len(replace_person)
|
||||
new_line = None
|
||||
|
||||
if is_camelcase_link(start_idx, end_idx):
|
||||
# camel-case link or unlinked reference in text
|
||||
def is_spurious_substring():
|
||||
# If there's not a non-alphanumeric character on both sides of
|
||||
# the "link", we may be making a clbuttic replacement.
|
||||
# <https://en.wikipedia.org/wiki/Scunthorpe_problem>
|
||||
start_ok = start_idx == 0 or not line[start_idx-1].isalnum()
|
||||
end_ok = end_idx == len(line) or not line[end_idx].isalnum()
|
||||
return not (start_ok and end_ok)
|
||||
|
||||
if not is_spurious_substring():
|
||||
new_line = (line[0:start_idx]
|
||||
+ f'[[{replace_initials}|PrivatePerson]]'
|
||||
+ line[end_idx:])
|
||||
elif is_bare_bracketed_link(start_idx, end_idx):
|
||||
# link with the person as the target and text
|
||||
replacement = replace_initials + '|PrivatePerson'
|
||||
new_line = line[0:start_idx] + replacement + line[end_idx:]
|
||||
elif is_textual_bracketed_link(start_idx, end_idx):
|
||||
# link with the person as the target only;
|
||||
# beware that you might have put something private in the text
|
||||
if replace_link_text:
|
||||
start_of_link = line[0:start_idx].rfind('[[', 0, start_idx) + 2
|
||||
new_line = line[0:start_of_link] + f"{replace_initials}|PrivatePerson" + line[end_idx:]
|
||||
else:
|
||||
new_line = line[0:start_idx] + 'PrivatePerson' + line[end_idx:]
|
||||
else:
|
||||
link = line[start_idx:end_idx]
|
||||
raise ValueError("Unknown type of link '{link}'.")
|
||||
|
||||
if new_line:
|
||||
line = new_line
|
||||
dirty = True
|
||||
# If we changed the length of the string by modifying it,
|
||||
# we need to update our stored position within the string.
|
||||
increment_iterator_by = len(new_line) - len(line)
|
||||
except StopIteration:
|
||||
pass
|
||||
|
||||
if dirty:
|
||||
return line
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
@tzk_builder
|
||||
def replace_private_people(initialer: Callable[[str], str] = None) -> None:
|
||||
def replace_private_people(initialer: Callable[[str], str] = None, replace_link_text: bool = False) -> None:
|
||||
"""
|
||||
Replace the names of people who are not marked Public with their initials.
|
||||
|
||||
@@ -384,37 +542,36 @@ def replace_private_people(initialer: Callable[[str], str] = None) -> None:
|
||||
that takes one string argument
|
||||
(a tiddler filename without the full path, e.g., ``MsJaneDoe.tid``)
|
||||
and returns a string to be considered the "initials" of that person.
|
||||
|
||||
:param replace_link_text: If you have links in the form
|
||||
``So then [[John said|MrJohnDoe]] something about this``,
|
||||
then enabling this option ensures that the link is fully
|
||||
replaced with
|
||||
``So then [[J.D.|PrivatePerson]] something about this``.
|
||||
This means that when using this feature, having the
|
||||
link text also be meaningful after redaction is important.
|
||||
|
||||
.. warning ::
|
||||
Using this link replacement feature does not redact everything, just the link
|
||||
(and the link text with `replace_link_text` enabled). So *do not* rely on it
|
||||
for redacting everything. Making a tiddler public still needs consideration and
|
||||
tooling is there to help, not to replace your own judgment.
|
||||
"""
|
||||
assert 'public_wiki_folder' in build_state
|
||||
|
||||
replacement_table = _private_people_replacement_table(initialer)
|
||||
tid_files = (Path(build_state['public_wiki_folder']) / "tiddlers").glob("**/*.tid")
|
||||
root = (Path(build_state['public_wiki_folder']) / "tiddlers")
|
||||
tid_files = itertools.chain(root.glob("**/*.tid"), root.glob("**/*.json"))
|
||||
|
||||
for tiddler in tid_files:
|
||||
dirty = False
|
||||
with tiddler.open() as f:
|
||||
lines = f.readlines()
|
||||
for idx, line in enumerate(lines):
|
||||
for replace_person, replace_initials in replacement_table.items():
|
||||
if replace_person in line:
|
||||
if '|' + replace_person + ']]' in line:
|
||||
# link with the person as the target only;
|
||||
# beware that you might have put something private in the text
|
||||
lines[idx] = line.replace(replace_person,
|
||||
'PrivatePerson')
|
||||
elif '[[' + replace_person + ']]' in line:
|
||||
# link with the person as the target and text
|
||||
lines[idx] = line.replace(replace_person,
|
||||
replace_initials + '|PrivatePerson')
|
||||
else:
|
||||
# camel-case link or unlinked reference in text;
|
||||
# or spurious substring, so rule that out with the '\b' search
|
||||
lines[idx] = re.sub(
|
||||
r"\b" + re.escape(replace_person) + r"\b",
|
||||
f'<<privateperson "{replace_initials}">>',
|
||||
line
|
||||
)
|
||||
dirty = True
|
||||
for i in range(len(lines)):
|
||||
private_line = _privatize_line(lines[i], replacement_table, replace_link_text)
|
||||
if private_line is not None:
|
||||
lines[i] = private_line
|
||||
dirty = True
|
||||
if dirty:
|
||||
with tiddler.open("w") as f:
|
||||
f.writelines(lines)
|
||||
|
@@ -35,6 +35,10 @@ commit_remote = ""
|
||||
# http://localhost:8080 in your browser.
|
||||
listen_port = 8080
|
||||
|
||||
# Host to listen on. If you specify "0.0.0.0" it will listen to all network interfaces.
|
||||
# This is useful for allowing the wiki to be exposed to the network through a container.
|
||||
listen_host = "127.0.0.1"
|
||||
|
||||
# Uncomment if you want to require HTTP basic authentication when serving your wiki.
|
||||
# **WARNING**: this is NOT secure for use over the open Internet or all but the
|
||||
# simplest local networks, as the password is sent in the clear. For good
|
||||
|
@@ -0,0 +1,5 @@
|
||||
created: 20210925145600000
|
||||
modified: 20210925145600000
|
||||
tags:
|
||||
title: $:/config/TiddlyRemember/DefaultClasses
|
||||
type: text/vnd.tiddlywiki
|
@@ -0,0 +1,7 @@
|
||||
created: 20210929144900000
|
||||
modified: 20210929144900000
|
||||
tags:
|
||||
title: $:/config/TiddlyRemember/snippets/remembercz
|
||||
|
||||
<<remembercz "%NOTE_ID%"
|
||||
"Cloze">>
|
@@ -0,0 +1,8 @@
|
||||
created: 20210929144900000
|
||||
modified: 20210929144900000
|
||||
tags:
|
||||
title: $:/config/TiddlyRemember/snippets/rememberq
|
||||
|
||||
<<rememberq "%NOTE_ID%"
|
||||
"Q"
|
||||
"A">>
|
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2020 Soren Bjornstad.
|
||||
Copyright (c) 2020-2021 Soren Bjornstad and the TiddlyRemember community.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@@ -0,0 +1,20 @@
|
||||
created: 20210929144300000
|
||||
modified: 20210929144300000
|
||||
tags: $:/tags/Macro
|
||||
title: $:/plugins/sobjornstad/TiddlyRemember/macros/insert-snippet
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define tr-insert-note(snippet)
|
||||
<$vars
|
||||
thetime=<<now "[UTC]YYYY0MM0DD0hh0mm0ss0XXX">>
|
||||
theprefix={{$:/config/TiddlyRemember/IdPrefix}}>
|
||||
<$vars
|
||||
noteid={{{ [<theprefix>addsuffix<thetime>] }}}
|
||||
editingtid={{{ [<storyTiddler>get[draft.of]] }}}>
|
||||
<$action-sendmessage
|
||||
$message="tm-edit-text-operation"
|
||||
$param="replace-selection"
|
||||
text={{{ [<__snippet__>search-replace[%NOTE_ID%],<noteid>search-replace[%EDITING_TIDDLER%],<editingtid>] }}}/>
|
||||
</$vars>
|
||||
</$vars>
|
||||
\end
|
@@ -1,10 +1,10 @@
|
||||
created: 20200510004110231
|
||||
modified: 20200730205800000
|
||||
modified: 20200925141800000
|
||||
tags: $:/tags/Macro
|
||||
title: $:/plugins/sobjornstad/TiddlyRemember/macros/remember
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define remembertwo(id, reference)
|
||||
\define remembertwo(id, reference, sched)
|
||||
<div class="tr-selfidentification">
|
||||
<$set name="selfid" filter="""[enlist[$reference$]]""" value="""[<$link to="$reference$">$reference$</$link>: $id$]""" emptyValue="[$id$]">
|
||||
<<selfid>>
|
||||
@@ -16,10 +16,13 @@ type: text/vnd.tiddlywiki
|
||||
<div class="tr-reference">
|
||||
<$text text=<<__reference__>>/>
|
||||
</div>
|
||||
<div class="tr-sched">
|
||||
<$text text=<<__sched__>>/>
|
||||
</div>
|
||||
\end
|
||||
|
||||
\define rememberq(id, question, answer, reference: "")
|
||||
<div class="rememberq remembertwo">
|
||||
\define rememberq(id, question, answer, reference: "", sched: "", class:"")
|
||||
<div class={{{ [[rememberq remembertwo ]addsuffix<__class__>addsuffix[ ]addsuffix{$:/config/TiddlyRemember/DefaultClasses}] }}}>
|
||||
<div class="rquestion tr-ritem">
|
||||
<div>Q:</div>
|
||||
<p>$question$</p>
|
||||
@@ -28,12 +31,12 @@ type: text/vnd.tiddlywiki
|
||||
<div>A:</div>
|
||||
<p>$answer$</p>
|
||||
</div>
|
||||
<$macrocall $name=remembertwo id=<<__id__>> reference=<<__reference__>>/>
|
||||
<$macrocall $name=remembertwo id=<<__id__>> reference=<<__reference__>> sched=<<__sched__>>/>
|
||||
</div>
|
||||
\end
|
||||
|
||||
\define rememberp(id, first, second, reference: "")
|
||||
<div class="rememberp remembertwo">
|
||||
\define rememberp(id, first, second, reference: "", sched: "", class: "")
|
||||
<div class={{{ [[rememberp remembertwo ]addsuffix<__class__>addsuffix[ ]addsuffix{$:/config/TiddlyRemember/DefaultClasses}] }}}>
|
||||
<div class="rfirst tr-ritem">
|
||||
<div>1:</div>
|
||||
<p>$first$</p>
|
||||
@@ -42,52 +45,51 @@ type: text/vnd.tiddlywiki
|
||||
<div>2:</div>
|
||||
<p>$second$</p>
|
||||
</div>
|
||||
<$macrocall $name=remembertwo id=<<__id__>> reference=<<__reference__>>/>
|
||||
<$macrocall $name=remembertwo id=<<__id__>> reference=<<__reference__>> sched=<<__sched__>>/>
|
||||
</div>
|
||||
\end
|
||||
|
||||
\define remembercz(id, text, mode: "block", reference: "")
|
||||
<$list filter="[[$mode$]match[inline]]">
|
||||
<$macrocall $name=twRememberClozeInline id=<<__id__>> text=<<__text__>> reference=<<__reference__>>/>
|
||||
\define remembercz(id, text, mode: "block", reference: "", sched: "", class: "")
|
||||
<$list filter="[[$mode$]match[inline]]" variable=_>
|
||||
<$macrocall $name=twRememberClozeInline id=<<__id__>> text=<<__text__>> reference=<<__reference__>> sched=<<__sched__>> class=<<__class__>>/>
|
||||
</$list>
|
||||
<$list filter="[[$mode$]!match[inline]]">
|
||||
<$macrocall $name=twRememberClozeBlock id=<<__id__>> text=<<__text__>> reference=<<__reference__>>/>
|
||||
<$list filter="[[$mode$]!match[inline]]" variable=_>
|
||||
<$macrocall $name=twRememberClozeBlock id=<<__id__>> text=<<__text__>> reference=<<__reference__>> sched=<<__sched__>> class=<<__class__>>/>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define twRememberClozeBlock(id, text, reference)
|
||||
<div class="remembercz">
|
||||
<span class="cloze-identifier">cloze: </span>
|
||||
<span class="cloze-text">$text$</span>
|
||||
<div class="tr-selfidentification">
|
||||
<$set name="selfid" filter="""[enlist[$reference$]]""" value="""[<$link to="$reference$">$reference$</$link>: $id$]""" emptyValue="[$id$]">
|
||||
<<selfid>>
|
||||
</$set>
|
||||
</div>
|
||||
<div class="rid">
|
||||
[$id$]
|
||||
</div>
|
||||
<div class="tr-reference">
|
||||
<$text text=<<__reference__>>/>
|
||||
</div>
|
||||
\define twRememberMetadata(id, reference, sched)
|
||||
<div class="tr-selfidentification">
|
||||
<$set name="selfid" filter="""[enlist[$reference$]]""" value="""[<$link to="$reference$">$reference$</$link>: $id$]""" emptyValue="[$id$]">
|
||||
<<selfid>>
|
||||
</$set>
|
||||
</div>
|
||||
<div class="rid">
|
||||
[$id$]
|
||||
</div>
|
||||
<div class="tr-reference">
|
||||
<$text text=<<__reference__>>/>
|
||||
</div>
|
||||
<div class="tr-sched">
|
||||
<$text text=<<__sched__>>/>
|
||||
</div>
|
||||
\end
|
||||
|
||||
\define twRememberClozeInline(id, text, reference)
|
||||
<span class="remembercz">
|
||||
<span class="cloze-identifier">{cloze: </span>
|
||||
\define twRememberClozeBlock(id, text, reference, sched, class)
|
||||
<div class={{{ [[remembercz ]addsuffix<__class__>addsuffix[ ]addsuffix{$:/config/TiddlyRemember/DefaultClasses}] }}}>
|
||||
<span class="cloze-identifier"><span class="tr-name-cloze">cloze: </span></span>
|
||||
<span class="cloze-display"><$set name="unescape" value={{{ [<__text__>search-replace:g[\{],[{]search-replace:g[\}],[}]] }}}><<unescape>></$set></span>
|
||||
<span class="cloze-text">$text$</span>
|
||||
<$macrocall $name="twRememberMetadata" id=<<__id__>> reference=<<__reference__>> sched=<<__sched__>>/>
|
||||
</div>
|
||||
\end
|
||||
|
||||
\define twRememberClozeInline(id, text, reference, sched, class)
|
||||
<span class={{{ [[remembercz ]addsuffix<__class__>addsuffix[ ]addsuffix{$:/config/TiddlyRemember/DefaultClasses}] }}}>
|
||||
<span class="cloze-identifier">{<span class="tr-name-cloze">cloze: </span></span>
|
||||
<span class="cloze-display"><$set name="unescape" value={{{ [<__text__>search-replace:g[\{],[{]search-replace:g[\}],[}]] }}}><<unescape>></$set></span>
|
||||
<span class="cloze-identifier">}</span>
|
||||
<div class="tr-selfidentification">
|
||||
<$set name="selfid" filter="""[enlist[$reference$]]""" value="""[<$link to="$reference$">$reference$</$link>: $id$]""" emptyValue="[$id$]">
|
||||
<<selfid>>
|
||||
</$set>
|
||||
</div>
|
||||
<div class="rid">
|
||||
[$id$]
|
||||
</div>
|
||||
<div class="tr-reference">
|
||||
<$text text=<<__reference__>>/>
|
||||
</div>
|
||||
<span class="cloze-text">$text$</span>
|
||||
<$macrocall $name="twRememberMetadata" id=<<__id__>> reference=<<__reference__>> sched=<<__sched__>>/>
|
||||
</span>
|
||||
\end
|
@@ -43,11 +43,37 @@ div.remembercz {
|
||||
color: <<colour muted-foreground>>;
|
||||
}
|
||||
|
||||
/* the separate reference and ID fields are only for TR's benefit */
|
||||
|
||||
/* these separate fields are only read by the TR parser */
|
||||
div.remembertwo div.tr-reference, .remembercz div.tr-reference {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.remembertwo div.rid, .remembercz div.rid {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.remembertwo div.tr-sched, .remembercz div.tr-sched {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.remembercz > span.cloze-text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/***** Built-in classes for common format customizations; apply to the class: parameter to macros *****/
|
||||
/* Hide the ID field */
|
||||
.tr-hide-id div.tr-selfidentification {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Hide the ID only if it's an inline cloze */
|
||||
span.remembercz.tr-hide-inline-cloze-id div.tr-selfidentification {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Hide the word "cloze" on inline clozes */
|
||||
span.remembercz.tr-hide-inline-cloze-name span.cloze-identifier span.tr-name-cloze {
|
||||
display: none;
|
||||
}
|
@@ -6,9 +6,13 @@ type: text/vnd.tiddlywiki
|
||||
|
||||
\import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]
|
||||
|
||||
<span id="tr-version">1.2.2</span>
|
||||
<$set name="tr-rendering" value="yes">
|
||||
|
||||
<span id="tr-version">1.3.3</span>
|
||||
|
||||
{{||$:/plugins/sobjornstad/TiddlyRemember/templates/AnkiDecks}}
|
||||
{{||$:/plugins/sobjornstad/TiddlyRemember/templates/AnkiTags}}
|
||||
|
||||
<$transclude mode="block" />
|
||||
|
||||
</$set>
|
||||
|
@@ -10,21 +10,4 @@ tags: $:/tags/EditorToolbar
|
||||
title: $:/plugins/sobjornstad/TiddlyRemember/toolbar/remembercz
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define getMacro()
|
||||
<<remembercz "$(clozeid)$"
|
||||
"Cloze">>
|
||||
\end
|
||||
|
||||
\define prefixId() $(theprefix)$$(thetime)$
|
||||
|
||||
<$set name=thetime value=<<now "[UTC]YYYY0MM0DD0hh0mm0ss0XXX">> >
|
||||
<$set name=theprefix value={{$:/config/TiddlyRemember/IdPrefix}}>
|
||||
<$set name=clozeid value=<<prefixId>> >
|
||||
<$action-sendmessage
|
||||
$message="tm-edit-text-operation"
|
||||
$param="replace-selection"
|
||||
text=<<getMacro>>
|
||||
/>
|
||||
</$set>
|
||||
</$set>
|
||||
</$set>
|
||||
<$macrocall $name=tr-insert-note snippet={{$:/config/TiddlyRemember/snippets/remembercz}}>
|
@@ -9,22 +9,4 @@ tags: $:/tags/EditorToolbar
|
||||
title: $:/plugins/sobjornstad/TiddlyRemember/toolbar/rememberq
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define getMacro()
|
||||
<<rememberq "$(questionid)$"
|
||||
"Q"
|
||||
"A">>
|
||||
\end
|
||||
|
||||
\define prefixId() $(theprefix)$$(thetime)$
|
||||
|
||||
<$set name=thetime value=<<now "[UTC]YYYY0MM0DD0hh0mm0ss0XXX">> >
|
||||
<$set name=theprefix value={{$:/config/TiddlyRemember/IdPrefix}}>
|
||||
<$set name=questionid value=<<prefixId>> >
|
||||
<$action-sendmessage
|
||||
$message="tm-edit-text-operation"
|
||||
$param="replace-selection"
|
||||
text=<<getMacro>>
|
||||
/>
|
||||
</$set>
|
||||
</$set>
|
||||
</$set>
|
||||
<$macrocall $name=tr-insert-note snippet={{$:/config/TiddlyRemember/snippets/rememberq}}>
|
@@ -2,7 +2,7 @@
|
||||
"title": "$:/plugins/sobjornstad/TiddlyRemember",
|
||||
"description": "TiddlyRemember: Embed Anki notes in your TiddlyWiki",
|
||||
"author": "Soren Bjornstad",
|
||||
"version": "1.2.2",
|
||||
"version": "1.3.3",
|
||||
"core-version": ">=5.1.21",
|
||||
"source": "https://github.com/sobjornstad/TiddlyRemember",
|
||||
"list": "readme license",
|
||||
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/appear/defaults/button-class
|
||||
|
||||
tc-btn-invisible tc-tiddlylink
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/appear/defaults/default-state
|
||||
|
||||
$:/temp/appear/
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/appear/defaults/keep
|
||||
|
||||
yes
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/appear/defaults/mode
|
||||
|
||||
block
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/appear/defaults/show
|
||||
|
||||
»
|
@@ -0,0 +1,13 @@
|
||||
/*\
|
||||
title: $:/plugins/tobibeer/appear/popup.js
|
||||
type: application/javascript
|
||||
module-type: utils
|
||||
|
||||
An enhanced version of the core Popup to support:
|
||||
* absolute popups
|
||||
* preview popups
|
||||
* popup z-index
|
||||
|
||||
@preserve
|
||||
\*/
|
||||
(function(){"use strict";var t=require("$:/core/modules/utils/dom/popup.js").Popup,e=require("$:/core/modules/widgets/reveal.js").reveal,s=e.prototype.refresh;t.prototype.show=function(t){var e,s=t.domNode,p=$tw.utils.hasClass(s,"tc-popup-absolute"),o=this.popupInfo(s),i=function(t){var e=t,s=0,p=0;do{s+=e.offsetLeft||0;p+=e.offsetTop||0;e=e.offsetParent}while(e);return{left:s,top:p}},l={left:s.offsetLeft,top:s.offsetTop};e=o.popupLevel;if(o.isHandle){e++}this.cancel(e);if(this.findPopup(t.title)===-1){this.popups.push({title:t.title,wiki:t.wiki,domNode:s})}l=p?i(s):l;t.wiki.setTextReference(t.title,"("+l.left+","+l.top+","+s.offsetWidth+","+s.offsetHeight+")");if(this.popups.length>0){this.rootElement.addEventListener("click",this,true)}};t.prototype.popupInfo=function(t){var e,s=false,p=t;while(p&&e===undefined){if($tw.utils.hasClass(p,"tc-popup-handle")||$tw.utils.hasClass(p,"tc-popup-keep")){s=true}if($tw.utils.hasClass(p,"tc-reveal")&&($tw.utils.hasClass(p,"tc-popup")||$tw.utils.hasClass(p,"tc-popup-handle"))){e=parseInt(p.style.zIndex)-1e3}p=p.parentNode}var o={popupLevel:e||0,isHandle:s};return o};t.prototype.handleEvent=function(t){if(t.type==="click"){var e=this.popupInfo(t.target),s=e.popupLevel-1;if(e.isHandle){if(s<0){s=1}else{s++}}this.cancel(s)}};e.prototype.refresh=function(){var t,e,p=this.isOpen;e=s.apply(this,arguments);t=this.domNodes[0];if(this.isOpen&&(p!==this.isOpen||!t.style.zIndex)&&t&&(this.type==="popup"||$tw.utils.hasClass(t,"tc-block-dropdown")&&$tw.utils.hasClass(t,"tc-reveal"))){t.style.zIndex=1e3+$tw.popup.popups.length}return e}})();
|
@@ -0,0 +1,3 @@
|
||||
module-type: utils
|
||||
title: $:/plugins/tobibeer/appear/popup.js
|
||||
type: application/javascript
|
@@ -0,0 +1,31 @@
|
||||
title: $:/plugins/tobibeer/appear/readme
|
||||
|
||||
This plugin provides the ''$appear'' widget that can render popups and sliders (inline or block) as well as accordion menus.
|
||||
|
||||
!! Attributes
|
||||
; type
|
||||
: set to `popup` to have the content appear as a popup
|
||||
; show
|
||||
: the button label
|
||||
; hide
|
||||
: the hide button label
|
||||
; mode
|
||||
: either `block` or `inline`, with respect to the inner content
|
||||
: any other mode is interpreted as block mode, without the default styles applying, e.g. drop-shadows
|
||||
; once
|
||||
: allows to click the button once, then hides it (unless the state is deleted)
|
||||
; $state
|
||||
: the widget calculates a state for you, use this to append a simple id
|
||||
; state
|
||||
: alternatively, specify a fully qualified state
|
||||
; keep
|
||||
: make popups sticky when `yes` or `true`
|
||||
; handle / handler / variables
|
||||
: allows to take the popup contents out of the flow and render them elsewhere on the page
|
||||
: required to properly create popups in table cells and other constained elements
|
||||
: specify variables to take along
|
||||
|
||||
<br>
|
||||
|
||||
; documentation / examples / demos...
|
||||
: http://tobibeer.github.io/tw5-plugins#appear
|
@@ -0,0 +1,21 @@
|
||||
tags: $:/tags/Stylesheet
|
||||
title: $:/plugins/tobibeer/appear/styles
|
||||
|
||||
\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline html
|
||||
|
||||
<pre>.tc-reveal.appear-block,
|
||||
.tc-popup.appear {
|
||||
border-radius: 5px;
|
||||
padding: 1px 1em;
|
||||
<<box-shadow "2px 2px 4px rgba(0,0,0,0.3)">>;
|
||||
}
|
||||
.tc-popup.appear {
|
||||
padding: 0 1em;
|
||||
background: <<colour background>>;
|
||||
}
|
||||
.appear-reveal.appear-inline{
|
||||
margin-left:5px;
|
||||
}
|
||||
.appear-reveal.appear-inline.appear-once{
|
||||
margin-left:0;
|
||||
}</pre>
|
File diff suppressed because one or more lines are too long
@@ -0,0 +1,3 @@
|
||||
module-type: widget
|
||||
title: $:/plugins/tobibeer/appear/widget.js
|
||||
type: application/javascript
|
15
tzk/editions/tzk/plugins/appear/plugin.info
Normal file
15
tzk/editions/tzk/plugins/appear/plugin.info
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"author": "Tobias Beer",
|
||||
"core-version": ">=5.1.9",
|
||||
"created": "20220505135225785",
|
||||
"dependents": "",
|
||||
"description": "Create popups, sliders or accordion menus with the appear widget.",
|
||||
"documentation": "https://tobibeer.github.io/tw5-appear",
|
||||
"list": "readme",
|
||||
"modified": "20220505135225785",
|
||||
"plugin-type": "plugin",
|
||||
"requires": "",
|
||||
"source": "https://github.com/tobibeer/tw5-appear",
|
||||
"title": "$:/plugins/tobibeer/appear",
|
||||
"version": "0.6.2"
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
title: $:/plugins/tobibeer/preview/config
|
||||
|
||||
\define default()
|
||||
<dt>$(defaults)$$(option)$</dt>
|
||||
<dd>
|
||||
//{{$:/plugins/tobibeer/preview/lingo/$(option)$}}<$list
|
||||
filter="[[$(option)$]prefix[template]]">
|
||||
{{$(defaults)$$(option)$}}</$list>://<br>
|
||||
<$edit-text tag=input tiddler="$(defaults)$$(option)$"/>
|
||||
</dd>
|
||||
\end
|
||||
|
||||
<dl class="preview-defaults">
|
||||
<$vars defaults="$:/plugins/tobibeer/preview/defaults/">
|
||||
<$list filter="[all[tiddlers+shadows]removeprefix<defaults>sort[title]]" variable="option">
|
||||
<<default>>
|
||||
</$list>
|
||||
</$vars>
|
||||
</dl>
|
||||
<style>.preview-defaults input {width:90%;}</style>
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/preview/defaults/class
|
||||
|
||||
tc-popup-keep
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/preview/defaults/delay
|
||||
|
||||
1500
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/preview/defaults/exclude
|
||||
|
||||
[is[system]] [all[shadows]] [!has[text]]
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/preview/defaults/keys
|
||||
|
||||
CTRL
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/preview/defaults/not
|
||||
|
||||
tc-drop-down tc-sidebar-scrollable tc-topbar tc-tiddler-title
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/preview/defaults/template
|
||||
|
||||
$:/plugins/tobibeer/preview/template
|
@@ -0,0 +1,11 @@
|
||||
/*\
|
||||
title: $:/plugins/tobibeer/preview/keyboard.js
|
||||
type: application/javascript
|
||||
module-type: utils
|
||||
|
||||
Fixes $:/core/modules/utils/dom/keyboard.js by providing an alternative.
|
||||
Do not use as an API, let's fix the core.
|
||||
|
||||
@preserve
|
||||
\*/
|
||||
(function(){"use strict";var e={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DELETE:46};exports.parseKeyDescriptorTB=function(t){var l,r,y,s=t.toUpperCase().split("+"),K={keyCode:null,shiftKey:false,altKey:false,ctrlKey:false};for(y=0;y<s.length;y++){l=false;r=s[y];if(r.substr(0,1)==="!"){l=true;r=r.substr(1)}if(r==="CTRL"){K.ctrlKey=l?null:true}else if(r==="SHIFT"){K.shiftKey=l?null:true}else if(r==="ALT"){K.altKey=l?null:true}else if(r==="META"){K.metaKey=l?null:true}else if(e[r]){K.keyCode=e[r]}else{K.keyCode=r.charCodeAt(0)}}return K};exports.checkKeyDescriptorTB=function(e,t){var l=!!t.metaKey;return(t.keyCode===null||e.keyCode===t.keyCode)&&(t.shiftKey===null?!e.shiftKey:e.shiftKey===t.shiftKey)&&(t.altKey===null?!e.altKey:e.altKey===t.altKey)&&(t.ctrlKey===null?!e.ctrlKey:e.ctrlKey===t.ctrlKey)&&(t.metaKey===null?!e.metaKey:e.metaKey===l)}})();
|
@@ -0,0 +1,3 @@
|
||||
module-type: utils
|
||||
title: $:/plugins/tobibeer/preview/keyboard.js
|
||||
type: application/javascript
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/preview/lingo/class
|
||||
|
||||
css classes applied to the popup
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/preview/lingo/delay
|
||||
|
||||
delay popup for this many milliseconds
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/preview/lingo/exclude
|
||||
|
||||
no preview for links to tiddlers matching this filter
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/preview/lingo/keys
|
||||
|
||||
modifier keys to trigger popup directly on-hover (ctrl, alt+shift, meta, etc...)
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/preview/lingo/not
|
||||
|
||||
no preview for links inside elements with these classes
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/preview/lingo/open
|
||||
|
||||
view at ''<<WIKI>>''
|
@@ -0,0 +1,3 @@
|
||||
title: $:/plugins/tobibeer/preview/lingo/template
|
||||
|
||||
the preview template
|
@@ -0,0 +1,10 @@
|
||||
/*\
|
||||
title: $:/plugins/tobibeer/preview/link.js
|
||||
type: application/javascript
|
||||
module-type: startup
|
||||
|
||||
Enhances the link widget for on-hover previews
|
||||
|
||||
@preserve
|
||||
\*/
|
||||
(function(){var e,t=require("$:/core/modules/widgets/link.js").link,i=t.prototype.render,o=t.prototype.handleClickEvent;t.prototype.render=function(){i.apply(this,arguments);var t=this,o=this.wiki,p=this.domNodes[0],r=o.getTiddler(t.to),n="$:/plugins/tobibeer/preview/defaults/",u="$:/temp/tobibeer/preview-",l=$tw.utils.parseKeyDescriptorTB(o.getTextReference(n+"keys","").toUpperCase()),s=o.getTextReference(n+"delay").toUpperCase(),a=function(e){var i=$tw.popup.popupInfo(e),p=i.popupLevel;return o.getTextReference(u+p)&&o.getTextReference(u+p+"-tiddler")===t.to?null:i},f=function(){var i,r=a(p);if(r){i=r.popupLevel;clearTimeout(t.previewTimeout);$tw.popup.cancel(i);i++;o.setText(u+i+"-tiddler","text",null,t.to);if($tw.popup.findPopup(u+i)===-1){setTimeout(function(){$tw.popup.triggerPopup({domNode:p,title:u+i,wiki:o});e=0},50)}}},d=function(){var e,i,r=1,u=o.getTextReference(n+"not","");if(u){$tw.utils.each(u.split(" "),function(e){var t=p;while(t&&r){if($tw.utils.hasClass(t,e)){r=0;return false}t=t.parentNode}})}if(r){i=o.getTextReference(n+"exclude","");e=i?o.filterTiddlers(i):[];if(e.indexOf(t.to)>=0){r=0}}return r};s=s!==undefined?parseInt(s):null;if(s!==null&&isNaN(s)){s=0}if(r){$tw.utils.addClass(p,"tc-popup-handle");$tw.utils.addClass(p,"tc-popup-absolute");["mouseover","mouseout"].forEach(function(i){p.addEventListener(i,function(o){var p=o||window.event;if(i==="mouseover"){if(d()){if(!p.keyCode){p.keyCode=0}if($tw.utils.checkKeyDescriptorTB(p,l)){if(!e){e=1;f()}}else if(s!==null){e=0;t.previewTimeout=setTimeout(f,s)}}}else{e=0;clearTimeout(t.previewTimeout)}})})}};t.prototype.handleClickEvent=function(){o.apply(this,arguments);clearTimeout(this.previewTimeout);$tw.popup.cancel(Math.max(0,$tw.popup.popupInfo(this.domNodes[0]).popupLevel))}})();
|
@@ -0,0 +1,3 @@
|
||||
module-type: startup
|
||||
title: $:/plugins/tobibeer/preview/link.js
|
||||
type: application/javascript
|
@@ -0,0 +1,24 @@
|
||||
tags: $:/tags/PageTemplate
|
||||
title: $:/plugins/tobibeer/preview/popups
|
||||
|
||||
\define state(num)
|
||||
$:/temp/tobibeer/preview-$num$
|
||||
\end
|
||||
|
||||
\define classes(num)
|
||||
tc-popup appear appear-block appear-reveal tc-preview-tiddler tc-preview-tiddler-$num$ $(default-classes)$
|
||||
\end
|
||||
|
||||
\define level(num)
|
||||
<$reveal tag="div" type="popup" state=<<state $num$>> class=<<classes $num$>>>
|
||||
<$tiddler tiddler={{$:/temp/tobibeer/preview-$num$-tiddler}}>
|
||||
<$transclude tiddler={{$:/plugins/tobibeer/preview/defaults/template}} mode="block"/>
|
||||
</$tiddler>
|
||||
</$reveal>
|
||||
\end
|
||||
|
||||
<$vars default-classes={{$:/plugins/tobibeer/preview/defaults/class}}>
|
||||
<$list filter="1 2 3 4 5 6 7 8 9">
|
||||
<$macrocall $name="level" num={{!!title}}/>
|
||||
</$list>
|
||||
</$vars>
|
@@ -0,0 +1,8 @@
|
||||
title: $:/plugins/tobibeer/preview/readme
|
||||
|
||||
The plugin $:/plugins/tobibeer/preview enhances the core <<x LinkWidget>> to display a preview of tiddlers when hovering an internal link.
|
||||
|
||||
<br>
|
||||
|
||||
; documentation / examples / demos...
|
||||
: http://tobibeer.github.io/tw5-plugins#preview
|
@@ -0,0 +1,8 @@
|
||||
tags: $:/tags/Stylesheet
|
||||
title: $:/plugins/tobibeer/preview/styles
|
||||
|
||||
.tc-popup.tc-preview-tiddler{
|
||||
max-width:600px;
|
||||
width:100%;
|
||||
padding:1em;
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
title: $:/plugins/tobibeer/preview/template
|
||||
|
||||
{{||$:/core/ui/ViewTemplate/tags}}
|
||||
|
||||
<$transclude mode="block"/>
|
15
tzk/editions/tzk/plugins/preview/plugin.info
Normal file
15
tzk/editions/tzk/plugins/preview/plugin.info
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"author": "Tobias Beer",
|
||||
"core-version": ">=5.1.9",
|
||||
"created": "20220505135243990",
|
||||
"dependents": "",
|
||||
"description": "Shows a tiddler preview when hovering internal links",
|
||||
"documentation": "https://tobibeer.github.io/tw5-preview",
|
||||
"list": "readme config",
|
||||
"modified": "20220505135243990",
|
||||
"plugin-type": "plugin",
|
||||
"requires": "[[tobibeer/appear|http://tobibeer.github.io/tw5-plugins/#appear]]",
|
||||
"source": "https://github.com/tobibeer/tw5-preview",
|
||||
"title": "$:/plugins/tobibeer/preview",
|
||||
"version": "0.5.6"
|
||||
}
|
@@ -0,0 +1,68 @@
|
||||
caption: Shuffle Operator
|
||||
title: $:/plugins/mklauber/shuffle/readme
|
||||
|
||||
|!purpose|Randomize the order of the input list|
|
||||
|!input|a selection of titles|
|
||||
|!parameter|a random string to be used to create consistent random ordering|
|
||||
|!output|The input titles, rearranged in a random order|
|
||||
|
||||
This plugin implements a new filter operator called Shuffle. This operator takes the input list and randomizes the order of the list. If no parameter is provided, the list order is random every time.
|
||||
|
||||
!!!Example:
|
||||
```
|
||||
<$list filter="1 2 3 4 5 +[shuffle[]]">
|
||||
|
||||
</$list>
|
||||
```
|
||||
|
||||
<$button popup="$:/state/shuffle/reveal1">Run Demo</$button>
|
||||
|
||||
<$reveal type="popup" state="$:/state/shuffle/reveal1">
|
||||
<div class="tc-drop-down">
|
||||
<$list filter="1 2 3 4 5 +[shuffle[]]">
|
||||
|
||||
</$list>
|
||||
</div>
|
||||
</$reveal>
|
||||
|
||||
Combining this operator with the first operator allows you to choose 1 or more titles randomly from a list.
|
||||
|
||||
!!!Example:
|
||||
```
|
||||
<$list filter="1 2 3 4 5 +[shuffle[]first[2]]">
|
||||
|
||||
</$list>
|
||||
```
|
||||
|
||||
<$button popup="$:/state/shuffle/reveal2">Run Demo</$button>
|
||||
|
||||
<$reveal type="popup" state="$:/state/shuffle/reveal2">
|
||||
<div class="tc-drop-down">
|
||||
<$list filter="1 2 3 4 5 +[shuffle[]first[2]]">
|
||||
|
||||
</$list>
|
||||
</div>
|
||||
</$reveal>
|
||||
|
||||
If a parameter is provided the list will be ordered identically every time it is rendered. This can be useful in conjunction a button that updates a state tiddler. Set the parameter of this operator to reference that state tiddler, and create a button that updates that tiddler, and now the ordering of the random operators only changes when the button is pressed.
|
||||
|
||||
!!!Example:
|
||||
```
|
||||
<$button>
|
||||
<$action-setfield $tiddler="$:/temp/shuffle/example" $field="state" $value=<<now "0hh:0mm:0ss">>/>
|
||||
Change Order
|
||||
</$button>
|
||||
|
||||
<$list filter="1 2 3 4 5 +[shuffle{$:/temp/shuffle/example!!state}]">
|
||||
|
||||
</$list>
|
||||
```
|
||||
|
||||
<$button>
|
||||
<$action-setfield $tiddler="$:/temp/shuffle/example" $field="state" $value=<<now "0hh:0mm:0ss">>/>
|
||||
Update
|
||||
</$button>
|
||||
|
||||
<$list filter="1 2 3 4 5 +[shuffle{$:/temp/shuffle/example!!state}]">
|
||||
|
||||
</$list>
|
@@ -0,0 +1 @@
|
||||
!function(a,b){function c(c,j,k){var n=[];j=1==j?{entropy:!0}:j||{};var s=g(f(j.entropy?[c,i(a)]:null==c?h():c,3),n),t=new d(n),u=function(){for(var a=t.g(m),b=p,c=0;a<q;)a=(a+c)*l,b*=l,c=t.g(1);for(;a>=r;)a/=2,b/=2,c>>>=1;return(a+c)/b};return u.int32=function(){return 0|t.g(4)},u.quick=function(){return t.g(4)/4294967296},u.double=u,g(i(t.S),a),(j.pass||k||function(a,c,d,f){return f&&(f.S&&e(f,t),a.state=function(){return e(t,{})}),d?(b[o]=a,c):a})(u,s,"global"in j?j.global:this==b,j.state)}function d(a){var b,c=a.length,d=this,e=0,f=d.i=d.j=0,g=d.S=[];for(c||(a=[c++]);e<l;)g[e]=e++;for(e=0;e<l;e++)g[e]=g[f=s&f+a[e%c]+(b=g[e])],g[f]=b;(d.g=function(a){for(var b,c=0,e=d.i,f=d.j,g=d.S;a--;)b=g[e=s&e+1],c=c*l+g[s&(g[e]=g[f=s&f+b])+(g[f]=b)];return d.i=e,d.j=f,c})(l)}function e(a,b){return b.i=a.i,b.j=a.j,b.S=a.S.slice(),b}function f(a,b){var c,d=[],e=typeof a;if(b&&"object"==e)for(c in a)try{d.push(f(a[c],b-1))}catch(a){}return d.length?d:"string"==e?a:a+"\0"}function g(a,b){for(var c,d=a+"",e=0;e<d.length;)b[s&e]=s&(c^=19*b[s&e])+d.charCodeAt(e++);return i(b)}function h(){try{var b;return j&&(b=j.randomBytes)?b=b(l):(b=new Uint8Array(l),(k.crypto||k.msCrypto).getRandomValues(b)),i(b)}catch(b){var c=k.navigator,d=c&&c.plugins;return[+new Date,k,d,k.screen,i(a)]}}function i(a){return String.fromCharCode.apply(0,a)}var j,k=this,l=256,m=6,n=52,o="random",p=b.pow(l,m),q=b.pow(2,n),r=2*q,s=l-1;if(b["seed"+o]=c,g(b.random(),a),"object"==typeof module&&module.exports){module.exports=c;try{j=require("crypto")}catch(a){}}else"function"==typeof define&&define.amd&&define(function(){return c})}([],Math);
|
@@ -0,0 +1,6 @@
|
||||
created: 20180220123939614
|
||||
modified: 20180220125617309
|
||||
module-type: library
|
||||
tags:
|
||||
title: $:/plugins/mklauber/shuffle/seedrandom.js
|
||||
type: application/javascript
|
@@ -0,0 +1,53 @@
|
||||
(function(){
|
||||
|
||||
"use strict";
|
||||
|
||||
var hash = function(str) {
|
||||
var hash = 0, i, chr, len;
|
||||
if (str.length === 0) return hash;
|
||||
for (i = 0, len = str.length; i < len; i++) {
|
||||
chr = str.charCodeAt(i);
|
||||
hash = ((hash << 5) - hash) + chr;
|
||||
hash |= 0; // Convert to 32bit integer
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
var shuffle = function(array, seed) {
|
||||
var currentIndex = array.length, temporaryValue, randomIndex ;
|
||||
Math.seedrandom(seed)
|
||||
|
||||
// While there remain elements to shuffle...
|
||||
while (0 !== currentIndex) {
|
||||
|
||||
// Pick a remaining element...
|
||||
randomIndex = Math.floor(Math.random() * currentIndex);
|
||||
currentIndex -= 1;
|
||||
|
||||
// And swap it with the current element.
|
||||
temporaryValue = array[currentIndex];
|
||||
array[currentIndex] = array[randomIndex];
|
||||
array[randomIndex] = temporaryValue;
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
var prepare_results = function (source) {
|
||||
var results = [];
|
||||
source(function(tiddler,title) {
|
||||
results.push(title);
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
exports.shuffle = function(source, operator, options) {
|
||||
var results = prepare_results(source);
|
||||
if (operator['operand'] == "") {
|
||||
shuffle(results);
|
||||
} else {
|
||||
shuffle(results, hash(operator['operand']));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
})();
|
@@ -0,0 +1,6 @@
|
||||
caption: A filter Operator to randomize the order of the list passed to it.
|
||||
created: 20150811171933696
|
||||
modified: 20180220125039203
|
||||
module-type: filteroperator
|
||||
title: $:/plugins/mklauber/shuffle/shuffle.js
|
||||
type: application/javascript
|
@@ -0,0 +1,5 @@
|
||||
exports.name = "shuffle"
|
||||
exports.before = ["render"]
|
||||
exports.startup = function() {
|
||||
$tw.modules.execute('$:/plugins/mklauber/shuffle/seedrandom.js');
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
created: 20180220133753576
|
||||
modified: 20180220133920300
|
||||
module-type: startup
|
||||
tags:
|
||||
title: $:/plugins/mklauber/shuffle/startup.js
|
||||
type: application/javascript
|
13
tzk/editions/tzk/plugins/shuffle/plugin.info
Normal file
13
tzk/editions/tzk/plugins/shuffle/plugin.info
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"author": "Matthew Lauber",
|
||||
"core-version": ">=5.0.0",
|
||||
"created": "20210105134918257",
|
||||
"dependents": "",
|
||||
"description": "A Shuffle filter operator",
|
||||
"list": "readme",
|
||||
"modified": "20211107172616237",
|
||||
"plugin-type": "plugin",
|
||||
"source": "https://github.com/mklauber/tiddly-shuffle",
|
||||
"title": "$:/plugins/mklauber/shuffle",
|
||||
"version": "1.0.2"
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
created: 20210928031215487
|
||||
creator: soren
|
||||
modified: 20210928031216652
|
||||
modifier: soren
|
||||
title: $:/config/EditorToolbarButtons/Visibility/$:/core/ui/EditorToolbar/do-thing
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
show
|
@@ -1,6 +1,8 @@
|
||||
created: 20200121230518238
|
||||
modified: 20210410005001202
|
||||
creator: soren
|
||||
modified: 20220622234624323
|
||||
modifier: soren
|
||||
title: $:/config/RelinkOnRename
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
yes
|
||||
no
|
@@ -1,5 +1,7 @@
|
||||
created: 20200516190911842
|
||||
modified: 20210308030709436
|
||||
creator: soren
|
||||
modified: 20220302210205566
|
||||
modifier: soren
|
||||
tags:
|
||||
title: $:/config/TiddlyRemember/TagMapping
|
||||
type: text/vnd.tiddlywiki
|
||||
|
@@ -1,6 +1,6 @@
|
||||
created: 20200118003731285
|
||||
creator: soren
|
||||
modified: 20200118003737882
|
||||
modified: 20220215235820508
|
||||
modifier: soren
|
||||
title: $:/config/Toolbar/ButtonClass
|
||||
type: text/vnd.tiddlywiki
|
||||
|
@@ -0,0 +1,8 @@
|
||||
created: 20220622212041227
|
||||
creator: soren
|
||||
modified: 20220622212041250
|
||||
modifier: soren
|
||||
title: $:/config/shortcuts-mac/save-tiddler
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
cmd-Enter
|
@@ -0,0 +1,8 @@
|
||||
created: 20220622212047526
|
||||
creator: soren
|
||||
modified: 20220622212047547
|
||||
modifier: soren
|
||||
title: $:/config/shortcuts-not-mac/save-tiddler
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
ctrl-Enter
|
@@ -0,0 +1,6 @@
|
||||
created: 20220622212052270
|
||||
creator: soren
|
||||
modified: 20220622212052289
|
||||
modifier: soren
|
||||
title: $:/config/shortcuts/save-tiddler
|
||||
type: text/vnd.tiddlywiki
|
@@ -2,9 +2,9 @@ caption: Sidebar info links
|
||||
created: 20210623014408947
|
||||
creator: soren
|
||||
description: Show navigation links to the most important parts of the wiki underneath the subtitle.
|
||||
modified: 20210825145449987
|
||||
modified: 20211107173557802
|
||||
modifier: soren
|
||||
private: no
|
||||
private: yes
|
||||
public: no
|
||||
tags:
|
||||
title: $:/config/zettelkasten/FeatureFlags/SidebarInfoLinks
|
||||
|
@@ -2,7 +2,7 @@ caption: Spoiler banner
|
||||
created: 20210622003118415
|
||||
creator: soren
|
||||
description: Display a warning banner on fiction tiddlers (any tiddler with a non-empty `universe` field) noting that we don't try to hide spoilers.
|
||||
modified: 20210909130158483
|
||||
modified: 20220502164810636
|
||||
modifier: soren
|
||||
private: no
|
||||
public: no
|
||||
|
@@ -0,0 +1,19 @@
|
||||
caption: {{$:/language/Buttons/Linkify/Caption}}
|
||||
condition: [<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]
|
||||
created: 20210928031136147
|
||||
creator: soren
|
||||
description: {{$:/language/Buttons/Linkify/Hint}}
|
||||
icon: $:/core/images/linkify
|
||||
modified: 20210928031136215
|
||||
modifier: soren
|
||||
shortcuts: ((linkify))
|
||||
tags: $:/tags/EditorToolbar
|
||||
title: $:/core/ui/EditorToolbar/linkify
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<$action-sendmessage
|
||||
$message="tm-edit-text-operation"
|
||||
$param="wrap-selection"
|
||||
prefix="[["
|
||||
suffix="]]"
|
||||
/>
|
@@ -0,0 +1,19 @@
|
||||
caption: {{$:/language/Buttons/Transcludify/Caption}}
|
||||
condition: [<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]
|
||||
created: 20210928031136147
|
||||
creator: soren
|
||||
description: {{$:/language/Buttons/Transcludify/Hint}}
|
||||
icon: $:/core/images/transcludify
|
||||
modified: 20210928031136239
|
||||
modifier: soren
|
||||
shortcuts: ((transcludify))
|
||||
tags: $:/tags/EditorToolbar
|
||||
title: $:/core/ui/EditorToolbar/transcludify
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<$action-sendmessage
|
||||
$message="tm-edit-text-operation"
|
||||
$param="wrap-selection"
|
||||
prefix="{{"
|
||||
suffix="}}"
|
||||
/>
|
52
tzk/editions/tzk/tiddlers/$__inmysocks_macros_day-diff.js
Normal file
52
tzk/editions/tzk/tiddlers/$__inmysocks_macros_day-diff.js
Normal file
@@ -0,0 +1,52 @@
|
||||
/*\
|
||||
title: $:/inmysocks/macros/day-diff.js
|
||||
type: application/javascript
|
||||
module-type: macro
|
||||
|
||||
Takes two dates and returns their difference in days
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Information about this macro
|
||||
*/
|
||||
|
||||
exports.name = "day-diff";
|
||||
|
||||
exports.params = [
|
||||
{name: "year1"},
|
||||
{name: "month1"},
|
||||
{name: "day1"},
|
||||
{name: "year2"},
|
||||
{name: "month2"},
|
||||
{name: "day2"}
|
||||
];
|
||||
|
||||
/*
|
||||
Run the macro
|
||||
*/
|
||||
exports.run = function(year1, month1, day1, year2, month2, day2) {
|
||||
//Make each date object.
|
||||
var date1 = new Date(year1, Number(month1)+Number(1), day1);
|
||||
var date2 = new Date(year2, Number(month2)+Number(1), day2);
|
||||
|
||||
//Find difference in milliseconds.
|
||||
var elapsed = date2.getTime()-date1.getTime();
|
||||
|
||||
//Number of milliseconds in a day.
|
||||
var dayMS = 86400000;
|
||||
|
||||
//Convert milliseconds to year months and days
|
||||
var days_diff = Math.floor(elapsed/dayMS);
|
||||
|
||||
var result = days_diff;
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
})();
|
@@ -0,0 +1,6 @@
|
||||
created: 20150225185218583
|
||||
modified: 20211204021739668
|
||||
module-type: macro
|
||||
tags:
|
||||
title: $:/inmysocks/macros/day-diff.js
|
||||
type: application/javascript
|
@@ -0,0 +1,31 @@
|
||||
caption: RememberCz
|
||||
condition: [<targetTiddler>!has[type]] [<targetTiddler>type[text/vnd.tiddlywiki]]
|
||||
created: 20200517155905263
|
||||
creator: soren
|
||||
description: Remember Cloze Deletion
|
||||
icon: $:/plugins/sobjornstad/TiddlyRemember/icons/lightbulb-black.svg
|
||||
modified: 20211113234933532
|
||||
modifier: soren
|
||||
shortcuts: ((remembercz))
|
||||
tags: $:/tags/EditorToolbar
|
||||
title: $:/plugins/sobjornstad/TiddlyRemember/toolbar/remembercz
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define getMacro()
|
||||
<<remembercz "$(clozeid)$"
|
||||
"Cloze">>
|
||||
\end
|
||||
|
||||
\define prefixId() $(theprefix)$$(thetime)$
|
||||
|
||||
<$set name=thetime value=<<now "[UTC]YYYY0MM0DD0hh0mm0ss0XXX">> >
|
||||
<$set name=theprefix value={{$:/config/TiddlyRemember/IdPrefix}}>
|
||||
<$set name=clozeid value=<<prefixId>> >
|
||||
<$action-sendmessage
|
||||
$message="tm-edit-text-operation"
|
||||
$param="replace-selection"
|
||||
text=<<getMacro>>
|
||||
/>
|
||||
</$set>
|
||||
</$set>
|
||||
</$set>
|
@@ -0,0 +1,8 @@
|
||||
created: 20220505135343597
|
||||
creator: soren
|
||||
modified: 20220505135454120
|
||||
modifier: soren
|
||||
title: $:/plugins/tobibeer/preview/defaults/delay
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
500
|
@@ -0,0 +1,8 @@
|
||||
created: 20220505135432323
|
||||
creator: soren
|
||||
modified: 20220505135433494
|
||||
modifier: soren
|
||||
title: $:/plugins/tobibeer/preview/defaults/exclude
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
[is[system]] [all[shadows]]
|
@@ -0,0 +1,8 @@
|
||||
created: 20220505135435971
|
||||
creator: soren
|
||||
modified: 20220505135437221
|
||||
modifier: soren
|
||||
title: $:/plugins/tobibeer/preview/defaults/keys
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Ctrl
|
@@ -0,0 +1,11 @@
|
||||
created: 20220505135633168
|
||||
creator: soren
|
||||
modified: 20220505135638189
|
||||
modifier: soren
|
||||
title: $:/plugins/tobibeer/preview/template
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
{{||$:/core/ui/ViewTemplate/subtitle}}
|
||||
{{||$:/core/ui/ViewTemplate/tags}}
|
||||
|
||||
<$transclude mode="block"/>
|
@@ -3,7 +3,7 @@ created: 20200419143537510
|
||||
creator: soren
|
||||
description: Copy the name of this tiddler to the clipboard
|
||||
list-after: $:/core/ui/Buttons/info
|
||||
modified: 20210922125723154
|
||||
modified: 20220215235957457
|
||||
modifier: soren
|
||||
tags: $:/tags/ViewToolbar
|
||||
title: $:/sib/Buttons/CopyTitleReference
|
||||
@@ -12,7 +12,7 @@ type: text/vnd.tiddlywiki
|
||||
\whitespace trim
|
||||
<$button message="tm-copy-to-clipboard" param={{!!title}} tooltip={{$:/sib/Buttons/CopyTitleReference!!caption}} class=<<tv-config-toolbar-class>>>
|
||||
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
|
||||
<i class="far fa-copy" style="font-size:160%; position:relative; bottom:-4px; left:-1px;"/>
|
||||
<i class="far fa-copy" style="font-size: 160%; position:relative; bottom:-4px; left:-1px;"/>
|
||||
</$list>
|
||||
<$list filter="[<tv-config-toolbar-text>match[yes]]">
|
||||
<span class="tc-btn-text">
|
||||
|
@@ -1,8 +1,10 @@
|
||||
caption: new source
|
||||
created: 20200822190145295
|
||||
creator: soren
|
||||
description: Create a new source tiddler
|
||||
list-after: $:/core/ui/Buttons/new-tiddler
|
||||
modified: 20210522014032330
|
||||
modified: 20220504192240445
|
||||
modifier: soren
|
||||
tags: $:/tags/PageControls
|
||||
title: $:/sib/Buttons/NewSource
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -25,6 +27,6 @@ type: text/vnd.tiddlywiki
|
||||
readstatus="unread"
|
||||
author=""
|
||||
completed=""
|
||||
year="2021"
|
||||
year=<<now YYYY>>
|
||||
/>
|
||||
</$button>
|
@@ -1,10 +1,11 @@
|
||||
caption: Excise private chunk
|
||||
condition: [<targetTiddler>type[]] [<targetTiddler>type[text/vnd.tiddlywiki]] +[first[]]
|
||||
created: 20210522034413324
|
||||
creator: soren
|
||||
description: Create a new private chunk from the selection
|
||||
icon: $:/core/images/locked-padlock
|
||||
list-after: $:/core/ui/EditorToolbar/excise
|
||||
modified: 20210522034828757
|
||||
modified: 20210928031136154
|
||||
modifier: soren
|
||||
shortcuts: ((excise-private-chunk))
|
||||
tags: $:/tags/EditorToolbar
|
||||
title: $:/sib/Buttons/excise-private-chunk
|
||||
|
@@ -1,11 +1,13 @@
|
||||
caption: possible
|
||||
color: lightblue
|
||||
created: 20210508225155649
|
||||
modified: 20210508230813020
|
||||
creator: soren
|
||||
modified: 20211229142954562
|
||||
modifier: soren
|
||||
section: main
|
||||
stackorder: 30
|
||||
tags:
|
||||
title: $:/sib/EpistemicStatus/possible
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
I [[withhold judgment|OpinionsRequireCounterarguments]] on the idea; I am merely reporting it.
|
||||
I [[withhold judgment|NoOpinion]] on the idea; I am merely reporting it.
|
@@ -1,7 +1,7 @@
|
||||
caption: Next steps
|
||||
created: 20210828133924602
|
||||
creator: soren
|
||||
modified: 20210828134435065
|
||||
modified: 20210922163144199
|
||||
modifier: soren
|
||||
tags:
|
||||
title: $:/sib/GettingStarted/NextSteps
|
||||
@@ -13,6 +13,8 @@ I recommend starting by ''adding some notes''! Add a couple of tiddlers for the
|
||||
|
||||
Once you've gotten a few notes into the system, you will be in a good place to ''decide what elements of this edition you like and what things you'll want to change''. If you want to get into customizing the wiki and you don't have much experience with TiddlyWiki, check out [[Grok TiddlyWiki|https://groktiddlywiki.com/read]], a complete textbook and reference designed for learning how this stuff works from the ground up.
|
||||
|
||||
At any time, you can watch [[an hour-long walkthrough video|https://www.youtube.com/watch?v=9X_T-DVie8o]] showing the most important features of tzk.
|
||||
|
||||
At any time, you can click the ''tools button {{$:/core/images/theme-button}}'' on the page toolbar (upper-right corner of the wiki, right under the title) to access a wide variety of tools, settings, and documentation related to the Zettelkasten edition.
|
||||
|
||||
If you have questions, comments, or suggestions, please feel free to get in touch at `zettelkasten@sorenbjornstad.com`.
|
@@ -1,14 +1,19 @@
|
||||
created: 20210623014041787
|
||||
creator: soren
|
||||
list-after: $:/core/ui/SideBarSegments/site-subtitle
|
||||
modified: 20210623014719347
|
||||
modified: 20211107173606954
|
||||
modifier: soren
|
||||
tags: $:/tags/SideBarSegment
|
||||
title: $:/sib/SideBar/InfoLinks
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define go-random-action() <$action-navigate $to={{{[tag[Idea]!tag[PrivateChunk]!regexp[/]!tag[Stub]shuffle[]first[]]}}}/>
|
||||
|
||||
<$list filter=<<ff SidebarInfoLinks>> variable=_>
|
||||
[[about|PublicHomepage]] ·
|
||||
[[reading|RecentlyRead]] ·
|
||||
[[favorites|Favorites]]
|
||||
[[favorites|Favorites]] ·
|
||||
<$button class="tc-tiddlylink tc-btn-invisible" actions=<<go-random-action>>>random idea</$button>
|
||||
|
||||
<style>
|
||||
.gtw-sidebar-links a, .gtw-sidebar-links button {
|
||||
|
@@ -1,10 +1,12 @@
|
||||
caption: Stubs
|
||||
created: 20200516155336361
|
||||
creator: soren
|
||||
list-after: $:/core/ui/MoreSideBar/Missing
|
||||
modified: 20210522014721028
|
||||
modified: 20211204001205484
|
||||
modifier: soren
|
||||
title: $:/sib/SideBar/Write/Stub
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<$list filter="[tag[Stub]sort[]]" emptyMessage="No stubs right now! You're awesome!">
|
||||
<$list filter="[tag[Stub]sort[]] -[[$:/TagSaver]]" emptyMessage="No stubs right now! You're awesome!">
|
||||
<$link to=<<currentTiddler>>><<currentTiddler>></$link><br/>
|
||||
</$list>
|
||||
|
@@ -1,10 +1,12 @@
|
||||
created: 20201204132021892
|
||||
modified: 20210522014049552
|
||||
creator: soren
|
||||
modified: 20211027125509141
|
||||
modifier: soren
|
||||
tags: $:/tags/EditTemplate
|
||||
title: $:/sib/Templates/Automatic/MissingTiddlerCreationNotification
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<$list filter="[all[current]get[draft.of]prefix[New Tiddler]]" variable="draftof">
|
||||
<$list filter="[all[current]get[draft.of]prefix[New ]]" variable="draftof">
|
||||
<$list filter="[all[current]get[draft.title]backlinks[]first[]]" variable=_>
|
||||
Creating missing tiddler <$link to={{!!draft.title}}/>. The following tiddlers will link here when you save:
|
||||
<<list-links "[all[current]get[draft.title]backlinks[]]">>
|
||||
|
@@ -0,0 +1,36 @@
|
||||
created: 20211120164840100
|
||||
creator: soren
|
||||
description: Navigate to the parent or a sibling of the current subtiddler. Subtiddler names are separated from that of their supertiddlers by a / (and are not system tiddlers).
|
||||
modified: 20220202173655863
|
||||
modifier: soren
|
||||
tags: $:/tags/ViewTemplate
|
||||
title: $:/sib/Templates/Automatic/Subtiddler
|
||||
transcludedin: All tiddlers whose titles contain a slash and are not system tiddlers.
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define expand-siblings() <$action-setfield $tiddler="$:/temp/ShowSiblings" $index=<<currentTiddler>> $value="yes" />
|
||||
\define contract-siblings() <$action-setfield $tiddler="$:/temp/ShowSiblings" $index=<<currentTiddler>> $value="no" />
|
||||
\define siblings-filter() [prefix<parentTiddlerPlusSlash>!match<currentTiddler>]
|
||||
|
||||
<$list filter="[all[current]!is[system]regexp:title[/]]" variable=_>
|
||||
<$set name="parentTiddler" value={{{ [all[current]split[/]butlast[]join[/]] }}}>
|
||||
<$set name="parentTiddlerPlusSlash" value={{{ [<parentTiddler>addsuffix[/]] }}}>
|
||||
<div style="text-align: center;">
|
||||
|
||||
This is a subtiddler of <$link to=<<parentTiddler>>/>.<br>
|
||||
<$reveal stateTitle="$:/temp/ShowSiblings" stateIndex=<<currentTiddler>> type="nomatch" text="yes">
|
||||
<$list filter="[prefix<parentTiddlerPlusSlash>!match<currentTiddler>first[]]" variable=_ emptyMessage="This is the only subtiddler.">
|
||||
<$button class="tc-btn-invisible tc-tiddlylink" actions=<<expand-siblings>>>{{$:/core/images/right-arrow}} Siblings of this subtiddler</$button> (<$count filter=<<siblings-filter>>/>)
|
||||
</$list>
|
||||
</$reveal>
|
||||
<$reveal stateTitle="$:/temp/ShowSiblings" stateIndex=<<currentTiddler>> type="match" text="yes">
|
||||
<$button class="tc-btn-invisible tc-tiddlylink" actions=<<contract-siblings>>>{{$:/core/images/down-arrow}} Siblings of this subtiddler:</$button><br>
|
||||
<$list filter=<<siblings-filter>>>
|
||||
<$link to=<<currentTiddler>>><$text text={{{ [<currentTiddler>removeprefix<parentTiddlerPlusSlash>] }}}/></$link><br>
|
||||
</$list>
|
||||
</$reveal>
|
||||
|
||||
</div>
|
||||
</$set>
|
||||
</$set>
|
||||
</$list>
|
@@ -0,0 +1,22 @@
|
||||
created: 20211120170347843
|
||||
creator: soren
|
||||
description: Show a warning on tiddlers that don't have a type selected.
|
||||
modified: 20211221014011578
|
||||
modifier: soren
|
||||
tags: $:/tags/ViewTemplate
|
||||
title: $:/sib/Templates/Automatic/TypeTagChecker
|
||||
transcludedin: All tiddlers that exist, aren't system tiddlers or subtiddlers, and don't have at least one tag of the color #ff0000.
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<!-- System tiddlers, missing tiddlers, and subtiddlers are exempt from the warning. -->
|
||||
<$list filter="[all[current]!is[system]!is[missing]!regexp[/]]">
|
||||
<$list filter="[all[current]tags[]color[#ff0000]] ~[[Oops]] +[match[Oops]]" variable=_>
|
||||
<div style="display: inline-block; vertical-align: center; margin-top: 6px; margin-left: 1em; fill: yellow;">
|
||||
<span style="height: 44px">{{$:/core/images/warning}}</span>
|
||||
</div>
|
||||
<div style="display: inline-block; margin-left: 1em; color: yellow; font-weight: bold;">
|
||||
This tiddler does not have a type tag (type tags appear in red). You should probably attach one.<br>
|
||||
See [[ZettelkastenCardType]] for details on the available options.
|
||||
</div>
|
||||
</$list>
|
||||
</$list>
|
15
tzk/editions/tzk/tiddlers/$__sib_Tools_Tray.tid
Normal file
15
tzk/editions/tzk/tiddlers/$__sib_Tools_Tray.tid
Normal file
@@ -0,0 +1,15 @@
|
||||
caption: Tray
|
||||
created: 20210701023215046
|
||||
creator: soren
|
||||
description: Items we're currently working on but don't need to leave open. Drag and drop a link to a tiddler to add it.
|
||||
list:
|
||||
modified: 20220716205827340
|
||||
modifier: soren
|
||||
tags: Meta Tool
|
||||
title: $:/sib/Tools/Tray
|
||||
tooltype: aggregator
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Stuff I'm working on but don't need to keep open:
|
||||
|
||||
<<list-links-draggable "$:/sib/Tools/Tray" itemTemplate:"$:/sib/Tools/Tray/Template">>
|
@@ -1,6 +1,6 @@
|
||||
created: 20210410004529968
|
||||
creator: soren
|
||||
modified: 20210825162735756
|
||||
modified: 20210924153927403
|
||||
modifier: soren
|
||||
tags:
|
||||
title: $:/sib/indite/InditeChildren
|
||||
@@ -50,11 +50,14 @@ copy <<copy-me>> · <<copy-rendered>>
|
||||
$viewBlock$
|
||||
</div>
|
||||
</$list>
|
||||
|
||||
<$list filter="[<tr-rendering>!match[yes]]" variable=_>
|
||||
<$list filter="[all[current]editmode[edit]] [all[current]editmode[both]]">
|
||||
<div class={{{ [[indite-sbs-editor]addsuffix[ ]addsuffix<thewidth>] }}}>
|
||||
<$transclude tiddler="$:/core/ui/EditTemplate/body/editor"/>
|
||||
</div>
|
||||
</$list>
|
||||
</$list>
|
||||
</$set>
|
||||
\end
|
||||
|
||||
|
@@ -1,7 +1,9 @@
|
||||
caption: Indite view template
|
||||
created: 20210410004824597
|
||||
creator: soren
|
||||
description: Tiddlers that are part of the Indite writing system (under development) hide the normal view template via CSS and use this one instead.
|
||||
modified: 20210523143848140
|
||||
modified: 20210924153731019
|
||||
modifier: soren
|
||||
tags: $:/tags/ViewTemplate
|
||||
title: $:/sib/indite/ViewTemplate
|
||||
transcludedin: All tiddlers tagged <<tag Indite>>.
|
||||
|
@@ -2,7 +2,7 @@ caption: Subtiddlers
|
||||
condition: [all[tiddlers]prefix<storyTiddler>!field:title<storyTiddler>sort[]]
|
||||
created: 20201206210345097
|
||||
creator: soren
|
||||
modified: 20210920161045390
|
||||
modified: 20211227155615108
|
||||
modifier: soren
|
||||
tags: $:/tags/ReferenceExplorerTab
|
||||
title: $:/sib/refexplorer/Subtiddlers
|
||||
|
@@ -1,5 +1,7 @@
|
||||
created: 20210719234124096
|
||||
modified: 20210719235343017
|
||||
creator: soren
|
||||
modified: 20211025140658570
|
||||
modifier: soren
|
||||
tags: $:/tags/Stylesheet
|
||||
title: $:/sib/styles/footnote
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -26,8 +28,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
.refnotes-footnote:after {
|
||||
content: counter(fnote-count);
|
||||
font-size:small;
|
||||
vertical-align: super;
|
||||
line-height: 1.5;
|
||||
vertical-align: top;
|
||||
font-size: 0.8em;
|
||||
/*vertical-align: super;
|
||||
line-height: 1.5;*/
|
||||
margin-left: 0em;
|
||||
color: yellow;
|
||||
}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
created: 20210624125244567
|
||||
modified: 20210629025407566
|
||||
creator: soren
|
||||
modified: 20211025010048942
|
||||
modifier: soren
|
||||
tags: $:/tags/Stylesheet
|
||||
title: $:/sib/styles/hr
|
||||
type: text/vnd.tiddlywiki
|
||||
@@ -7,7 +9,7 @@ type: text/vnd.tiddlywiki
|
||||
/* Based on: Flaired edges, by Tomas Theunissen
|
||||
https://css-tricks.com/examples/hrs/ */
|
||||
|
||||
.tc-tiddler-body hr, .tc-tiddler-preview-preview hr {
|
||||
.tc-tiddler-body > hr, .tc-tiddler-preview-preview > hr {
|
||||
overflow: visible; /* For IE */
|
||||
height: 30px;
|
||||
border-style: solid;
|
||||
|
7
tzk/editions/tzk/tiddlers/$__tags_EditorToolbar.tid
Normal file
7
tzk/editions/tzk/tiddlers/$__tags_EditorToolbar.tid
Normal file
@@ -0,0 +1,7 @@
|
||||
created: 20210928031136148
|
||||
creator: soren
|
||||
list: $:/core/ui/EditorToolbar/do-thing $:/core/ui/EditorToolbar/paint $:/core/ui/EditorToolbar/opacity $:/core/ui/EditorToolbar/line-width $:/core/ui/EditorToolbar/rotate-left $:/core/ui/EditorToolbar/clear $:/core/ui/EditorToolbar/bold $:/core/ui/EditorToolbar/italic $:/core/ui/EditorToolbar/strikethrough $:/core/ui/EditorToolbar/underline $:/core/ui/EditorToolbar/superscript $:/core/ui/EditorToolbar/subscript $:/core/ui/EditorToolbar/mono-line $:/core/ui/EditorToolbar/linkify $:/core/ui/EditorToolbar/transcludify $:/core/ui/EditorToolbar/mono-block $:/core/ui/EditorToolbar/quote $:/core/ui/EditorToolbar/list-bullet $:/core/ui/EditorToolbar/list-number $:/core/ui/EditorToolbar/heading-1 $:/core/ui/EditorToolbar/heading-2 $:/core/ui/EditorToolbar/heading-3 $:/core/ui/EditorToolbar/heading-4 $:/core/ui/EditorToolbar/heading-5 $:/core/ui/EditorToolbar/heading-6 $:/core/ui/EditorToolbar/link $:/core/ui/EditorToolbar/excise $:/sib/Buttons/excise-private-chunk $:/core/ui/EditorToolbar/picture $:/core/ui/EditorToolbar/stamp $:/core/ui/EditorToolbar/size $:/core/ui/EditorToolbar/editor-height $:/core/ui/EditorToolbar/more $:/core/ui/EditorToolbar/preview $:/core/ui/EditorToolbar/preview-type $:/plugins/sobjornstad/TiddlyRemember/toolbar/rememberq $:/plugins/sobjornstad/TiddlyRemember/toolbar/remembercz $:/plugins/tiddlywiki/katex/ui/EditorToolbar/katex
|
||||
modified: 20210928031142401
|
||||
modifier: soren
|
||||
title: $:/tags/EditorToolbar
|
||||
type: text/vnd.tiddlywiki
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user