From deaa2cbc66ebb34deaf6cfb371893f1b8e4d6684 Mon Sep 17 00:00:00 2001 From: Michael Hanke Date: Mon, 11 May 2009 10:48:32 +0200 Subject: [PATCH] Add new logo svg and general artwork infrastructure. --- Makefile | 12 +- artwork/.gitignore | 3 + artwork/Makefile | 37 +++++ artwork/logo.svg | 314 +++++++++++++++++++++++++++++++++++++++++++ artwork/logo.svgtune | 16 +++ sphinx/conf.py | 17 ++- 6 files changed, 395 insertions(+), 4 deletions(-) create mode 100644 artwork/.gitignore create mode 100644 artwork/Makefile create mode 100644 artwork/logo.svg create mode 100644 artwork/logo.svgtune diff --git a/Makefile b/Makefile index a65b6d1..fd125e1 100644 --- a/Makefile +++ b/Makefile @@ -4,16 +4,22 @@ WWW_DIR = build/html prep: - mkdir -p build/src - cp -r sphinx/* build/src + if [ ! -d build ]; then mkdir build; fi + rsync -rvlhp sphinx/ build/src -html: prep source +pics: + $(MAKE) -C artwork + + +html: pics prep source cd build/src && $(MAKE) html BUILDDIR=$(CURDIR)/build clean: -rm -rf build + $(MAKE) -C artwork clean + distclean: clean diff --git a/artwork/.gitignore b/artwork/.gitignore new file mode 100644 index 0000000..07ff1af --- /dev/null +++ b/artwork/.gitignore @@ -0,0 +1,3 @@ +logo_tuned +logo_tuned/label_w200.png +logo_tuned/fmri_w200.png diff --git a/artwork/Makefile b/artwork/Makefile new file mode 100644 index 0000000..9f88e45 --- /dev/null +++ b/artwork/Makefile @@ -0,0 +1,37 @@ +all:: pics + +SVGIS=$(shell /bin/ls *.svgtune | sed -e 's/.svgtune/_tuned/g') + +pics: $(SVGIS) + +clean:: + for p in *.svg; do rm -f $${p%*.svg}.{pdf,eps,png}; done + rm -rf *_tuned + +ignore-%: + @grep -q "^$*$$" .gitignore || { \ + echo "$*" >> .gitignore; echo "Ignore $@"; } + +%_tuned: %.svgtune ignore-%_tuned + @echo "Splitting SVG using $<" + @svgtune $< + +%.pdf: %.svg ignore-%.pdf + @echo "Rendering $@" + @inkscape -z -f "$<" -A "$@" + +%.png: %.svg ignore-%.png + @echo "Rendering $@" + @inkscape -z -f "$<" -e "$@" -d 150 + +%_w200.png: %.svg ignore-%_w200.png + @echo "Rendering $@" + @inkscape -z -f "$<" -e "$@" -w 200 + + +# Some enforced conversions to overcome problems with transparency issues +# in PDFs +all:: logo_tuned/fmri_w200.png + + +.PHONY: all pics diff --git a/artwork/logo.svg b/artwork/logo.svg new file mode 100644 index 0000000..2bf2b90 --- /dev/null +++ b/artwork/logo.svg @@ -0,0 +1,314 @@ + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/artwork/logo.svgtune b/artwork/logo.svgtune new file mode 100644 index 0000000..020a518 --- /dev/null +++ b/artwork/logo.svgtune @@ -0,0 +1,16 @@ +%file logo.svg + +# Disable ALL layers +layers style=display:none + +layer label=Brain style=display:inline +%save plain + +layer label=Debian style=display:inline +%save label + +layer label=fMRI style=display:inline +%save fmri + +layer label=EEG style=display:inline +%save full diff --git a/sphinx/conf.py b/sphinx/conf.py index 16125ab..7f5eb46 100644 --- a/sphinx/conf.py +++ b/sphinx/conf.py @@ -21,6 +21,21 @@ import sys, os # absolute, like shown here. #sys.path.append(os.path.abspath('.')) +def artworkdir(): + """Look into every parent dir for 'artwork' and return its relative path.""" + level = 0 + while True: + target = os.path.join(*([os.path.pardir] * level + ['artwork'])) + if os.path.isdir(target): + return target + else: + level += 1 + # if there is no way up + if os.path.abspath(os.path.join(*([os.path.pardir] * level))) == \ + os.path.abspath(os.path.join(*([os.path.pardir] * (level + 1)))): + raise(ValueError, "Cannot find 'artwork'.") + + # General configuration # --------------------- @@ -105,7 +120,7 @@ html_title = project # The name of an image file (relative to this directory) to place at the top # of the sidebar. -html_logo = 'pics/neurodebian.png' +html_logo = os.path.join(artworkdir(), 'logo_tuned/fmri_w200.png') # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -- 2.39.2