From ac7c4dc8ce1538cfda817ed32e47f892767df068 Mon Sep 17 00:00:00 2001 From: Jessie Hildebrandt Date: Sat, 13 Apr 2024 21:15:21 -0400 Subject: [PATCH] Initial commit --- c++.eld | 120 +++++++++++++++++++++++++++++++++++++++++++++++++ elisp.eld | 68 ++++++++++++++++++++++++++++ javascript.eld | 70 +++++++++++++++++++++++++++++ 3 files changed, 258 insertions(+) create mode 100644 c++.eld create mode 100644 elisp.eld create mode 100644 javascript.eld diff --git a/c++.eld b/c++.eld new file mode 100644 index 0000000..ba5c597 --- /dev/null +++ b/c++.eld @@ -0,0 +1,120 @@ +;;; c++.eld --- Tempel template definitions file -*- lexical-binding: t; -*- + +;; Author: Jessie Hildebrandt +;; Homepage: https://gitlab.com/jessieh/tempel-templates + +;; This file is not part of GNU Emacs. + +;;; Commentary: + +;; This file provides Tempel template definitions. + +;;; License: + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth +;; Floor, Boston, MA 02110-1301, USA. + +;;; Code: + +c++-mode c++-ts-mode + +;; ---------------------------------- ;; +;; Section header +;; ---------------------------------- ;; + +(sec + > "/* -----------------------------------------------------------------------------" > + n> " *" > + n> " * " (r "Section title" title) > + n> " *" > + n> " * -------------------------------------------------------------------------- */" > + n) + +;; ---------------------------------- ;; +;; Subsection header +;; ---------------------------------- ;; + +(sub + > "/* -------------------------------------" > + n> " * " (r "Subsection title" title) > + n> " * ---------------------------------- */" > + n) + +;; ---------------------------------- ;; +;; Subdivision header +;; ---------------------------------- ;; + +(div + > "/* --- " (r "Subdivision title" title) " --- */" > + n) + +;; ---------------------------------- ;; +;; Doc comment +;; ---------------------------------- ;; + +(doc + > "/**" > + n> " * " (r "TODO: Doc me!") > + n> " */" >) + +;; ---------------------------------- ;; +;; File doc comment +;; ---------------------------------- ;; + +(file + > "/**" > + n> " * @file " (or (file-relative-name buffer-file-name + (project-root (project-current))) + (file-name-nondirectory (buffer-file-name))) > + n> " * @brief " (p "Brief description of file") > + n> " */" > + n) + +;; ---------------------------------- ;; +;; Function header +;; ---------------------------------- ;; + +(fn + > (i doc) > + n> (p "void") " " (p "fn_name") "(" p ")" > + n> "{" > + n> r> > + n> "}" > + n) + +;; ---------------------------------- ;; +;; Module declarations +;; ---------------------------------- ;; + +(module + > (i sec (title "Global module fragment")) > + n> "module;" > + n + n> (i sec (title "Module declaration")) > + n> "/**" > + n> " * @module " (p (file-name-base (or (buffer-file-name) "module_name")) module-name) > + n> " * @brief " (p "Brief description of module") > + n> " */" > + n> "export module " module-name ";" > + n + n> (i sec (title (concat namespace-name "::"))) > + n> "namespace " (p module-name namespace-name) " {" > + n + n> (i sub (title "Exports and prototypes")) + n> "export {}" > + n + n> r> > + n + n> "}" >) diff --git a/elisp.eld b/elisp.eld new file mode 100644 index 0000000..724a16e --- /dev/null +++ b/elisp.eld @@ -0,0 +1,68 @@ +;;; elisp.eld --- Tempel template definitions file -*- lexical-binding: t; -*- + +;; Author: Jessie Hildebrandt +;; Homepage: https://gitlab.com/jessieh/tempel-templates + +;; This file is not part of GNU Emacs. + +;;; Commentary: + +;; This file provides Tempel template definitions. + +;;; License: + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth +;; Floor, Boston, MA 02110-1301, USA. + +;;; Code: + +emacs-lisp-mode lisp-data-mode + +;; ---------------------------------- ;; +;; Section header +;; ---------------------------------- ;; + +(sec + > ";; -------------------------------------------------------------------------- ;;" > + n> ";;" > + n> ";; " (p "Section title") > + n> ";;" > + n> ";; -------------------------------------------------------------------------- ;;" > + n) + +;; ---------------------------------- ;; +;; Subsection header +;; ---------------------------------- ;; + +(sub + > ";; ---------------------------------- ;;" > + n> ";; " (p "Subsection title") > + n> ";; ---------------------------------- ;;" > + n) + +;; ---------------------------------- ;; +;; Autoload flag +;; ---------------------------------- ;; + +(autoload + > ";;;###autoload" >) + +;; ---------------------------------- ;; +;; File header +;; ---------------------------------- ;; + +(file + > ";;; " (file-name-nondirectory (buffer-file-name)) " --- " (p "Description of file") " -*- lexical-binding: t; -*-" > + n) diff --git a/javascript.eld b/javascript.eld new file mode 100644 index 0000000..e5d29b6 --- /dev/null +++ b/javascript.eld @@ -0,0 +1,70 @@ +;;; javascript.eld --- Tempel template definitions file -*- lexical-binding: t; -*- + +;; Author: Jessie Hildebrandt +;; Homepage: https://gitlab.com/jessieh/tempel-templates + +;; This file is not part of GNU Emacs. + +;;; Commentary: + +;; This file provides Tempel template definitions. + +;;; License: + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth +;; Floor, Boston, MA 02110-1301, USA. + +;;; Code: + +js-mode js-ts-mode typescript-mode typescript-ts-mode + +;; ---------------------------------- ;; +;; Section header +;; ---------------------------------- ;; + +(sec + > "/* -----------------------------------------------------------------------------" > + n> " *" > + n> " * " (r "Section title" title) > + n> " *" > + n> " * -------------------------------------------------------------------------- */" > + n) + +;; ---------------------------------- ;; +;; Subsection header +;; ---------------------------------- ;; + +(sub + > "/* -------------------------------------" > + n> " * " (r "Subsection title" title) > + n> " * ---------------------------------- */" > + n) + +;; ---------------------------------- ;; +;; Subdivision header +;; ---------------------------------- ;; + +(div + > "/* --- " (r "Subdivision title" title) " --- */" > + n) + +;; ---------------------------------- ;; +;; Doc comment +;; ---------------------------------- ;; + +(doc + > "/**" > + n> " * " (r "TODO: Doc me!") > + n> " */" >)