Add scaffolding for platforms.txt, add option to fuel-scaffold-vocab
parent
4f8a6a032c
commit
0142d46688
|
@ -267,6 +267,9 @@ PRIVATE>
|
|||
: scaffold-summary ( vocab summary -- )
|
||||
[ "summary.txt" ] dip scaffold-metadata ;
|
||||
|
||||
: scaffold-platforms ( vocab platforms -- )
|
||||
[ "platforms.txt" ] dip scaffold-metadata ;
|
||||
|
||||
: scaffold-vocab ( vocab-root string -- )
|
||||
{
|
||||
[ scaffold-directory ]
|
||||
|
|
|
@ -162,6 +162,10 @@ PRIVATE>
|
|||
[ scaffold-summary ]
|
||||
[ drop [ vocab-summary-path ] keep swap vocab-append-path absolute-path fuel-eval-set-result ] 2bi ;
|
||||
|
||||
: fuel-scaffold-platforms ( name platforms -- )
|
||||
[ scaffold-platforms ]
|
||||
[ drop [ vocab-platforms-path ] keep swap vocab-append-path absolute-path fuel-eval-set-result ] 2bi ;
|
||||
|
||||
: fuel-scaffold-get-root ( name -- ) find-vocab-root fuel-eval-set-result ;
|
||||
|
||||
! Remote connection
|
||||
|
|
|
@ -96,6 +96,10 @@ IN: %s
|
|||
(let ((cmd `(:fuel* (,vocab ,summary fuel-scaffold-summary) "fuel")))
|
||||
(fuel-eval--send/wait cmd)))
|
||||
|
||||
(defsubst fuel-scaffold--create-platforms (vocab platforms)
|
||||
(let ((cmd `(:fuel* (,vocab ,platforms fuel-scaffold-platforms) "fuel")))
|
||||
(fuel-eval--send/wait cmd)))
|
||||
|
||||
(defun fuel-scaffold--help (parent)
|
||||
(when (and parent (fuel-scaffold--check-auto fuel-scaffold-help-autoinsert-p))
|
||||
(let* ((ret (fuel-scaffold--create-docs (fuel-scaffold--vocab parent)))
|
||||
|
@ -131,6 +135,7 @@ You can configure `fuel-scaffold-developer-name' (set by default to
|
|||
nil t (or root-hint "resource:")))
|
||||
(summary (read-string "Vocab summary (empty for none): "))
|
||||
(tags (read-string "Vocab tags (empty for none): "))
|
||||
(platforms (read-string "Vocab platforms (empty for all): "))
|
||||
(help (y-or-n-p "Scaffold help? "))
|
||||
(tests (y-or-n-p "Scaffold tests? "))
|
||||
(cmd `(:fuel* ((,root ,name ,fuel-scaffold-developer-name)
|
||||
|
@ -143,6 +148,8 @@ You can configure `fuel-scaffold-developer-name' (set by default to
|
|||
(fuel-scaffold--create-summary name summary))
|
||||
(when (not (equal "" tags))
|
||||
(fuel-scaffold--create-tags name tags))
|
||||
(when (not (equal "" platforms))
|
||||
(fuel-scaffold--create-platforms name platforms))
|
||||
(when help
|
||||
(fuel-scaffold--create-docs name))
|
||||
(when tests
|
||||
|
@ -221,6 +228,18 @@ You can configure `fuel-scaffold-developer-name' (set by default to
|
|||
(error "Error creating summary file" (car (fuel-eval--retort-error ret))))
|
||||
(find-file file)))
|
||||
|
||||
(defun fuel-scaffold-platforms (&optional arg)
|
||||
"Creates, if it does not already exist, a platforms file for the current vocabulary."
|
||||
(interactive "P")
|
||||
(let* ((vocab (or (and (not arg ) (fuel-syntax--current-vocab))
|
||||
(fuel-completion--read-vocab nil)))
|
||||
(platforms (read-string "Platforms: "))
|
||||
(ret (fuel-scaffold--create-platforms vocab platforms))
|
||||
(file (fuel-eval--retort-result ret)))
|
||||
(unless file
|
||||
(error "Error creating platforms file" (car (fuel-eval--retort-error ret))))
|
||||
(find-file file)))
|
||||
|
||||
|
||||
(provide 'fuel-scaffold)
|
||||
;;; fuel-scaffold.el ends here
|
||||
|
|
Loading…
Reference in New Issue