Add scaffolding for platforms.txt, add option to fuel-scaffold-vocab
parent
4f8a6a032c
commit
0142d46688
|
@ -267,6 +267,9 @@ PRIVATE>
|
||||||
: scaffold-summary ( vocab summary -- )
|
: scaffold-summary ( vocab summary -- )
|
||||||
[ "summary.txt" ] dip scaffold-metadata ;
|
[ "summary.txt" ] dip scaffold-metadata ;
|
||||||
|
|
||||||
|
: scaffold-platforms ( vocab platforms -- )
|
||||||
|
[ "platforms.txt" ] dip scaffold-metadata ;
|
||||||
|
|
||||||
: scaffold-vocab ( vocab-root string -- )
|
: scaffold-vocab ( vocab-root string -- )
|
||||||
{
|
{
|
||||||
[ scaffold-directory ]
|
[ scaffold-directory ]
|
||||||
|
|
|
@ -162,6 +162,10 @@ PRIVATE>
|
||||||
[ scaffold-summary ]
|
[ scaffold-summary ]
|
||||||
[ drop [ vocab-summary-path ] keep swap vocab-append-path absolute-path fuel-eval-set-result ] 2bi ;
|
[ 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 ;
|
: fuel-scaffold-get-root ( name -- ) find-vocab-root fuel-eval-set-result ;
|
||||||
|
|
||||||
! Remote connection
|
! Remote connection
|
||||||
|
|
|
@ -96,6 +96,10 @@ IN: %s
|
||||||
(let ((cmd `(:fuel* (,vocab ,summary fuel-scaffold-summary) "fuel")))
|
(let ((cmd `(:fuel* (,vocab ,summary fuel-scaffold-summary) "fuel")))
|
||||||
(fuel-eval--send/wait cmd)))
|
(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)
|
(defun fuel-scaffold--help (parent)
|
||||||
(when (and parent (fuel-scaffold--check-auto fuel-scaffold-help-autoinsert-p))
|
(when (and parent (fuel-scaffold--check-auto fuel-scaffold-help-autoinsert-p))
|
||||||
(let* ((ret (fuel-scaffold--create-docs (fuel-scaffold--vocab parent)))
|
(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:")))
|
nil t (or root-hint "resource:")))
|
||||||
(summary (read-string "Vocab summary (empty for none): "))
|
(summary (read-string "Vocab summary (empty for none): "))
|
||||||
(tags (read-string "Vocab tags (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? "))
|
(help (y-or-n-p "Scaffold help? "))
|
||||||
(tests (y-or-n-p "Scaffold tests? "))
|
(tests (y-or-n-p "Scaffold tests? "))
|
||||||
(cmd `(:fuel* ((,root ,name ,fuel-scaffold-developer-name)
|
(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))
|
(fuel-scaffold--create-summary name summary))
|
||||||
(when (not (equal "" tags))
|
(when (not (equal "" tags))
|
||||||
(fuel-scaffold--create-tags name tags))
|
(fuel-scaffold--create-tags name tags))
|
||||||
|
(when (not (equal "" platforms))
|
||||||
|
(fuel-scaffold--create-platforms name platforms))
|
||||||
(when help
|
(when help
|
||||||
(fuel-scaffold--create-docs name))
|
(fuel-scaffold--create-docs name))
|
||||||
(when tests
|
(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))))
|
(error "Error creating summary file" (car (fuel-eval--retort-error ret))))
|
||||||
(find-file file)))
|
(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)
|
(provide 'fuel-scaffold)
|
||||||
;;; fuel-scaffold.el ends here
|
;;; fuel-scaffold.el ends here
|
||||||
|
|
Loading…
Reference in New Issue