forked from linux-test-project/ltp
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docparse: Generate html and pdf using asciidoc{,tor}
Rewrite testinfo.pl to generate *.txt pages in asciidoc format which is then regenerated to html (and pdf if enabled) using asciidoc,{tor}. Replace getting Linux kernel git commit messages from local git repository (needed after having all tests in single page, because API has access limits; it's also better to generate everything once thus don't depend on network connection). Reviewed-by: Cyril Hrubis <chrubis@suse.cz> Reviewed-by: Li Wang <liwang@redhat.com> Signed-off-by: Petr Vorel <pvorel@suse.cz>
- Loading branch information
Showing
3 changed files
with
458 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
/*.txt | ||
/docbook-xsl.css | ||
/docparse | ||
/metadata.json | ||
/metadata.html | ||
/metadata.pdf | ||
/metadata.chunked/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,77 @@ | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
# Copyright (c) 2019 Cyril Hrubis <chrubis@suse.cz> | ||
# Copyright (c) 2020 Petr Vorel <pvorel@suse.cz> | ||
|
||
top_srcdir ?= .. | ||
|
||
include $(top_srcdir)/include/mk/env_pre.mk | ||
include $(top_srcdir)/include/mk/functions.mk | ||
|
||
ifeq ($(METADATA_GENERATOR),asciidoctor) | ||
METADATA_GENERATOR_CMD := asciidoctor | ||
METADATA_GENERATOR_PARAMS := -d book metadata.txt | ||
METADATA_GENERATOR_PARAMS_HTML := -b xhtml | ||
METADATA_GENERATOR_PARAMS_PDF := -b pdf -r asciidoctor-pdf | ||
else ifeq ($(METADATA_GENERATOR),asciidoc) | ||
METADATA_GENERATOR_CMD := a2x | ||
METADATA_GENERATOR_PARAMS := --xsltproc-opts "--stringparam toc.section.depth 1" -d book -L --resource="$(PWD)" metadata.txt | ||
METADATA_GENERATOR_PARAMS_HTML := -f xhtml | ||
METADATA_GENERATOR_PARAMS_PDF := -f pdf | ||
METADATA_GENERATOR_PARAMS_HTML_CHUNKED := -f chunked | ||
else ifeq ($(METADATA_GENERATOR),) | ||
$(error 'METADATA_GENERATOR' not not configured, run ./configure in the root directory) | ||
else | ||
$(error '$(METADATA_GENERATOR)' not supported, only asciidoctor and asciidoc are supported) | ||
endif | ||
|
||
ifdef VERBOSE | ||
METADATA_GENERATOR_PARAMS += -v | ||
endif | ||
|
||
CLEAN_TARGETS := *.css *.js *.txt | ||
MAKE_TARGETS := metadata.json | ||
|
||
ifeq ($(WITH_METADATA_HTML),yes) | ||
MAKE_TARGETS += metadata.html | ||
ifneq ($(METADATA_GENERATOR_PARAMS_HTML_CHUNKED),) | ||
MAKE_TARGETS += metadata.chunked | ||
endif | ||
endif | ||
|
||
ifeq ($(WITH_METADATA_PDF),yes) | ||
MAKE_TARGETS += metadata.pdf | ||
endif | ||
|
||
HOST_MAKE_TARGETS := docparse | ||
|
||
INSTALL_DIR = metadata | ||
INSTALL_TARGETS = *.css *.js | ||
|
||
ifndef METADATA_GENERATOR | ||
METADATA_GENERATOR := asciidoctor | ||
endif | ||
|
||
.PHONY: metadata.json | ||
|
||
metadata.json: docparse | ||
$(abs_srcdir)/parse.sh > metadata.json | ||
|
||
txt: metadata.json | ||
$(abs_srcdir)/testinfo.pl metadata.json | ||
|
||
ifeq ($(WITH_METADATA_HTML),yes) | ||
metadata.html: txt | ||
$(METADATA_GENERATOR_CMD) $(METADATA_GENERATOR_PARAMS) $(METADATA_GENERATOR_PARAMS_HTML) | ||
|
||
ifneq ($(METADATA_GENERATOR_PARAMS_HTML_CHUNKED),) | ||
metadata.chunked: txt | ||
$(METADATA_GENERATOR_CMD) $(METADATA_GENERATOR_PARAMS) $(METADATA_GENERATOR_PARAMS_HTML_CHUNKED) | ||
endif | ||
endif | ||
|
||
ifeq ($(WITH_METADATA_PDF),yes) | ||
metadata.pdf: txt | ||
$(METADATA_GENERATOR_CMD) $(METADATA_GENERATOR_PARAMS) $(METADATA_GENERATOR_PARAMS_PDF) | ||
endif | ||
|
||
include $(top_srcdir)/include/mk/generic_leaf_target.mk |
Oops, something went wrong.