Skip to content

Asciidoc bootstrap - dual targeting #41

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 51 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
e09786a
First attempt at Bootstrap NUT website
aquette Mar 13, 2023
cc32368
Adjustments and fixes
aquette Mar 13, 2023
da62fdd
Menu addition
aquette Mar 13, 2023
e070e3a
Refine git ignored files
aquette Mar 13, 2023
79e59f0
Merge branch 'master' of github.com:networkupstools/nut-website into …
aquette Mar 14, 2023
b0aa418
Add specific options for index.html (jumbotron)
aquette Mar 14, 2023
db62a8d
Complete navigation info (menu)
aquette Mar 14, 2023
d5fe36b
Update jumbotron (NUT welcome message)
aquette Mar 14, 2023
630e303
Fix navinfo menu
aquette Mar 14, 2023
1304957
Remove welcome message, now that it's in Jumbotron
aquette Mar 14, 2023
e1eb734
Rename website.txt to index.txt
aquette Mar 14, 2023
dafa86c
Fix wrongs dirs
aquette Mar 14, 2023
c58d90b
Fix and complete welcome message
aquette Mar 14, 2023
75d8834
Fix menu
aquette Mar 14, 2023
aaa3445
Fix ToC position, and add fonts
aquette Mar 14, 2023
af32a0e
Makefile.am: prepare for dual modality builds - with old "web-layout"…
jimklimov Apr 1, 2023
b9a666c
navinfo.html, scripts/asciidoc.js: cosmetic fixes
jimklimov Apr 1, 2023
88ee8bf
autogen.sh, Makefile.am: hide GNU make conditionals from automake
jimklimov Apr 1, 2023
bfd9f13
Merge remote-tracking branch 'upstream/master' into asciidoc-bootstra…
jimklimov Jul 30, 2023
4d55db1
configure.ac: prepare COUNT_HCL_MODELS and COUNT_HCL_MANUFACTURERS st…
jimklimov Jul 30, 2023
681bad8
index-jumboinfo.html.in: make it a template which uses COUNT_HCL_MODE…
jimklimov Jul 30, 2023
99fb1a3
index.html: drop obsolete comment as we now do auto-prepare COUNT_HCL…
jimklimov Jul 30, 2023
05b5c96
Merge branch 'auto-stats' into asciidoc-bootstrap-dual
jimklimov Jul 30, 2023
9275496
index.txt, Makefile.am: fix index.html builds with different LAYOUT o…
jimklimov Jul 30, 2023
1588e43
ci_build.sh: pass LAYOUT envvar to make if specified (or bolt it as "…
jimklimov Jul 30, 2023
a6bdeb0
Makefile.am: rectify SCRIPT_FILES for WEBLAYOUT vs BOOTSTRAP
jimklimov Jul 30, 2023
b13e841
Makefile.am: fix if/else to separate if/endif clauses
jimklimov Jul 30, 2023
bd2e3d1
Makefile.am, autogen.sh: try different sed patterns for automake ifeq…
jimklimov Jul 30, 2023
3796cc9
Revert "Makefile.am, autogen.sh: try different sed patterns for autom…
jimklimov Jul 30, 2023
0c0b3bd
Makefile.am: revise use of "# HIDE FROM AUTOMAKE #" for defaults
jimklimov Jul 30, 2023
51e3f99
Makefile.am: fix ADOC_PARAMS_DDL_L1/L2 to use "top_srcdir" instead of…
jimklimov Jul 30, 2023
513f471
Makefile.am etc: Fix use of index-jumboinfo-header-$(LAYOUT).html
jimklimov Jul 30, 2023
fbeed52
web-layout.conf: fix reference to historic sites for URLs to render well
jimklimov Jul 30, 2023
d71867c
projects.txt: refer to NUT GitHub Wiki page
jimklimov Jul 30, 2023
f857b0e
Merge branch 'master' into asciidoc-bootstrap-dual
jimklimov Jul 30, 2023
f1d877f
Makefile.am: set LAYOUT=web-layout (legacy) as default for now
jimklimov Jul 30, 2023
e984cdb
README.asciidoc: update regarding ci_build.sh support for LAYOUT envvar
jimklimov Jul 30, 2023
80864dd
Jenkinsfile-infra: add a toggle to select the LAYOUT to build
jimklimov Jul 30, 2023
c86a2fc
Revise some page links relative to asciidoc {root}
jimklimov Jul 30, 2023
17de929
Revert "Makefile.am: fix ADOC_PARAMS_DDL_L1/L2 to use "top_srcdir" in…
jimklimov Jul 30, 2023
0ace348
navinfo.html: update similar to web-layout.conf (detail GitHub resour…
jimklimov Jul 30, 2023
9a73819
Merge remote-tracking branch 'upstream/master' into asciidoc-bootstra…
jimklimov Aug 3, 2023
beb7a64
Merge remote-tracking branch 'upstream/master' into asciidoc-bootstra…
jimklimov Apr 13, 2024
8bf212f
Regenerate site 20240415T084834Z vs nut commit 7cbcef70b, nut-ddl com…
jimklimov Apr 15, 2024
5125826
Merge branch 'nut-website-dict' into asciidoc-bootstrap-dual
jimklimov Apr 15, 2024
7836208
GitIgnore index-jumboinfo.html.in-spellchecked
jimklimov Apr 15, 2024
4e868c1
Merge remote-tracking branch 'upstream/master' into asciidoc-bootstra…
jimklimov Apr 15, 2024
eccb592
Merge branch 'dict-report' into asciidoc-bootstrap-dual
jimklimov Apr 17, 2024
32ff17d
nut-website.dict.addon: update with keywords from nut::docs/nut.dict …
jimklimov Apr 17, 2024
c2c310e
Merge remote-tracking branch 'upstream/master' into asciidoc-bootstra…
jimklimov Apr 18, 2024
22093a3
Merge branch 'master' into asciidoc-bootstrap-dual
jimklimov May 10, 2024
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
21 changes: 17 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ Makefile.in
missing

# NUT Website-specific
ups-html.txt
website.txt
historic-release.txt
/ups-html.txt
/historic-release.txt
/website.txt
.git-commit-website
*.txt-spellchecked
*.txt.in-spellchecked
*.asciidoc-spellchecked
*.html.in-spellchecked
*.usage-report
/nut-website.dict
/nut-website.dict.bak-pre-sorting
Expand All @@ -31,7 +32,19 @@ historic-release.txt
/nut-website.dict.tmp
/images/
/output/
/*.html
/acknowledgements.html
/cables.html
/documentation.html
/download.html
/features.html
/index.html
/index-jumboinfo.html
/nut-qa.html
/old-news.html
/projects.html
/stable-hcl.html
/support.html
/ups-protocols.html
/.prerequisites_hcl
/.prerequisites_hcl.started
/.all-files
Expand Down
5 changes: 5 additions & 0 deletions Jenkinsfile-infra
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ pipeline {
defaultValue: true,
description: 'If "true", the "nut-ddl.py" script should fail if there are concerns about DDL file markup (so something is ambiguous, duplicate where should be unique, missing where required...) so these would be fatal before site build; if "false" then such issues are only printed as warnings.'
)
choice(
name: 'LAYOUT',
choices: ['web-layout', 'bootstrap'],
description: 'Select the web-site design to generate.\nThe "bootstrap" is intended for NUT v2.8.1 or later releases, and is currently work in progress.\nThe "web-layout" shows its age, for a few decades - used until NUT v2.8.0 release.'
)
}

stages {
Expand Down
119 changes: 109 additions & 10 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
# of Makefile.am->Makefile.in->Makefile the resulting file can have crucial
# parts commented away. Alternately, `make unhide-from-automake` after edits.

# CSS based simulated frames layout. The "web-layout" is old design
# used for NUT releases 2.8.0 and before. The "bootstrap" is newer.
LAYOUT = web-layout
# New Bootstrap project based layout, proposed for NUT release 2.8.1
# and later, see https://github.com/networkupstools/nut-website/pull/31
#LAYOUT = bootstrap

# Also relies on GNU `ln -fsr` options, for historic sub-site publication
LN = ln
#LN = gln
Expand Down Expand Up @@ -55,12 +62,38 @@ LAYOUT_FILES = \
css/xhtml11-quirks.css \
css/xhtml11.css

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

WEBLAYOUT_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?
BOOTSTRAP_SCRIPT_FILES_EXTRA =
js/html5shiv.min.js \
js/respond.min.js
js/ie8-responsive-file-warning.js
js/ie-emulation-modes-warning.js
js/npm.js

SCRIPT_FILES =
# HIDE FROM AUTOMAKE #ifeq ($(strip $(LAYOUT)),bootstrap)
# HIDE FROM AUTOMAKE #SCRIPT_FILES += $(BOOTSTRAP_SCRIPT_FILES)
# HIDE FROM AUTOMAKE #endif
# HIDE FROM AUTOMAKE #ifeq ($(strip $(LAYOUT)),web-layout)
# HIDE FROM AUTOMAKE #SCRIPT_FILES += $(WEBLAYOUT_SCRIPT_FILES)
# HIDE FROM AUTOMAKE #endif

WEBSITE_FILES = \
acknowledgements.html \
cables.html \
Expand All @@ -76,6 +109,8 @@ WEBSITE_FILES = \
ups-protocols.html

WEBSITE_DEPS = \
index-jumboinfo.html \
index-jumboinfo-header-$(LAYOUT).html \
nut/docs/solaris-usb.html \
nut/docs/cables.pdf \
nut/docs/developer-guide.chunked \
Expand All @@ -97,24 +132,58 @@ WEBSITE_DEPS += \
nut/docs/ChangeLog.pdf
endif

# CSS based simulated frames layout.
LAYOUT = web-layout
BOOTSTRAP_WEBSITE_DEPS = \
navinfo.html

BOOTSTRAP_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

# HIDE FROM AUTOMAKE #ifeq ($(strip $(LAYOUT)),bootstrap)
# HIDE FROM AUTOMAKE #WEBSITE_DEPS += $(BOOTSTRAP_WEBSITE_DEPS)
# HIDE FROM AUTOMAKE #endif

ADOC_PARAMS_COMMON = \
--backend=xhtml11 \
--conf-file="$(srcdir)/$(LAYOUT).conf" \
--attribute icons \
--attribute linkcss \
--attribute=badges \
--attribute=website \
--attribute=quirks \
--attribute=websitelayout="$(LAYOUT)" \
--attribute=revision="$(PACKAGE_VERSION)" \
--attribute=webrevision="$(WEBSITE_VERSION)" \
--attribute tree_version="@TREE_VERSION@" \
--attribute localdate="`TZ=UTC date +%Y-%m-%d`" \
--attribute localtime="`TZ=UTC date +%H:%M:%S`" \
--attribute=date="`TZ=UTC date`"

ADOC_PARAMS_WEB_LAYOUT = \
--backend=xhtml11

ADOC_PARAMS_BOOTSTRAP = \
--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=.

# HIDE FROM AUTOMAKE #ifeq ($(strip $(LAYOUT)),bootstrap)
# HIDE FROM AUTOMAKE #ADOC_PARAMS_COMMON += $(ADOC_PARAMS_BOOTSTRAP)
# HIDE FROM AUTOMAKE #endif
# HIDE FROM AUTOMAKE #ifeq ($(strip $(LAYOUT)),web-layout)
# HIDE FROM AUTOMAKE #ADOC_PARAMS_COMMON += $(ADOC_PARAMS_WEB_LAYOUT)
# HIDE FROM AUTOMAKE #endif

ASCIIDOC_PARAMS = \
$(ADOC_PARAMS_COMMON) \
--attribute iconsdir=$(srcdir)/images \
Expand Down Expand Up @@ -367,6 +436,11 @@ $(OUTDIR): .all-files
cp -fR $(WEBSITE_FILES) images $(FAVICON_FILES) $(OUTDIR)
$(MKDIR_P) $(OUTDIR)/css
cp -f $(LAYOUT_FILES) $(OUTDIR)/css/
if test x"$(LAYOUT)" = xbootstrap ; then \
cp -f $(BOOTSTRAP_LAYOUT_FILES) $(OUTDIR)/css/ && \
$(MKDIR_P) $(OUTDIR)/fonts && \
cp -f $(BOOTSTRAP_WEBSITE_FONTS) $(OUTDIR)/fonts/ ; \
fi
$(MKDIR_P) $(OUTDIR)/docs/man
cp -fR $(WEBSITE_DEPS) $(OUTDIR)/docs/
cp -f nut/docs/man/*.html $(OUTDIR)/docs/man/
Expand Down Expand Up @@ -490,18 +564,28 @@ ups-html.txt scripts/ups_data.js: .prerequisites_hcl
#touch "$@"

# 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 $<
# HIDE FROM AUTOMAKE #ifeq ($(strip $(LAYOUT)),bootstrap)
# HIDE FROM AUTOMAKE #index.html: index.txt news.txt Makefile $(LAYOUT).conf historic-release.txt index-jumboinfo.html index-jumboinfo-header-$(LAYOUT).html
# HIDE FROM AUTOMAKE # $(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ -a index-only -a jumbotron -a jumboinfo $<
# HIDE FROM AUTOMAKE #
# HIDE FROM AUTOMAKE #ASCIIDOC_TOC_PARAMS = -a toc2 -a toc-placement=right -a toclevels=3
# HIDE FROM AUTOMAKE #endif
# HIDE FROM AUTOMAKE #ifeq ($(strip $(LAYOUT)),web-layout)
# HIDE FROM AUTOMAKE #index.html: index.txt news.txt Makefile $(LAYOUT).conf historic-release.txt index-jumboinfo.html index-jumboinfo-header-$(LAYOUT).html
# HIDE FROM AUTOMAKE # $(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ -a index-only $<
# HIDE FROM AUTOMAKE #
# HIDE FROM AUTOMAKE #ASCIIDOC_TOC_PARAMS = -a toc
# HIDE FROM AUTOMAKE #endif

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 $@ $(ASCIIDOC_TOC_PARAMS) $<

# 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 $@ $(ASCIIDOC_TOC_PARAMS) $<

documentation.html: nut/docs/documentation.txt $(LAYOUT).conf historic-release.txt
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ $<
Expand All @@ -513,7 +597,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 $@ $(ASCIIDOC_TOC_PARAMS) $<

stable-hcl.html: stable-hcl.txt ups-html.txt $(LAYOUT).conf historic-release.txt
$(ASCIIDOC) $(ASCIIDOC_PARAMS) -o $@ -a hcl $<
Expand Down Expand Up @@ -624,6 +708,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" - see $(ASCIIDOC_TOC_PARAMS)
$(MODELS_TARGETS): $$(patsubst %.html,%.txt,$$@) $(LAYOUT).conf historic-release.txt
$(ASCIIDOC) $(ADOC_PARAMS_DDL_L2) --attribute toc -o "$@" "$<"

Expand Down Expand Up @@ -665,11 +750,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" - see $(ASCIIDOC_TOC_PARAMS)
$(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" - see $(ASCIIDOC_TOC_PARAMS)
$(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 @@ -761,7 +848,11 @@ 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.in \
news.txt \
old-news.txt \
projects.txt \
stable-hcl.txt \
ups-protocols.txt \
protocols/sec.txt \
protocols/us9003.txt \
protocols/sec-protocol.txt \
Expand All @@ -779,6 +870,14 @@ SPELLCHECK_SRC = \
protocols/minicol.txt \
protocols/oneac.txt

SPELLCHECK_SRC += index.txt

# NOTE: It is possible that in historic releases "nut" source recipes
# only spell-check *.txt filename patterns. Specifying this input file
# does not hurt but may have no effect then.
SPELLCHECK_SRC += index-jumboinfo.html.in
#SPELLCHECK_SRC += index-jumboinfo-header-$(LAYOUT).html

### Note: historically the NUT makefiles' implementation of spellcheck rules
### assumes use of its own nut.dict. When it became possible to split it
### out, we can add NUT_SPELL_DICT="$(NUT_SPELL_DICT)" to the sub-"make"
Expand Down
10 changes: 9 additions & 1 deletion README.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ to refer to such officially published snapshots. This index is currently
maintained manually, to ensure human decision about publishing (or hiding) an
historic release (especially a release candidate) vs. experimenting with that.

NOTE: NUT v2.8.2 release and earlier used a `LAYOUT=web-layout` design, while
newer releases use `LAYOUT=bootstrap`; these may have to be nudged into `make`
arguments above (note also renaming of `website.txt` to `index.txt` and less
content inside -- some paragraphs were evicted to `index-jumboinfo.html` as
"jumbotron integration") or passed as environment variables to `ci_build.sh`.

NOTE: `make dist-files` should update the historic release site source tarballs
and related ChangeLog, news and checksum files IFF the release data was not yet
there. You probably need to commit that back to "source" github repository.
Expand Down Expand Up @@ -305,7 +311,9 @@ https://ci.networkupstools.org/view/InfraTasks/job/nut-website/
once per such release with a spell like this:
+
------
:; CI_AUTOCOMMIT=true CI_AUTOPUSH=true NUT_HISTORIC_RELEASE=v2.8.0-rc3 ./ci_build.sh
:; CI_AUTOCOMMIT=true CI_AUTOPUSH=true \
NUT_HISTORIC_RELEASE=v2.8.0-rc3 LAYOUT=web-layout \
./ci_build.sh
------

* The `nut-website` specific spell-checking is handled with a dynamic mix of
Expand Down
Loading