[bootlin/training-materials updates] master: Add Elixir macros (a31a4535)
Michael Opdenacker
michael.opdenacker at bootlin.com
Tue May 26 11:38:09 CEST 2020
Repository : https://github.com/bootlin/training-materials
On branch : master
Link : https://github.com/bootlin/training-materials/commit/a31a45355057bb1d2fe7ce468c0166acfd8aa617
>---------------------------------------------------------------
commit a31a45355057bb1d2fe7ce468c0166acfd8aa617
Author: Michael Opdenacker <michael.opdenacker at bootlin.com>
Date: Tue May 26 11:38:09 2020 +0200
Add Elixir macros
Signed-off-by: Michael Opdenacker <michael.opdenacker at bootlin.com>
>---------------------------------------------------------------
a31a45355057bb1d2fe7ce468c0166acfd8aa617
common/common.sty | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/common/common.sty b/common/common.sty
index e9fc9331..d88421f6 100644
--- a/common/common.sty
+++ b/common/common.sty
@@ -1,12 +1,17 @@
% Common Bootlin commands
+% Generic commands
+\newcommand\projdir[2]{\href{https://elixir.bootlin.com/#1/latest/source/#2/}{\code{#2/}}}
+\newcommand\projfile[2]{\href{https://elixir.bootlin.com/#1/latest/source/#2}{\code{#2}}}
+
+% Linux commands
\newcommand\kfunc[1]{\href{https://elixir.bootlin.com/linux/latest/ident/#1}{\code{#1()}}}
\newcommand\ksym[1]{\href{https://elixir.bootlin.com/linux/latest/ident/#1}{\code{#1}}}
\newcommand\kstruct[1]{\href{https://elixir.bootlin.com/linux/latest/ident/#1}{\code{struct #1}}}
-\newcommand\kfile[1]{\href{https://elixir.bootlin.com/linux/latest/source/#1}{\code{#1}}}
+\newcommand\kfile[1]{\projfile{linux}{#1}}
\newcommand\krelfile[2]{\href{https://elixir.bootlin.com/linux/latest/source/#1/#2}{\code{#2}}} % For relative file paths
\newcommand\kfileversion[2]{\href{https://elixir.bootlin.com/linux/v#2/source/#1}{\code{#1}}}
-\newcommand\kdir[1]{\href{https://elixir.bootlin.com/linux/latest/source/#1/}{\code{#1/}}}
+\newcommand\kdir[1]{\projdir{linux}{#1}}
\newcommand\kreldir[2]{\href{https://elixir.bootlin.com/linux/latest/source/#1/#2}{\code{#2/}}} % For relative directory paths
\newcommand\ksubarch[1]{\href{https://elixir.bootlin.com/linux/latest/source/arch/#1/}{\code{#1}}}
\newcommand\kerneldoctext[1]{\href{https://kernel.org/doc/Documentation/#1}{\code{Documentation/#1}}}
More information about the training-materials-updates
mailing list