diff --git a/Makefile b/Makefile index 3f637cb..5499aed 100644 --- a/Makefile +++ b/Makefile @@ -126,9 +126,9 @@ uninstall: # Show targets ######################################################################## -.PHONY: help +.PHONY: list -help: +list: echo 'Usage: make TARGET [parameter=value...]' echo 'Targets:'; \ $(MAKE) --print-data-base --just-print 2>&1 \ @@ -138,10 +138,10 @@ help: | sed 's/:\+$$//' \ | pr --omit-pagination --indent=4 --width=80 --columns=4 echo 'Default parameters:'; \ - echo ' prefix = /usr/local'; \ - echo ' bindir = /usr/local/bin'; \ - echo ' datadir = /usr/local/share'; \ - echo ' mandir = /usr/local/share/man' + echo ' prefix = $(prefix)'; \ + echo ' bindir = $(bindir)'; \ + echo ' datadir = $(datadir)'; \ + echo ' mandir = $(mandir)' ######################################################################## # Generate help text diff --git a/bin/jqt b/bin/jqt index f2b50b0..156b0f7 100755 --- a/bin/jqt +++ b/bin/jqt @@ -497,7 +497,7 @@ function merge # Render template ######################################################################## -declare -a JQ_PATH=( '-L' "$DATADIR/jqt" ) +declare -a JQ_PATH=( '-L' "${DATADIR}/jqt" ) # < stdin > stdout function render @@ -544,7 +544,7 @@ Preprocessor options Data options Template options -C -L DIRECTORY -H -i MODULE -S - -j MODULE:NAME Information options + -j MODULE:NAME Information options Document options -h, --help -4, -5 -p -d FILE -V, --version @@ -709,6 +709,8 @@ while getopts :hVD:I:P:L:i:j:45d:weprt:m:M:T:CHS-: opt; do ;; version) echo "$SELF $VERSION"; exit 0 ;; + datadir) echo "${DATADIR}"; exit 0 + ;; # Pandoc options: base-header-level=*) PANDOC_OPTS[${#PANDOC_OPTS[@]}]="--$OPTARG";; bibliography=*) PANDOC_OPTS[${#PANDOC_OPTS[@]}]="--$OPTARG";; diff --git a/docs/Makefile b/docs/Makefile index 1afd8a3..d1c7580 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,158 +1,56 @@ ######################################################################## -# Makefile -# # Project: jqt # Author: jordinas@gmail.com # Description: Makefile for JQT web site management. # Published: https://fadado.github.io/jqt/ # -# Variables: -# $(Metadata) -# Rules: -# $(Metadata) directory target and clobber method +# Project specific makefile. All the imported modules are expected to be +# independent, valid for any project without any change. This should be +# the only makefile to edit by hand! # -######################################################################## - -######################################################################## -# Load _Make_ configuration. -######################################################################## - -include make.d/configuration.make - -# Do not try to rebuilt static makefiles. -Makefile make.d/configuration.make: ; - -######################################################################## -# Metadata directory for all generated make and metadata files. -######################################################################## - -Metadata ?= .meta - -$(Metadata): - $(info ==> $@) - mkdir --parents $@ >/dev/null 2>&1 || true - -# Delete all generated metadata -clobber:: ; @rm -rf $(Metadata) - -######################################################################## -# Print debug info. -######################################################################## - -ifneq (,$(TRACE)) -ifdef MAKE_RESTARTS -$(info Makefile phase restarted: $(MAKE_RESTARTS)) -endif -endif - -######################################################################## -# Check command line sanity. -######################################################################## - -# Target 'clobber' must be alone. -ifeq (clobber,$(filter clobber,$(MAKECMDGOALS))) -ifneq (1,$(words $(MAKECMDGOALS))) -$(error Target "clobber" must be alone) -endif -endif +# Variables used: +# Root +# +# Variables modified: +# JQTFLAGS -# Do not build to clobber immediately. -ifeq (clobber,$(MAKECMDGOALS)) -ifeq (,$(wildcard $(Metadata))) -$(error Nothing to clobber) -endif -endif +#Meta := .meta +#VERBOSE := 1 +#TRACE := 1 -# Do not build to clean immediately. -ifeq (clean,$(filter clean,$(MAKECMDGOALS))) -ifeq (,$(wildcard $(Metadata))) -$(error Nothing to clean) -endif -endif +include make.d/Makefile.make -# Check _root_ intentions. -ifeq (,$(filter install uninstall,$(MAKECMDGOALS))) -ifeq (0,$(shell id --user)) -$(error Root only can make "(un)install" targets) -endif -else -ifneq (0,$(shell id --user)) -$(error Only root can make "(un)install" targets) -endif -endif +# Last phase, after metadata configuration. +ifdef __build ######################################################################## -# Include all makefile phases. +# Build pages options. ######################################################################## -# Recursive variable used in all included makefiles. This works because the -# included files do not include other makefiles. - -THIS = $(lastword $(MAKEFILE_LIST)) +# Pandoc options +JQTFLAGS += -5 --toc-depth=4 ######################################################################## -# Derive metadata from `config.yaml` or `config.json`. - --include $(Metadata)/phase1.make - include make.d/phase1.make - -# Do not try to rebuilt static makefiles. -make.d/phase1.make: ; - -# If `__phase_1` is not defined because `phase1.make` does not exists, after -# this point the rest of the file is ignored, but `phase1.make` is built -# because a rule exists in the file `config.make`. Then this `Makefile` is -# restarted, `MAKE_RESTARTS` is be equal to 1, `phase1.make` is now loaded and -# `__phase_1` is defined. Equivalent situation happens in all phases. - -ifdef __phase_1 - +# HTML 5 validation. ######################################################################## -# Build metadata from filesystem introspection. --include $(Metadata)/phase2.make - include make.d/phase2.make +# Download vnu.jar from `https://github.com/validator/validator/releases`. -# Do not try to rebuilt static makefiles. -make.d/phase2.make: ; +.PHONY: h5.valid h5.lint -ifdef __phase_2 - -######################################################################## -# Define standard rules and rules for HTML pages and nodes. - --include $(Metadata)/phase3.make - include make.d/phase3.make - -# Do not try to rebuilt static makefiles. -make.d/phase3.make: ; - -ifdef __phase_3 - -######################################################################## -# Several complementary makefiles. - -include make.d/sitemap.make -include make.d/styles.make -##include make.d/tools.make - -# Do not try to rebuilt static makefiles. -make.d/sitemap.make: ; -make.d/styles.make: ; -##make.d/tools.make: ; - -######################################################################## -# Project specific makefile. All the previous modules are expected to be -# independent, valid for any project without any change. This file must -# exist but can be empty. +# Validation tool. +VNU := /usr/local/vnu/vnu.jar -include config.make +# Validation. +h5.valid: build + @xmlwf $(Root)/*.html + @java -jar $(VNU) --errors-only --format gnu $(Root)/*.html -# Do not try to rebuilt static makefiles. -config.make: ; +# Validation with warnings. +h5.lint: build + @xmlwf $(Root)/*.html + @java -jar $(VNU) --format text $(Root)/*.html -endif # __phase_3 -endif # __phase_2 -endif # __phase_1 +endif # __build # vim:ai:sw=8:ts=8:noet:fileencoding=utf8:syntax=make diff --git a/docs/README.md b/docs/README.md index a4f84d7..3ca6d66 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,31 +2,19 @@ ## Extension conventions for content files -The files in the `content` and `data` directories must follow some conventions in the file +The files in the `content` directory must follow some conventions in the file extensions: -* Web site pages - - `content/content.md` - - `content/data.md` - - `content/engine.md` - - `content/index.md` - - `content/structure.md` - -* Partial MarkDown to be included - - `content/EXAMPLE.text` - - `content/FLOW.text` - - `content/LINKS.text` - - `content/opt/\*.text` - -* Other unrelated MarkDown files - - `content/help.text` - - `content/jqt.1.text` - -* Extension conventions for data files - - `data/table.csv` - - `data/snippets.md` - - `data/document.json` - - `data/document.yaml` +* `*.md`: Web site pages. +* `*.text`: Partial MarkDown to be included and other unrelated MarkDown files. + +The files in the `data` directory must follow some conventions in the file +extensions: + +* `*.md`: MarkDown snippets in front-matter. +* `*.csv`: CSV data files. +* `*.json`: JSON documents. +* `*.yaml`: YAML documents. # Variables @@ -41,13 +29,14 @@ predefined variables: * `.site.Blocks` * `.site.Content` * `.site.Data` -* `.site.Destination` +* `.site.Root` * `.site.Layouts` -* `.site.Metadata` +* `.site.Meta` * `.site.Styles` In the configuration file you can assign new values to all predefined variables -except `Metadata`, with hardcoded value in the file `Makefile`. +except `Meta`, with default value defined in the file `make.d/Makefile.make`. +You can modify this variable at the very beggining of your `Makefile`. ## Page variables @@ -76,7 +65,7 @@ Front-matter members and the predefined variables. ``` Slug - |---^---| + |---^---| content/name.html |-^| Id @@ -96,6 +85,17 @@ content/extras/indexes/name.html Path ``` +# _Sake_: static site build automation system + +## Current _GMake_ commands + +``` +Usage: make TARGET [parameter=value...] +Targets: + build clobber h5.lint list + clean configure h5.valid touch +``` + diff --git a/docs/config.make b/docs/config.make deleted file mode 100644 index 8f01314..0000000 --- a/docs/config.make +++ /dev/null @@ -1,44 +0,0 @@ -######################################################################## -# -# Specific makefile for this web site. -# This should be the only makefile to edit by hand! -# -# Variables imported: -# Metadata -# Destination -# -# Variables modified: -# JQTFLAGS - -######################################################################## -# Build pages options. -######################################################################## - -# Pandoc options -JQTFLAGS += -5 --toc-depth=4 - -# Extra dependencies -#?$(DestinationPages): $(Blocks)/filters.jq $(Blocks)/*/*.html $(Blocks)/*/*/*.html - -######################################################################## -# HTML 5 validation. -######################################################################## - -# Download vnu.jar from `https://github.com/validator/validator/releases`. - -.PHONY: valid lint - -# Validation tool. -VNU := /usr/local/vnu/vnu.jar - -# Validation. -valid: all - @xmlwf $(Destination)/*.html - @java -jar $(VNU) --errors-only --format gnu $(Destination)/*.html - -# Validation with warnings. -lint: all - @xmlwf $(Destination)/*.html - @java -jar $(VNU) --format text $(Destination)/*.html - -# vim:ai:sw=8:ts=8:noet:fileencoding=utf8:syntax=make diff --git a/docs/config.yaml b/docs/config.yaml index 88dce49..af0da03 100644 --- a/docs/config.yaml +++ b/docs/config.yaml @@ -14,12 +14,12 @@ # Blocks blocks # Content content # Data data -# Destination _site +# Root _site # Layouts layouts # Styles styles # Changes from defaults (fast RAM disk) -Destination: /tmp/jqt +Root: /tmp/jqt # # Site parameters @@ -51,6 +51,7 @@ defaults: title-prefix: jqt author: *author lang: *lang + Layout: page-toc Datasets: - snippets Dependencies: @@ -58,7 +59,10 @@ defaults: - content/macros.m - content/LINKS.txt # Flags: -# - -mXYZ:$(Metadata)/XYZ.json +# - -mXYZ:$(Meta)/XYZ.json + - idprefix: "blog/" + properties: + Layout: page # vim:ts=2:sw=2:ai:et:fileencoding=utf8:syntax=yaml ... diff --git a/docs/content/blog/2017-04-13-hello.md b/docs/content/blog/2017-04-13-hello.md index 2e4716a..bfc0d23 100644 --- a/docs/content/blog/2017-04-13-hello.md +++ b/docs/content/blog/2017-04-13-hello.md @@ -7,7 +7,6 @@ description: | keywords: blog, post, jqt, jq, pandoc published: "2017-04-13T06:45:07Z" updated: "2017-04-13T06:45:07Z" -Layout: page --- <%include content/LINKS.txt>& diff --git a/docs/make.d/Makefile.make b/docs/make.d/Makefile.make new file mode 100644 index 0000000..c4d0e6e --- /dev/null +++ b/docs/make.d/Makefile.make @@ -0,0 +1,136 @@ +######################################################################## +# Makefile.make -- Main makefile. +# +# Variables: +# $(Meta) +# Rules: +# $(Meta) directory target and clobber target +# +######################################################################## + +# Where all *.make files resides... +MDIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))) + +######################################################################## +# Load _Make_ configuration. +######################################################################## + +include $(MDIR)/configuration.make + +# Do not try to rebuilt static makefiles. +$(MDIR)/Makefile.make $(MDIR)/configuration.make: ; + +######################################################################## +# Metadata directory for all generated make and metadata files. +######################################################################## + +Meta ?= .meta + +$(Meta): + $(info ==> $@) + mkdir --parents $@ >/dev/null 2>&1 || true + +# Delete all generated metadata +clobber:: ; @rm -rf $(Meta) + +######################################################################## +# Print debug info. +######################################################################## + +ifneq (,$(TRACE)) +ifdef MAKE_RESTARTS +$(info Makefile phase restarted: $(MAKE_RESTARTS)) +endif +endif + +######################################################################## +# Check command line sanity. +######################################################################## + +# Target 'clobber' must be alone. +ifeq (clobber,$(filter clobber,$(MAKECMDGOALS))) +ifneq (1,$(words $(MAKECMDGOALS))) +$(error Target "clobber" must be alone) +endif +endif + +# Do not build to clobber immediately. +ifeq (clobber,$(MAKECMDGOALS)) +ifeq (,$(wildcard $(Meta))) +$(error Nothing to clobber) +endif +endif + +## Do not build to clean immediately. +#ifeq (clean,$(filter clean,$(MAKECMDGOALS))) +#ifeq (,$(wildcard $(Meta))) +#$(error Nothing to clean) +#endif +#endif + +######################################################################## +# Include all makefile phases. +######################################################################## + +# Recursive variable used in all included makefiles. This works because the +# included files do not include other makefiles. + +THIS = $(lastword $(MAKEFILE_LIST)) + +######################################################################## +# Derive metadata from `config.yaml` or `config.json`. + +-include $(Meta)/phase1.make + include $(MDIR)/phase1.make + +# Do not try to rebuilt static makefiles. +$(MDIR)/phase1.make: ; + +# If `__phase_1` is not defined because `phase1.make` does not exists, after +# this point the rest of the file is ignored, but `phase1.make` is built +# because a rule exists in the file `config.make`. Then this `Makefile` is +# restarted, `MAKE_RESTARTS` is be equal to 1, `phase1.make` is now loaded and +# `__phase_1` is defined. Equivalent situation happens in all phases. + +ifdef __phase_1 + +######################################################################## +# Build metadata from filesystem introspection. + +-include $(Meta)/phase2.make + include $(MDIR)/phase2.make + +# Do not try to rebuilt static makefiles. +$(MDIR)/phase2.make: ; + +ifdef __phase_2 + +######################################################################## +# Define standard rules and rules for HTML pages and nodes. + +-include $(Meta)/phase3.make + include $(MDIR)/phase3.make + +# Do not try to rebuilt static makefiles. +$(MDIR)/phase3.make: ; + +ifdef __phase_3 +__build := 1 + +######################################################################## +# Several complementary makefiles. + +include $(MDIR)/sitemap.make +include $(MDIR)/styles.make +include $(MDIR)/tools.make + +# Do not try to rebuilt static makefiles. +$(MDIR)/sitemap.make: ; +$(MDIR)/styles.make: ; +$(MDIR)/tools.make: ; + +endif # __phase_3 +endif # __phase_2 +endif # __phase_1 + +# vim:ai:sw=8:ts=8:noet:fileencoding=utf8:syntax=make diff --git a/docs/make.d/configuration.make b/docs/make.d/configuration.make index d5f78a1..9915a81 100644 --- a/docs/make.d/configuration.make +++ b/docs/make.d/configuration.make @@ -20,7 +20,7 @@ $(error GNU Make version $(MAKE_VERSION); version >= 3.82 is needed) endif # Only one target at the same time. -MAKECMDGOALS ?= all +MAKECMDGOALS ?= build ######################################################################## # Make configuration. @@ -42,8 +42,8 @@ $(VERBOSE).SILENT: # Sets the default goal to be used if no targets were specified on the # command line. -.PHONY: all -.DEFAULT_GOAL := all +.PHONY: build +.DEFAULT_GOAL := build # Default shell: if we require GNU Make, why not require Bash? SHELL := /bin/bash diff --git a/docs/make.d/phase1.jq b/docs/make.d/phase1.jq index 1f78415..745efed 100644 --- a/docs/make.d/phase1.jq +++ b/docs/make.d/phase1.jq @@ -1,9 +1,9 @@ ######################################################################## -# phase1.jq -- Define contents for `$(Metadata)/phase2.make`. +# phase1.jq -- Define contents for `$(Meta)/phase2.make`. # # jq -r -f phase1.jq -# < $(Metadata)/site.json -# > $(Metadata)/phase1.make +# < $(Meta)/site.json +# > $(Meta)/phase1.make # # Output makefile @@ -13,7 +13,7 @@ "Blocks := " + .Blocks, "Content := " + .Content, "Data := " + .Data, -"Destination := " + .Destination, +"Root := " + .Root, "Layouts := " + .Layouts, "Styles := " + .Styles, "\n# \u0076im:syntax=make" diff --git a/docs/make.d/phase1.make b/docs/make.d/phase1.make index b79b2b4..1ec270e 100644 --- a/docs/make.d/phase1.make +++ b/docs/make.d/phase1.make @@ -1,44 +1,44 @@ ######################################################################## # phase1.make -- Rules for files derived from user defined configuration. # -# Variables defined in $(Metadata)/phase1.make: +# Variables defined in $(Meta)/phase1.make: # __phase_1 # Assets # Blocks # Content # Data -# Destination +# Root # Layouts # Styles # -# Rules defined in make.d/phase1.make: -# $(Metadata)/config.json -# $(Metadata)/site.json -# $(Metadata)/phase1.make -# $(Destination) directory rule and clobber and clean targets +# Rules defined in $(MDIR)/phase1.make: +# $(Meta)/config.json +# $(Meta)/site.json +# $(Meta)/phase1.make +# $(Root) directory rule and clobber and clean targets -SUPER := Makefile +SUPER := $(MDIR)/Makefile.make ######################################################################## # Files derived from user defined configuration file. ######################################################################## # -# Create `$(Metadata)/config.json` from `config.yaml` or `config.json`. +# Create `$(Meta)/config.json` from `config.yaml` or `config.json`. # ifeq (config.yaml,$(wildcard config.yaml)) -# Convert `config.yaml` to `$(Metadata)/config.json`. -$(Metadata)/config.json: config.yaml $(SUPER) $(THIS) \ -| $(Metadata) +# Convert `config.yaml` to `$(Meta)/config.json`. +$(Meta)/config.json: $(CURDIR)/config.yaml $(SUPER) $(THIS) \ +| $(Meta) $(info ==> $@) yaml2json < $< > $@ else ifeq (config.json,$(wildcard config.json)) -# Convert `config.json` to `$(Metadata)/config.json`. -$(Metadata)/config.json: config.json $(SUPER) $(THIS) \ -| $(Metadata) +# Convert `config.json` to `$(Meta)/config.json`. +$(Meta)/config.json: $(CURDIR)/onfig.json $(SUPER) $(THIS) \ +| $(Meta) $(info ==> $@) jqt -Pjson < $< > $@ @@ -47,24 +47,24 @@ $(error Configuration file not found) endif # -# Create `$(Metadata)/site.json` from `$(Metadata)/config.json` using -# `make.d/phase1_site.jq`. +# Create `$(Meta)/site.json` from `$(Meta)/config.json` using +# `$(MDIR)/phase1_site.jq`. # -$(Metadata)/site.json: $(Metadata)/config.json make.d/phase1_site.jq +$(Meta)/site.json: $(Meta)/config.json $(MDIR)/phase1_site.jq $(info ==> $@) jq --sort-keys \ - --from-file make.d/phase1_site.jq \ - --arg Metadata $(Metadata) \ + --from-file $(MDIR)/phase1_site.jq \ + --arg Meta $(Meta) \ < $< > $@ # -# Create `$(Metadata)/phase1.make` from `$(Metadata)/site.json` using -# `make.d/phase1.jq`. +# Create `$(Meta)/phase1.make` from `$(Meta)/site.json` using +# `$(MDIR)/phase1.jq`. # -$(Metadata)/phase1.make: $(Metadata)/site.json make.d/phase1.jq +$(Meta)/phase1.make: $(Meta)/site.json $(MDIR)/phase1.jq $(info ==> $@) jq --raw-output \ - --from-file make.d/phase1.jq \ + --from-file $(MDIR)/phase1.jq \ < $< > $@ ifdef __phase_1 @@ -73,15 +73,15 @@ ifdef __phase_1 # Site destination directory. ######################################################################## -$(Destination): +$(Root): $(info ==> $@) mkdir --parents $@ >/dev/null 2>&1 || true # Delete generated files. -clean: ; @rm -rf $(Destination)/* +clean: ; @rm -rf $(Root)/* # Delete destination directory. -clobber:: ; @rm -rf $(Destination) +clobber:: ; @rm -rf $(Root) endif # __phase_1 diff --git a/docs/make.d/phase1_site.jq b/docs/make.d/phase1_site.jq index 12e9f45..3805261 100644 --- a/docs/make.d/phase1_site.jq +++ b/docs/make.d/phase1_site.jq @@ -1,23 +1,23 @@ ######################################################################## # phase1_site.jq -- Define global members using default values. # -# jq -S -f phase1_site.jq --arg Metadata $(Metadata) -# < $(Metadata)/config.json -# > $(Metadata)/site.json +# jq -S -f phase1_site.jq --arg Meta $(Meta) +# < $(Meta)/config.json +# > $(Meta)/site.json # Delete `.defaults` and add some new members with default value if not defined # in the configuration file. # del(.defaults) + { - Metadata: $Metadata, - Assets: (.Assets // "assets"), - Blocks: (.Blocks // "blocks"), - Content: (.Content // "content"), - Data: (.Data // "data"), - Destination: (.Destination // "_site"), - Layouts: (.Layouts // "layouts"), - Styles: (.Styles // "styles") + Meta: $Meta, + Assets: (.Assets // "assets"), + Blocks: (.Blocks // "blocks"), + Content: (.Content // "content"), + Data: (.Data // "data"), + Root: (.Root // "_site"), + Layouts: (.Layouts // "layouts"), + Styles: (.Styles // "styles") } # vim:ts=4:sw=4:ai:et:fileencoding=utf8:syntax=jq diff --git a/docs/make.d/phase2.jq b/docs/make.d/phase2.jq index be6d669..acad979 100644 --- a/docs/make.d/phase2.jq +++ b/docs/make.d/phase2.jq @@ -1,14 +1,14 @@ ######################################################################## -# phase2.jq -- Define contents for `$(Metadata)/phase2.make`. +# phase2.jq -- Define contents for `$(Meta)/phase2.make`. # # find $(Content) all MarkDown files | # jq -s -Rr -f phase2.jq # --arg DF "$$(find $(Data) -name '*.*')" # --arg Content $(Content) # --arg Data $(Data) -# --arg Destination $(Destination) -# --arg Metadata $(Metadata) -# > $(Metadata)/phase2.make +# --arg Root $(Root) +# --arg Meta $(Meta) +# > $(Meta)/phase2.make # Extract pathname directory. def dir: @@ -20,7 +20,7 @@ def dir: # destination_paths := _site/jqt/ _site/jqt/blog/ ... def destination_paths($paths): def dpath: - sub("^" + $Content; $Destination) + sub("^" + $Content; $Root) ; "destination_paths := " + ([$paths[] | dpath] | join(" ")) + "\n" ; @@ -28,7 +28,7 @@ def destination_paths($paths): # metadata_paths := .meta/pages/ .meta/pages/blog/ ... def metadata_paths($paths): def mpath: - sub("^" + $Content; $Metadata + "/pages") + sub("^" + $Content; $Meta + "/pages") ; "metadata_paths := " + ([$paths[] | mpath] | join(" ")) + "\n" ; @@ -40,7 +40,7 @@ def metadata_paths($paths): def data_files($files): def d2m($x): sub("\\."+$x+"$"; ".json") - | sub("^"+$Data; $Metadata) + | sub("^"+$Data; $Meta) ; ($files / "\n") as $names | [$names[] | select(test(".md$"))] as $data_md @@ -60,7 +60,7 @@ def data_files($files): # PagesHTML := _site/jqt/content.html _site/jqt/blog/2017-04-13-hello.html ... def pages_html($documents): def dpage: - sub("^" + $Content; $Destination) + sub("^" + $Content; $Root) | sub("\\.(?:markdown|mk?d)$"; ".html") ; "PagesHTML := " + ([$documents[] | dpage] | join(" ")) + "\n" @@ -68,7 +68,7 @@ def pages_html($documents): # PagesJSON := .meta/pages/content.json .meta/pages/blog/2017-04-13-hello.json ... def md2json: - sub("^" + $Content; $Metadata + "/pages") + sub("^" + $Content; $Meta + "/pages") | sub("\\.(?:markdown|mk?d)$"; ".json") ; diff --git a/docs/make.d/phase2.make b/docs/make.d/phase2.make index bd383b1..512cbb1 100644 --- a/docs/make.d/phase2.make +++ b/docs/make.d/phase2.make @@ -1,7 +1,7 @@ ######################################################################## # phase2.make -- Build metadata from filesystem introspection. # -# Variables defined in $(Metadata)/phase2.make: +# Variables defined in $(Meta)/phase2.make: # __phase_2 # data_csv # data_json @@ -12,32 +12,32 @@ # PagesHTML # PagesJSON # -# Rules defined in $(Metadata)/phase2.make: +# Rules defined in $(Meta)/phase2.make: # metadata JSON files for each HTML page # -# Variables defined in make.d/phase2.make: +# Variables defined in $(MDIR)/phase2.make: # DataFiles # -# Rules defined in make.d/phase2.make: +# Rules defined in $(MDIR)/phase2.make: # $(data_csv) # $(data_json) # $(data_md) # $(data_yaml) # $(destination_paths) # $(metadata_paths) -# $(Metadata)/content.text -# $(Metadata)/data.text -# $(Metadata)/phase2.make -# $(Metadata)/pages-by-id.json +# $(Meta)/content.text +# $(Meta)/data.text +# $(Meta)/phase2.make +# $(Meta)/pages-by-id.json -SUPER := $(Metadata)/phase1.make +SUPER := $(Meta)/phase1.make ######################################################################## # Create makefile defining global variables about pathnames and rules to # generate JSON metadata files for each page. ######################################################################## -$(Metadata)/content.text: $(THIS) +$(Meta)/content.text: $(THIS) $(info ==> $@) find $(Content) -type f -a \ -name '[!_]*.md' -o \ @@ -45,32 +45,32 @@ $(Metadata)/content.text: $(THIS) -name '[!_]*.markdown' \ > $@ -$(Metadata)/data.text: $(THIS) +$(Meta)/data.text: $(THIS) $(info ==> $@) find $(Data) -name '*.*' > $@ # -# Create `$(Metadata)/phase2.make` from `find` output using `make.d/phase2.jq`. +# Create `$(Meta)/phase2.make` from `find` output using `$(MDIR)/phase2.jq`. # -$(Metadata)/phase2.make: CONTENT := $(Metadata)/content.text -$(Metadata)/phase2.make: DATA := $(Metadata)/data.text -$(Metadata)/phase2.make: make.d/phase2.jq $(Metadata)/content.text $(Metadata)/data.text $(SUPER) $(THIS) +$(Meta)/phase2.make: CONTENT := $(Meta)/content.text +$(Meta)/phase2.make: DATA := $(Meta)/data.text +$(Meta)/phase2.make: $(MDIR)/phase2.jq $(Meta)/content.text $(Meta)/data.text $(SUPER) $(THIS) $(info ==> $@) - jq --raw-input \ - --raw-output \ - --slurp \ - --from-file make.d/phase2.jq \ - --arg DF "$$(<$(DATA))" \ - --arg Content $(Content) \ - --arg Data $(Data) \ - --arg Destination $(Destination) \ - --arg Metadata $(Metadata) \ + jq --raw-input \ + --raw-output \ + --slurp \ + --from-file $(MDIR)/phase2.jq \ + --arg DF "$$(<$(DATA))" \ + --arg Content $(Content) \ + --arg Data $(Data) \ + --arg Root $(Root) \ + --arg Meta $(Meta) \ < $(CONTENT) > $@ ifdef __phase_2 # -# Variables used when building JSON files in `$(Metadata)/phase2.make`. +# Variables used when building JSON files in `$(Meta)/phase2.make`. # define EXTRACT_FRONT_MATTER = @@ -86,19 +86,19 @@ define BUILD_PAGE_JSON jq --sort-keys \ --arg Source $< \ --arg Target $@ \ - --arg Metadata $(Metadata) \ - --slurpfile config $(Metadata)/config.json \ - --from-file make.d/phase2_page.jq + --arg Meta $(Meta) \ + --slurpfile config $(Meta)/config.json \ + --from-file $(MDIR)/phase2_page.jq endef # # Extra prerequisites for JSON metadata pages. # -$(PagesJSON): $(Metadata)/config.json make.d/phase2_page.jq $(THIS) \ +$(PagesJSON): $(Meta)/config.json $(MDIR)/phase2_page.jq $(THIS) \ | $$(dir $$@) -# Content example for `$(Metadata)/phase2.make`: +# Content example for `$(Meta)/phase2.make`: # __phase_2 := 1 # destination_paths := _site/jqt/ _site/jqt/blog/ @@ -124,12 +124,12 @@ $(PagesJSON): $(Metadata)/config.json make.d/phase2_page.jq $(THIS) \ # Rules for directories. ######################################################################## -# Directories starting at `$(Destination)/`. +# Directories starting at `$(Root)/`. $(destination_paths): $(info ==> $@) mkdir --parents $@ >/dev/null 2>&1 || true -# Directories starting at `$(Metadata)/pages/`. +# Directories starting at `$(Meta)/pages/`. $(metadata_paths): $(info ==> $@) mkdir --parents $@ >/dev/null 2>&1 || true @@ -140,13 +140,13 @@ $(metadata_paths): # Bundle all pages as a relation (Id => page) # TODO: use xargs? write $^ to a temp file with file()? -$(Metadata)/pages-by-id.json: $(PagesJSON) +$(Meta)/pages-by-id.json: $(PagesJSON) $(info ==> $@) cat $^ \ | jq -n 'reduce inputs as $$p ({}; . + {($$p.Id):$$p})' \ > $@ -#$(Metadata)/pages-by-id.json: $(PagesJSON) +#$(Meta)/pages-by-id.json: $(PagesJSON) # $(info ==> $@) # @jq --slurp 'reduce .[] as $$p ({}; . + {($$p.Id): $$p})' $^ > $@ @@ -157,32 +157,32 @@ $(Metadata)/pages-by-id.json: $(PagesJSON) DataFiles := ifneq (,$(data_md)) -$(data_md): $(Metadata)/%.json : $(Data)/%.md \ -| $(Metadata) +$(data_md): $(Meta)/%.json : $(Data)/%.md \ +| $(Meta) $(info ==> $@) jqt -T < $< | yaml2json > $@ DataFiles += $(data_md) endif ifneq (,$(data_yaml)) -$(data_yaml): $(Metadata)/%.json : $(Data)/%.yaml \ -| $(Metadata) +$(data_yaml): $(Meta)/%.json : $(Data)/%.yaml \ +| $(Meta) $(info ==> $@) yaml2json > $@ DataFiles += $(data_yaml) endif ifneq (,$(data_json)) -$(data_json): $(Metadata)/%.json : $(Data)/%.json \ -| $(Metadata) +$(data_json): $(Meta)/%.json : $(Data)/%.json \ +| $(Meta) $(info ==> $@) jqt -P json < $< > $@ DataFiles += $(data_json) endif ifneq (,$(data_csv)) -$(data_csv): $(Metadata)/%.json : $(Data)/%.csv \ -| $(Metadata) +$(data_csv): $(Meta)/%.json : $(Data)/%.csv \ +| $(Meta) $(info ==> $@) csv2json < $< > $@ DataFiles += $(data_csv) diff --git a/docs/make.d/phase2_page.jq b/docs/make.d/phase2_page.jq index f1c2b5e..47d8bc6 100644 --- a/docs/make.d/phase2_page.jq +++ b/docs/make.d/phase2_page.jq @@ -4,10 +4,10 @@ # input is page front-matter converted to JSON | # jq -S -f phase2_page.jq # --arg Source $(Content)/.../PAGE.md -# --arg Target $(Metadata)/pages/.../PAGE.json -# --arg Metadata $(Metadata) -# --slurpfile config $(Metadata)/config.json -# > $(Metadata)/pages/.../PAGE.json +# --arg Target $(Meta)/pages/.../PAGE.json +# --arg Meta $(Meta) +# --slurpfile config $(Meta)/config.json +# > $(Meta)/pages/.../PAGE.json # Pathname functions def basename: @@ -24,31 +24,31 @@ def notdir: sub("^.*/"; "") ; -# `$(Metadata)/pages/path/to/page.json` => `(../)+` +# `$(Meta)/pages/path/to/page.json` => `(../)+` def page_base: # . as $target ("../" * (((. / "/") | length) - 3)) // "" ; -# `$(Metadata)/pages/path/to/page.json` => `path/to/page` +# `$(Meta)/pages/path/to/page.json` => `path/to/page` def page_id: # . as $target - basename | sub($Metadata+"/pages/"; "") + basename | sub($Meta+"/pages/"; "") ; -# `$(Metadata)/pages/path/to/page.json` => `page` +# `$(Meta)/pages/path/to/page.json` => `page` def page_filename: # . as $target notdir | basename ; -# `$(Metadata)/pages/path/to/page.json` => `path/to/` +# `$(Meta)/pages/path/to/page.json` => `path/to/` def page_path: # . as $obj .Id | dir ; -# `$(Metadata)/pages/path/to/page.json` => `path/to` +# `$(Meta)/pages/path/to/page.json` => `path/to` def page_section: #. as $obj if $Target | test("(? `page.html` +# `$(Meta)/pages/path/to/page.json` => `page.html` def page_slug: # . as $obj .Filename + ".html" ; -# `$(Metadata)/pages/path/to/page.json` => `path/to/page.html` +# `$(Meta)/pages/path/to/page.json` => `path/to/page.html` def page_url: # . as $obj .Path + .Slug diff --git a/docs/make.d/phase3.jq b/docs/make.d/phase3.jq index 7514fb4..2c22482 100644 --- a/docs/make.d/phase3.jq +++ b/docs/make.d/phase3.jq @@ -1,12 +1,12 @@ ######################################################################## -# phase3.jq -- Define contents for `$(Metadata)/phase3.make`. +# phase3.jq -- Define contents for `$(Meta)/phase3.make`. # # jq -r -f phase3.jq -# --arg Metadata $(Metadata) +# --arg Meta $(Meta) # --arg Layouts $(Layouts) -# --arg Destination $(Destination) -# < $(Metadata)/pages-by-id.json -# > $(Metadata)/phase3.make +# --arg Root $(Root) +# < $(Meta)/pages-by-id.json +# > $(Meta)/phase3.make def dependencies: if .Dependencies @@ -16,7 +16,7 @@ def dependencies: def dataset: if .Datasets - then " " + (.Datasets | map("-m\(.):\($Metadata)/\(.).json") | join(" ")) + then " " + (.Datasets | map("-m\(.):\($Meta)/\(.).json") | join(" ")) else "" end ; @@ -27,7 +27,7 @@ def flags: ; def page: - " -mpage:\($Metadata)/pages/\(.Id).json" + " -mpage:\($Meta)/pages/\(.Id).json" ; def layout: @@ -42,7 +42,7 @@ def layout: # $(info ==> $@) # @$(JQT) -d $< -mpage:.meta/pages/blog/2017-04-13-hello.json layouts/page.html | $(DETAILS) > $@ def page_rule: - $Destination+"/"+.URL+": " + .Source + layout + dependencies, + $Root+"/"+.URL+": " + .Source + layout + dependencies, "\t$(info ==> $@)", "\t@$(JQT) -d $<" + dataset + flags + page + layout + " | $(DETAILS) > $@" ; diff --git a/docs/make.d/phase3.make b/docs/make.d/phase3.make index 11d36b5..08c7c80 100644 --- a/docs/make.d/phase3.make +++ b/docs/make.d/phase3.make @@ -1,47 +1,45 @@ ######################################################################## # phase3.make -- Define standard rules and rules for HTML pages and nodes. # -# Rules defined in $(Metadata)/phase3.make: +# Rules defined in $(Meta)/phase3.make: # all HTML target files # -# Rules defined in make.d/phase3.make: -# $(Metadata)/phase3.make +# Rules defined in $(MDIR)/phase3.make: +# $(Meta)/phase3.make # -# Targets defined in make.d/phase3.make: -# all -# build +# Targets defined in $(MDIR)/phase3.make: +# build # clean # clobber -# dbg.meta -# dbg.fresh -# dbg.touch +# configure +# touch -SUPER := $(Metadata)/phase2.make +SUPER := $(Meta)/phase2.make ######################################################################## # Create makefile containing rules for all HTML files. ######################################################################## # Build rules for each page. -$(Metadata)/phase3.make: $(Metadata)/pages-by-id.json make.d/phase3.jq $(SUPER) $(THIS) +$(Meta)/phase3.make: $(Meta)/pages-by-id.json $(MDIR)/phase3.jq $(SUPER) $(THIS) $(info ==> $@) - jq --raw-output \ - --arg Metadata $(Metadata) \ - --arg Layouts $(Layouts) \ - --arg Destination $(Destination) \ - --from-file make.d/phase3.jq \ + jq --raw-output \ + --arg Meta $(Meta) \ + --arg Layouts $(Layouts) \ + --arg Root $(Root) \ + --from-file $(MDIR)/phase3.jq \ < $< > $@ ifdef __phase_3 # -# Variables used in `$(Metadata)/phase3.make`. +# Variables used in `$(Meta)/phase3.make`. # define JQTFLAGS := - -msite:$(Metadata)/site.json \ + -msite:$(Meta)/site.json \ -I./ \ - -L$(Metadata) \ + -L$(Meta) \ -L$(Blocks) \ -ifilters endef @@ -59,14 +57,14 @@ endef # Extra prerequisites for HTML pages. # -$(PagesHTML): $(Destination)/%.html : $(Metadata)/pages/%.json -$(PagesHTML): $(Metadata)/phase3.make $(Blocks)/*/markup.html $(Blocks)/*/*/markup.html \ +$(PagesHTML): $(Root)/%.html : $(Meta)/pages/%.json +$(PagesHTML): $(Meta)/phase3.make $(Blocks)/*/markup.html $(Blocks)/*/*/markup.html \ | $$(dir $$@) ifneq (,$(DataFiles)) $(PagesHTML): $(DataFiles) endif -# Content example for `$(Metadata)/phase3.make`: +# Content example for `$(Meta)/phase3.make`: # __phase_3 := 1 # _site/jqt/index.html: content/index.md layouts/page.html content/macros.m content/LINKS.txt content/EXAMPLE.txt @@ -84,23 +82,20 @@ endif # Standard targets. ######################################################################## -.PHONY: clean clobber build +.PHONY: clean clobber # Copy Assets after create HTML pages. -all:: $(PagesHTML) - @cp --verbose --recursive --update $(Assets)/* $(Destination) \ +build:: $(PagesHTML) + @cp --verbose --recursive --update $(Assets)/* $(Root) \ | sed "s/^.*-> ./==> /;s/.$$//" # Delete secondary files. clobber:: ; @rm -rf *~ *.bak *.log -# Build again all documents. -build: clean all - ######################################################################## # Debug variations on the `build` target. -.PHONY: dbg.meta dbg.touch dbg.fresh +.PHONY: configure touch # Touch top file define TEST_AND_TOUCH.sh @@ -113,22 +108,18 @@ define TEST_AND_TOUCH.sh endef # Force regeneration of all metadata and data files. -dbg.meta: +configure: ifdef MAKE_RESTARTS @$(MAKE) -s $(DataFiles) VERBOSE=$(VERBOSE) TRACE=$(TRACE) else - @rm -rf $(Metadata) + @rm -rf $(Meta) @$(MAKE) -s $(DataFiles) VERBOSE=$(VERBOSE) TRACE=$(TRACE) endif # Make after touching `config.{yaml,json}`. -dbg.touch: +touch: @$(TEST_AND_TOUCH.sh) - @$(MAKE) -s all VERBOSE=$(VERBOSE) TRACE=$(TRACE) - -# Clobber and build again. -dbg.fresh: clobber - @$(MAKE) -s all VERBOSE=$(VERBOSE) TRACE=$(TRACE) + @$(MAKE) -s build VERBOSE=$(VERBOSE) TRACE=$(TRACE) endif # __phase_3 diff --git a/docs/make.d/sitemap.jq b/docs/make.d/sitemap.jq index 82efacf..d39df95 100644 --- a/docs/make.d/sitemap.jq +++ b/docs/make.d/sitemap.jq @@ -2,9 +2,9 @@ # sitemap.jq -- Generate site map XML file. # # jq -r -f sitemap.jq -# --slurpfile site $(Metadata)/site.json -# < $(Metadata)/pages-by-id.json -# > $(Destination)/sitemap.xml +# --slurpfile site $(Meta)/site.json +# < $(Meta)/pages-by-id.json +# > $(Root)/sitemap.xml $site[0].baseurl as $baseurl | diff --git a/docs/make.d/sitemap.make b/docs/make.d/sitemap.make index 52f372c..e1232d1 100644 --- a/docs/make.d/sitemap.make +++ b/docs/make.d/sitemap.make @@ -2,21 +2,21 @@ # sitemap.make -- Define rules for site map. # # Exported rules for: -# $(Destination)/sitemap.xml -# $(Destination)/sitemap.xml.gz +# $(Root)/sitemap.xml +# $(Root)/sitemap.xml.gz -$(Destination)/sitemap.xml: $(Metadata)/pages-by-id.json $(Metadata)/site.json make.d/sitemap.jq $(THIS) \ -| $(Destination) +$(Root)/sitemap.xml: $(Meta)/pages-by-id.json $(Meta)/site.json $(MDIR)/sitemap.jq $(THIS) \ +| $(Root) $(info ==> $@) jq --raw-output \ - --slurpfile site $(Metadata)/site.json \ - --from-file make.d/sitemap.jq \ + --slurpfile site $(Meta)/site.json \ + --from-file $(MDIR)/sitemap.jq \ < $< > $@ -$(Destination)/sitemap.xml.gz: $(Destination)/sitemap.xml +$(Root)/sitemap.xml.gz: $(Root)/sitemap.xml $(info ==> $@) @gzip --stdout < $< > $@ -all:: $(Destination)/sitemap.xml $(Destination)/sitemap.xml.gz +build:: $(Root)/sitemap.xml $(Root)/sitemap.xml.gz # vim:ai:sw=8:ts=8:noet:fileencoding=utf8:syntax=make diff --git a/docs/make.d/styles.make b/docs/make.d/styles.make index 7068678..e170078 100644 --- a/docs/make.d/styles.make +++ b/docs/make.d/styles.make @@ -2,21 +2,21 @@ # styles.make -- Generate main CSS stylesheet. # # Exported rules for: -# $(Destination)/styles.css +# $(Root)/styles.css # Secondary prerequisites. -$(Destination)/styles.css: \ +$(Root)/styles.css: \ $(Blocks)/*/style.css \ $(Blocks)/*/*/style.css \ $(Styles)/*.css \ - $(Styles)/*.m \ $(Styles)/milligram/*.css \ + $(Styles)/milligram/*.m \ -$(Destination)/styles.css: $(Styles)/main.css $(THIS) \ -| $(Destination) +$(Root)/styles.css: $(Styles)/main.css $(THIS) \ +| $(Root) $(info ==> $@) - @jqt -P CSS-min -I$(Styles) < $< > $@ + jqt -P CSS-min -I$(Styles) < $< > $@ -all:: $(Destination)/styles.css +build:: $(Root)/styles.css # vim:ai:sw=8:ts=8:noet:fileencoding=utf8:syntax=make diff --git a/docs/make.d/tools.make b/docs/make.d/tools.make index ac10fd9..4557188 100644 --- a/docs/make.d/tools.make +++ b/docs/make.d/tools.make @@ -4,24 +4,23 @@ # Miscelaneous tools. # # Defined targets: -# help +# list ######################################################################## # Show all targets. ######################################################################## -.PHONY: help +.PHONY: list -# Warning: `make help` can build several phases. -help: +# Warning: `make list` can build several phases. +list: @echo 'Usage: make TARGET [parameter=value...]' @echo 'Targets:'; \ $(MAKE) --print-data-base --just-print 2>&1 \ | grep -v '^[mM]akefile' \ - | awk '/^[^ \t.%][-A-Za-z0-9_]*:/ { print $$1 }' \ + | awk '/^[^ \t.%][-A-Za-z0-9_.]*:/ { print $$1 }' \ | sort --unique \ | sed 's/:\+$$//' \ - | pr --omit-pagination --indent=4 --width=80 --columns=4\ - || true + | pr --omit-pagination --indent=4 --width=80 --columns=4 # vim:ai:sw=8:ts=8:noet:fileencoding=utf8:syntax=make diff --git a/docs/styles/main.css b/docs/styles/main.css index b33dc03..4475549 100644 --- a/docs/styles/main.css +++ b/docs/styles/main.css @@ -2,13 +2,8 @@ // Top-level stylesheet //////////////////////////////////////////////////////////////////////// -&include{bem.m} -&include{colornames.m} - @import url("https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic"); -&include{normalize.css} - &include{milligram.css} &include{blocks/body/_blog/style.css} @@ -26,4 +21,4 @@ // Not used //&include{media.css} -// vim:ts=2:sw=2:ai:et:fileencoding=utf-8:syntax=css +// vim:ts=2:sw=2:ai:et:fileencoding=utf-8:syntax=scss diff --git a/docs/styles/media.css b/docs/styles/media.css index 5e6d6d3..53c0559 100644 --- a/docs/styles/media.css +++ b/docs/styles/media.css @@ -17,4 +17,4 @@ /* Larger than Desktop HD */ //@media screen and (min-width: 1200px) { } -// vim:ts=2:sw=2:ai:et:fileencoding=utf-8:syntax=css +// vim:ts=2:sw=2:ai:et:fileencoding=utf-8:syntax=scss diff --git a/docs/styles/milligram.css b/docs/styles/milligram.css index c8ac18b..b656e7d 100644 --- a/docs/styles/milligram.css +++ b/docs/styles/milligram.css @@ -2,6 +2,12 @@ // Milligram theme //////////////////////////////////////////////////////////////////////// +// Include first! +&include{milligram/BEM.m} +&include{milligram/COLORNAMES.m} + +&include{milligram/Normalize.css} + // Parameters &define{ColorInitial}{&White} &define{ColorPrimary}{&DarkCyan} @@ -36,4 +42,4 @@ //&include{milligram/form.css} //&include{milligram/button.css} -// vim:ts=2:sw=2:ai:et:fileencoding=utf-8:syntax=css +// vim:ts=2:sw=2:ai:et:fileencoding=utf-8:syntax=scss diff --git a/docs/styles/bem.m b/docs/styles/milligram/BEM.m similarity index 92% rename from docs/styles/bem.m rename to docs/styles/milligram/BEM.m index 931864b..b01ba55 100644 --- a/docs/styles/bem.m +++ b/docs/styles/milligram/BEM.m @@ -24,7 +24,7 @@ // // Cases: // -// &CHM{block}{modifier} => .block.-modifier +// &CHM{block}{}{modifier} => .block.-modifier // &CHM{block}{element}{modifier} => .block__element.-modifier // &define{CHM}{&SEL{$1}&ifneq{$2}{}__$2&endif.-$3} @@ -46,4 +46,4 @@ // ^theme &SEL // _hack &HACK -// vim:ts=4:sw=4:ai:et:fileencoding=utf8:syntax=cpp +// vim:ts=4:sw=4:ai:et:fileencoding=utf8:syntax=scss diff --git a/docs/styles/colornames.m b/docs/styles/milligram/COLORNAMES.m similarity index 99% rename from docs/styles/colornames.m rename to docs/styles/milligram/COLORNAMES.m index 1ffbe88..3380d5f 100644 --- a/docs/styles/colornames.m +++ b/docs/styles/milligram/COLORNAMES.m @@ -147,4 +147,4 @@ &define{LightYellow}{ #FFFFE0} &define{Ivory}{ #FFFFF0} &define{White}{ #FFFFFF} -// vim:syntax=tex:ts=32 +// vim:syntax=scss:ts=32 diff --git a/docs/styles/normalize.css b/docs/styles/milligram/Normalize.css similarity index 100% rename from docs/styles/normalize.css rename to docs/styles/milligram/Normalize.css diff --git a/docs/styles/milligram/button.css b/docs/styles/milligram/button.css index 465f1ed..36b460b 100644 --- a/docs/styles/milligram/button.css +++ b/docs/styles/milligram/button.css @@ -27,7 +27,7 @@ // Rules -&_buttons { +&_buttons{} { background-color: &ColorPrimary; border: 0.1rem solid &ColorPrimary; border-radius: .4rem; @@ -53,49 +53,49 @@ outline: 0; } -&_buttons{.button_disabled}, +&_buttons{&BEM{button}{}{disabled}}, &_buttons{[disabled]} { cursor: default; opacity: .5; } -&_buttons_active{.button_disabled}, +&_buttons_active{&BEM{button}{}{disabled}}, &_buttons_active{[disabled]} { background-color: &ColorPrimary; border-color: &ColorPrimary; } -&_buttons{.button_outline} { +&_buttons{&BEM{button}{}{outline}} { background-color: transparent; color: &ColorPrimary; } -&_buttons_active{.button_outline} { +&_buttons_active{&BEM{button}{}{outline}} { background-color: transparent; border-color: &ColorSecondary; color: &ColorSecondary; } -&_buttons_active{.button_outline.button_disabled}, -&_buttons_active{.button_outline[disabled]} { +&_buttons_active{&BEM{button}{}{outline}&BEM{button}{}{disabled}}, +&_buttons_active{&BEM{button}{}{outline}[disabled]} { border-color: inherit; color: &ColorPrimary; } -&_buttons{.button_clear} { +&_buttons{&BEM{button}{}{clear}} { background-color: transparent; border-color: transparent; color: &ColorPrimary; } -&_buttons_active{.button_clear} { +&_buttons_active{&BEM{button}{}{clear}} { background-color: transparent; border-color: transparent; color: &ColorSecondary; } -&_buttons_active{.button_clear.button_disabled}, -&_buttons_active{.button_clear[disabled]} { +&_buttons_active{&BEM{button}{}{clear}&BEM{button}{}{disabled}}, +&_buttons_active{&BEM{button}{}{clear}[disabled]} { color: &ColorPrimary; } diff --git a/docs/styles/milligram/code.css b/docs/styles/milligram/code.css index 9a8ccf7..3cff201 100644 --- a/docs/styles/milligram/code.css +++ b/docs/styles/milligram/code.css @@ -22,7 +22,7 @@ code { pre { background: &ColorTertiary; border-left: 0.3rem solid &ColorPrimary; - overflow-y: hidden; + overflow-y: hidden; } pre > code { diff --git a/docs/styles/milligram/color.css b/docs/styles/milligram/color.css index c16b08e..af6c38a 100644 --- a/docs/styles/milligram/color.css +++ b/docs/styles/milligram/color.css @@ -10,8 +10,6 @@ // Color // –––––––––––––––––––––––––––––––––––––––––––––––––– -// TODO: add `!default`? - &ifndef{ColorInitial} &define{ColorInitial}{#FFFFFF} &endif diff --git a/docs/styles/milligram/form.css b/docs/styles/milligram/form.css index eb09490..a5347fc 100644 --- a/docs/styles/milligram/form.css +++ b/docs/styles/milligram/form.css @@ -30,7 +30,7 @@ } &_input{} { - appearance: none // Removes awkward default styles on some inputs for iOS + appearance: none // Removes awkward default styles on some inputs for iOS background-color: transparent; border: 0.1rem solid &ColorQuaternary; border-radius: .4rem; diff --git a/docs/styles/milligram/spacing.css b/docs/styles/milligram/spacing.css index 696d1bc..f7cb9cb 100644 --- a/docs/styles/milligram/spacing.css +++ b/docs/styles/milligram/spacing.css @@ -18,7 +18,7 @@ // Spacing // –––––––––––––––––––––––––––––––––––––––––––––––––– -.button, +&BEM{button}, button, dd, dt, diff --git a/docs/styles/milligram/table.css b/docs/styles/milligram/table.css index 438912c..946724c 100644 --- a/docs/styles/milligram/table.css +++ b/docs/styles/milligram/table.css @@ -11,7 +11,7 @@ // –––––––––––––––––––––––––––––––––––––––––––––––––– table { - border-spacing: 0; + border-spacing: 0; width: 100%; } diff --git a/docs/styles/milligram/typography.css b/docs/styles/milligram/typography.css index 419ebf9..475080c 100644 --- a/docs/styles/milligram/typography.css +++ b/docs/styles/milligram/typography.css @@ -19,7 +19,7 @@ // –––––––––––––––––––––––––––––––––––––––––––––––––– b, strong { - font-weight: bold; + font-weight: bold; } p { @@ -33,7 +33,7 @@ h4, h5, h6 { font-weight: 300; - letter-spacing: -.1rem; // JJOR: set again in _heading + letter-spacing: -.1rem; // JJOR: set again in _heading margin-bottom: calc(&TypographyScale * 2.0rem); margin-top: 0; // calc(&TypographyScale * 0) }