linux/Documentation
Akira Yokosawa f7ebe6b769 docs: Activate exCJK only in CJK chapters
Activating xeCJK in English and Italian-translation documents
results in sub-optimal typesetting with wide-looking apostrophes
and quotation marks.

The xeCJK package provides macros for enabling and disabling its
effect in the middle of a document, namely \makexeCJKactive and
\makexeCJKinactive.

So the goal of this change is to activate xeCJK in the relevant
chapters in translations.

To do this:

    o Define custom macros in the preamble depending on the
      availability of the "Noto Sans CJK" font so that those
      macros can be used regardless of the use of xeCJK package.

    o Patch \sphinxtableofcontents so that xeCJK is inactivated
      after table of contents.

    o Embed those custom macros in each language's index.rst file
      as a ".. raw:: latex" construct.

Note: A CJK chapter needs \kerneldocCJKon in front of its chapter
heading, while a non-CJK chapter should have \kerneldocCJKoff
below its chapter heading.

This is to make sure the CJK font is available to CJK chapter's
heading and ending page's footer.

Tested against Sphinx versions 2.4.4 and 4.0.2.

Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Tested-by: Wu XiangCheng <bobwxc@email.cn>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/lkml/2061da0a-6ab1-35f3-99c1-dbc415444f37@gmail.com
Link: https://lore.kernel.org/r/83208ddc-5de9-b283-3fd6-92c635348ca0@gmail.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2021-05-27 09:59:41 -06:00
..
ABI docs: ABI: sysfs-class-led-trigger-pattern: remove repeat duplication 2021-05-20 13:44:14 -06:00
accounting
admin-guide docs: admin-guide: update description for kernel.hotplug sysctl 2021-05-13 10:14:17 -06:00
arm It's been a relatively busy cycle in docsland, though more than usually 2021-04-26 13:22:43 -07:00
arm64 Assorted arm64 fixes and clean-ups, the most important: 2021-05-07 12:11:05 -07:00
block docs: block: blk-mq.rst: correct drive -> driver 2021-05-20 14:26:49 -06:00
bpf bpf: Document the pahole release info related to libbpf in bpf_devel_QA.rst 2021-04-23 17:11:58 -07:00
cdrom docs: cdrom-standard.rst: get rid of uneeded UTF-8 chars 2021-05-11 11:00:17 -06:00
core-api A few late-arriving documentation fixes, including some oprofile cleanup, a 2021-05-06 08:33:54 -07:00
cpu-freq
crypto
dev-tools Documentation: checkpatch: Tweak BIT() macro include 2021-05-20 14:27:30 -06:00
devicetree Kbuild updates for v5.13 (2nd) 2021-05-08 10:00:11 -07:00
doc-guide
driver-api Remove link to nonexistent rocket driver docs 2021-05-11 11:02:39 -06:00
fault-injection
fb Documentation: Add leading slash to some paths 2021-03-31 13:49:19 -06:00
features powerpc updates for 5.13 2021-04-30 12:22:28 -07:00
filesystems f2fs-for-5.13-rc1 2021-05-04 18:03:38 -07:00
firmware_class
firmware-guide Documentation: firmware-guide: gpio-properties: Add note to SPI CS case 2021-04-28 19:11:13 +02:00
fpga Documentation: fpga: dfl: Add description for DFL UIO support 2021-03-28 14:58:18 +02:00
gpu drm-misc-next for 5.13: 2021-04-07 17:32:12 +10:00
hid Documentation: Add leading slash to some paths 2021-03-31 13:49:19 -06:00
hwmon docs: hwmon: tmp103.rst: fix bad usage of UTF-8 chars 2021-05-11 11:00:18 -06:00
i2c
ia64
ide
iio iio: hrtimer: Allow sub Hz granularity 2021-03-25 19:13:49 +00:00
infiniband
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2021-05-06 23:37:55 -07:00
isdn
kbuild Kconfig updates for v5.13 2021-04-29 14:32:00 -07:00
kernel-hacking
leds Documentation: Add leading slash to some paths 2021-03-31 13:49:19 -06:00
litmus-tests
livepatch
locking
m68k
maintainer media: add a subsystem profile documentation 2021-03-22 08:56:42 +01:00
mhi
mips
misc-devices dw-xdata-pcie: Update outdated info and improve text format 2021-04-14 19:47:28 +02:00
netlabel
networking docs: networking: device_drivers: fix bad usage of UTF-8 chars 2021-05-11 11:00:18 -06:00
nios2
nvdimm
openrisc
parisc
PCI
pcmcia
power power supply and reset changes for the v5.13 series 2021-04-28 15:43:58 -07:00
powerpc powerpc updates for 5.13 2021-04-30 12:22:28 -07:00
process Documentation: drop optional BOMs 2021-05-10 15:17:34 -06:00
RCU docs: Correctly spell Stephen Hemminger's name 2021-03-15 13:53:24 -07:00
riscv Documentation: riscv: Add documentation that describes the VM layout 2021-04-26 08:25:05 -07:00
s390 s390/pci: expose UID uniqueness guarantee 2021-04-05 11:30:57 +02:00
scheduler docs: sched-bwc.rst: fix a typo on a doc name 2021-05-20 13:44:13 -06:00
scsi for-5.13/block-2021-04-27 2021-04-28 14:27:12 -07:00
security Documentation: drop optional BOMs 2021-05-10 15:17:34 -06:00
sh
sound
sparc
sphinx
sphinx-static
spi spi: Updates for v5.13 2021-04-26 16:32:11 -07:00
staging
target
timers Documentation: drop optional BOMs 2021-05-10 15:17:34 -06:00
trace Documentation: trace: Add documentation for TRBE 2021-04-06 16:05:38 -06:00
translations docs: Activate exCJK only in CJK chapters 2021-05-27 09:59:41 -06:00
usb docs: usb: function: Modify path name 2021-05-13 10:14:18 -06:00
userspace-api Add Landlock, a new LSM from Mickaël Salaün <mic@linux.microsoft.com> 2021-05-01 18:50:44 -07:00
virt docs: virt: api.rst: fix a pointer to SGX documentation 2021-05-20 13:44:14 -06:00
vm mm: gup: remove FOLL_SPLIT 2021-04-30 11:20:37 -07:00
w1
watchdog
x86 A few late-arriving documentation fixes, including some oprofile cleanup, a 2021-05-06 08:33:54 -07:00
xtensa
.gitignore
arch.rst docs: Group arch-specific documentation under "CPU Architectures" 2021-03-15 13:35:35 -06:00
asm-annotations.rst
atomic_bitops.txt
atomic_t.txt
Changes
CodingStyle
conf.py docs: Activate exCJK only in CJK chapters 2021-05-27 09:59:41 -06:00
COPYING-logo
docutils.conf
dontdiff kbuild: generate Module.symvers only when vmlinux exists 2021-04-25 05:17:02 +09:00
index.rst docs: Group arch-specific documentation under "CPU Architectures" 2021-03-15 13:35:35 -06:00
Kconfig
logo.gif
Makefile
memory-barriers.txt
SubmittingPatches
watch_queue.rst