texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[8380] Make js distributable and installable


From: gavinsmith0123
Subject: [8380] Make js distributable and installable
Date: Tue, 23 Oct 2018 08:18:05 -0400 (EDT)

Revision: 8380
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8380
Author:   gavin
Date:     2018-10-23 08:18:05 -0400 (Tue, 23 Oct 2018)
Log Message:
-----------
Make js distributable and installable

* texi2any-js.in: New program.

* Makefile.am: Install files under $pkgdatadir.  New target "examples" 
to build examples.  Create texi2any-js from texi2any-js.in.

* style/info.css, style/kawa.js: Move up a directory.

Modified Paths:
--------------
    trunk/js/Makefile.am
    trunk/js/README
    trunk/js/configure.ac

Added Paths:
-----------
    trunk/js/info.css
    trunk/js/kawa.css
    trunk/js/texi2any-js.in

Removed Paths:
-------------
    trunk/js/style/

Modified: trunk/js/Makefile.am
===================================================================
--- trunk/js/Makefile.am        2018-10-22 21:52:23 UTC (rev 8379)
+++ trunk/js/Makefile.am        2018-10-23 12:18:05 UTC (rev 8380)
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-# Copyright (C) 2017  Free Software Foundation, Inc.
+# Copyright (C) 2017-2018  Free Software Foundation, Inc.
 #
 # This file is part of GNU Texinfo.
 #
@@ -16,7 +16,6 @@
 # You should have received a copy of the GNU General Public License
 # along with GNU Texinfo.  If not, see <http://www.gnu.org/licenses/>.
 
-all: $(examples)
 
 phony =
 
@@ -45,21 +44,42 @@
 endif
 
 .PHONY: $(phony)
+EXTRA_DIST =
 
+# Javascript files that will be included in the html pages.  The order
+# of those files is the order in which they will be included
+js_scripts = \
+  modernizr.js \
+  info.js
+
+dist_pkgdata_DATA=$(js_scripts) info.css
+
+bin_SCRIPTS = texi2any-js
+EXTRA_DIST += texi2any-js.in
+
+texi2any-js: texi2any-js.in
+       sed -e 's,@pkgdatadir@,'$(pkgdatadir)',g' $(srcdir)/texi2any-js.in >$@
+       chmod a+x $@
+
+
 ## ---------- ##
 ## Examples.  ##
 ## ---------- ##
 
+examples: $(examples)
+
 examples = \
   examples/hello-html \
   examples/kawa-html
 
-# Javascript files that will be included in the html pages.  The order
-# of those files is the order in which they will be included
-js_scripts = \
-  modernizr.js \
-  info.js
+examples_src = \
+  examples/hello \
+  examples/kawa \
+  kawa.css
 
+EXTRA_DIST += $(examples_src)
+
+
 hello_extra_head = '<link rel="stylesheet" type="text/css" 
href="info.css"/><script src="modernizr.js" 
type="text/javascript"></script><script src="info.js" 
type="text/javascript"></script>'
 
 examples/hello-html: examples/hello/hello.texi
@@ -66,7 +86,7 @@
        $(MAKEINFO) -I=$(srcdir) --html \
          -c EXTRA_HEAD=$(hello_extra_head) \
          examples/hello/hello.texi -o $@ && \
-       cp $(js_scripts) style/info.css $@
+       cp $(js_scripts) info.css $@
 
 kawa_extra_head = '<link rel="stylesheet" type="text/css" 
href="info.css"/><link rel="stylesheet" type="text/css" 
href="kawa.css"/><script src="modernizr.js" 
type="text/javascript"></script><script src="info.js" 
type="text/javascript"></script>'
 
@@ -74,7 +94,7 @@
        $(MAKEINFO) -I=$(srcdir) --html \
          -c EXTRA_HEAD=$(kawa_extra_head) \
          examples/kawa/kawa.texi -o $@ && \
-       cp $(js_scripts) style/info.css style/kawa.css $@
+       cp $(js_scripts) info.css kawa.css $@
 
 clean-local:
        rm -rf $(examples)

Modified: trunk/js/README
===================================================================
--- trunk/js/README     2018-10-22 21:52:23 UTC (rev 8379)
+++ trunk/js/README     2018-10-23 12:18:05 UTC (rev 8380)
@@ -11,7 +11,7 @@
 
   autoreconf -fi
   ./configure
-  make
+  make examples
 
 note: The Makefile doesn't support out of tree build.
 

Modified: trunk/js/configure.ac
===================================================================
--- trunk/js/configure.ac       2018-10-22 21:52:23 UTC (rev 8379)
+++ trunk/js/configure.ac       2018-10-23 12:18:05 UTC (rev 8380)
@@ -1,5 +1,4 @@
-dnl Process this file with autoconf to produce a configure script.
-# Copyright (C) 2017  Free Software Foundation, Inc.
+# Copyright (C) 2017-2018  Free Software Foundation, Inc.
 #
 # This file is part of GNU Texinfo.
 #
@@ -16,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with GNU Texinfo.  If not, see <http://www.gnu.org/licenses/>.
 
-AC_INIT([info.js], [0.1], address@hidden)
+AC_INIT([texinfo-js], [0.0.90], address@hidden)
 AC_CONFIG_SRCDIR([info.js])
 AC_CONFIG_AUX_DIR([build-aux])
 

Copied: trunk/js/info.css (from rev 7983, trunk/js/style/info.css)
===================================================================
--- trunk/js/info.css                           (rev 0)
+++ trunk/js/info.css   2018-10-23 12:18:05 UTC (rev 8380)
@@ -0,0 +1,172 @@
+/*-----------.
+| Sub pages  |
+`-----------*/
+
+div[node] {
+    left: 25%;
+    width: 75%;
+    height: auto;
+    top: 0pt;
+    bottom: 0pt;
+    position: absolute;
+    overflow: hidden;
+}
+
+div[node][hidden] {
+    display: none;
+}
+
+/* Non-iframed main page */
+div[node]#index {
+    overflow: auto
+}
+
+/* Iframed sub pages */
+iframe.node {
+    width: 100%;
+    height: 100%;
+    border: none;
+    margin: 0px;
+    padding: 0px;
+}
+
+#sub-pages.blurred {
+    opacity: 0.2;
+}
+
+.highlight {
+    background: lightgrey;
+}
+
+/*--------------------------.
+| Lateral table of content  |
+`--------------------------*/
+
+#slider {
+    position: fixed;
+    top: 0em;
+    right: 25%;
+    bottom: 0em;
+    left: 0em;
+    height: 100%;
+    width: 25%;
+    overflow: auto;
+    border: none;
+    margin: 0px;
+    padding: 0px;
+}
+
+div.toc-sidebar header {
+    font-size: xx-large;
+}
+
+div.toc-sidebar div {
+    padding: 0.25em;
+    overflow: auto;
+}
+
+div.toc ul[toc-detail] {
+    display: none
+}
+
+div.toc ul, div toc nav {
+    margin: 0px;
+    padding: 0px;
+}
+
+div.toc ul ul {
+    margin-left: 1em;
+}
+
+div.toc a[toc-current] {
+    font-weight: bold
+}
+
+/*-------------.
+| Help screen  |
+`-------------*/
+
+table#keyboard-shortcuts {
+    margin: 20px;
+}
+
+table#keyboard-shortcuts td {
+    padding: 5px;
+}
+
+table#keyboard-shortcuts th {
+    text-align: left;
+}
+
+/* The Modal (background) hidden by default */
+.modal {
+    display: none;
+    position: fixed;
+    z-index: 1;
+    padding-top: 100px;
+    left: 25%;
+    top: 0;
+    width: 75%;
+    height: 100%;
+    overflow: auto;
+    background-color: rgb(0,0,0); /* Fallback color */
+    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
+}
+
+/* Modal Content */
+.modal-content {
+    background-color: white;
+    margin: auto;
+    padding: 20px;
+    width: 80%;
+}
+
+/*-------.
+| Icons  |
+`-------*/
+
+/* The Close Button */
+.close {
+    color: darkgrey;
+    float: right;
+    font-size: xx-large;
+}
+
+#icon-bar {
+    float: right;
+}
+
+.icon {
+    color: darkgrey;
+    font-size: x-large;
+}
+
+.icon:hover, .icon:focus, .close:hover, .close:focus {
+    color: black;
+    cursor: pointer;
+}
+
+/*--------.
+| popups  |
+`--------*/
+
+.text-input, .echo-area, .error {
+    background: lightgrey;
+    z-index: 10;
+    position: fixed;
+    right: 0;
+}
+
+.error .text-input {
+    top: 0;
+    right: 0;
+}
+
+.error {
+    background-color: orange;
+    padding: 5px;
+}
+
+.echo-area {
+    bottom: 0;
+}

Copied: trunk/js/kawa.css (from rev 7983, trunk/js/style/kawa.css)
===================================================================
--- trunk/js/kawa.css                           (rev 0)
+++ trunk/js/kawa.css   2018-10-23 12:18:05 UTC (rev 8380)
@@ -0,0 +1,39 @@
+body.mainbar {
+    background: #fffff5;
+}
+
+pre.example kbd {
+    background-color: #FFFFD0;
+    font-style: normal;
+    font-weight: bold;
+}
+
+#slider {
+    background-color: #F4FCFF;
+}
+
+div.toc-sidebar a {
+    text-decoration: none;
+}
+
+div.toc-sidebar a:hover, div.toc-sidebar a:hover div {
+    color: #fff;
+    background-color: #69C;
+}
+
+div.display {
+  white-space: pre-wrap;
+  font-family: monospace;
+}
+
+div.toc li {
+    display: block;
+    text-indent: 0;
+    text-align: left;
+    border: solid;
+    border-width: 1px 0px 0px 1px;
+    border-color: #AAA #666 #666 #AAA;
+    list-style: none;              /* Remove triangle from H2 */
+    padding: 0px 4px;
+    margin: 0;
+}

Added: trunk/js/texi2any-js.in
===================================================================
--- trunk/js/texi2any-js.in                             (rev 0)
+++ trunk/js/texi2any-js.in     2018-10-23 12:18:05 UTC (rev 8380)
@@ -0,0 +1,71 @@
+#!/bin/sh
+# Copyright (C) 2017-2018 Free Software Foundation, Inc.
+#
+# This file is part of GNU Texinfo.
+#
+# GNU Texinfo 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.
+#
+# GNU Texinfo 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 GNU General Public License
+# along with GNU Texinfo.  If not, see <http://www.gnu.org/licenses/>.
+
+MAKEINFO=${MAKEINFO:-texi2any}
+
+# substituted by Makefile
address@hidden@
+if test $pkgdatadir = '@'pkgdatadir'@' ; then
+  pkgdatadir=.
+fi
+
+extra_head='
+<link rel="stylesheet" type="text/css" href="info.css"/>
+<script src="modernizr.js" type="text/javascript"></script>
+<script src="info.js" type="text/javascript"></script>
+'
+
+if test $# -lt 1 ; then
+  echo "usage: $0 manual"
+  exit 1
+fi
+
+manual=$1 ; shift
+makeinfo_flags=$@
+
+js_scripts="$pkgdatadir/modernizr.js $pkgdatadir/info.js"
+for f in $js_scripts ; do
+  if ! test -f $f ; then
+    echo "$f not found"
+    exit 1
+  fi
+done
+
+css_files="$pkgdatadir/info.css"
+for f in $css_files ; do
+  if ! test -f $f ; then
+    echo "$f not found"
+    exit 1
+  fi
+done
+
+
+if test x$outdir = x ; then
+  outdir=`basename $manual`
+  outdir=${outdir%.texi}-html
+fi
+
+$MAKEINFO --html -c EXTRA_HEAD="$extra_head" $manual -o $outdir $makeinfo_flags
+if test $? -ne 0 ; then
+  echo "makeinfo failed"
+  exit 1
+else
+  cp $js_scripts $css_files $outdir
+fi
+
+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]