summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex-dev/base/source2edoc.cls
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-01-09 21:36:18 +0000
committerKarl Berry <karl@freefriends.org>2021-01-09 21:36:18 +0000
commitb33d382702e71037548dba5374e276b861ea8031 (patch)
tree1670ea7d19f460766341de9e97fe76c8bd09931f /Master/texmf-dist/tex/latex-dev/base/source2edoc.cls
parent23616a07e621fb344c8329dfa20c60408b644d95 (diff)
latex-dev (9jan21)
git-svn-id: svn://tug.org/texlive/trunk@57365 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex-dev/base/source2edoc.cls')
-rw-r--r--Master/texmf-dist/tex/latex-dev/base/source2edoc.cls39
1 files changed, 37 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/latex-dev/base/source2edoc.cls b/Master/texmf-dist/tex/latex-dev/base/source2edoc.cls
index 5b6700039c3..e06108230da 100644
--- a/Master/texmf-dist/tex/latex-dev/base/source2edoc.cls
+++ b/Master/texmf-dist/tex/latex-dev/base/source2edoc.cls
@@ -2,7 +2,7 @@
% This class is buggy and needs fixing
\ProvidesClass{source2edoc}
- [2020/08/16 v0.1 Quick hack to typeset source2.tex
+ [2020/12/02 v0.2 Quick hack to typeset source2.tex
(not usable for anything else and buggy -- will vanish again)!]
\LoadClass{l3doc}
@@ -14,8 +14,43 @@
-% l3doc's def are buggy (already fixed there but not distributed yet)
+
\ExplSyntaxOn
+
+% in 2e we have a lot of functions that have no ``user-level'' documentation so we disable
+% a bogus backref in that case. Over time the sources should be clean up to have such documentation.
+
+\cs_set_protected:Npn \__codedoc_print_documented:
+ {
+ \seq_gset_filter:NNn \g__codedoc_nested_names_seq
+ \g__codedoc_nested_names_seq
+ { ! \__codedoc_if_macro_internal_p:n {##1} }
+ \seq_if_empty:NF \g__codedoc_nested_names_seq
+ {
+% This is a crude change: we grab the first name
+ \__codedoc_get_hyper_target:xN
+ { \seq_item:Nn \g__codedoc_nested_names_seq { 1 } }
+ \l__codedoc_tmpa_tl
+% ... and check if it has a reference
+ \cs_if_exist:cT{ r@\l__codedoc_tmpa_tl }
+% If it does we show it, if not we don't.
+ {
+ \int_set:Nn \l__codedoc_tmpa_int
+ { \seq_count:N \g__codedoc_nested_names_seq }
+ \int_compare:nNnTF \l__codedoc_tmpa_int = 1 {~This~} {~These~}
+ \bool_if:NTF \l__codedoc_macro_var_bool {variable} {function}
+ \int_compare:nNnTF \l__codedoc_tmpa_int = 1 {~is~} {s~are~}
+ documented~on~page~
+ \exp_args:Nx \pageref { \l__codedoc_tmpa_tl } .
+ }
+ }
+ \seq_gclear:N \g__codedoc_nested_names_seq
+ }
+
+
+
+% some l3doc's def are buggy (already fixed there but not distributed yet)
+
\RenewDocumentCommand \DocInclude { m }
{
\relax\clearpage