aboutsummaryrefslogtreecommitdiff
path: root/bin/hedgedoc2quarto
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2024-05-03 16:10:54 +0200
committerJonas Smedegaard <dr@jones.dk>2024-05-03 16:10:54 +0200
commit02c83c9638a4701bf223eb4cbf57cfa2587a5a0a (patch)
tree0a76f1b76f1735143fc609d7ecd1188fda9eec4d /bin/hedgedoc2quarto
parentf18a687d57e842e818df1b26071d518cc621d065 (diff)
handle dot graphs
Diffstat (limited to 'bin/hedgedoc2quarto')
-rwxr-xr-xbin/hedgedoc2quarto8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/hedgedoc2quarto b/bin/hedgedoc2quarto
index c81ddd5..5e2eb70 100755
--- a/bin/hedgedoc2quarto
+++ b/bin/hedgedoc2quarto
@@ -37,6 +37,14 @@ die 'Too many arguments: expected INFILE and OUTFILE' if $bogus;
@ARGV = ($infile) if $infile;
my $content = do { local $/ = undef; <> };
+# TODO: integrate with subroutine handler below
+$content =~ s/^
+ (?'fence'[``~]{3,})\s*
+ \Kgraphviz\n
+ (?'code'.*?\n)
+ \k'fence'
+ $/{dot}\n\/\/| fig-width: 100\%\n$+{code}$+{fence}/gsmx;
+
$content =~ s/^
(?'fence'[``~]{3,})\s*
\Kmermaid\n