Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

测试 ctxdoc 文档类 #704

Open
muzimuzhi opened this issue Mar 18, 2024 · 1 comment
Open

测试 ctxdoc 文档类 #704

muzimuzhi opened this issue Mar 18, 2024 · 1 comment

Comments

@muzimuzhi
Copy link
Contributor

因为基于实验性的 l3doc 文档类,而且在实现时 patch 了不少命令,来自上游(如 l3kernell3doc)的修改很容易影响 ctxdoc 的可用性。

虽然 ctxdoc 宣称自己是仅 ctex-kit 内部使用的,挡不住它已被一些第三方项目已经用它排版项目文档。

两个选择:

  • ctxdoc 文档类添加几个测试
  • 把编译 ctex 文档纳入 CI
@muzimuzhi
Copy link
Contributor Author

两个选择:

  • ctxdoc 文档类添加几个测试
  • 把编译 ctex 文档纳入 CI

后者更有意义,但不能完全替代前者。(编译不报错,不意味着排版结果符合预期。)

我还想让 ctxdoc 在每次 patch 失败时抛出错误,而不是安静地往 log 写 *** FAIL ***

\patchcmd{\@addtocurcol}%
{\vskip \intextsep}%
{\edef\save@first@penalty{\the\lastpenalty}\unpenalty
\ifnum \lastpenalty = \@M % hopefully the OR penalty
\unpenalty
\else
\penalty \save@first@penalty \relax % put it back
\fi
\ifnum\outputpenalty <-\@Mii
\addvspace\intextsep
\vskip\parskip
\else
\addvspace\intextsep
\fi}%
{\typeout{*** SUCCESS ***}}{\typeout{*** FAIL ***}}

ctex-kit/support/ctxdoc.cls

Lines 221 to 227 in e612c95

%% 抑制首段的 \parskip
\ctex_patch_cmd_once:NnnnTF \__codedoc_function_descr_start:w
{ }
{ \noindent }
{ \skip_vertical:n { -\parskip } \noindent }
{ \iow_term:n { *** ~ SUCCESS ~ *** } }
{ \iow_term:n { *** ~ FAIL ~ *** } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant