Skip to content

Commit

Permalink
Better filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
fadado committed Apr 1, 2017
1 parent aa88356 commit 72fecaf
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 62 deletions.
80 changes: 41 additions & 39 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# jqt site documentation management
# jqt documentation management

########################################################################
# Prerequisites
Expand Down Expand Up @@ -50,28 +50,28 @@ SHELL := /bin/bash
########################################################################

# Output directories
Meta := .yummy
Metadata := .yummy
Destination := /tmp/jqt

# Directories for input files
# Input files directories
Assets := ./assets
Blocks := ./blocks
Content := ./content
Data := ./data
Styles := ./styles
Layouts := ./layouts

# Common sources for all targets
# Common dependencies for all targets
Common := \
$(Meta)/config.json \
$(Meta)/snippets.json \
$(Metadata)/config.json \
$(Metadata)/snippets.json \
$(Blocks)/*/markup.html \
$(Layouts)/default.html \
$(Blocks)/main.html \
$(Blocks)/filters.jq \
$(Content)/LINKS.txt \
blocks/filters.jq \
content/markup.m \
$(Content)/macros.m \

# Files to "build"
Home := index
Home := index
Pages := content data engine structure
Files := README.md styles.css
ManPage := ../jqt.1.gz
Expand All @@ -81,49 +81,41 @@ Targets := \
$(ManPage) \

########################################################################
# Commands
# jqt command with options
########################################################################

# The template engine (.site and .snippets defined in the jqt call)
JQT = jqt $(JQTFLAGS)
# The template engine (.site and .snippets are defined in the jqt call)

JQTFLAGS := \
-5 \
-I./ \
-iblocks/filters \
-msite:$(Meta)/config.json \
-msnippets:$(Meta)/snippets.json \
-msite:$(Metadata)/config.json \
-msnippets:$(Metadata)/snippets.json \
--toc-depth=4 \

JQT = jqt $(JQTFLAGS)

########################################################################
# Rules
########################################################################

# Main
all: $(Targets)

# Validation with vnu.jar
VNU := /usr/local/vnu/vnu.jar
valid: all
xmlwf $(Destination)/*.html
java -jar $(VNU) --errors-only --format gnu $(Destination)/*.html

lint: all
xmlwf $(Destination)/*.html
java -jar $(VNU) --format text $(Destination)/*.html

# Directories
$(Meta) $(Destination): ; mkdir $@ >/dev/null 2>&1 || true
$(Metadata) $(Destination): ; mkdir $@ >/dev/null 2>&1 || true

# Meta files
$(Meta)/config.json: config.yaml \
| $(Meta)
# Metadata files
$(Metadata)/config.json: config.yaml \
| $(Metadata)
yaml2json <$< >$@

$(Meta)/snippets.json: $(Content)/snippets.yaml \
| $(Meta)
$(Metadata)/snippets.json: $(Content)/snippets.yaml \
| $(Metadata)
jqt -T <$< | yaml2json > $@

# Target files
# Documentation site to build
$(Destination)/README.md: $(Assets)/README.md \
| $(Destination)
$(info ==> $@)
Expand All @@ -138,25 +130,25 @@ DETAILS := sed \
$(Destination)/index.html: $(Content)/home.md $(Common) \
| $(Destination)
$(info ==> $@)
$(JQT) -d $< $(Layouts)/default.html > $@
$(JQT) -d $< $(Blocks)/main.html > $@

$(foreach p,$(Pages),$(Destination)/$(p).html): $(Content)/FLOW.txt $(Content)/opt/*.txt
$(Destination)/index.html $(Destination)/structure.html: $(Content)/EXAMPLE.txt

define Target
$(Destination)/$(1).html: $(Content)/$(1).md $(Layouts)/$(2).html $(Common) \
$(Destination)/$(1).html: $(Content)/$(1).md $(Blocks)/$(2).html $(Common) \
| $(Destination)
$$(info ==> $$@)
$(JQT) -d $$< $(Layouts)/$(2).html | $(DETAILS) > $$@
$(JQT) -d $$< $(Blocks)/$(2).html | $(DETAILS) > $$@
endef

$(foreach p,$(Pages),$(eval $(call Target,$(p),page)))

$(Destination)/styles.css: $(Styles)/main.css $(Styles)/*.css $(Styles)/new/*.css $(Blocks)/*/*style.css
$(Destination)/styles.css: $(Styles)/*.css $(Styles)/new/*.css $(Blocks)/*/*style.css $(Styles)/macros.m
$(info ==> $@)
jqt -P CSS-min -I$(Styles) <$< >$@

# Man page (to be build without callig `jqt`!)
# Man page (to be build without calling jqt!)
GPP_MD := \
-U '<%' '>' '\B' '\B' '\W>' '<' '>' '$$' '' \
-M '<%' '>' '\B' '\B' '\W>' '<' '>' \
Expand Down Expand Up @@ -193,7 +185,7 @@ clean:
rm -rf $(Destination)/* $(ManPage)

clobber:
rm -rf $(Destination) $(Meta)
rm -rf $(Destination) $(Metadata)

build: clean all

Expand All @@ -208,4 +200,14 @@ help:
| sed 's/:\+$$//' \
| pr --omit-pagination --indent=4 --width=80 --columns=4

# Validation with vnu.jar
VNU := /usr/local/vnu/vnu.jar
valid: all
xmlwf $(Destination)/*.html
java -jar $(VNU) --errors-only --format gnu $(Destination)/*.html

lint: all
xmlwf $(Destination)/*.html
java -jar $(VNU) --format text $(Destination)/*.html

# vim:ai:sw=8:ts=8:noet:fileencoding=utf8:syntax=make
12 changes: 12 additions & 0 deletions docs/blocks/container/markup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<#######################################################################
# Document body
######################################################################>&
<body class="#container">
<%include blocks/header/markup.html>&
<%include blocks/body/markup.html>&
<%include blocks/footer/markup.html>&
<%partial analytics 'UA-82432866-1'>&
</body>
<#
vim:ts=2:sw=2:ai:et:fileencoding=utf8:syntax=html
#>&
11 changes: 11 additions & 0 deletions docs/blocks/container/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
////////////////////////////////////////////////////////////////////////
// Container
////////////////////////////////////////////////////////////////////////

@media screen {
body&SEL{#container} {
max-width: 800px;
}
}

// vim:ts=2:sw=2:ai:et:fileencoding=utf-8:syntax=css
7 changes: 1 addition & 6 deletions docs/layouts/default.html → docs/blocks/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@
<#
# Document body
#>
<body class="#container">
<%include blocks/header/markup.html>&
<%include blocks/body/markup.html>&
<%include blocks/footer/markup.html>&
<%partial analytics 'UA-82432866-1'>&
</body>
<%include blocks/container/markup.html>&
</html>
<#
vim:ts=2:sw=2:ai:et:fileencoding=utf8:syntax=html
Expand Down
2 changes: 1 addition & 1 deletion docs/layouts/page.html → docs/blocks/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<#
# Inherit default layout
#>&
<%include layouts/default.html>&
<%include blocks/main.html>&
<#
vim:ts=2:sw=2:ai:et:fileencoding=utf8:syntax=html
#>&
2 changes: 1 addition & 1 deletion docs/content/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: jqt transforms MarkDown documents to HTML using Pandoc.
keywords: jqt, markdown, pandoc, gpp, preprocessing, authoring content
updated: "2016-08-28T10:27:09Z"
---
<%include content/markup.m>&
<%include content/macros.m>&
<%include content/LINKS.txt>&

# Authoring content
Expand Down
2 changes: 1 addition & 1 deletion docs/content/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: jqt combines one template with one MarkDown document and a data mod
keywords: jqt, JSON, YAML, gpp, preprocessing, data model
updated: "2016-08-28T10:27:09Z"
---
<%include content/markup.m>&
<%include content/macros.m>&
<%include content/LINKS.txt>&

# Data model
Expand Down
2 changes: 1 addition & 1 deletion docs/content/engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: jqt orchestrates several shell utilities to transform MarkDown text
keywords: jqt, jq, YAML, gpp, preprocessing, template engine
updated: "2016-08-28T10:27:09Z"
---
<%include content/markup.m>&
<%include content/macros.m>&
<%include content/LINKS.txt>&

# Template engine
Expand Down
2 changes: 1 addition & 1 deletion docs/content/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Could be jq the basis for a web template engine?
keywords: jqt, jq, template engine
updated: "2016-08-28T10:27:09Z"
---
<%include content/markup.m>&
<%include content/macros.m>&
<%include content/LINKS.txt>&

# Welcome
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/content/structure.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
layout: page
title: Defining the page structure with jqt
description: Web pages structure is defined by the HTML markup.
description: Web pages structure is defined by the HTML macros.
keywords: jqt, jq, gpp, preprocessing, template engine
updated: "2016-08-28T10:27:09Z"
---
<%include content/markup.m>&
<%include content/macros.m>&
<%include content/LINKS.txt>&

# Page structure
Expand Down
Empty file added docs/data/.gitignore
Empty file.
File renamed without changes.
18 changes: 8 additions & 10 deletions docs/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@
// main
////////////////////////////////////////////////////////////////////////

&include{bem.m}
&include{macros.m}
&include{new/default.css}

&include{milligram.css}
//&include{media.css}

@media screen {
html {
background-color: &ColorInitial;
}
}

&include{blocks/container/style.css}
&include{blocks/header/style.css}
&include{blocks/footer/style.css}
&include{blocks/panel/style.css}
Expand All @@ -18,13 +25,4 @@
&include{blocks/license/style.css}
&include{blocks/repository/style.css}

@media screen {
html {
background-color: &ColorInitial;
}
body&SEL{#container} {
max-width: 800px;
}
}

// vim:ts=2:sw=2:ai:et:fileencoding=utf-8:syntax=css

0 comments on commit 72fecaf

Please sign in to comment.