Add static web output module skeleton.

This commit is contained in:
Dominik Pantůček 2023-04-01 17:24:28 +02:00
parent 71d8eab9d7
commit 34117b278d
2 changed files with 57 additions and 2 deletions

View file

@ -40,13 +40,15 @@ BBSTOOL-DEPS=bbstool.scm testing.import.scm listing.import.scm \
member-parser.import.scm members-print.import.scm \ member-parser.import.scm members-print.import.scm \
member-fees.import.scm members-dir.import.scm \ member-fees.import.scm members-dir.import.scm \
csv-simple.import.scm bank-account.import.scm \ csv-simple.import.scm bank-account.import.scm \
bank-fio.import.scm members-payments.import.scm bank-fio.import.scm members-payments.import.scm \
web-static.import.scm
BBSTOOL-OBJS=bbstool.o testing.o listing.o month.o period.o ansi.o \ BBSTOOL-OBJS=bbstool.o testing.o listing.o month.o period.o ansi.o \
dictionary.o command-line.o members-base.o utils.o primes.o \ dictionary.o command-line.o members-base.o utils.o primes.o \
member-record.o configuration.o progress.o table.o cards.o \ member-record.o configuration.o progress.o table.o cards.o \
members-print.o member-fees.o members-dir.o csv-simple.o \ members-print.o member-fees.o members-dir.o csv-simple.o \
bank-account.o bank-fio.o members-payments.o member-parser.o bank-account.o bank-fio.o members-payments.o member-parser.o \
web-static.o
.PHONY: imports .PHONY: imports
imports: $(BBSTOOL-DEPS) imports: $(BBSTOOL-DEPS)
@ -214,3 +216,9 @@ MEMBERS-PAYMENTS-SOURCES=members-payments.scm bank-account.import.scm \
members-payments.o: members-payments.import.scm members-payments.o: members-payments.import.scm
members-payments.import.scm: $(MEMBERS-PAYMENTS-SOURCES) members-payments.import.scm: $(MEMBERS-PAYMENTS-SOURCES)
WEB-STATIC-SOURCES=web-static.scm
web-static.o: web-static.import.scm
web-static.import.scm: $(WEB-STATIC-SOURCES)

47
src/web-static.scm Normal file
View file

@ -0,0 +1,47 @@
;;
;; web-static.scm
;;
;; Exporting members status for displaying in dokuwiki hack.
;;
;; ISC License
;;
;; Copyright 2023 Brmlab, z.s.
;; Dominik Pantůček <dominik.pantucek@trustica.cz>
;;
;; Permission to use, copy, modify, and/or distribute this software
;; for any purpose with or without fee is hereby granted, provided
;; that the above copyright notice and this permission notice appear
;; in all copies.
;;
;; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
;; WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
;; WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
;; AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
;; CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
;; OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
;; NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
;;
(declare (unit web-static))
(module
web-static-output
(
gen-web-static-member
)
(import scheme
(chicken format)
member-record)
;; Generate all the files in current directory, should be wrapped in
;; something like with-current-directory.
(define (gen-web-static-member mr)
(let ((nick (member-nick mr))
(id (member-id mr)))
(let ((nf (open-output-file (sprintf "~A.id" nick))))
(display id nf)
(newline nf))))
)