Skip to content

Commit

Permalink
* Added Makefile
Browse files Browse the repository at this point in the history
* Package docs are now generated from Makefile
  • Loading branch information
osthomas committed Jul 22, 2021
1 parent 34ed992 commit a422613
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 84 deletions.
45 changes: 45 additions & 0 deletions Makefile
@@ -0,0 +1,45 @@
DOCS=docs
DOCS_IMAGES_RAW=$(DOCS)/images
DOCS_IMAGES_ANNOTATED=$(DOCS_IMAGES_RAW)/annotated
ANNOTATED_TIKZ=$(wildcard $(DOCS_IMAGES_ANNOTATED)/*.tikz)
ANNOTATED_JPGS=$(patsubst %.tikz, %.jpg, $(ANNOTATED_TIKZ))
PKG_DOCS=optoConfig96/resources/docs

all: generate_package

generate_docs: $(ANNOTATED_JPGS) $(DOCS)/optoConfig96_guide.html README.md

$(DOCS_IMAGES_ANNOTATED)/%.jpg: $(DOCS_IMAGES_ANNOTATED)/%.tikz
cd $(DOCS_IMAGES_ANNOTATED) ; \
pdflatex $(notdir $<)
gs -sDEVICE=png16m -dJPEGQ=90 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 \
-dDOINTERPOLATE -r95 -o $@ $(patsubst %.tikz, %.pdf, $<)
rm $(DOCS_IMAGES_ANNOTATED)/*.{aux,log,pdf}

$(DOCS)/optoConfig96_guide.html: $(DOCS)/guide.md
pandoc -s $< --css guide.css -o $@

README.md: $(DOCS)/guide.md
# Ignore YAML header
tail -n+5 docs/guide.md > README.md
# Make image paths relative to root
sed -i "s|images/|docs/images/|g" README.md

generate_package: generate_docs
# Copy docs to resources folder to make the documentation available from
# within the application
rm -rf $(PKG_DOCS)
mkdir -p $(PKG_DOCS)/images/annotated
cp $(DOCS)/*.{css,html} $(PKG_DOCS)
cp $(DOCS)/images/*.jpg $(PKG_DOCS)/images
cp $(DOCS)/images/annotated/*.jpg $(PKG_DOCS)/images/annotated
python -m build

.PHONY: test_install
test_install:
rm -rf test_install
mkdir test_install ; cd test_install ; \
python -m venv test_install_venv ; \
source test_install_venv/bin/activate ; \
pip install ../dist/optoConfig96-1.0.3.tar.gz ; \
python -m optoConfig96
@@ -1,5 +1,5 @@
\documentclass{article}
\usepackage[paperwidth=1920px, paperheight=1080px, textwidth=1920px , textheight=1080px, margin=0pt]{geometry}
\usepackage[margin=0pt]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{sans} % font
Expand All @@ -9,14 +9,9 @@
\usepackage[active, tightpage]{preview}
\PreviewEnvironment[]{tikzpicture}
\usetikzlibrary{shapes, arrows.meta, calc, intersections, decorations.text, positioning}
\graphicspath{{/home/oliver/Code/optoPlate96/python/docs/images/}}

\tikzset{
every node/.append style={inner sep=5pt, outer sep=0},
imgnode/.style={inner sep=0, outer sep=0, anchor=south west, align=center},
number/.append style={draw=red!50, line width=2pt, fill=red!10, circle, font=\fontsize{70pt}{70pt}\bfseries\selectfont}
}

\begin{document}
<>
\end{document}
Binary file modified docs/images/annotated/bulk_assign.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions docs/images/annotated/bulk_assign.tikz
@@ -1,14 +1,17 @@
\begin{tikzpicture}[>=stealth, line width=3pt]
\input{annotation_preamble}
\PassOptionsToPackage{paperwidth=1920px, paperheight=1080px, textwidth=1920px, textheight=1080px}{geometry}

\begin{document}
\begin{tikzpicture}[>=stealth, line width=3pt]
\tikzset{
line/.style={
draw, white, line width=8pt, ->,
postaction={draw, red, line width=3pt, shorten >=6pt}
}
}

\node (image) [imgnode] {\includegraphics{bulk_assign_programs}};
\node (image2) [imgnode, below=2cm of image] {\includegraphics{bulk_assign_wells}};
\node (image) [imgnode] {\includegraphics{../bulk_assign_programs}};
\node (image2) [imgnode, below=2cm of image] {\includegraphics{../bulk_assign_wells}};

\draw[->, >=stealth] (image) -- (image2) node[midway, right] {\resizebox{3.5cm}{!}{Bulk assign}};

Expand All @@ -22,3 +25,4 @@
\end{scope}

\end{tikzpicture}
\end{document}
Binary file modified docs/images/annotated/overview.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions docs/images/annotated/overview.tikz
@@ -1,8 +1,8 @@
\begin{tikzpicture}%[remember picture, overlay]
%\begin{scope}[shift={(current page.south west)}]


\input{annotation_preamble}
\PassOptionsToPackage{paperwidth=1920px, paperheight=1080px, textwidth=1920px, textheight=1080px}{geometry}

\begin{document}
\begin{tikzpicture}
\node (image) [imgnode,draw] {\includegraphics{overview}};


Expand All @@ -16,5 +16,5 @@
\node[number] at (0.25, 0.25) {5};
\node[number] at (0.75, 0.25) {6};
\end{scope}

\end{tikzpicture}
\end{document}
4 changes: 2 additions & 2 deletions docs/optoConfig96_guide.html
Expand Up @@ -24,7 +24,7 @@
<h1 class="title">optoConfig-96 User Guide</h1>
</header>
<h1 id="optoconfig-96---interactive-configuration-of-experiments-using-the-optoplate-96">optoConfig-96 - Interactive configuration of experiments using the optoPlate-96</h1>
<p>User guide for version 1.0.2.</p>
<p>User guide for version 1.0.3.</p>
<p>If optoConfig-96 was useful to you, please consider citing the paper:</p>
<p>Thomas, OS, Hörner, M &amp; Weber, W: A graphical user interface to design high-throughput optogenetic experiments with the optoPlate-96. <em>Nat Protoc</em> (2020). https://doi.org/10.1038/s41596-020-0349-x</p>
<h1 id="installation-instructions">Installation Instructions</h1>
Expand Down Expand Up @@ -60,7 +60,7 @@ <h2 id="as-a-python-package">As a Python package</h2>
<ol type="1">
<li><p>Clone the repository by entering:</p>
<p><code>git clone https://github.com/WeberSynBioLab/optoConfig-96.git</code></p>
<p>in a terminal. Alternatively, download the package from the <a href="https://github.com/WeberSynBioLab/optoConfig-96/releases">GitHub <em>Releases</em> page</a>. The package is not yet on <a href="https://www.pypi.org">PyPI</a>.</p>
<p>in a terminal. Alternatively, download the package from the <a href="https://github.com/WeberSynBioLab/optoConfig-96/releases">GitHub <em>Releases</em> page</a>.</p>
<ol type="1">
<li>If you cloned the repository, you will first have to prepare the package by running <code>python setup.py build sdist</code> in a terminal, in the directory in which the optoConfig-96 <code>setup.py</code> is located.</li>
<li>The package will be created at <code>dist/optoConfig96-x.x.x.tar.gz</code>, where <code>x.x.x</code> denotes the current version.</li>
Expand Down

This file was deleted.

Binary file modified optoConfig96/resources/docs/images/annotated/bulk_assign.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 0 additions & 24 deletions optoConfig96/resources/docs/images/annotated/bulk_assign.tikz

This file was deleted.

Binary file modified optoConfig96/resources/docs/images/annotated/overview.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 0 additions & 20 deletions optoConfig96/resources/docs/images/annotated/overview.tikz

This file was deleted.

4 changes: 2 additions & 2 deletions optoConfig96/resources/docs/optoConfig96_guide.html
Expand Up @@ -24,7 +24,7 @@
<h1 class="title">optoConfig-96 User Guide</h1>
</header>
<h1 id="optoconfig-96---interactive-configuration-of-experiments-using-the-optoplate-96">optoConfig-96 - Interactive configuration of experiments using the optoPlate-96</h1>
<p>User guide for version 1.0.2.</p>
<p>User guide for version 1.0.3.</p>
<p>If optoConfig-96 was useful to you, please consider citing the paper:</p>
<p>Thomas, OS, Hörner, M &amp; Weber, W: A graphical user interface to design high-throughput optogenetic experiments with the optoPlate-96. <em>Nat Protoc</em> (2020). https://doi.org/10.1038/s41596-020-0349-x</p>
<h1 id="installation-instructions">Installation Instructions</h1>
Expand Down Expand Up @@ -60,7 +60,7 @@ <h2 id="as-a-python-package">As a Python package</h2>
<ol type="1">
<li><p>Clone the repository by entering:</p>
<p><code>git clone https://github.com/WeberSynBioLab/optoConfig-96.git</code></p>
<p>in a terminal. Alternatively, download the package from the <a href="https://github.com/WeberSynBioLab/optoConfig-96/releases">GitHub <em>Releases</em> page</a>. The package is not yet on <a href="https://www.pypi.org">PyPI</a>.</p>
<p>in a terminal. Alternatively, download the package from the <a href="https://github.com/WeberSynBioLab/optoConfig-96/releases">GitHub <em>Releases</em> page</a>.</p>
<ol type="1">
<li>If you cloned the repository, you will first have to prepare the package by running <code>python setup.py build sdist</code> in a terminal, in the directory in which the optoConfig-96 <code>setup.py</code> is located.</li>
<li>The package will be created at <code>dist/optoConfig96-x.x.x.tar.gz</code>, where <code>x.x.x</code> denotes the current version.</li>
Expand Down

0 comments on commit a422613

Please sign in to comment.