Fix generating schema.org in offline mode
Makefile.am
30 | 30 | EXTRA_DIST += $(TESTS) | |
31 | 31 | ||
32 | 32 | schema.org/vocabulary.scm: schema.org/generate-vocabulary.scm | |
33 | - | ./env guile -c '(use-modules (schema.org generate-vocabulary)) (generate-schema "schema.org/vocabulary.scm" $(SCHEMA_ORG_VOCABULARY))' | |
33 | + | ./env guile -c '(use-modules (schema.org generate-vocabulary)) (generate-schema "schema.org/vocabulary.scm" "$(SCHEMA_ORG_FILE)")' |
schema.org/generate-vocabulary.scm
20 | 20 | #:use-module (jsonld) | |
21 | 21 | #:export (generate-schema)) | |
22 | 22 | ||
23 | - | (define* (generate-schema filename #:optional description-file) | |
24 | - | (define input (if description-file | |
25 | - | (json->scm description-file) | |
26 | - | "https://schema.org/version/8.0/schema.jsonld")) | |
23 | + | (define (generate-schema filename description-file) | |
24 | + | (define input (if (equal? description-file "") | |
25 | + | "https://schema.org/version/8.0/schema.jsonld" | |
26 | + | (call-with-input-file description-file json->scm))) | |
27 | 27 | (define definitions (assoc-ref (car (array->list (expand input))) "@graph")) | |
28 | 28 | ||
29 | 29 | (with-output-to-file filename |