Skip to content

Asciidoc bootstrap #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,18 @@ historic-release.txt
*.asciidoc-spellchecked
/images/
/output/
/*.html
acknowledgements.html
cables.html
documentation.html
download.html
features.html
index.html
nut-qa.html
old-news.html
projects.html
stable-hcl.html
support.html
ups-protocols.html

# Auto-published site
/networkupstools.github.io
64 changes: 55 additions & 9 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,28 @@ LAYOUT_FILES = \
css/xhtml11-quirks.css \
css/xhtml11.css

BOOTSTRAP_LAYOUT_FILES = \
css/nut.css \
css/asciidoc-bootstrap.min.css

SCRIPT_FILES = \
scripts/asciidoc.js \
scripts/filter_png.js \
scripts/jquery.js \
scripts/nut_jquery.js

BOOTSTRAP_SCRIPT_FILES = \
scripts/nut.js \
scripts/bootstrap.min.js \
scripts/jquery.min.js \
scripts/asciidoc.js
# TODO: do we actually need the following?
# js/html5shiv.min.js \
# js/respond.min.js
# js/ie8-responsive-file-warning.js
# js/ie-emulation-modes-warning.js
# js/npm.js

WEBSITE_FILES = \
acknowledgements.html \
cables.html \
Expand All @@ -73,14 +89,36 @@ WEBSITE_DEPS = \
nut/docs/packager-guide.chunked \
nut/docs/packager-guide.pdf \
nut/docs/user-manual.chunked \
nut/docs/user-manual.pdf
nut/docs/user-manual.pdf \
index-jumboinfo.html \
navinfo.html

WEBSITE_FONTS = \
fonts/glyphicons-halflings-regular.eot \
fonts/glyphicons-halflings-regular.svg \
fonts/glyphicons-halflings-regular.ttf \
fonts/glyphicons-halflings-regular.woff \
fonts/glyphicons-halflings-regular.woff2

# CSS based simulated frames layout.
LAYOUT = web-layout
#LAYOUT = web-layout
LAYOUT = bootstrap

# --backend=xhtml11

ADOC_PARAMS_COMMON = \
--backend=xhtml11 \
--conf-file="$(srcdir)/$(LAYOUT).conf" \
--backend=html5 \
--attribute lang=en \
--attribute totop! \
--attribute brand="Network UPS Tools" \
--attribute brandref=./ \
--attribute stylesdir=css \
--attribute navbar=fixed \
--attribute navinfo1 \
--attribute favicon \
--attribute script=nut.js \
--attribute bootstrapdir=. \
--attribute icons \
--attribute linkcss \
--attribute=badges \
Expand All @@ -98,6 +136,7 @@ ASCIIDOC_PARAMS = \
--attribute iconsdir=$(srcdir)/images \
--attribute scriptsdir=$(srcdir)/scripts


OUTDIR_BASE = @OUTDIR_BASE@
NUT_HISTORIC_RELEASE = @NUT_HISTORIC_RELEASE@

Expand Down Expand Up @@ -205,11 +244,15 @@ $(OUTDIR): all-files
cp -fR $(WEBSITE_FILES) images $(FAVICON_FILES) $(OUTDIR)
$(MKDIR_P) $(OUTDIR)/css
cp -f $(LAYOUT_FILES) $(OUTDIR)/css/
cp -f $(BOOTSTRAP_LAYOUT_FILES) $(OUTDIR)/css/
$(MKDIR_P) $(OUTDIR)/fonts
cp -f $(WEBSITE_FONTS) $(OUTDIR)/fonts/
$(MKDIR_P) $(OUTDIR)/docs/man
cp -fR $(WEBSITE_DEPS) $(OUTDIR)/docs/
cp -f nut/docs/man/*.html $(OUTDIR)/docs/man/
$(MKDIR_P) $(OUTDIR)/scripts
cp -f $(SCRIPT_FILES) scripts/ups_data.js $(OUTDIR)/scripts/
cp -f $(BOOTSTRAP_SCRIPT_FILES) scripts/ups_data.js $(OUTDIR)/scripts/
$(MKDIR_P) $(OUTDIR)/protocols
cp -f protocols/*.html $(OUTDIR)/protocols/
cp -fR protocols/images $(OUTDIR)/protocols
Expand Down Expand Up @@ -301,18 +344,18 @@ ups-html.txt scripts/ups_data.js: prerequisites_hcl
test -s "$(@)"

# Report each rebuild by depending on the Makefile
index.html: website.txt news.txt Makefile $(LAYOUT).conf historic-release.txt
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ -a index-only $<
index.html: index.txt news.txt Makefile $(LAYOUT).conf historic-release.txt index-jumboinfo.html
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ -a index-only -a jumbotron -a jumboinfo $<

acknowledgements.html: nut/docs/acknowledgements.txt $(LAYOUT).conf historic-release.txt
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ $<

cables.html: nut/docs/cables.txt $(LAYOUT).conf historic-release.txt
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ -a toc $<
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ -a toc2 -a toc-placement=right -a toclevels=3 $<

# React to newly published sources
download.html: nut/docs/download.txt source/*/*.tar.gz* $(LAYOUT).conf historic-release.txt
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ -a toc $<
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ -a toc2 -a toc-placement=right -a toclevels=3 $<

documentation.html: nut/docs/documentation.txt $(LAYOUT).conf historic-release.txt
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ $<
Expand All @@ -324,7 +367,7 @@ nut-qa.html: nut/docs/nut-qa.txt $(LAYOUT).conf historic-release.txt
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ $<

projects.html: projects.txt $(LAYOUT).conf historic-release.txt
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ -a toc $<
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ -a toc2 -a toc-placement=right -a toclevels=3 $<

stable-hcl.html: stable-hcl.txt ups-html.txt $(LAYOUT).conf historic-release.txt
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ -a hcl $<
Expand Down Expand Up @@ -435,6 +478,7 @@ $(MODELS_TARGETS_RAW): $$(patsubst %,$$(subst %,\%,$$(dir $$@))%.txt,$$(subst @,
MODELS_TARGETS := $(patsubst %.txt,%.html,$(MODELS_TARGETS_RAW))

# Compiled asciidoc pages (.html):
# FIXME: may need " -a toc2 -a toc-placement=right -a toclevels=3" instead of "-a toc"
$(MODELS_TARGETS): $$(patsubst %.html,%.txt,$$@) $(LAYOUT).conf historic-release.txt
$(ASCIIDOC) $(ADOC_PARAMS_DDL_L2) --attribute toc -o "$@" "$<"

Expand Down Expand Up @@ -476,11 +520,13 @@ $(DDL_DIR)/index.txt: $(DDL_DIR)/README.adoc $(MFR_TARGETS)
$(call file,>> $@,include::$(notdir $<)[])

# Compiled asciidoc page (.html)
# FIXME: may need " -a toc2 -a toc-placement=right -a toclevels=3" instead of "-a toc"
$(DDL_DIR)/index.html: $(DDL_DIR)/index.txt $(LAYOUT).conf historic-release.txt
$(ASCIIDOC) $(ADOC_PARAMS_DDL_L1) --attribute toc -o $@ $<

###

# FIXME: may need " -a toc2 -a toc-placement=right -a toclevels=3" instead of "-a toc"
$(HISTORIC_DIR)/index.html: $(HISTORIC_DIR)/index.txt $(LAYOUT).conf historic-release.txt
$(ASCIIDOC) $(ADOC_PARAMS_DDL_L1) --attribute toc -o $@ $<

Expand Down Expand Up @@ -572,7 +618,7 @@ FILTER_DIRONCE = awk 'BEGIN {o=""} ; { if ($(DOLLAR)0 == o"/") { print $(DOLLAR)

SPELLCHECK_SRC = \
README.asciidoc \
news.txt old-news.txt projects.txt stable-hcl.txt ups-protocols.txt website.txt \
news.txt old-news.txt projects.txt stable-hcl.txt ups-protocols.txt index.txt \
protocols/sec.txt \
protocols/us9003.txt \
protocols/sec-protocol.txt \
Expand Down
Loading