From a88401dcbce6b4d6742eaec1033609c13f912a32 Mon Sep 17 00:00:00 2001 From: Marek Paśnikowski Date: Sat, 20 Jan 2024 11:21:31 +0100 Subject: Separate testing facility in a new file Pull out and expand the testing code into a dedicated file. Also, remove the requirement on 'ox-publish because this package is not yet used at all. --- www/build-site.el | 4 ---- www/www-test-data.el | 27 +++++++++++++++++++++++++++ www/www.org | 35 +++++++++++++++++++++++++++++++---- 3 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 www/www-test-data.el diff --git a/www/build-site.el b/www/build-site.el index e1c712e..3e88b9a 100644 --- a/www/build-site.el +++ b/www/build-site.el @@ -1,7 +1,5 @@ ;; -*- lexical-binding: t; -*- -( require 'ox-publish ) - ( defun publication-object ( ) ( let ( ( object-projects ( list ) ) ( org-publish-project-alist ( list ) ) @@ -39,5 +37,3 @@ ( funcall object-compose ) ( funcall object-report ) ( ) ) ) - -( publish :data-projects ( list "marekpasnikowski.pl" ) ) diff --git a/www/www-test-data.el b/www/www-test-data.el new file mode 100644 index 0000000..19705c7 --- /dev/null +++ b/www/www-test-data.el @@ -0,0 +1,27 @@ +;; -*- lexical-binding: t; -*- + +( load "~/src/channel/www/build-site" ) + +( print "publish-test-1" ) + +( publish :data-projects ( list "test.pl" "example.org" ) ) + +( print "publish-test-2" ) + +( publish + + :data-projects + ( list "test.pl" + + :property1 + "value1" + + :property2 + "value2" ) ) + +( print "publish-test-3" ) + +( publish "test.pl" + + :components + ( list "example.pl" "example.org" ) ) diff --git a/www/www.org b/www/www.org index 980f3e6..c51bf76 100644 --- a/www/www.org +++ b/www/www.org @@ -17,6 +17,37 @@ Publishing has been contributed to Org by David O’Toole. Publishing needs significant configuration to specify files, destination and many other properties of a project. +#+NAME: www-test-data +#+BEGIN_SRC elisp :tangle www-test-data.el + ;; -*- lexical-binding: t; -*- + + ( load "~/src/channel/www/build-site" ) + + ( print "publish-test-1" ) + + ( publish :data-projects ( list "test.pl" "example.org" ) ) + + ( print "publish-test-2" ) + + ( publish + + :data-projects + ( list "test.pl" + + :property1 + "value1" + + :property2 + "value2" ) ) + + ( print "publish-test-3" ) + + ( publish "test.pl" + + :components + ( list "example.pl" "example.org" ) ) +#+END_SRC + *** [[https://orgmode.org/manual/Project-alist.html][The variable =org-publish-project-alist=]] Publishing is configured almost entirely through setting the value of one @@ -45,8 +76,6 @@ are also published, in the sequence given. #+BEGIN_SRC elisp :tangle build-site.el ;; -*- lexical-binding: t; -*- - ( require 'ox-publish ) - ( defun publication-object ( ) ( let ( ( object-projects ( list ) ) ( org-publish-project-alist ( list ) ) @@ -84,8 +113,6 @@ are also published, in the sequence given. ( funcall object-compose ) ( funcall object-report ) ( ) ) ) - - ( publish :data-projects ( list "marekpasnikowski.pl" ) ) #+END_SRC * EOF -- cgit v1.2.3