Commit Graph

86 Commits

Author SHA1 Message Date
Soren I. Bjornstad
04272c3973 also privatize JSON tiddlers
This seems slightly dangerous because we're just applying the same
replacement logic and JSON has a much fussier syntax. However, if any
tiddlers end up invalid we should just get a build failure, so this
doesn't seem highly consequential.
2022-08-19 17:14:06 -05:00
Soren I. Bjornstad
1f56f68448 stop using <<privateperson>> macro
Since we have to do raw links anyway in many cases, it doesn't really
make sense to use two different formats. This also gets around an edge
case where replacement produces invalid syntax if the person to be
replaced is linked within a macro, since the >> of privateperson then
terminates the outside macro -- given my increasing use of footnotes,
this isn't all that uncommon.
2022-08-19 17:09:20 -05:00
Soren I. Bjornstad
3e9ecd4b70 work around ReadTheDocs bug 2022-03-27 15:22:31 -05:00
Soren I. Bjornstad
7be018ea3f pull ZK updates and bump version 2022-03-27 15:19:41 -05:00
Soren I. Bjornstad
8fb496bbfe Merge branch 'new-private-person-replacement-logic' into march-tweaks 2022-03-27 15:14:41 -05:00
dcac80c5ac Replace link text of private person
It is possible that a private person is linked to in a tiddler with the
syntax `[[Jane|MsJaneDoe]]`.

Up to now, the text of the link was not redacted, which could lead to
unintentional privacy leaks.

Therefore, a new parameter `replace_link_text` is introduced for the
`replace_private_people` builder.

When that is set to True, then the link text is also replaced with the
initials.

Signed-off-by: Jacob Kiers <code@kiers.eu>
2022-03-22 23:34:32 +01:00
Soren I. Bjornstad
4875f7c1f5 avoid incrementing iterator when not appropriate
By chance, this hasn't caused any problems yet.
2022-03-16 12:33:20 -05:00
Soren I. Bjornstad
f0bd41f65a implement more robust private-person replacer
The previous method occasionally gave incorrect results because it
performed replacements on an entire line, rather than on individual
instances of the text to replace. This usually worked fine, but in rare
cases could create wrong/ugly output, and with future improvements to
what can be replaced could end up causing leaks.

This was a royal PITA to get working, but I'm fairly sure it's correct
now due to all the doctests. Please add more if you find any regressions
or think of cases that aren't covered.
2022-03-16 09:19:49 -05:00
Soren Bjornstad
d3f6216837
Merge pull request #4 from jacobkiers/allow-specifying-listening-host
Allow setting the host parameter
2022-03-14 21:01:35 -05:00
Soren I. Bjornstad
e14709be40 update copyright notice 2022-03-14 20:59:57 -05:00
bdeaac5d03 Specify listen_host as an option in the config file
Signed-off-by: Jacob Kiers <code@kiers.eu>
2022-03-14 18:22:07 +01:00
Soren I. Bjornstad
4acff2731a remove debug print mistakenly left in 2022-03-11 20:14:30 -06:00
3b1f91bcb0 Allow setting the host parameter
In order to run in a Docker container, it is necessary to listen on all interfaces (`0.0.0.0`).
So make it possible to set the host.

Fixes #1

Signed-off-by: Jacob Kiers <code@kiers.eu>
2022-03-12 02:31:57 +01:00
Soren I. Bjornstad
572c3d0316 bump version and allow use of --version to see it 2022-01-23 17:28:19 -06:00
Soren I. Bjornstad
4a6e4e7bc0 don't crash if tzk is used without arguments 2022-01-23 17:22:45 -06:00
Soren I. Bjornstad
35ca2b896e regular update 2022-01-03 15:31:14 -06:00
Soren I. Bjornstad
0705c55e77 fix only one PrivatePerson replacement working per line
Because the 'line' variable was already bound in the outer loop, changes
to the line in the inner loop were lost in subsequent inner-loop
iterations, if required. Change to always indexing the array (which is
defined outside the scope of the loops) directly on every reference.

(This is why it's usually best not to modify things while looping over
them. Maybe a refactor could be in order.)
2021-11-29 21:47:21 -06:00
Soren I. Bjornstad
f8edb70065 bump version 2021-09-22 11:34:02 -05:00
Soren I. Bjornstad
218705bdc9 add walkthrough video link 2021-09-22 11:33:19 -05:00
Soren I. Bjornstad
48a8789c4d activate venv before trying publish
Was planning to do this myself, but I forgot so many times I'm just
adding it...
2021-09-22 11:29:05 -05:00
Soren Bjornstad
48ab7f9514
add walkthrough video to README 2021-09-22 11:28:36 -05:00
Soren I. Bjornstad
f2d9a2abe6 bump version 2021-09-22 10:58:25 -05:00
Soren I. Bjornstad
cb55a967d0 remove build folder prior to building wheels
Otherwise files that have been removed will still show up in the wheel
-- but not in the source distribution -- which is super confusing and
wrong. No idea why Python doesn't check this itself.
2021-09-22 10:57:18 -05:00
Soren I. Bjornstad
52c0daedbb fix tray 2021-09-22 10:54:06 -05:00
Soren I. Bjornstad
09b856488b bump version 2021-09-22 08:06:32 -05:00
Soren I. Bjornstad
9218a83d41 fix caption/description on several buttons 2021-09-22 07:58:17 -05:00
Soren I. Bjornstad
a896244367 fix permalink button going to my Zettelkasten 2021-09-22 07:52:15 -05:00
Soren I. Bjornstad
ec83de9978 fix 'compile_html_file' to use dirs_exist_ok
5065efd3 incorrectly changed to doing an rmtree of the entire target
since that was what editionify needed. Editionify should clean the
target directory, but the single HTML file build should not (it ended up
wiping my git repository from my hard drive). We might wish to revisit
this particular fix in the future since it still fails to delete removed
extimages, but this doesn't seem like a big deal.
2021-09-21 21:13:30 -05:00
Soren I. Bjornstad
9a70b67af7 bump version 2021-09-21 20:45:44 -05:00
Soren I. Bjornstad
86441e9618 don't carry FileSystemPaths into emptified edition
Better for people to set up their own scheme if they want one, and it
avoids tiddlers potentially being in two different places (since
FileSystemPaths isn't honored during an init/savewikifolder).
2021-09-21 20:44:12 -05:00
Soren I. Bjornstad
2f53a8f616 fix missing link and missing kill phrases tiddler 2021-09-21 20:20:37 -05:00
Soren I. Bjornstad
c335597b57 adjust explanation of restore-plugins situation
It was just me being dense...I was overwriting the existing plugins
array.
2021-09-21 13:08:55 -05:00
Soren I. Bjornstad
a7bdd2397e fix bad URL to license 2021-09-21 12:44:53 -05:00
Soren I. Bjornstad
102af1be43 don't upload to test pypi for the real publish >__< 2021-09-21 12:42:01 -05:00
Soren I. Bjornstad
828efa0a74 make publish executable 2021-09-21 12:39:42 -05:00
Soren I. Bjornstad
14cc96a907 check in editions directory
Although this is automatically generated, it represents a critical part
of the content of the edition which cannot be created from the content
in the repository (it's generated from a private directory on my
computer), so at this point it is appropriate to check it in.
2021-09-21 12:27:23 -05:00
Soren I. Bjornstad
c79644e179 minor doc fixes 2021-09-21 12:24:59 -05:00
Soren I. Bjornstad
1304d8edc2 fix 'tzk convert' failing when outside source directory
I only tested it with '.' as the source for some reason, so missed this.
2021-09-21 12:21:27 -05:00
Soren I. Bjornstad
39df530ec2 improve help messages 2021-09-21 12:07:15 -05:00
Soren I. Bjornstad
3e0615815f update README URLs 2021-09-21 11:56:08 -05:00
Soren I. Bjornstad
ea26f18906 set up publish to pypi 2021-09-21 11:54:05 -05:00
Soren I. Bjornstad
7669da024a add doc status badge to readme 2021-09-21 11:43:51 -05:00
Soren I. Bjornstad
c946c6696d add MIT license 2021-09-21 11:39:01 -05:00
Soren I. Bjornstad
ea7f7edf91 reorganize to prepare for publish 2021-09-21 11:32:33 -05:00
Soren I. Bjornstad
87438e5858 make _set_text_field work properly when 1 line long
OBO error resulted in the new text getting appended rather than
replacing the existing text in this case.
2021-09-21 10:24:28 -05:00
Soren I. Bjornstad
c91e507a89 copy all plugins across tiddlywiki.info when creating edition
Don't know why it doesn't do this itself. Also opened a forum thread:
https://talk.tiddlywiki.org/t/tiddlywiki-init-removing-plugins-from-the-edition/819
2021-09-21 10:21:41 -05:00
Soren I. Bjornstad
2d33b53be6 fix unhandled exception if publish target doesn't exist
It wasn't actually that we didn't create it, but that we tried to clean
first and the folder to be cleaned didn't exist!
2021-09-21 09:36:27 -05:00
Soren I. Bjornstad
5e7a1e3d22 fix several doc files that got out of date 2021-09-21 09:30:32 -05:00
Soren I. Bjornstad
91b27c6e40 add 'tzk convert' to switch between Node & single-file 2021-09-20 14:16:32 -05:00
Soren I. Bjornstad
cf69aa54dd don't use walrus operator
Forgot I was trying to support 3.6+.
2021-09-20 12:27:40 -05:00