]> Sergey Matveev's repositories - swg.git/commitdiff
Rename to swg
authorSergey Matveev <stargrave@stargrave.org>
Thu, 15 May 2025 15:02:08 +0000 (18:02 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 15 May 2025 15:02:08 +0000 (18:02 +0300)
README
USAGE
VIM
swg [moved from zk with 96% similarity]

diff --git a/README b/README
index fbcbfe48ec561641b1f482fa09cfd057fde308df..5e39ef4365da0ce3ac41dcb73857eac3f6d147cd 100644 (file)
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
-zk -- zettelkästen/wiki/static website helper/generator.
+swg -- simple wiki/zettelkästen helper/generator.
 
 Here is suggested trivially simple format of plaintext data, ready to be
-used for zettelkästen, wiki, static website, documentation generation.
+used for zettelkästen, wiki, static website, info documentation generation.
 
 There are various already existing similar solutions. But most of them
 are either too complex, or not too flexible enough, or far from being
@@ -48,7 +48,7 @@ completely optional feature.
 
 Look how [LINKS] should be made. How [FORMAT] is defined.
 How your [VIM] editor can be used with all of that.
-Look for [USAGE] of zk utility itself.
+Look for [USAGE] of swg utility itself.
 
 Use grep, git-grep or similar tools to search through pages.
 fzf can be used to quickly navigate to necessary page/file.
diff --git a/USAGE b/USAGE
index 6db859fa869240cdfa2d318dfcaf7e615cb1a8ad..b0fc6b55ee793be861c62000fa82fdd6e3b0d359 100644 (file)
--- a/USAGE
+++ b/USAGE
@@ -1,28 +1,28 @@
-* zk links path/to/page
+* swg links path/to/page
   Prints all (internal) links presented on the page.
-* zk backs path/to/page
+* swg backs path/to/page
   Prints all (internal) backlinks to the page.
-* zk cats [prefix]
+* swg cats [prefix]
   Print all categories/directories, optionally filtered by prefix.
-* zk htmls path/to/dir
+* swg htmls path/to/dir
   Render current directory to a bunch of HTMLs.
-* zk dot | dot -Tpng >relations.png
+* swg dot | dot -Tpng >relations.png
   Generates Graphviz'es dot graph with internal links relationships.
-* zk info >out.info
+* swg info >out.info
   Generates GNU Info output.
 
 If directory does not have "index" file, then it will be autogenerated
 with all files in the directory (category) and all backlinks to it.
 
-If $ZK_DO_BACKS=0 environment variable is set, then no backlinks table
+If $SWG_DO_BACKS=0 environment variable is set, then no backlinks table
 will be generated on the pages by default.
 
-.zkignore may contain regular expressions (one per line) to ignore
+.swgignore may contain regular expressions (one per line) to ignore
 specified files during processing. Your directory may contain images or
 binary files, that must not be processed. Files starting with dot will
 be ignored by default.
 
-If $ZK_PRINT_MISSING environment variable is set, then warning will be
+If $SWG_PRINT_MISSING environment variable is set, then warning will be
 print for links leading to non-existent pages.
 
 How to forcefully change the title of the generated HTML page?
diff --git a/VIM b/VIM
index 9ffa6ff4f4827f7e85ec37687f650784cbef88b6..c8e9fdba3a687ab8def175a72e82ed1828a36351 100644 (file)
--- a/VIM
+++ b/VIM
@@ -13,8 +13,8 @@ directories and filenames in them.
 
 Square bracketed links can be highlighted with:
 
-    syntax region zkLink start="\[\S" end="\S]"
-    highlight link zkLink String
+    syntax region swgLink start="\[\S" end="\S]"
+    highlight link swgLink String
 
 Command ([FORMAT]) lines can be highlighted with:
 
diff --git a/zk b/swg
similarity index 96%
rename from zk
rename to swg
index b5d9a016036eb125f7318e678e6efe7e66415eb2..3320eb60e3fae8cb4c5edd930d72e973a3e74763 100755 (executable)
--- a/zk
+++ b/swg
@@ -1,5 +1,5 @@
 #!/usr/bin/env perl
-# zk -- zettelkästen/wiki/static website helper/generator
+# swg -- simple wiki/zettelkästen helper/generator
 # Copyright (C) 2022-2025 Sergey Matveev <stargrave@stargrave.org>
 
 use strict;
@@ -7,7 +7,7 @@ use warnings;
 use utf8;
 use Carp q{croak};
 
-use version; our $VERSION = qv('1.0.0');
+use version; our $VERSION = qv(1.0.0);
 
 use Encode qw(encode decode);
 binmode STDOUT, q{:encoding(UTF-8)};
@@ -24,8 +24,8 @@ Usage:
     $0 dot | dot -Tpng >relations.png
     $0 info >out.info
 
-By default ZK_DO_BACKS=1 is set.
-Do not forget about .zkignore with regular expressions.
+By default SWG_DO_BACKS=1 is set.
+Do not forget about .swgignore with regular expressions.
 END_USAGE
 ;
     exit 1;
@@ -33,8 +33,8 @@ END_USAGE
 
 if ($#ARGV == -1) { usage }
 
-my $DoBacks = ((not exists $ENV{ZK_DO_BACKS}) or
-    ($ENV{ZK_DO_BACKS} eq q{1})) ? 1 : 0;
+my $DoBacks = ((not exists $ENV{SWG_DO_BACKS}) or
+    ($ENV{SWG_DO_BACKS} eq q{1})) ? 1 : 0;
 
 my %Mtimes;
 my %CatFiles;
@@ -44,8 +44,9 @@ use File::Basename;
 
 {
     my @ignores;
-    if (-e q{.zkignore}) {
-        open my $fh, q{<:encoding(UTF-8)}, q{.zkignore} or croak "$!";
+    my $swgignore = q{.swgignore};
+    if (-e $swgignore) {
+        open my $fh, q{<:encoding(UTF-8)}, $swgignore or croak "$!";
         while (<$fh>) {
             chop;
             push @ignores, $_;
@@ -125,14 +126,14 @@ for my $pth (keys %Mtimes) {
             }
             if ($w =~ /\/$/) {
                 if (not exists $CatDirs{$w}) {
-                    if (exists $ENV{ZK_PRINT_MISSING}) {
+                    if (exists $ENV{SWG_PRINT_MISSING}) {
                         print "missing $w\n";
                     }
                     return;
                 }
             } else {
                 if (not exists $Mtimes{$w}) {
-                    if (exists $ENV{ZK_PRINT_MISSING}) {
+                    if (exists $ENV{SWG_PRINT_MISSING}) {
                         print "missing $w\n";
                     }
                     return;
@@ -501,7 +502,7 @@ if ($ARGV[0] eq q{dump}) {
         utime $mtime, $mtime, "$ARGV[1]/$pth.txt";
     }
 } elsif ($ARGV[0] eq q{info}) {
-    print "Autogenerated by zk\n";
+    print "Autogenerated by swg $VERSION\n";
     my $sep = "\n\1f\n";
     print "${sep}File: self, Node: Top, Up: (dir)\n\n";
     if (exists $Mtimes{q{index}}) {