Changeset - 441df63ee7cc
[Not reviewed]
0 4 3
Bradley Kuhn (bkuhn) - 10 years ago 2014-11-06 17:34:18
bkuhn@ebb.org
Hack tex4ht's overlib stuff to use jQuery tooltip

tex4ht supports "overlib" for footnote popups. The hack is pretty
straightforward; it dumps a Javascript area into a .js file that can
then be used by overlib to popup stuff.

This hack is to use that output to make the same thing work with jQuery
UI's tooltip widget.

Note that we run with overlib support first, then *without* it in the
Makefile setup. This is to force the needed .js file to be generated,
but make sure the HTML doesn't try to load overlib (which is default).

(This should be adapted as a patch to upstream tex4ht ultimately.)

Also included herein are improvements to the Makefile to build the HTML
output.
7 files changed with 137 insertions and 12 deletions:
0 comments (0 inline, 0 general)
Makefile
Show inline comments
 
# Makefile for Copyleft Tutorial                      -*- GNUMakefile -*-
 

	
 
ifndef BOOK_BASE
 
BOOK_BASE=comprehensive-gpl-guide
 
endif
 

	
 
LATEX_INPUT_FILES = $(BOOK_BASE).tex compliance-guide.tex license-texts.tex enforcement-case-studies.tex gpl-lgpl.tex
 
BOOK_CLASS_FILE = gpl-book.cls
 

	
 
HTML_OUTPUT_DIR = public_html
 

	
 
TEX4HT=tex4ht
 
T4HT=t4ht
 
HTLATEX=htlatex
 
PDFLATEX = pdflatex
 
LATEX = latex
 
BIBTEX = bibtex
 
FIG2DEV = fig2dev
 
DVIPS=dvips
 

	
 
all:	err $(BOOK_BASE).pdf $(BOOK_BASE).ps $(BOOK_BASE).html
 
all:	err $(BOOK_BASE).pdf $(BOOK_BASE).ps html
 

	
 
pdf:	err $(BOOK_BASE).pdf
 

	
 
html:	$(HTML_OUTPUT_DIR)/monolithic/$(BOOK_BASE).html $(HTML_OUTPUT_DIR)/$(BOOK_BASE).html pdf $(BOOK_BASE).ps
 
	/bin/ln -f $(BOOK_BASE).ps $(HTML_OUTPUT_DIR)/$(BOOK_BASE).ps
 
	/bin/ln -f $(BOOK_BASE).pdf $(HTML_OUTPUT_DIR)/$(BOOK_BASE).pdf
 

	
 
.SUFFIXES: .fig .postscript .eps .pdf .pstex_t .pstex .ps .dvi .tex
 

	
 
.postscript.pdf:
 
	ps2pdf $< $@
 

	
 
.postscript.eps:
 
	ps2epsi $< $@
 

	
 
.dvi.ps:
 
	$(DVIPS) $< -o $@
 

	
 
.tex.dvi:
 
	$(LATEX) $<
 

	
 
.fig.pdf:
 
	$(FIG2DEV) -L pdf -p "portrait" -c $< > $@
 

	
 
.fig.pstex_t:
 
	$(FIG2DEV) -L pstex_t $< > $@
 

	
 
.fig.pstex:
 
	$(FIG2DEV) -L pstex $< > $@
 

	
 
$(BOOK_BASE).pdf: $(PDF_FIGS) $(LATEX_INPUT_FILES) $(BOOK_CLASS_FILE)
 
	$(PDFLATEX) $(BOOK_BASE)
 
	$(PDFLATEX) $(BOOK_BASE)
 
	$(PDFLATEX) $(BOOK_BASE)
 

	
 
$(BOOK_BASE).html: $(LATEX_INPUT_FILES) $(BOOK_CLASS_FILE)
 
	echo "building HTML"
 
	$(LATEX)  '\def\generateHTML{\hfill}'  '\input'  $(BOOK_BASE).tex
 
	$(LATEX)  '\def\generateHTML{\hfill}'   '\input'  $(BOOK_BASE).tex
 
	$(TEX4HT) -f/$(BOOK_BASE).tex -i/$(BOOK_TEX_PATH)
 
	$(T4HT) -f/$(BOOK_BASE).tex
 
	rm $(BOOK_BASE).dvi
 
$(HTML_OUTPUT_DIR)/monolithic/$(BOOK_BASE).html: $(LATEX_INPUT_FILES) $(BOOK_CLASS_FILE)
 
	mkdir -p $(HTML_OUTPUT_DIR)/monolithic/js
 
	mkdir -p $(HTML_OUTPUT_DIR)/monolithic/css
 
	/bin/rm -f $(BOOK_BASE)*.html
 
	/bin/rm -f $(BOOK_BASE)*.js
 
	$(HTLATEX) comprehensive-gpl-guide.tex "webhacks,xhtml,mouseover"
 
	$(HTLATEX) comprehensive-gpl-guide.tex "webhacks,xhtml,mouseover"
 
	mv ${BOOK_BASE}*js $(HTML_OUTPUT_DIR)/monolithic/js
 
	/bin/rm -f $(BOOK_BASE)*.html
 
	/bin/rm -f $(BOOK_BASE)*.js
 
	$(HTLATEX) comprehensive-gpl-guide.tex "webhacks,xhtml"
 
	mv $(BOOK_BASE)*html $(HTML_OUTPUT_DIR)/monolithic
 
	mv cm*png $(HTML_OUTPUT_DIR)/monolithic
 
	mv ${BOOK_BASE}*css $(HTML_OUTPUT_DIR)/monolithic
 
	cp -pa js/*js $(HTML_OUTPUT_DIR)/monolithic/js
 
	cp -pa css/*css $(HTML_OUTPUT_DIR)/monolithic/css
 

	
 
$(HTML_OUTPUT_DIR)/$(BOOK_BASE).html: $(LATEX_INPUT_FILES) $(BOOK_CLASS_FILE)
 
	mkdir -p $(HTML_OUTPUT_DIR)/js
 
	mkdir -p $(HTML_OUTPUT_DIR)/css
 
	/bin/rm -f $(BOOK_BASE)*.html
 
	/bin/rm -f $(BOOK_BASE)*.js
 
	$(HTLATEX) comprehensive-gpl-guide.tex "webhacks,xhtml,3,next,mouseover"
 
	mv ${BOOK_BASE}*js $(HTML_OUTPUT_DIR)/js
 
	/bin/rm -f $(BOOK_BASE)*.html
 
	/bin/rm -f $(BOOK_BASE)*.js
 
	$(HTLATEX) comprehensive-gpl-guide.tex "webhacks,3,next,webhacks"
 
	mv ${BOOK_BASE}*css $(HTML_OUTPUT_DIR)
 
	mv ${BOOK_BASE}*html $(HTML_OUTPUT_DIR)
 
	mv cm*png $(HTML_OUTPUT_DIR)
 
	cp -pa js/*js $(HTML_OUTPUT_DIR)/js
 
	cp -pa css/*css $(HTML_OUTPUT_DIR)/css
 

	
 
$(BOOK_BASE).dvi: $(LATEX_INPUT_FILES) $(EPS_FIGS) ${BOOK_CLASS_FILE}
 
	$(LATEX)  $(BOOK_BASE).tex
 
	$(LATEX)  $(BOOK_BASE).tex
 

	
 
clean:
 
	/bin/rm -f $(BOOK_BASE).ps $(BOOK_BASE).pdf $(BOOK_BASE).log texput.log $(BOOK_BASE).lg $(BOOK_BASE).tmp $(BOOK_BASE).xref *.4ct *.4tc *.aux *.dvi $(BOOK_BASE)*.html *.idv *.lg *.tmp $(BOOK_BASE).css $(BOOK_BASE).log $(BOOK_BASE).out $(BOOK_BASE)-js.*
 

	
 
	/bin/rm -f $(BOOK_BASE).ps $(BOOK_BASE).pdf $(BOOK_BASE).log texput.log $(BOOK_BASE).lg $(BOOK_BASE).tmp $(BOOK_BASE).xref *.4ct *.4tc *.aux *.dvi $(BOOK_BASE)*.html *.idv *.lg *.tmp $(BOOK_BASE).css $(BOOK_BASE).log $(BOOK_BASE).out $(BOOK_BASE)-js.* cm*png
 
	/bin/rm -rf public_html
 
err: ; $(ERR)
README.md
Show inline comments
 
# Copyleft and GPL Tutorial Materials
 

	
 
This repository contains various tutorial materials regarding the suite of GNU General
 
Public Licenses and copyleft (as applied to software).
 

	
 
The primary item of interest is an omnibus book on copyleft that is built
 
from the comprehensive-GPL-guide.tex file.
 

	
 
You can likely build a PDF file from:
 
You can build this project with the following command:
 

	
 
    $ pdflatex comprehensive-gpl-guide.tex && pdflatex comprehensive-gpl-guide.tex && pdflatex comprehensive-gpl-guide.tex
 
    $ make
 

	
 
HTML output will be in the public_html directory and a PDF file will be in  comprehensive-gpl-guide.pdf.
 

	
 
You can also [download a prebuilt PDF file](http://ebb.org/bkuhn/articles/copyleft-book.pdf).
 

	
 
Note the
 
[canonical repository for this project is on gitorious](https://gitorious.org/gpl-compliance-tools/tutorial/source/master:). Copies
 
of this repository on other sites is for informational and backup purposes
 
only.
 

	
 
## Contributing
 

	
 
Patches to this project are welcome.  Please
 
[submit a merge request on Gitorious](https://gitorious.org/gpl-compliance-tools/merge_requests).
 
If you cannot use that, you can email patches directly to Bradley.  You can
 
find his email address in the commit logs.
TODO.md
Show inline comments
 
# TODOS
 

	
 
* Document [creating an EPUB](http://tex.stackexchange.com/questions/1551/use-latex-to-produce-epub)
 
* Adapt the jQuery UI tooltip hack used for the overlib replacement with
 
  tex4ht to upstream tex4ht.
comprehensive-gpl-guide.tex
Show inline comments
 
% comprehensive-gpl-guide.tex                                    -*- LaTeX -*-
 
%
 
% Toplevel file to build the entire book.
 
\documentclass[10pt, letterpaper, openany, oneside]{book}
 
% I'm somewhat convinced that this book would be better formatted using
 
%  the memoir class :
 
%    http://www.ctan.org/pkg/memoir
 
%   http://mirror.unl.edu/ctan/macros/latex/contrib/memoir/memman.pdf
 

	
 
% For the moment, I've thrown in fancychap because I don't have time to
 
% research memoir.
 

	
 
\usepackage{hyperref}
 
\usepackage{enumerate}
 
\usepackage[Conny]{fncychap}
 
\usepackage[dvips]{graphicx}
 
\usepackage[verbose, twoside, dvips,
 
              paperwidth=8.5in, paperheight=11in,
 
              left=1in, right=1in, top=1.25in, bottom=.75in,
 
           ]{geometry}
 

	
 
\newcommand{\tutorialpartsplit}[2]{#2}
 

	
 
%\input{no-numbers-on-table-of-contents}
 

	
 
\begin{document}
 

	
 
\pagestyle{plain}
 
\pagenumbering{roman}
 

	
 
\frontmatter
 

	
 
\begin{titlepage}
 

	
 
\begin{center}
 

	
 
{\Huge
 
{\sc Copyleft and the  \\
 

	
 
GNU General Public License:
 

	
 
\vspace{.25in}
 

	
 
A Comprehensive Tutorial
 
}}
 
\vfill
 

	
 
{\parindent 0in
 
\begin{tabbing}
 
Copyright \= \copyright{} 2003--2007 \hspace{1.mm} \=  \kill
 
Copyright \> \copyright{} 2014 \>  Bradley M. Kuhn. \\
 
Copyright \> \copyright{} 2014 \>  Anthony K. Sebro, Jr. \\
 
Copyright \> \copyright{} 2008 \>  Software Freedom Law Center. \\
 
Copyright \> \copyright{} 2003-2007 \> Free Software Foundation, Inc. \\
 
\end{tabbing}
 

	
 
\vspace{.3in}
 

	
 
The copyright holders hereby grant the freedom to copy, modify, convey,
 
Adapt, and/or redistribute this work under the terms of the Creative Commons
 
Attribution Share Alike 4.0 International License.  A copy of that license is
 
available at \verb=https://creativecommons.org/licenses/by-sa/4.0/legalcode=.
 

	
 
Each part of this book, except the appendix, is separately under this same
 
license, but copyrighted by different entities at different times.  Each part
 
therefore also contains its own copyright and licensing notice.  The notice
 
above is for the entire work, and includes the full copyright and licensing
 
details, except for the appendix.
 

	
 
Since the appendix includes copies of the texts of various licenses published
 
by FSF, and they are all licensed under the license, ``Everyone is permitted
 
to copy and distribute verbatim copies of this license document, but changing
 
it is not allowed.''.  However, those who seek to make modified versions of
 
those licenses should note the
 
\href{https://www.gnu.org/licenses/gpl-faq.html#ModifyGPL}{explanation given in the GPL FAQ}.
 

	
 
\vfill
 

	
 
Patches are welcome to this material.  Sources can be found in the Git
 
repository at: \url{https://gitorious.org/gpl-compliance-tools/tutorial/}
 
}
 
\end{center}
 

	
 
\end{titlepage}
 

	
 
\tableofcontents
 

	
 
\chapter{Preface}
 

	
 
This tutorial is the culmination of nearly a decade of studying and writing
 
about software freedom licensing and the GPL\@.  Each part of this tutorial
 
is a course unto itself, educating the reader on a myriad of topics from the
 
deep details of the GPLv2 and GPLv3, common business models in the copyleft
 
licensing area (both the friendly and unfriendly kind), best practices for
 
compliance with the GPL, for engineers, managers, and lawyers, as well as
 
real-world case studies of GPL enforcement matters.
 

	
 
It is unlikely that all the information herein is necessary to learn all at
 
once, and therefore this tutorial likely serves best as a reference book.
 
The material herein has been used as the basis for numerous live tutorials
 
and discussion groups since 2002, and the materials have been periodically
 
updated.   They likely stand on their own as excellent reference material.
 

	
 
However, if you are reading these course materials without attending a live
 
tutorial session, please note that this material is merely a summary of the
 
highlights of the various CLE and other tutorial courses based on this
 
material.  Please be aware that during the actual courses, class discussion
 
and presentation supplements this printed curriculum.  Simply reading this
 
material is \textbf{not an equivalent} for attending a course.
 

	
 
\mainmatter
 

	
 
\input{gpl-lgpl}
 

	
 
\input{compliance-guide}
 

	
 
\input{enforcement-case-studies}
 

	
 
\appendix
 

	
 
\input{license-texts}
 

	
 

	
css/footnote-hack.css
Show inline comments
 
new file 100644
 
/*  Released as CC0: http://creativecommons.org/publicdomain/zero/1.0/ */
 
/*   by Bradley M. Kuhn <bkuhn@ebb.org>  */
 

	
 
.ui-tooltip, .arrow:after {
 
background: black;
 
border: 2px solid white;
 
}
 
.ui-tooltip {
 
padding: 10px 20px;
 
color: white;
 
border-radius: 20px;
 
box-shadow: 0 0 7px black;
 
max-width: 50%;
 
}
 
.arrow {
 
width: 70px;
 
height: 16px;
 
overflow: hidden;
 
position: absolute;
 
left: 50%;
 
margin-left: -35px;
 
bottom: -16px;
 
}
 
.arrow.top {
 
top: -16px;
 
bottom: auto;
 
}
 
.arrow.left {
 
left: 20%;
 
}
 
.arrow:after {
 
content: "";
 
position: absolute;
 
left: 20px;
 
top: -20px;
 
width: 25px;
 
height: 25px;
 
box-shadow: 6px 5px 9px -9px black;
 
-webkit-transform: rotate(45deg);
 
-ms-transform: rotate(45deg);
 
transform: rotate(45deg);
 
}
 
.arrow.top:after {
 
bottom: -20px;
 
top: auto;
 
}
js/tex4ht-footnote-hack.js
Show inline comments
 
new file 100644
 
//  Released as CC0: http://creativecommons.org/publicdomain/zero/1.0/
 
//   by Bradley M. Kuhn <bkuhn@ebb.org>
 

	
 
$(function() {
 
$( ".footnote-mark" ).tooltip({
 
    items: "a",
 
    hide: { duration: 5000 },
 
    position: {
 
        my: "center bottom-20",
 
        at: "center left",
 
        using: function( position, feedback ) {
 
            $( this ).css( position );
 
            $( "<div>" )
 
                .addClass( "arrow" )
 
                .addClass( feedback.vertical )
 
                .addClass( feedback.horizontal )
 
                .appendTo( this );
 
        }
 
    },
 
    content: function() {
 
        var element = $( this );
 
        if ( element.is( 'a' ) ) {
 
            var footnoteVal = element.attr( "href" );
 
            return tex4ht[footnoteVal.substring(footnoteVal.search("#") + 1)];
 
        }
 
    }});
 
});
 
// $(function() {
 
// $( document ).tooltip({
 
// content: function() {
 
//     var element = $( this );
 
//     return "HI";
 
// }});});
webhacks.cfg
Show inline comments
 
new file 100644
 
\Preamble{xhtml}
 
\begin{document}
 
\Configure{@HEAD}{\HCode{<link rel="stylesheet" type="text/css" href="css/footnote-hack.css" /> \Hnewline}}
 
  \Configure{@HEAD}{\HCode{<script type="text/javascript" src="http://copyleft.org/jquery-1.10.2.js"></script>\Hnewline}}
 
  \Configure{@HEAD}{\HCode{<script type="text/javascript" src="http://copyleft.org/jquery-ui-1.11.2.js"></script>\Hnewline}}
 
  \Configure{@HEAD}{\HCode{<script type="text/javascript" src="js/comprehensive-gpl-guide-js.js"></script>\Hnewline}}
 
  \Configure{@HEAD}{\HCode{<script type="text/javascript" src="js/tex4ht-footnote-hack.js"></script>\Hnewline}}
 
\EndPreamble
0 comments (0 inline, 0 general)