diff options
-rw-r--r-- | Makefile.in | 128 | ||||
-rw-r--r-- | build_manifest.sh | 38 | ||||
-rw-r--r-- | build_website.sh | 125 |
3 files changed, 46 insertions, 245 deletions
diff --git a/Makefile.in b/Makefile.in index 5c8ff90..54b24ce 100644 --- a/Makefile.in +++ b/Makefile.in @@ -31,74 +31,12 @@ ASCIIDOCVERSION = @PACKAGE_VERSION@ ASCIIDOCDATE = @PACKAGE_DATE@ ASCIIDOCCONF = $(sysconfdir)/asciidoc -prog = asciidoc.py a2x.py -progdir = $(bindir) - manp = $(patsubst %1.txt,%1,$(wildcard doc/*.1.txt)) manpdir = $(mandir)/man1 -conf = $(wildcard *.conf) -confdir = $(ASCIIDOCCONF) - -filtersdir = $(ASCIIDOCCONF)/filters - -codefilter = filters/code/code-filter.py -codefilterdir = $(filtersdir)/code -codefilterconf = filters/code/code-filter.conf -codefilterconfdir = $(filtersdir)/code - -graphvizfilter = filters/graphviz/graphviz2png.py -graphvizfilterdir = $(filtersdir)/graphviz -graphvizfilterconf = filters/graphviz/graphviz-filter.conf -graphvizfilterconfdir = $(filtersdir)/graphviz - -musicfilter = filters/music/music2png.py -musicfilterdir = $(filtersdir)/music -musicfilterconf = filters/music/music-filter.conf -musicfilterconfdir = $(filtersdir)/music - -sourcefilterconf = filters/source/source-highlight-filter.conf -sourcefilterconfdir = $(filtersdir)/source - -latexfilter = filters/latex/latex2img.py -latexfilterdir = $(filtersdir)/latex -latexfilterconf = filters/latex/latex-filter.conf -latexfilterconfdir = $(filtersdir)/latex - -unwraplatexfilter = filters/unwraplatex.py -unwraplatexfilterdir = $(filtersdir) - -themesdir = $(ASCIIDOCCONF)/themes - -flasktheme = themes/flask/flask.css -flaskthemedir = $(themesdir)/flask - -volnitskytheme = themes/volnitsky/volnitsky.css -volnitskythemedir = $(themesdir)/volnitsky - -docbook = $(wildcard docbook-xsl/*.xsl) -docbookdir = $(ASCIIDOCCONF)/docbook-xsl - -dblatex = $(wildcard dblatex/*.xsl) $(wildcard dblatex/*.sty) -dblatexdir = $(ASCIIDOCCONF)/dblatex - -css = $(wildcard stylesheets/*.css) -cssdir = $(ASCIIDOCCONF)/stylesheets - -js = $(wildcard javascripts/*.js) -jsdir = $(ASCIIDOCCONF)/javascripts - -callouts = $(wildcard images/icons/callouts/*) -calloutsdir = $(ASCIIDOCCONF)/images/icons/callouts - -icons = $(wildcard images/icons/*.png) images/icons/README -iconsdir = $(ASCIIDOCCONF)/images/icons - doc = $(wildcard README*) $(wildcard BUGS*) $(wildcard INSTALL*) $(wildcard CHANGELOG*) -DATATARGETS = manp conf docbook dblatex css js callouts icons codefilterconf graphvizfilterconf latexfilterconf musicfilterconf sourcefilterconf flasktheme volnitskytheme -PROGTARGETS = prog codefilter graphvizfilter latexfilter musicfilter unwraplatexfilter -TARGETS = $(DATATARGETS) $(PROGTARGETS) doc +TARGETS = doc INSTDIRS = $(TARGETS:%=%dir) @@ -121,36 +59,9 @@ help : Makefile $(INSTDIRS): $(INSTALL) -d $(DESTDIR)$($@) -$(PROGTARGETS): % : %dir - $(INSTALL_PROG) $($@) $(DESTDIR)$($<)/ - -$(DATATARGETS): % : %dir - $(INSTALL_DATA) $($@) $(DESTDIR)$($<)/ - $(manp): %.1 : %.1.txt python3 -m asciidoc.a2x -f manpage $< -progsymlink: - (cd $(DESTDIR)$(progdir); ln -sf asciidoc.py asciidoc) - (cd $(DESTDIR)$(progdir); ln -sf a2x.py a2x) - -##. - -## version: print out the version to use for the other targets -.PHONY: version -version: - @echo "Version $(ASCIIDOCVERSION) (released $(ASCIIDOCDATE))"; - -## vers_update: updates the version string in asciidoc and a2x -.PHONY: vers_update -vers_update: - @for f in $(prog); do \ - echo "Setting VERSION in $$f to $(ASCIIDOCVERSION)"; \ - $(SED) "s#^VERSION = '.*'#VERSION = '$(ASCIIDOCVERSION)'#" $$f > $$f.out; \ - mv $$f.out $$f; \ - chmod +x $$f; \ - done - ##. DOC_FILES = CHANGELOG.txt README.asciidoc BUGS.txt INSTALL.txt doc/a2x.1.txt \ @@ -158,8 +69,6 @@ DOC_FILES = CHANGELOG.txt README.asciidoc BUGS.txt INSTALL.txt doc/a2x.1.txt \ doc/epub-notes.txt doc/publishing-ebooks-with-asciidoc.txt \ doc/source-highlight-filter.txt doc/slidy.txt doc/slidy-example.txt -WEBSITE_FILES = $(wildcard website/*.txt) - ## spell: run doc_spell and website_spell .PHONY: spell spell: doc_spell website_spell @@ -173,19 +82,15 @@ doc_spell: aspell check -p ./doc/asciidoc.dict $$f; \ done -## website_spell: run aspell over all files under website/ -.PHONY: website_spell -website_spell: - @for f in $(WEBSITE_FILES); do \ - echo "aspell check -p ./website/asciidoc-website.dict $$f"; \ - aspell check -p ./website/asciidoc-website.dict $$f; \ - done - ##. +.PHONY: pip +pip: + python3 -m pip install . + ## install: install asciidoc to target directory .PHONY: install -install: all $(PROGTARGETS) $(DATATARGETS) progsymlink +install: all pip $(DATATARGETS) ## build: runs manpages .PHONY: build @@ -212,28 +117,11 @@ docs: $(INSTALL) -d $(DESTDIR)$(docdir)/doc ( cd doc && \ cp -R * $(DESTDIR)$(docdir)/doc ) - $(INSTALL) -d $(DESTDIR)$(docdir)/website - ( cd website && \ - cp -R * $(DESTDIR)$(docdir)/website ) - -## website: generates the website into ./gh-pages directory (which will point at gh-pages branch) -.PHONY: website -website: - bash build_website.sh - -## tags: generate tags index files for use with vim and other tags-capable editors -.PHONY: tags -tags: - rm -f tags - ctags asciidoc.py asciidocapi.py tests/testasciidoc.py ## uninstall: uninstall asciidoc .PHONY: uninstall uninstall: - rm -f $(DESTDIR)$(progdir)/asciidoc - rm -f $(DESTDIR)$(progdir)/asciidoc.py - rm -f $(DESTDIR)$(progdir)/a2x - rm -f $(DESTDIR)$(progdir)/a2x.py + python3 -m pip uninstall asciidoc rm -f $(DESTDIR)$(manpdir)/asciidoc.1 rm -f $(DESTDIR)$(manpdir)/testasciidoc.1 rm -f $(DESTDIR)$(manpdir)/a2x.1 @@ -251,7 +139,7 @@ MANIFEST: MANIFEST.in ##. ## dist: creates the zip and tarball for release .PHONY: dist -dist: vers_update manpages MANIFEST +dist: manpages MANIFEST mkdir -p build rm -rf build/* tar -czf build/asciidoc-tmp.tar.gz -T MANIFEST diff --git a/build_manifest.sh b/build_manifest.sh new file mode 100644 index 0000000..4f427ce --- /dev/null +++ b/build_manifest.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +cat > MANIFEST.tmp <<- EOM +asciidoc/*.py +asciidoc/**/* +doc/asciidoc.conf +doc/article-docinfo.xml +doc/customers.csv +doc/*.1 +doc/*.txt +doc/asciidoc.dict +tests/data/* +tests/testasciidoc.py +tests/testasciidoc.conf +*.sh +BUGS.txt +CHANGELOG.txt +configure +configure.ac +COPYRIGHT +Dockerfile +MANIFEST +MANIFEST.in +install-sh +INSTALL.txt +Makefile +Makefile.in +README.md +EOM + +rm -f MANIFEST +while read in; do + if [ ! -z "${in}" ]; then + ls -1Ad ${in} | grep -v ".pyc" | grep -v "__pycache__" >> MANIFEST + fi +done < MANIFEST.tmp +echo "MANIFEST" >> MANIFEST +rm -f MANIFEST.tmp diff --git a/build_website.sh b/build_website.sh deleted file mode 100644 index d58d812..0000000 --- a/build_website.sh +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/env bash - -# layout1 - Tables based layout. -# layout2 - CSS based layout -LAYOUT=layout2 - -ASCIIDOCVERSION=$(sed -n '1p' configure.ac | grep -o -e "[0-9]*\.[0-9]*\.[a-z0-9]*") -# trying to embed this string with spaces into the command below causes -# sys.argv to get funny, and I cannot figure out why -ASCIIDOCDATE=$(sed -n '3p' configure.ac | grep -o -e "[0-9]* [A-Z][a-z]* [0-9]*") - -# execute this as a function so that we do not run afoul of bash's string interpolation / splitting -# when trying to execute commands from variables -asciidoc() { - python3 -m asciidoc -a revnumber="${ASCIIDOCVERSION}" -a revdate="${ASCIIDOCDATE}" "$@" -} - -A2X="python3 -m asciidoc.a2x" - -# Step 0: Initialize the gh-pages folder -if [ ! -d gh-pages ]; then - git clone https://github.com/asciidoc/asciidoc-py3 gh-pages - pushd gh-pages - git checkout gh-pages - popd -fi -pushd gh-pages -find . -maxdepth 1 -type f -not \( -name '*.md' -o -name '*.md5' -o -name '*.epub' -o -name 'CNAME' -o -name '.nojekyll' \) -exec rm -rf {} \; -rm -rf chunked -rm -rf images -popd - - -# Step 1: Conslidate all files into the gh-pages directory -files=( - asciidoc/resources/docbook-xsl/asciidoc-docbook-xsl.txt - asciidoc/resources/filters/graphviz/asciidoc-graphviz-sample.txt - asciidoc/resources/stylesheets/asciidoc.css - asciidoc/resources/javascripts/asciidoc.js - asciidoc/resources/javascripts/ASCIIMathML.js - CHANGELOG.txt - INSTALL.txt - asciidoc/resources/javascripts/LaTeXMathML.js - asciidoc/resources/stylesheets/xhtml11-quirks.css -) - -for file in ${files[@]}; do - name=$(basename ${file}) - set -x - cp ${file} gh-pages/${name} - { set +x; } 2>/dev/null -done - -set -x -cp website/* gh-pages -cp doc/*.txt gh-pages -cp -R images gh-pages -cp -R asciidoc/resources/icons gh-pages/images - -cp doc/asciidoc.1.txt gh-pages/manpage.txt -cp doc/asciidoc.txt gh-pages/userguide.txt -{ set +x; } 2>/dev/null - -# Step 2: Build the files -ASCIIDOC="asciidoc -b xhtml11 -f gh-pages/${LAYOUT}.conf -a icons -a badges -a max-width=70em -a source-highlighter=highlight" -for file in gh-pages/*.txt; do - name=${file:9:-4} - opts="" - if [ "${name}" = "userguide" ] || [ "${name}" = "faq" ]; then - opts="-a toc -a numbered" - elif [ "${name}" = "index" ]; then - opts="-a index-only" - elif [ "${name}" = "manpage" ] || [ "${name}" = "a2x.1" ] || [ "${name}" = "asciidoc.1" ]; then - opts="-d manpage" - elif [ "${name}" = "asciimathml" ]; then - opts="-a asciimath" - elif [ "${name}" = "latexmath" ]; then - opts="-a latexmath" - fi - if [ "${name}" = "index" ] || [ "${name}" = "INSTALL" ] || [ "${name}" = "asciidocapi" ] || [ "${name}" = "testasciidoc" ] || [ "${name}" = "publishing-ebooks-with-asciidoc" ]; then - opts+=" -a toc -a toclevels=1" - fi - set -x - ${ASCIIDOC} ${opts} ${file} - { set +x; } 2>/dev/null -done - -# Step 3: build out remaining specific files from doc -ASCIIDOC="asciidoc" -# TODO: investigate epub generation (--epubcheck fails) -set -x -${ASCIIDOC} -a data-uri -a icons -a toc -a max-width=55em -o gh-pages/article-standalone.html gh-pages/article.txt -${ASCIIDOC} -b html5 -a icons -a toc2 -a theme=flask -o gh-pages/article-html5-toc2.html gh-pages/article.txt - -${ASCIIDOC} -d manpage -b html4 gh-pages/asciidoc.1.txt -${ASCIIDOC} -b xhtml11 -d manpage -o gh-pages/asciidoc.1.css-embedded.html gh-pages/asciidoc.1.txt -${ASCIIDOC} -d manpage -b docbook gh-pages/asciidoc.1.txt -pushd gh-pages -xsltproc --nonet ../asciidoc/resources/docbook-xsl/manpage.xsl asciidoc.1.xml -rm asciidoc.1.xml -popd - -${ASCIIDOC} -b xhtml11 -n -a toc -a toclevels=2 -o gh-pages/asciidoc.css-embedded.html gh-pages/asciidoc.txt -# ${A2X} -f epub -d book --epubcheck --icons asciidoc.txt -${A2X} -f chunked -d book --icons -D ./gh-pages gh-pages/asciidoc.txt -mv gh-pages/asciidoc.chunked gh-pages/chunked - -# ${A2X} -f epub -d book --epubcheck --icons book.txt - -${ASCIIDOC} -n -b docbook gh-pages/article.txt -pushd gh-pages -xsltproc --nonet --stringparam admon.textlabel 0 ../asciidoc/resources/docbook-xsl/fo.xsl article.xml > article.fo -fop article.fo article.pdf -{ set +x; } 2>/dev/null -rm gh-pages/article.xml -rm gh-pages/article.fo -popd - -set -x -${ASCIIDOC} -b docbook gh-pages/asciidoc.txt -pushd gh-pages -dblatex -p ../asciidoc/resources/dblatex/asciidoc-dblatex.xsl -s ../asciidoc/resources/dblatex/asciidoc-dblatex.sty -o asciidoc.pdf asciidoc.xml -{ set +x; } 2>/dev/null -rm asciidoc.xml -popd |