Skip to content

Commit

Permalink
harmonize i/e formats and improve doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromedockes committed Feb 25, 2021
1 parent aacdf48 commit 016dabb
Show file tree
Hide file tree
Showing 35 changed files with 1,902 additions and 1,602 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
docs/documentation.html
docs/*.html
docs/gh-pages-site/

cmake_build/
qmake_build/
Expand Down
39 changes: 23 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,33 +96,40 @@ install(TARGETS labelbuddy
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")

file(WRITE "${CMAKE_BINARY_DIR}/copyright"
"Copyright (C) 2010-2013 ${CPACK_DEBIAN_PACKAGE_MAINTAINER}
"Copyright (C) 2021 ${CPACK_DEBIAN_PACKAGE_MAINTAINER}
This software may be licensed under the terms of the
GNU Lesser General Public License Version 3 (the ``LGPL''),
or (at your option) any later version.
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Software distributed under the License is distributed
on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
express or implied. See the LGPL for the specific language
governing rights and limitations.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the LGPL along with this
program. If not, go to http://www.gnu.org/licenses/lgpl.html
or write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
You should have received a copy of the GNU General Public License
along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
On Debian systems, the complete text of the GNU Lesser General Public
License can be found in `/usr/share/common-licenses/LGPL-3'.")
On Debian systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL-3'.")

execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/changelog
execute_process(COMMAND gzip -9 -c -n ${CMAKE_SOURCE_DIR}/docs/changelog
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
OUTPUT_FILE "${CMAKE_BINARY_DIR}/changelog.Debian.gz")

install(FILES "${CMAKE_BINARY_DIR}/changelog.Debian.gz"
"${CMAKE_BINARY_DIR}/copyright"
"${CMAKE_SOURCE_DIR}/docs/documentation.html"
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
)
)

execute_process(COMMAND gzip -9 -c -n ${CMAKE_SOURCE_DIR}/docs/man/labelbuddy.1
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
OUTPUT_FILE "${CMAKE_BINARY_DIR}/labelbuddy.1.gz")

install(FILES "${CMAKE_BINARY_DIR}/labelbuddy.1.gz"
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")

include(CPack)
30 changes: 19 additions & 11 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
.PHONY: all clean
html := $(patsubst %.adoc,%.html,$(wildcard *.adoc))
html := $(subst README.html,documentation.html,$(html))
webhtml := $(patsubst %,gh-pages-site/%,$(html))
examples := $(wildcard example_data/*.txt)

all: documentation.html README.rst example_data/example_documents.json
.PHONY: all clean html

documentation.html: documentation.md
pandoc $< -s --toc -N -o $@
all: $(html) $(webhtml) example_data/example_documents.json

README.rst: documentation.md
pandoc documentation.md -t rst --toc -s | \
sed 's/:Author:/..\n Author: /;/\.\. raw/,/ *<\/style>/d' > $@
%.html: %.adoc
asciidoctor -b xhtml -a lbversion="$$(cat ../data/VERSION.txt)" $<

gh-pages-site/%.html: %.html
mkdir -p gh-pages-site
xsltproc add_nav.xsl $< > $@

documentation.html: README.adoc
asciidoctor -b xhtml -a lbversion="$$(cat ../data/VERSION.txt)" $< -o $@

example_data/documentation.txt: documentation.html
lynx -dump -nolist -nonumbers -width=70 $< | \
sed '/[email protected]/s/$$/\n/;1,/^ *1 Intro/{s/^\( *\)[*+o]/\1 /}' > $@
lynx -dump -nolist -nonumbers -width=79 $< | \
sed 's/\xe2\x80\x8b//g;/^ *Last updated[-: 0-9]*$$/d' > $@

example_data/example_documents.json: example_data/documentation.txt example_data/make_example_docs.py example_data/hello_annotations.txt
example_data/example_documents.json: $(examples) example_data/documentation.txt example_data/make_example_docs.py
python3 example_data/make_example_docs.py

clean:
rm -f documentation.html README.rst \
rm -f *.html \
example_data/documentation.txt example_data/example_documents.json
Loading

0 comments on commit 016dabb

Please sign in to comment.