Skip to content

Commit d34d1e2

Browse files
Separated deprecated code. (rpgtex#245)
* Separated deprecated code
1 parent b232246 commit d34d1e2

15 files changed

+627
-582
lines changed

dndcore.def

+7-9
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313
\RequirePackage {etoolbox}
1414
\RequirePackage {textcomp,gensymb} % degree symbol for italian ordinals
1515
\RequirePackage {hang} % hanging paragraphs
16-
\RequirePackage {keycommand}
1716
\RequirePackage [autolanguage] {numprint} % localization of thousands separator
1817
\RequirePackage {tabularx} % variable-width table columns
1918
\RequirePackage [breakable,skins,xparse]{tcolorbox} % styled text boxes
2019
\RequirePackage {tikz} % drawing ornaments and lines
2120
\RequirePackage {xcolor}
22-
\RequirePackage {xkeyval}
2321
\RequirePackage {xparse} % \NewDocumentCommand and expl3
2422

2523
\sys_if_engine_luatex:T
@@ -77,16 +75,16 @@
7775
\RequirePackage {lib/dndcolors} % color definitions
7876
\RequirePackage {lib/dndfonts} % font definitions
7977
\RequirePackage {lib/dndstrings} % Load document strings
80-
\RequirePackage {lib/dnddeprecated} % Deprecated macros
78+
79+
% Conditionally load deprecated code for backwards compatibility
80+
\bool_if:NF \l__dnd_no_deprecated_code_bool
81+
{ \RequirePackage {lib/dnddeprecated} }
8182

8283
% Main modules in alphabetical order
8384
\RequirePackage {lib/dndcomment} % inline comment boxes
8485
\RequirePackage {lib/dndheader} % fancy headers and footers
85-
\RequirePackage {lib/dndmonster} % \monsterbox definition
86-
\RequirePackage {lib/dndpaperbox} % \paperbox definition
87-
\RequirePackage {lib/dndquote} % \quotebox definition
86+
\RequirePackage {lib/dndmonster} % stat blocks
8887
\RequirePackage {lib/dndreadaloud} % read-aloud text
89-
\RequirePackage {lib/dndsections} % section styling
88+
\RequirePackage {lib/dndsections} % section styling and special section headers
9089
\RequirePackage {lib/dndsidebar} % sidebars
91-
\RequirePackage {lib/dndspell} % \spell definition
92-
\RequirePackage {lib/dndtable} % \dndtable definition
90+
\RequirePackage {lib/dndtable} % tables

dndoptions.clo

+8
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
\bool_new:N \l__dnd_justified_bool
3131
\bool_new:N \l__dnd_multitoc_bool
3232
\bool_new:N \l__dnd_layout_bool
33+
\bool_new:N \l__dnd_no_deprecated_code_bool
3334

3435
\bool_set_true:N \l__dnd_multitoc_bool
3536
\bool_set_eq:NN \l__dnd_layout_bool \c__dnd_isclass_bool
@@ -67,6 +68,13 @@
6768
},
6869
justified .value_forbidden:n = true,
6970

71+
% Suppress deprecated code
72+
nodeprecatedcode .code:n =
73+
{
74+
\bool_set_true:N \l__dnd_no_deprecated_code_bool
75+
},
76+
nodeprecatedcode .value_forbidden:n = true,
77+
7078
% Avoid multi-column toc
7179
nomultitoc .code:n =
7280
{

example.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
\documentclass[letterpaper,twocolumn,openany]{dndbook}
1+
\documentclass[letterpaper,twocolumn,openany,nodeprecatedcode]{dndbook}
22

33
% Use babel or polyglossia to automatically redefine macros for terms
44
% Armor Class, Level, etc...

lib/compat.sty

-2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,3 @@
1212
% https://github.com/latex3/latex3/blob/8fcb571ddda61c01773d9746d32cecdbe63afb26/l3kernel/l3obsolete.txt#L65
1313
\cs_new_eq:NN \str_case_e:nnF \str_case_x:nnF
1414
}
15-
16-
\ExplSyntaxOff

lib/dndcolors.sty

-20
Original file line numberDiff line numberDiff line change
@@ -41,30 +41,10 @@
4141

4242
% Sets the themecolor and colors for all themed elements
4343
% If called without the optional color, resets the color of all themed elements to the current themecolor
44-
% Old interface
45-
\newcommand{\setthemecolor}[1][themecolor]{%
46-
\colorlet{themecolor}{#1}
47-
\colorlet{commentcolor}{#1}
48-
\colorlet{sidebarcolor}{#1}
49-
\colorlet{tablecolor}{#1}
50-
}
51-
52-
% New interface
5344
\NewDocumentCommand {\DndSetThemeColor} { O {themecolor} }
5445
{
5546
\colorlet {themecolor} {#1}
5647
\colorlet {commentcolor} {#1}
5748
\colorlet {sidebarcolor} {#1}
5849
\colorlet {tablecolor} {#1}
5950
}
60-
61-
% Backwards-compatible aliases and colours
62-
\colorlet {commentgreen} {PhbLightGreen}
63-
\colorlet {itemtablepink} {DmgCoral}
64-
\colorlet {monstertan} {statblockbg}
65-
\definecolor {monstertandark} {HTML} {F0DBB5}
66-
67-
% Old interface
68-
\colorlet {commentboxcolor} {commentcolor}
69-
\colorlet {paperboxcolor} {sidebarcolor}
70-
\colorlet {quoteboxcolor} {readaloudcolor}

lib/dndcomment.sty

-36
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,5 @@
11
\ExplSyntaxOn
22

3-
% Old interface
4-
%Usage \begin{commentbox}[options]{title}[color]
5-
\DeclareTColorBox{commentbox}{O{} m O{commentboxcolor}}{%
6-
before~upper={%
7-
\bool_if:NT \l__dnd_layout_bool
8-
{
9-
\bool_if:NF \l__dnd_justified_bool
10-
{ \RaggedRight }
11-
}
12-
},
13-
code={\linespread{.9}},
14-
frame~hidden,
15-
boxrule=0pt,
16-
breakable,
17-
enhanced,
18-
before~skip=13pt plus 4pt minus 4pt,
19-
toptitle=2pt,
20-
boxsep=3pt,
21-
left=6pt,
22-
right=6pt,
23-
top=0pt,
24-
bottom=2pt,
25-
sharp~corners,
26-
fonttitle=\DndFontCommentTitle,
27-
fontupper=\DndFontCommentBody,
28-
fontlower=\DndFontCommentBody,
29-
title={#2},
30-
parbox=false,
31-
colback=#3,
32-
colbacktitle=#3,
33-
coltitle=black,
34-
after~skip=13pt plus 4pt minus 4pt,
35-
#1
36-
}
37-
38-
% New interface
393
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
404
% Environment for comments.
415
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

0 commit comments

Comments
 (0)