Skip to content

Commit 9582132

Browse files
authored
Merge pull request #386 from euslisp/fix-rtd2
use readthedoc theme for RTD.org
2 parents cf60387 + 259528a commit 9582132

21 files changed

+389
-101
lines changed

doc/latex/Makefile

+31
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,34 @@ html:
2727
rm -f ../html/manual*.{old,html,png,pl} ../html/manual-images.*
2828
TRANSPARENT_COLOR="#ffffff" latex2html -dir ../html/ -transparent -local_icons -split +3 -auto_prefix -iso_language JP -address "This document was generated using the LaTeX2HTML translator on `date` from <a href=\"http://github.com/euslisp/EusLisp.git\">EusLisp</a> version <a href=\"http://github.com/euslisp/EusLisp/commit/`git rev-parse --verify HEAD`\">`git log -1 --oneline`</a>" -html_version="4.0,unicode" manual
2929
(cd ../html; for imgfile in manual-img*.png; do pngtopnm $$imgfile > /tmp/$$imgfile.pnm; pnmtopng -transparent white /tmp/$$imgfile.pnm > $$imgfile; done)
30+
31+
latex.py:
32+
wget https://raw.githubusercontent.com/jobh/latex.py/master/latex.py
33+
34+
#
35+
TEXFILES=$(filter-out manual.tex, $(wildcard *.tex))
36+
RSTFILES=$(TEXFILES:%.tex=%.rst)
37+
%.rst : %.tex
38+
python3 latex.py -2 -L preamble.tex $< > /tmp/tmp_$^
39+
pandoc /tmp/tmp_$^ -o $@ -V documentclass=ltjarticle --latex-engine=lualatex
40+
sed -i 's@.. figure:: \(.*\).ps@.. figure:: \1.png@g' $@ # use png for figures
41+
42+
PSFILES=$(wildcard fig/*.ps)
43+
PNGFILES=$(PSFILES:%.ps=%.png)
44+
%.png : %.ps
45+
#ps2png $^ $@
46+
pstopnm -stdout $^ | pnmflip -rotate270 | pnmtopng - > $@
47+
48+
49+
rst: manual.rst
50+
manual.rst: latex.py $(RSTFILES) $(PNGFILES)
51+
cp manual.tex /tmp/manual.tex
52+
sed -i 's@\\input{\(.*\)}@..include:: \1\n@g' /tmp/manual.tex # convert \input in tex to bypass pandoc
53+
sed -i 's@\\part{\(.*\)}@.. toctree:: \1@' /tmp/manual.tex # convert \part in tex to bypass pandoc
54+
sed -i ':a;/^[^%].*\\\\$$/{N;s/\\\\\n//;ba}' /tmp/manual.tex # concatinate title/author multi lines
55+
pandoc --no-wrap -s /tmp/manual.tex -o manual.rst -V documentclass=ltjarticle --latex-engine=lualatex
56+
sed -i '[email protected]:: \(.*\)@ \1@' manual.rst # restore ..include for rst
57+
sed -i 's@.. toctree:: \(.*\)@.. toctree::\n :maxdepth: 1\n :caption: \1@' manual.rst # restore ..toctree for rst
58+
sed -i 's@** Featuring@**\nFeaturing@' manual.rst # add newline before Featuring in title
59+
sed -i -ne '3!{p;d;};h;n;:1;4!{N;b1};G;h;n;p;g;p' manual.rst; head manual.rst
60+

doc/latex/conf.py

+191
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# EusLisp documentation build configuration file, created by
4+
# sphinx-quickstart on Mon Jun 10 14:01:34 2019.
5+
#
6+
# This file is execfile()d with the current directory set to its
7+
# containing dir.
8+
#
9+
# Note that not all possible configuration values are present in this
10+
# autogenerated file.
11+
#
12+
# All configuration values have a default; values that are commented out
13+
# serve to show the default.
14+
15+
# If extensions (or modules to document with autodoc) are in another directory,
16+
# add these directories to sys.path here. If the directory is relative to the
17+
# documentation root, use os.path.abspath to make it absolute, like shown here.
18+
#
19+
# import os
20+
# import sys
21+
# sys.path.insert(0, os.path.abspath('.'))
22+
23+
import subprocess, os, sys
24+
def sh(command):
25+
print("+ {}".format(command))
26+
print(subprocess.check_output(command, shell=True))
27+
28+
on_rtd = os.environ.get('READTHEDOCS') == 'True'
29+
if on_rtd:
30+
# run make rst
31+
sh("make rst")
32+
33+
# -- General configuration ------------------------------------------------
34+
35+
# If your documentation needs a minimal Sphinx version, state it here.
36+
#
37+
# needs_sphinx = '1.0'
38+
39+
# Add any Sphinx extension module names here, as strings. They can be
40+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
41+
# ones.
42+
extensions = []
43+
44+
# Add any paths that contain templates here, relative to this directory.
45+
templates_path = ['_templates']
46+
47+
# The suffix(es) of source filenames.
48+
# You can specify multiple suffix as a list of string:
49+
#
50+
# source_suffix = ['.rst', '.md']
51+
source_suffix = '.rst'
52+
53+
# The master toctree document.
54+
master_doc = 'manual'
55+
56+
# General information about the project.
57+
project = u'EusLisp'
58+
copyright = u'1984-2001, National Institute of Advanced Industrial Science and Technology (AIST)'
59+
author = u'Toshihiro Matsui'
60+
61+
# The version info for the project you're documenting, acts as replacement for
62+
# |version| and |release|, also used in various other places throughout the
63+
# built documents.
64+
#
65+
# The short X.Y version.
66+
version = u'9.26'
67+
# The full version, including alpha/beta/rc tags.
68+
release = u'9.26'
69+
70+
# The language for content autogenerated by Sphinx. Refer to documentation
71+
# for a list of supported languages.
72+
#
73+
# This is also used if you do content translation via gettext catalogs.
74+
# Usually you set "language" from the command line for these cases.
75+
language = None
76+
77+
# List of patterns, relative to source directory, that match files and
78+
# directories to ignore when looking for source files.
79+
# This patterns also effect to html_static_path and html_extra_path
80+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
81+
82+
# The name of the Pygments (syntax highlighting) style to use.
83+
pygments_style = 'sphinx'
84+
85+
# If true, `todo` and `todoList` produce output, else they produce nothing.
86+
todo_include_todos = False
87+
88+
89+
# -- Options for HTML output ----------------------------------------------
90+
91+
# The theme to use for HTML and HTML Help pages. See the documentation for
92+
# a list of builtin themes.
93+
#
94+
html_theme = 'sphinx_rtd_theme'
95+
96+
# Theme options are theme-specific and customize the look and feel of a theme
97+
# further. For a list of options available for each theme, see the
98+
# documentation.
99+
#
100+
# html_theme_options = {}
101+
102+
# Add any paths that contain custom static files (such as style sheets) here,
103+
# relative to this directory. They are copied after the builtin static files,
104+
# so a file named "default.css" will overwrite the builtin "default.css".
105+
html_static_path = ['_static']
106+
107+
# Custom sidebar templates, must be a dictionary that maps document names
108+
# to template names.
109+
#
110+
# This is required for the alabaster theme
111+
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
112+
html_sidebars = {
113+
'**': [
114+
'relations.html', # needs 'show_related': True theme option to display
115+
'searchbox.html',
116+
]
117+
}
118+
119+
import sphinx_rtd_theme
120+
if on_rtd:
121+
# The theme to use for HTML and HTML Help pages. See the documentation for
122+
# a list of builtin themes.
123+
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
124+
sh("sed -i 's@set suffix@set suffix_bak@' {}/sphinx_rtd_theme/breadcrumbs.html".format(html_theme_path[0]))
125+
126+
# Add Edit on GitHub link
127+
html_context = {
128+
'suffix': '.tex',
129+
}
130+
131+
sh("mkdir -p _build/html")
132+
sh("cd _build/html; ln -sf manual.html index.html; ls -al")
133+
134+
135+
136+
# -- Options for HTMLHelp output ------------------------------------------
137+
138+
# Output file base name for HTML help builder.
139+
htmlhelp_basename = 'EusLispdoc'
140+
141+
142+
# -- Options for LaTeX output ---------------------------------------------
143+
144+
latex_elements = {
145+
# The paper size ('letterpaper' or 'a4paper').
146+
#
147+
# 'papersize': 'letterpaper',
148+
149+
# The font size ('10pt', '11pt' or '12pt').
150+
#
151+
# 'pointsize': '10pt',
152+
153+
# Additional stuff for the LaTeX preamble.
154+
#
155+
# 'preamble': '',
156+
157+
# Latex figure (float) alignment
158+
#
159+
# 'figure_align': 'htbp',
160+
}
161+
162+
# Grouping the document tree into LaTeX files. List of tuples
163+
# (source start file, target name, title,
164+
# author, documentclass [howto, manual, or own class]).
165+
latex_documents = [
166+
(master_doc, 'EusLisp.tex', u'EusLisp Documentation',
167+
u'Toshihiro Matsui', 'manual'),
168+
]
169+
170+
171+
# -- Options for manual page output ---------------------------------------
172+
173+
# One entry per manual page. List of tuples
174+
# (source start file, name, description, authors, manual section).
175+
man_pages = [
176+
(master_doc, 'euslisp', u'EusLisp Documentation',
177+
[author], 1)
178+
]
179+
180+
181+
# -- Options for Texinfo output -------------------------------------------
182+
183+
# Grouping the document tree into Texinfo files. List of tuples
184+
# (source start file, target name, title, author,
185+
# dir menu entry, description, category)
186+
texinfo_documents = [
187+
(master_doc, 'EusLisp', u'EusLisp Documentation',
188+
author, 'EusLisp', 'EusLisp is an integrated programming system for the research on intelligent robots based on Common Lisp and Object-Oriented programming.',
189+
'Miscellaneous'),
190+
]
191+

doc/latex/database.tex

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ \subsection{PostgreSQL}
7777

7878
\begin{refdesc}
7979

80-
\classdesc{pgsql}{propertied-object}{...}
80+
\classdesc{pgsql}{propertied-object}{...}{}{}
8181

8282
\methoddesc{:init}{key host port dbname user password}{
8383
connects to a database designated by host, port and dbname.
@@ -124,8 +124,8 @@ \subsection{PostgreSQL}
124124
For example, (delimit-list '(a b c) 'or) returns "a or b or c".
125125
This function is useful to compose SQL commands.}
126126

127-
\funcdesc{pq:select}{db fields table \&key where limit limit-offset order-by}
128-
{ sends an SQL command composed by the argument, and retrieves the
127+
\funcdesc{pq:select}{db fields table \&key where limit limit-offset order-by}{
128+
sends an SQL command composed by the argument, and retrieves the
129129
result in the synchronous manner.
130130
The following example
131131
gives a list of id, name and email selected from the address\_book table

doc/latex/datetime.tex

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ \section{Date and Time}
44

55
\begin{refdesc}
66

7-
\classdesc{time}{propertied-object}
8-
{(micro second minute hour day month weekday year \\
7+
\classdesc{time}{propertied-object}{
8+
(micro second minute hour day month weekday year \\
99
\> timezone dst seconds)}{
1010
defines time objects.
1111
}

doc/latex/evaluation.tex

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ \subsection{Evaluators}
111111
\begin{description}
112112
\item {special} declares special variables
113113
\item {type} declares the type of variables; {\tt (type integer count)};
114-
valid type specifiers are {\emx integer}, {\emx :integer} {\emx fixnum},
115-
{\emx :float} and {\emx float}. The {\bf type} keyword may be omitted
114+
valid type specifiers are \emx{integer}, \emx{:integer} \emx{fixnum},
115+
\emx{:float} and \emx{float}. The {\bf type} keyword may be omitted
116116
if type specifier is either one listed here. So {\tt (integer count)}
117117
is a correct declaration. Other types (classes) such as {\em float-vector},
118118
{\em integer-vector}, etc. need to be preceded by {\bf type}, as

doc/latex/generals.tex

+10-10
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ \subsection{Class Hierarchy}
383383
\> handle \> ;file handle returned by ''dlopen''}
384384

385385
\subsection{Type Specifier}
386-
Though EusLisp does not have the {\bfx deftype} special form,
386+
Though EusLisp does not have the \bfx{deftype} special form,
387387
type names are used in declarations and functions requesting
388388
to specify the type of results or contents,
389389
as in {\bf coerce, map, concatenate, make-array}, etc.
@@ -393,16 +393,16 @@ \subsection{Type Specifier}
393393

394394
As EusLisp does not have classes to represent numbers,
395395
types for numbers need to be given by keywords.
396-
{\bfx :integer}, {\bfx integer}, {\bfx :int}, {\bfx fixnum},
397-
or {\bfx :fixnum} is used to represent the integer type,
398-
{\bfx :float} or {\bfx float}, the floating point number type.
399-
As the {\emx element-type} argument of {\bfx make-array},
400-
{\bfx :character}, {\bfx character}, {\bfx :byte}, and {\bfx byte}
396+
\bfx{:integer}, \bfx{integer}, \bfx{:int}, \bfx{fixnum},
397+
or \bfx{:fixnum} is used to represent the integer type,
398+
\bfx{:float} or \bfx{float}, the floating point number type.
399+
As the \emx{element-type} argument of \bfx{make-array},
400+
\bfx{:character}, \bfx{character}, \bfx{:byte}, and \bfx{byte}
401401
are recognized to make strings.
402-
Low level functions such as {\bfx defcstruct}, {\bfx sys:peek},
403-
and {\bfx sys:poke}, also recognize
404-
{\bfx :character}, {\bfx character}, {\bfx :byte}, or {\bfx byte}
405-
for the byte access, and {\bfx :short} or {\bfx short} for short word access.
402+
Low level functions such as \bfx{defcstruct}, \bfx{sys:peek},
403+
and \bfx{sys:poke}, also recognize
404+
\bfx{:character}, \bfx{character}, \bfx{:byte}, or \bfx{byte}
405+
for the byte access, and \bfx{:short} or \bfx{short} for short word access.
406406
In any cases, keywords are preferable to lisp package symbols with the
407407
same pname.
408408

doc/latex/geometry.tex

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
\section{\label{Geometry}Geometric Modeling}
33
\markright{\arabic{section}. Geometric Modeling}
44

5-
EusLisp adopts {\emx Brep} (Boundary Representation) as the internal
5+
EusLisp adopts \emx{Brep} (Boundary Representation) as the internal
66
representation of 3D geometric models.
77
Components in Breps are represented by classes
88
{\bf edge, plane, polygon, face, hole,} and {\bf body}.
@@ -788,9 +788,8 @@ \subsection{\label{primitive-body-creation}Primitive Body Creation}
788788
{\em Top} is a 3D float-vector.
789789
{\em Bottom} is either a list of vertices of the bottom face or a radius
790790
(scalar). If it is the vertices list, it is order sensitive.
791-
\verb~ (make-cone \#f(0 0 10) (list \#f(10 0 0) \#f(0 10 0) \#f(-10 0 0)
792-
\#f(0 -10 0)))~ makes a cone of a square bottom.}
793-
791+
\verb~ (make-cone \#f(0 0 10) (list \#f(10 0 0) \#f(0 10 0) \#f(-10 0 0) \#f(0 -10 0)))~
792+
makes a cone of a square bottom.}
794793

795794
\funcdesc{make-solid-of-revolution}{points \&key (segments 16) name color}{
796795
{\em Points} are revolted along z-axis in the clock wise direction.

doc/latex/http.tex

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ \subsection{HTTP Client}
2525
\funcdesc{unescaped-url-string-from-namestring}{url-string \&optional (queryp t)}{
2626
returns result of {\tt unescape-url} as string.}
2727

28-
\funcdesc{read-http}{url \&key (timeout 10) (retry 5)}
29-
{makes a socket connection to the designated url, and
28+
\funcdesc{read-http}{url \&key (timeout 10) (retry 5)}{
29+
makes a socket connection to the designated url, and
3030
read the html document.
3131
The result is a list of tags and plain strings.
3232
HTML tags are converted as lists consisting of the tag-name
@@ -134,7 +134,7 @@ \subsection{HTTP CGI Programming}
134134
from the QUERY\_STRING environment variable or from the standard input.
135135
Anyways, the result is returned in one string.}
136136

137-
\funcdesc{parse-http-query}{query-string}
137+
\funcdesc{parse-http-query}{query-string}{}
138138

139139
\funcdesc{html-header}{}{generates the html header,
140140
usually a simple string of two lines,

doc/latex/io.tex

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ \subsection{Streams}
1717
\begin{refdesc}
1818

1919
\funcdesc{streamp}{object}{
20-
Any object created from {\bfx stream}, {\bfx io-stream},
20+
Any object created from \bfx{stream}, \bfx{io-stream},
2121
or their subclasses returns T.}
2222

2323
\funcdesc{input-stream-p}{object}{
@@ -256,7 +256,7 @@ \subsection{Reader}
256256
Only the first s-expression can be read.
257257
If successive read operations need to be performed on a string
258258
containing more than one expression,
259-
use string-stream made by {\bfx make-string-input-stream}.}
259+
use string-stream made by \bfx{make-string-input-stream}.}
260260

261261
\funcdesc{unread-char}{char \&optional stream}{
262262
puts the {\em char} back to the {\em stream}.
@@ -483,7 +483,7 @@ \subsubsection{Shared Memory}
483483
maps the file named {\em filename} to memory space.
484484
{\em Filename} can be either of a local file, an NFS-mounted remote file,
485485
or a memory device in {\tt /dev}.
486-
A {\bfx foreign-string}, whose elements can be accessed by {\bf aref},
486+
A \bfx{foreign-string}, whose elements can be accessed by {\bf aref},
487487
is returned.
488488
Writing data into a foreign-string mapped by {\tt map-file} with
489489
{\em direction=:input} will result a segmentation fault.}

doc/latex/loadforeign.tex

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
\macrodesc{load-foreign}{objfile \&key symbol-input symbol-output (symbol-file objfile) ld-option)}
2-
{loads an object module written other than EusLisp.
1+
\macrodesc{load-foreign}{objfile \&key symbol-input symbol-output (symbol-file objfile) ld-option)}{
2+
loads an object module written other than EusLisp.
33
A compiled code object is returned.
44
This result is necessary to make function entries in the module by
55
{\bf defforeign}.

doc/latex/manual.pdf

-856 KB
Binary file not shown.

doc/latex/mars-pre.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ \subsection{System Overview}
5555
%\begin{tabular}{c@\extracolsep{1em}c}
5656
\begin{tabular}{c c}
5757
\includegraphics[height=10cm]{fig/mars.ps}
58-
%\epsfile{file=fig/mars.eps,scale=0.3} & % 表紙と同じ絵に変更して。
58+
%\epsfile{file=fig/mars.eps,scale=0.3} & % 表紙と同じ絵に変更して。
5959
%\mbox{
6060
%\epsfsize=10cm
6161
%\epsfbox{file=fig/mars.eps}

doc/latex/matrix.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ \subsection{CascadedCoords}
482482

483483
\classdesc{cascaded-coords}{coordinates}{(parent descendants worldcoords manager changed)}{
484484
defines a linked coordinates. {\bf Cascaded-coords} is often abbreviated
485-
as {\bfx cascoords}.}
485+
as \bfx{cascoords}.}
486486

487487
\methoddesc{:inheritance}{}{
488488
returns the inheritance tree list describing all the descendants of the

0 commit comments

Comments
 (0)