Skip to content

Commit 4cec95d

Browse files
authored
ci: make install (#145)
1 parent 3886cbf commit 4cec95d

File tree

4 files changed

+87
-32
lines changed

4 files changed

+87
-32
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ build: prepare
2020
format:
2121
latexindent main.tex -l latexindent.yaml -w $(LATEXINDENT_ARGS)
2222

23+
# Install the package to TeX Live / MacTeX
24+
# For MiKTeX users, if you encounter `please use --texmfhome option`,
25+
# I wish you could do the job manually by using
26+
# `l3build install --texmfhome path/to/install`.
27+
# For more details, see the development guide.
28+
install:
29+
cd src && l3build install
30+
2331
# Clean temporary files
2432
clean:
2533
latexmk -C $(LATEXMK_ARGS)

src/MANIFEST.md

Lines changed: 21 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/build.lua

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,15 +291,28 @@ end
291291
-- FIXME: subfolders could not be detected. Use plain text for temporary fix.
292292
manifest_setup = function ()
293293
local groups = {
294+
{
295+
subheading = "Minimal manifest",
296+
description = [[
297+
The following group lists all the necessary files that required by the runtime.
298+
You could install these files to your TeX distribution or distribute them with
299+
your main document.]]
300+
},
301+
{
302+
name = "Minimal workset",
303+
description = "* vi/",
304+
dir = tdsdir.."/tex/"..moduledir,
305+
files = {"*.*"},
306+
exclude = {".",".."},
307+
flag = false,
308+
skipfiledescription = true,
309+
},
294310
{
295311
subheading = "Repository manifest",
296312
description = [[
297313
The following groups list the files included in the development repository of the package.
298314
Files listed with a ‘†’ marker are included in the TDS but not CTAN files, and files listed
299315
with ‘‡’ are included in both.
300-
301-
> **Minimal workset**: All files in **Derived files** and **Graphic resources**.
302-
Or directly use files in **TeX files (TDS)**.
303316
]],
304317
},
305318
{
@@ -435,9 +448,10 @@ The following group lists the files included in the CTAN package.
435448
{
436449
subheading = "Online manifest",
437450
description = [[
438-
The following group lists the files included in the Online distribution.
439-
You could upload the package to any online plateforms or use it as the
440-
minimal workset on the local machine.
451+
The following group lists the files included in the online distribution.
452+
You could upload the package to any online plateforms. Compared with
453+
**Minimal workset**, this distribution comes with all the plugins and
454+
quick start guide as the main file.
441455
You could generate the package by going to the root directory and
442456
using the command `make build-online` in the terminal.
443457
]],

src/doc/sjtubeamerdevguide.tex

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ \subsection{Build Overview}
228228
\begin{itemize}
229229
\item Unpacking Doc\TeX{} files.
230230
\item Generating documentation.
231-
\item Caching and clean demos.
231+
\item Caching and cleaning demos.
232232
\item Generating Visual Studio Code snippets (as is in
233233
\texttt{.vscode/sjtubeamer.code-snippets})
234234
\item Generating \texttt{MANIFEST.md} to show the repository structure.
@@ -241,7 +241,7 @@ \subsection{Build Overview}
241241
\item Compiling \verb"main.tex" for users.
242242
\item Building the cover collection.
243243
\item Formatting codes.
244-
\item Build the online distribution \texttt{sjtubeamer-online.zip}.
244+
\item Building the online distribution \texttt{sjtubeamer-online.zip}.
245245
\end{itemize}
246246

247247
\subsection{l3build}\label{sec:l3build}
@@ -258,12 +258,29 @@ \subsubsection{Built-In Commands}\label{sec:builtincmd}
258258

259259
\fcmd{l3build install} This command will install current version from
260260
\verb"source" to your \TeX{} distribution. Remember to update the
261-
\verb"l3build" to the latest version to avoid misbehaving. This
262-
command requires an argument \verb"--texmfhome" option to specify the
263-
install path, which could be obtained from Mik\TeX{} Console or the
264-
\verb"tlmgr". Then, refresh the database of filenames in your TeX{}
265-
distribution. This command is useful if you want this template to be globally
266-
available for all documents on your computer.
261+
\verb"l3build" to the latest version to avoid misbehaving.
262+
263+
For MiK\TeX{} users, this command requires an argument
264+
\begin{verbatim}
265+
l3build install --texmfhome /path/to/install
266+
\end{verbatim}
267+
to specify the install path, which could be obtained from Mik\TeX{} Console
268+
(Settings $\rightarrow$ Directories $\rightarrow$ TEXMF root directories
269+
(Install)). It is often not necessary for \TeX{} Live and Mac\TeX{} users,
270+
unless you want to install the files in a different place other than
271+
\verb"TEXMFHOME" (the value could be obtained by
272+
\verb"kpsewhich -var-value TEXMFHOME"). If you specify the package location by
273+
\verb"--texmfhome", then you need to refresh the database of filenames in your
274+
TeX{} distribution by \verb"texhash" or \verb"sudo texhash" to elevate the
275+
privileges if it prompts ``directory not writable. Skipping...''. In fact, if
276+
the filenames stay the same, you don't need to refresh the database (no need to
277+
use the command \verb"texhash" after the first-time installation, basically).
278+
You don't need to \verb"texhash" at all if you follow the default behavior of
279+
installing the package into \verb"TEXMFHOME" (which will be detected
280+
automatically without the database).
281+
282+
This command is useful if you want this template to be globally available for
283+
all documents on your computer.
267284

268285
\fcmd{l3build unpack} This command will unpack the source code and create a
269286
sandbox environment in \verb"build/local". You can create your own test
@@ -272,26 +289,19 @@ \subsubsection{Built-In Commands}\label{sec:builtincmd}
272289

273290
\fcmd{l3build check} Process a regression test, with an optional parameter to
274291
perform one of the following tests:
275-
\begin{center}
276-
\ttfamily color font inner outer sjtuvi
277-
\end{center}
292+
\begin{verbatim}
293+
color font inner outer sjtuvi
294+
\end{verbatim}
278295
which will show if the module is standing-free. If the compilation error
279296
occurs, please check if your code uses one definition from another module
280297
without requiring it first, or an undefined control sequence occurs.
281298

282299
This command will also move the generated style files to the root directory.
283300

284301
\fcmd{l3build doc} This command will generate the documentation of this
285-
package.
286-
% We set an overall testing file \verb"doc/min.tex" to test all features of \themename.
287-
% \begin{center}
288-
% unpack $\rightarrow$ \verb"min.tex" $\rightarrow$ documentations
289-
% \end{center}
290-
Since the doc has a lot of dependencies (or unit tests), you can cache the demo
302+
package. Since the doc has a lot of dependencies (or unit tests), you can cache the demo
291303
files to \verb"support/tutorial" directory. This could be done by the exclusive
292304
\verb"l3build cache-demo" in Section \ref{sec:exclcmd}.
293-
% Change the variable in \verb"build.lua": \verb"cachedemo=true" to cache the demo automatically, and remove the variable to clean the cached files.
294-
% We highly recommend that using *nix to compile the doc.
295305

296306
\fcmd{l3build save color} If you make some modification to the framework
297307
(except \verb"sjtucover") and change the result. To save the current
@@ -431,6 +441,14 @@ \subsection{Continuous Integration}\label{sec:make}
431441
For those who are familiar with \verb"makefile" system, the following commands
432442
might be helpful to build the package under the root directory:
433443

444+
\fcmd{make install} This command will run \verb"l3build install", which installs
445+
the unpacked files to \TeX{} Live and Mac\TeX{} \verb"TEXMFHOME" directory
446+
according to \verb"l3build" documentation.
447+
Unfortunately, it is likely to fail on MiK\TeX{} since the \verb"TEXMFHOME" is
448+
usually empty. Hope that MiK\TeX{} users won't use this command or try to modify
449+
the \verb"Makefile" to add some parameters mentioned in Section \ref{sec:l3build}
450+
to meet your need.
451+
434452
\fcmd{make generate} This command will unpack the Doc\TeX{} files into style
435453
files and update the generated files in the root directory.
436454

@@ -1050,7 +1068,7 @@ \subsection{Beamer Interface}\label{sec:beamer}
10501068
package \cite{beamerman}. You can acquire the doc by the terminal
10511069
command:
10521070
\begin{verbatim}
1053-
texdoc beame
1071+
texdoc beamer
10541072
\end{verbatim}
10551073
Then, you could choose to use some preset theme, or call the macro to control
10561074
the appearance of each component.

0 commit comments

Comments
 (0)