Skip to content

Commit

Permalink
fix see-also links to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ailin Nemui committed Oct 31, 2023
1 parent 9df3981 commit a332d1d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
19 changes: 14 additions & 5 deletions _tools/help2md.pl
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,20 @@ sub main {
my $res = "## $1 ##
";
$in_section = $1;
my @see_also = split " ", $2;
s/,$// for @see_also;
for (@see_also) {
$_ = "[$_](/documentation/help/\L$_\E)";
}
my @see_also = split ", ", $2;
@see_also = map {
my @words = split " ", $_;
if ("\L$words[0]" eq "set" && @words > 1) {
my $anchor = $words[1];
$anchor =~ y/_/-/;
@words = "[@words](/documentation/settings.md#\L$anchor)";
} elsif ("\L@words" eq "window log") {
@words = "[@words](/documentation/help/window_logging/)";
} else {
$words[0] = "[$words[0]](/documentation/help/\L$words[0]\E)";
}
$_ = "@words";
} @see_also;
$_ = $res . join ", ", @see_also;
}
# deindent textual paragraphs (try to keep examples)
Expand Down
2 changes: 1 addition & 1 deletion install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ patch -d "$(python -c 'import sphinx.builders.html;print(sphinx.builders.html.__

python -m pip install -e ./furo

PERL5LIB="$(pwd)/local/lib/perl5${PERL5LIB+:}$PERL5LIB"
PERL5LIB="$(pwd)/local/lib/perl5/$(perl -e'print substr $^V,1')${PERL5LIB+:}$PERL5LIB"
export PERL5LIB
cpm install --cpanfile=./_tools/cpanfile

Expand Down
2 changes: 1 addition & 1 deletion sphinx/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
linkify-it-py==2.0.0
sphinx-sitemap==2.2.0
myst-parser==0.18.0
myst-parser==1.0.0
sphinx-design==0.2.0

0 comments on commit a332d1d

Please sign in to comment.