]> gitweb.fluxo.info Git - templater.git/commitdiff
Adds http_server and git modules; update IDEAS
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 5 Jul 2023 21:58:03 +0000 (18:58 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 5 Jul 2023 21:58:03 +0000 (18:58 -0300)
IDEAS.md
share/templater/git/files/Makefile.git [new file with mode: 0644]
share/templater/git/setup
share/templater/http_server/description [new file with mode: 0644]
share/templater/http_server/files/Makefile.http_server [new file with mode: 0644]
share/templater/http_server/setup [new file with mode: 0755]
share/templater/sphinx/files/Makefile.sphinx
share/templater/templater/files/Makefile

index dd5e59e77dbd99a96375431828699e7f8704286b..d7a3843c1d50996cbafa32cdb1a42dbf5169aa40 100644 (file)
--- a/IDEAS.md
+++ b/IDEAS.md
@@ -1,5 +1,4 @@
-Ideas
-=====
+# Ideas
 
 * Bazaar:
   * README with basic info and HOWTO
@@ -23,6 +22,7 @@ Ideas
   * [Wrangling Web Contributions: How to Build a CONTRIBUTING.md](https://mozillascience.github.io/working-open-workshop/contributing/)
   * [Good-CONTRIBUTING.md-template.md · GitHub](https://gist.github.com/PurpleBooth/b24679402957c63ec426)
   * [vue/CONTRIBUTING.md at dev · vuejs/vue · GitHub](https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md)
+  * More Code of Conduct flavors
 * Modules:
   * Python
   * Flask
diff --git a/share/templater/git/files/Makefile.git b/share/templater/git/files/Makefile.git
new file mode 100644 (file)
index 0000000..026176b
--- /dev/null
@@ -0,0 +1,8 @@
+#
+# Makefile for Git-related tasks - https://templater.fluxo.info
+#
+
+# Configure a git post-receive hook
+post_receive:
+       git config receive.denyCurrentBranch ignore
+       test -s bin/post-receive && cd .git/hooks && ln -sf ../../bin/post-receive
index 952e6ef911a5a699dc715e00b1d6db1307b38c9c..a9b26a00b09a748ca579c538c4f54a9e1c3bb69b 100755 (executable)
@@ -18,6 +18,8 @@ function templater_git {
     templater_user_input GIT_USER  User             "-> Choose a git user name"
     templater_user_input GIT_EMAIL user@example.org "-> Choose a git email address"
 
+    templater_install_makefile $SHARE/git/files/Makefile.git
+
     git init
     git config user.name  "$GIT_USER"
     git config user.email "$GIT_EMAIL"
diff --git a/share/templater/http_server/description b/share/templater/http_server/description
new file mode 100644 (file)
index 0000000..836a709
--- /dev/null
@@ -0,0 +1 @@
+setup a simple HTTP server configuration
diff --git a/share/templater/http_server/files/Makefile.http_server b/share/templater/http_server/files/Makefile.http_server
new file mode 100644 (file)
index 0000000..c3d0ab3
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# HTTP Server Makefile - https://templater.fluxo.info
+#
+
+# Port to serve content
+HTTP_PORT="8000"
+HTTP_SERVER="http.server"
+
+# Base to serve the content
+HTTP_BASE="."
+
+# See http://unix.stackexchange.com/questions/32182/simple-command-line-http-server#32200
+#     http://php.net/manual/en/features.commandline.webserver.php
+serve:
+       @if [ "$(HTTP_SERVER)" = "SimpleHTTPServer" ]; then cd $(HTTP_BASE) && python -m SimpleHTTPServer $(HTTP_PORT);              fi
+       @if [ "$(HTTP_SERVER)" = "ssi_server"       ]; then cd $(HTTP_BASE) && PYTHONDONTWRITEBYTECODE=0 ssi_server.py $(HTTP_PORT); fi
+       @if [ "$(HTTP_SERVER)" = "http.server"      ]; then cd $(HTTP_BASE) && python3 -m http.server $(HTTP_PORT);                  fi
+       @if [ "$(HTTP_SERVER)" = "php"              ]; then cd $(HTTP_BASE) && php -S localhost:$(HTTP_PORT);                        fi
diff --git a/share/templater/http_server/setup b/share/templater/http_server/setup
new file mode 100755 (executable)
index 0000000..7983f73
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# HTTP Server templater module.
+#
+
+# Parameters
+SHARE="$1"
+
+# Include basic functions
+source $SHARE/templater/functions || exit 1
+
+# Sphinx implementation
+function templater_http_server {
+  if [ ! -e "Makefile.http_server" ]; then
+    templater_echo "Setting up a basic HTTP Server functionality..."
+
+    templater_install_makefile $SHARE/http_server/files/Makefile.http_server
+
+  else
+    templater_echo "HTTP Server functionality already set"
+  fi
+}
+
+# Dispatch
+templater_http_server
index 3369b20be0770ae79b16bdd006e3608eb41335c4..eeaf393f6248272f6adb0b7a8a3f919740a6bac5 100644 (file)
@@ -1,4 +1,5 @@
-# Makefile for Sphinx documentation
+#
+# Makefile for Sphinx documentation - https://templater.fluxo.info
 #
 
 # You can set these variables from the command line.
index 3a988d454e82afc08f9eef991c748194233e5f8a..4f0db17e8bc2e91d979ea221dac2683200dda324 100644 (file)
@@ -5,13 +5,6 @@
 # any Makefile.* available in the current folder.
 #
 
-# Port to serve content
-HTTP_PORT="8000"
-HTTP_SERVER="http.server"
-
-# Base to serve the content
-HTTP_BASE="."
-
 # Set CONTAINER based in what we have available in the system
 # This variable can be user in other, included Makefiles to handle virtualization tasks
 ifeq ($(shell which kvmx > /dev/null && test -s kvmxfile && echo yes), yes)
@@ -24,18 +17,8 @@ else
   CONTAINER = ''
 endif
 
-# See http://unix.stackexchange.com/questions/32182/simple-command-line-http-server#32200
-#     http://php.net/manual/en/features.commandline.webserver.php
-serve:
-       @if [ "$(HTTP_SERVER)" = "SimpleHTTPServer" ]; then cd $(HTTP_BASE) && python -m SimpleHTTPServer $(HTTP_PORT);              fi
-       @if [ "$(HTTP_SERVER)" = "ssi_server"       ]; then cd $(HTTP_BASE) && PYTHONDONTWRITEBYTECODE=0 ssi_server.py $(HTTP_PORT); fi
-       @if [ "$(HTTP_SERVER)" = "http.server"      ]; then cd $(HTTP_BASE) && python3 -m http.server $(HTTP_PORT);                  fi
-       @if [ "$(HTTP_SERVER)" = "php"              ]; then cd $(HTTP_BASE) && php -S localhost:$(HTTP_PORT);                        fi
-
-# Configure a git post-receive hook
-post_receive:
-       git config receive.denyCurrentBranch ignore
-       test -s bin/post-receive && cd .git/hooks && ln -sf ../../bin/post-receive
+# Default action
+default: all
 
 # Process any other Makefile whose filename matches Makefile.*
 # See https://www.gnu.org/software/make/manual/html_node/Include.html
@@ -45,6 +28,8 @@ post_receive:
 -include Makefile.*
 
 # Customization examples can be as simple as setting variables:
-#CONTAINER  = vagrant
-#CONTAINER  = docker
-#DESTDIR   ?= vendor
+#CONTAINER   = vagrant
+#CONTAINER   = docker
+#DESTDIR    ?= vendor
+#HTTP_PORT   ="8080"
+#HTTP_SERVER ="ssi_server"