SkillAgentSearch skills...

Ntemplate

A unified Quickproject template for Atlas Engineer libraries.

Install / Use

/learn @atlas-engineer/Ntemplate
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

This repository is a template for the pattern of libraries that emerged in Atlas Engineer (see [[https://github.com/atlas-engineer/nkeymaps][nkeymaps]], [[https://github.com/atlas-engineer/ndebug][ndebug]], [[https://github.com/atlas-engineer/nfiles][nfiles]] for manifestations of this pattern). It saves some hour of repository set up and is as easy to use as

#+begin_src lisp ;; In your REPL. (ql:quickload :quickproject) ;; IMPORTANT: Delete the .git directory to not break Quickproject copying. ;; FIXME: Make Quickproject ignore the .git directory. (delete-directory #p"/path/to/ntemplate/.git/" :recursive t) ;; Finally, create the project based on a template. (quickproject:make-project #p"/path/to/your/lib/" :template-directory #p"/path/to/ntemplate/" :author "Atlas Engineer LLC" :license "BSD-3 Clause") #+end_src

To add submodules to the repository, you can leverage the Guix definition. This only works for packages using a git-reference as source:

#+begin_src lisp (mapcar #'asdf:load-system '(:alexandria :serapeum :ospm :log4cl)) (defvar git-program "git")

(flet ((fetch-git-modules (local-repository &rest packages) "LOCAL-REPOSITORY is the path to the Git repository where to add the submodules. PACKAGES are the Guix packages corresponding to the submodules to fetch.

Return 2 values:

  • the list of inputs with a Git reference;
  • the list of inputs without a Git reference; you will have to add these submodules manually." (labels ((repo-url-name (url) (let ((pos (search "/" url :from-end t :end2 (1- (length url))))) (serapeum:string-replace-all "/" (subseq url pos) ""))) (sbcl-recursive-inputs (pkg) (let ((pkgs (mapcar (alexandria:compose #'first #'ospm:find-os-packages) (remove-if-not (lambda (input) (serapeum:string-prefix-p "sbcl-" input)) (ospm:inputs pkg))))) (cons pkg (alexandria:mappend #'sbcl-recursive-inputs pkgs))))) (multiple-value-bind (git-inputs non-git-inputs) (serapeum:partition (alexandria:compose #'ospm::guix-package-source-git-reference-p #'ospm:source) (delete-duplicates (alexandria:mappend (lambda (pkg-name) (sbcl-recursive-inputs (first (or (ospm:find-os-packages pkg-name) (error "Package ~a not found" pkg-name))))) packages))) (mapc (lambda (url) (let ((target (uiop:strcat "_build/" (repo-url-name url)))) (uiop:with-current-directory (local-repository) (if (uiop:directory-exists-p target) (log:info "~s already exists" target) (let ((cmd `(,git-program "submodule" "add" ,url ,target))) (format t "~&~{~a~,^ ~}~&" cmd) (uiop:run-program cmd :output t :error-output t)))))) (mapcar (alexandria:compose #'ospm:url #'ospm:source) (delete-duplicates git-inputs))) (values git-inputs non-git-inputs))))) (fetch-git-modules "/path/to/repository/checkout" "sbcl-lisp-unit2" "sbcl-MY-OTHER-LIB" "...")) #+end_src

And then go on with doing the actual work, testing, and documentation ;)

#+TITLE:(#| TMPL_VAR name |#)

What (#| TMPL_VAR name |#) is.

(#| TMPL_VAR name |#) does...

  • Getting Started Clone the Git repository: #+begin_src sh git clone --recursive https://github.com/atlas-engineer/(#| TMPL_VAR name |#) ~/common-lisp/ #+end_src

And then load ~:(#| TMPL_VAR name |#)~ in the REPL: #+begin_src lisp (asdf:load-system :(#| TMPL_VAR name |#)) ;; or, if you use Quicklisp (ql:quickload :(#| TMPL_VAR name |#)) #+end_src

  • Examples

#+begin_src lisp ;; Basic example here, see more in package.lisp. #+end_src

  • How it works

  • Roadmap

  • [ ]
View on GitHub
GitHub Stars4
CategoryDevelopment
Updated11mo ago
Forks2

Languages

Common Lisp

Security Score

82/100

Audited on Apr 25, 2025

No findings