]> granicus.if.org Git - re2c/commitdiff
Ported website to sphinx.
authorUlya Trofimovich <skvadrik@gmail.com>
Fri, 4 Mar 2016 08:42:14 +0000 (08:42 +0000)
committerUlya Trofimovich <skvadrik@gmail.com>
Fri, 4 Mar 2016 08:42:14 +0000 (08:42 +0000)
89 files changed:
Makefile [deleted file]
launch.hs
mk.sh
src/.nojekyll [new file with mode: 0644]
src/_static/favicon.ico [moved from src/favicon.ico with 100% similarity]
src/_static/feed/atom.xml [moved from src/feed/atom.xml with 97% similarity]
src/_static/feed/feed.png [moved from src/feed/feed.png with 100% similarity]
src/_templates/layout.html [new file with mode: 0644]
src/_templates/sidebar-home.html [new file with mode: 0644]
src/_templates/sidebar.html [new file with mode: 0644]
src/about/about.rst
src/conf.py [new file with mode: 0644]
src/contents.rst [deleted file]
src/css/default.css [deleted file]
src/examples/01_recognizing_integers.re.txt [moved from src/examples/01_recognizing_integers.re with 100% similarity]
src/examples/02_recognizing_strings.re.txt [moved from src/examples/02_recognizing_strings.re with 100% similarity]
src/examples/03_arbitrary_large_input.re.txt [moved from src/examples/03_arbitrary_large_input.re with 100% similarity]
src/examples/04_parsing_integers_blocks.re.txt [moved from src/examples/04_parsing_integers_blocks.re with 100% similarity]
src/examples/05_parsing_integers_conditions.re.txt [moved from src/examples/05_parsing_integers_conditions.re with 100% similarity]
src/examples/06_braille.re.txt [moved from src/examples/06_braille.re with 100% similarity]
src/examples/06_braille.utf8.txt.rst [deleted file]
src/examples/07_cxx98.re.txt [moved from src/examples/07_cxx98.re with 100% similarity]
src/examples/example_01.rst
src/examples/example_02.rst
src/examples/example_03.rst
src/examples/example_04.rst
src/examples/example_05.rst
src/examples/example_06.rst
src/examples/example_07.rst
src/examples/examples.rst
src/examples/home.rst [deleted file]
src/home.rst [deleted file]
src/index.rst
src/install/install.rst
src/manual/features/conditions/conditions.rst
src/manual/features/dot/dot.rst
src/manual/features/dot/php_json.re.txt [moved from src/manual/features/dot/php_json.re with 100% similarity]
src/manual/features/dot/utf8_any.re.txt [moved from src/manual/features/dot/utf8_any.re with 100% similarity]
src/manual/features/encodings/encodings.rst
src/manual/features/features.rst
src/manual/features/generic_api/generic_api.rst
src/manual/features/home.rst [deleted file]
src/manual/features/reuse/reuse.rst
src/manual/features/skeleton/example.c.txt [moved from src/manual/features/skeleton/example.c with 100% similarity]
src/manual/features/skeleton/example.rst
src/manual/features/skeleton/failures.rst
src/manual/features/skeleton/gen.sh.txt [moved from src/manual/features/skeleton/gen.sh with 100% similarity, mode: 0644]
src/manual/features/skeleton/generating_data.rst
src/manual/features/skeleton/hex2.re.txt [moved from src/manual/features/skeleton/hex2.re with 100% similarity]
src/manual/features/skeleton/skeleton.rst
src/manual/features/state/state.rst
src/manual/home.rst [deleted file]
src/manual/manual.rst
src/manual/options/home.rst [deleted file]
src/manual/options/options.rst
src/manual/syntax/syntax.rst
src/manual/warnings/condition_order/real_world.rst
src/manual/warnings/condition_order/simple_example.rst
src/manual/warnings/condition_order/wcondition_order.re.txt [moved from src/manual/warnings/condition_order/wcondition_order.re with 100% similarity]
src/manual/warnings/condition_order/wcondition_order.rst
src/manual/warnings/empty_character_class/wempty_character_class.rst
src/manual/warnings/home.rst [deleted file]
src/manual/warnings/match_empty_string/real_world.rst
src/manual/warnings/match_empty_string/simple_example.rst
src/manual/warnings/match_empty_string/wmatch_empty_string.re.txt [moved from src/manual/warnings/match_empty_string/wmatch_empty_string.re with 100% similarity]
src/manual/warnings/match_empty_string/wmatch_empty_string.rst
src/manual/warnings/swapped_range/wswapped_range.rst
src/manual/warnings/undefined_control_flow/default_vs_any.rst
src/manual/warnings/undefined_control_flow/simple_example.rst
src/manual/warnings/undefined_control_flow/wundefined_control_flow.rst
src/manual/warnings/unreachable_rules/infinite_rules.rst
src/manual/warnings/unreachable_rules/real_world.rst
src/manual/warnings/unreachable_rules/simple_example.rst
src/manual/warnings/unreachable_rules/wunreachable_rules.rst
src/manual/warnings/useless_escape/simple_example.rst
src/manual/warnings/useless_escape/wuseless_escape.rst
src/manual/warnings/warnings.rst
src/news/changelog/changelog.rst
src/news/home.rst [deleted file]
src/news/news.rst
src/news/release_notes/0_15.rst
src/news/release_notes/0_15_1.rst
src/news/release_notes/0_15_2.rst
src/news/release_notes/0_15_3.rst
src/news/release_notes/0_16.rst
src/template.html [deleted file]
src/theme-re2c/static/pygments.css [new file with mode: 0644]
src/theme-re2c/static/theme-re2c.css [new file with mode: 0644]
src/theme-re2c/theme.conf [new file with mode: 0644]

diff --git a/Makefile b/Makefile
deleted file mode 100644 (file)
index 9a772f8..0000000
--- a/Makefile
+++ /dev/null
@@ -1,140 +0,0 @@
-VPATH = ..
-
-SRC_RST = \
-    src/examples/examples.rst \
-    src/examples/06_braille.utf8.txt.rst \
-    src/examples/example_05.rst \
-    src/examples/example_02.rst \
-    src/examples/home.rst \
-    src/examples/example_01.rst \
-    src/examples/example_03.rst \
-    src/examples/example_07.rst \
-    src/examples/example_04.rst \
-    src/examples/example_06.rst \
-    src/contents.rst \
-    src/home.rst \
-    src/manual/syntax/syntax.rst \
-    src/manual/warnings/undefined_control_flow/default_vs_any.rst \
-    src/manual/warnings/undefined_control_flow/real_world.rst \
-    src/manual/warnings/undefined_control_flow/how_it_works.rst \
-    src/manual/warnings/undefined_control_flow/simple_example.rst \
-    src/manual/warnings/undefined_control_flow/wundefined_control_flow.rst \
-    src/manual/warnings/swapped_range/wswapped_range.rst \
-    src/manual/warnings/condition_order/real_world.rst \
-    src/manual/warnings/condition_order/how_it_works.rst \
-    src/manual/warnings/condition_order/simple_example.rst \
-    src/manual/warnings/condition_order/wcondition_order.rst \
-    src/manual/warnings/home.rst \
-    src/manual/warnings/useless_escape/real_world.rst \
-    src/manual/warnings/useless_escape/how_it_works.rst \
-    src/manual/warnings/useless_escape/simple_example.rst \
-    src/manual/warnings/useless_escape/wuseless_escape.rst \
-    src/manual/warnings/warnings.rst \
-    src/manual/warnings/warnings_list.rst \
-    src/manual/warnings/empty_character_class/wempty_character_class.rst \
-    src/manual/warnings/unreachable_rules/real_world.rst \
-    src/manual/warnings/unreachable_rules/infinite_rules.rst \
-    src/manual/warnings/unreachable_rules/how_it_works.rst \
-    src/manual/warnings/unreachable_rules/simple_example.rst \
-    src/manual/warnings/unreachable_rules/wunreachable_rules.rst \
-    src/manual/warnings/warnings_general.rst \
-    src/manual/warnings/match_empty_string/real_world.rst \
-    src/manual/warnings/match_empty_string/wmatch_empty_string.rst \
-    src/manual/warnings/match_empty_string/simple_example.rst \
-    src/manual/warnings/match_empty_string/false_alarm.rst \
-    src/manual/home.rst \
-    src/manual/features/generic_api/generic_api.rst \
-    src/manual/features/features.rst \
-    src/manual/features/conditions/conditions.rst \
-    src/manual/features/state/state.rst \
-    src/manual/features/skeleton/skeleton.rst \
-    src/manual/features/home.rst \
-    src/manual/features/dot/dot.rst \
-    src/manual/features/encodings/encodings.rst \
-    src/manual/features/reuse/reuse.rst \
-    src/manual/manual.rst \
-    src/manual/options/options.rst \
-    src/manual/options/home.rst \
-    src/manual/options/options_list.rst \
-    src/news/news.rst \
-    src/news/changelog/changelog.rst \
-    src/news/changelog/0_16.rst \
-    src/news/changelog/0_15_list.rst \
-    src/news/changelog/0_15.rst \
-    src/news/changelog/0_14.rst \
-    src/news/changelog/0_13.rst \
-    src/news/changelog/0_12.rst \
-    src/news/changelog/0_11.rst \
-    src/news/changelog/0_10.rst \
-    src/news/changelog/0_09.rst \
-    src/news/changelog/beginning.rst \
-    src/news/release_notes/0_15.rst \
-    src/news/release_notes/0_15_1.rst \
-    src/news/release_notes/0_15_2.rst \
-    src/news/release_notes/0_15_3.rst \
-    src/news/release_notes/0_16.rst \
-    src/news/home.rst \
-    src/about/about.rst \
-    src/install/install.rst \
-    src/index.rst
-
-SRC_CSS = src/css/default.css
-
-SRC_TPL = src/template.html
-
-SRC_OTH = \
-    src/CNAME \
-    src/examples/06_braille.utf8.txt \
-    src/examples/05_parsing_integers_conditions.re \
-    src/examples/06_braille.utf32.txt \
-    src/examples/06_braille.re \
-    src/examples/07_cxx98.re \
-    src/examples/01_recognizing_integers.re \
-    src/examples/04_parsing_integers_blocks.re \
-    src/examples/06_braille.ucs2.txt \
-    src/examples/06_braille.utf16.txt \
-    src/examples/03_arbitrary_large_input.re \
-    src/examples/02_recognizing_strings.re \
-    src/favicon.ico \
-    src/feed/feed.png \
-    src/feed/atom.xml \
-    src/manual/warnings/condition_order/wcondition_order.re \
-    src/manual/warnings/match_empty_string/wmatch_empty_string.re \
-    src/manual/features/dot/php_json_dot.png \
-    src/manual/features/dot/utf8_any.png \
-    src/manual/features/dot/php_json_neato.png \
-    src/manual/features/dot/utf8_any.re \
-    src/manual/features/dot/php_json.re \
-    src/manual/features/skeleton/example.c \
-    src/manual/features/skeleton/example.c.line4.input \
-    src/manual/features/skeleton/example.c.line4.keys \
-    src/manual/features/skeleton/example.png \
-    src/manual/features/skeleton/example_next.png \
-    src/manual/features/skeleton/gen.sh \
-    src/manual/features/skeleton/hex2.re \
-    src/manual/features/skeleton/plot.png \
-    src/about/1994_bumbulis_cowan_re2c_a_more_versatile_scanner_generator.pdf
-
-OBJ_RST = $(SRC_RST:%.rst=%.html)
-
-all: $(OBJ_RST)
-       @ for f in $(SRC_OTH) $(SRC_CSS); do { mkdir -p "`dirname $$f`"; cp "$(VPATH)/$$f" "$$f"; } done
-
--include $(SRC_RST:%.rst=%.d)
-
-# Option '--stylesheet' to 'rst2html' is used only to override dependency
-# from default stylesheet; the real stylesheet is linked in template file.
-# We have to manually insert dependency from template file.
-.rst.html:
-       @ mkdir -p "`dirname $@`"
-       @ rst2html.py --stylesheet="$(VPATH)/$(SRC_CSS)" --template="$(VPATH)/$(SRC_TPL)" --record-dependencies="$*.dd" $< $@
-       @ echo $@: "$(VPATH)/$(SRC_TPL)" `cat $*.dd` > $*.d && rm $*.dd
-       @ echo $@
-
-clean:
-       rm $(OBJ_RST)
-
-.SUFFIXES: .rst .html
-
-.POSIX:
-
index 36041436f7aab5fc946a1b577e82e620a72fb8c4..03afda53365926ec7efb165d9ae29837e75b5727 100644 (file)
--- a/launch.hs
+++ b/launch.hs
@@ -8,5 +8,5 @@ main =
             $ Snap.setAccessLog Snap.ConfigNoLog
             $ Snap.setErrorLog  Snap.ConfigNoLog
             $ Snap.emptyConfig
-    in  Snap.httpServe config $ Snap.serveDirectory "obj/src"
+    in  Snap.httpServe config $ Snap.serveDirectory "obj"
 
diff --git a/mk.sh b/mk.sh
index 131717351f4e14fb784b2af9199cfd6d0a679c1c..32afbe7be9292628e374af7bb3c3a5c7b83e5f51 100755 (executable)
--- a/mk.sh
+++ b/mk.sh
@@ -1,9 +1,6 @@
 #!/bin/sh
 
-objdir="obj" \
-    && cd "$objdir" \
-    && make -f ../Makefile -j5 \
-    && cd ..
+sphinx-build -b html src obj
 
 runhaskell launch.hs
 
diff --git a/src/.nojekyll b/src/.nojekyll
new file mode 100644 (file)
index 0000000..e69de29
similarity index 100%
rename from src/favicon.ico
rename to src/_static/favicon.ico
similarity index 97%
rename from src/feed/atom.xml
rename to src/_static/feed/atom.xml
index 91882205e4db46e24c3f9c42f7f3c6b0b2ba721e..8b6a75216622220199620c6b52226dd014bbdc66 100644 (file)
@@ -2,7 +2,7 @@
 <feed xmlns="http://www.w3.org/2005/Atom">
 
     <title>re2c</title>
-    <link rel="self" href="http://re2c.org/feed/atom.xml"/>
+    <link rel="self" href="http://re2c.org/_static/feed/atom.xml"/>
     <id>http://re2c.org/</id>
     <updated>2016-01-21T00:00:00Z</updated>
 
similarity index 100%
rename from src/feed/feed.png
rename to src/_static/feed/feed.png
diff --git a/src/_templates/layout.html b/src/_templates/layout.html
new file mode 100644 (file)
index 0000000..d4efff7
--- /dev/null
@@ -0,0 +1,14 @@
+{% extends "basic/layout.html" %}
+
+{% block linktags %}
+    <link rel="alternate" type="application/atom+xml" href="{{ pathto('_static/feed/atom.xml', 1) }}" title="Atom 1.0" />
+    {{ linktags }}
+{% endblock %}
+
+{# remove navigation header and footer #}
+{% block relbar1 %}{% endblock %}
+{% block relbar2 %}{% endblock %}
+
+{# put the sidebar before the body #}
+{% block sidebar1 %}{{ sidebar() }}{% endblock %}
+{% block sidebar2 %}{% endblock %}
diff --git a/src/_templates/sidebar-home.html b/src/_templates/sidebar-home.html
new file mode 100644 (file)
index 0000000..f4c18cb
--- /dev/null
@@ -0,0 +1,12 @@
+<div class="re2c-logo">
+    re2c-{{ version }}
+</div>
+
+<h3><a href="{{ pathto(master_doc) }}">Sitemap</a></h3>
+{{ toctree(includehidden=True, maxdepth=1) }}
+
+<h3>Community</h3>
+<div class="re2c-toc-local">
+    {{ toc }}
+</div>
+
diff --git a/src/_templates/sidebar.html b/src/_templates/sidebar.html
new file mode 100644 (file)
index 0000000..82f9add
--- /dev/null
@@ -0,0 +1,14 @@
+<div class="re2c-logo">
+    re2c-{{ version }}
+</div>
+
+<h3><a href="{{ pathto(master_doc) }}">Home</a></h3>
+{{ toctree(includehidden=True, maxdepth=-1) }}
+
+{%- if display_toc %}
+    <h3>{{ title }}</h3>
+    <div class="re2c-toc-local">
+        {{ toc }}
+    </div>
+{%- endif %}
+
index c08234ef31a02515f532eaefdfca4ba93282028e..3815632696afada6d649a1388510d8de093b3d5f 100644 (file)
@@ -2,8 +2,8 @@
 About
 =====
 
-.. include:: ../home.rst
-.. include:: ../contents.rst
+.. toctree::
+    :hidden:
 
 Authors
 -------
@@ -43,5 +43,5 @@ be appreciated.
 Version
 -------
 
-This page describes ``re2c`` version 0.16 packaged on 21 January 2016.
+This page describes re2c version |version|.
 
diff --git a/src/conf.py b/src/conf.py
new file mode 100644 (file)
index 0000000..9f9118e
--- /dev/null
@@ -0,0 +1,326 @@
+# -*- coding: utf-8 -*-
+#
+# re2c documentation build configuration file, created by
+# sphinx-quickstart on Sun Feb 28 16:21:14 2016.
+#
+# This file is execfile()d with the current directory set to its
+# containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys
+import os
+import shlex
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration ------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = [
+    'sphinx.ext.pngmath',
+]
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string:
+# source_suffix = ['.rst', '.md']
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u're2c'
+copyright = u'2016, re2c devs'
+author = u're2c devs'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.16'
+# The full version, including alpha/beta/rc tags.
+release = '0.16'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = [
+    'examples/06_braille.utf8.txt.rst',
+    'manual/features/skeleton/example.rst',
+    'manual/features/skeleton/failures.rst',
+    'manual/features/skeleton/generating_data.rst',
+    'manual/features/skeleton/use.rst',
+    'manual/options/options_list.rst',
+    'manual/warnings/condition_order/how_it_works.rst',
+    'manual/warnings/condition_order/real_world.rst',
+    'manual/warnings/condition_order/simple_example.rst',
+    'manual/warnings/match_empty_string/false_alarm.rst',
+    'manual/warnings/match_empty_string/real_world.rst',
+    'manual/warnings/match_empty_string/simple_example.rst',
+    'manual/warnings/undefined_control_flow/default_vs_any.rst',
+    'manual/warnings/undefined_control_flow/how_it_works.rst',
+    'manual/warnings/undefined_control_flow/real_world.rst',
+    'manual/warnings/undefined_control_flow/simple_example.rst',
+    'manual/warnings/unreachable_rules/how_it_works.rst',
+    'manual/warnings/unreachable_rules/infinite_rules.rst',
+    'manual/warnings/unreachable_rules/real_world.rst',
+    'manual/warnings/unreachable_rules/simple_example.rst',
+    'manual/warnings/useless_escape/how_it_works.rst',
+    'manual/warnings/useless_escape/real_world.rst',
+    'manual/warnings/useless_escape/simple_example.rst',
+    'manual/warnings/warnings_general.rst',
+    'manual/warnings/warnings_list.rst',
+    'news/changelog/0_09.rst',
+    'news/changelog/0_10.rst',
+    'news/changelog/0_11.rst',
+    'news/changelog/0_12.rst',
+    'news/changelog/0_13.rst',
+    'news/changelog/0_14.rst',
+    'news/changelog/0_15.rst',
+    'news/changelog/0_15_list.rst',
+    'news/changelog/0_16.rst',
+    'news/changelog/beginning.rst'
+]
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+#pygments_style = 'default'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+# If true, keep warnings as "system message" paragraphs in the built documents.
+#keep_warnings = False
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = False
+
+
+# -- Options for HTML output ----------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+html_theme = 'theme-re2c'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+html_theme_path = ["."]
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# 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
+# pixels large.
+html_favicon = '_static/favicon.ico'
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# Add any extra paths that contain custom files (such as robots.txt or
+# .htaccess) here, relative to this directory. These files are copied
+# directly to the root of the documentation.
+html_extra_path = ['CNAME']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+html_sidebars = {
+   'index': ['sidebar-home.html'],
+   '*/**': ['sidebar.html']
+}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+html_show_sourcelink = False
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+html_show_sphinx = False
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+html_show_copyright = False
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Language to be used for generating the HTML full-text search index.
+# Sphinx supports the following languages:
+#   'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
+#   'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
+#html_search_language = 'en'
+
+# A dictionary with options for the search language support, empty by default.
+# Now only 'ja' uses this config value
+#html_search_options = {'type': 'default'}
+
+# The name of a javascript file (relative to the configuration directory) that
+# implements a search results scorer. If empty, the default will be used.
+#html_search_scorer = 'scorer.js'
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 're2cdoc'
+
+# -- Options for LaTeX output ---------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+
+# Latex figure (float) alignment
+#'figure_align': 'htbp',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+#  author, documentclass [howto, manual, or own class]).
+latex_documents = [
+  (master_doc, 're2c.tex', u're2c Documentation',
+   u're2c devs', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output ---------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+    (master_doc, 're2c', u're2c Documentation',
+     [author], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output -------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+#  dir menu entry, description, category)
+texinfo_documents = [
+  (master_doc, 're2c', u're2c Documentation',
+   author, 're2c', 'One line description of project.',
+   'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
+
+# If true, do not generate a @detailmenu in the "Top" node's menu.
+#texinfo_no_detailmenu = False
diff --git a/src/contents.rst b/src/contents.rst
deleted file mode 100644 (file)
index f187f63..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-.. contents:: ★
-    :backlinks: none
-    :depth: 2
diff --git a/src/css/default.css b/src/css/default.css
deleted file mode 100644 (file)
index a62f7aa..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-body {
-    text-align: justify;
-    margin-top: 1%;
-    margin-right: auto;
-    margin-bottom: 1%;
-    margin-left: auto;
-    width: 85%;
-    font-family: sans-serif;
-}
-
-h1, h2, h3, h4, h5, h6 {
-    color: #557799;
-    font-weight: normal;
-}
-h1 {
-    border-bottom: groove gray;
-    padding-top: 1em;
-}
-h1.title {
-    font-size: 2.5em;
-    text-align: center;
-    border: none;
-}
-
-a {
-    color: #557799;
-}
-a:focus {
-    outline: none;
-}
-
-table, tr, td, th {
-    border: none;
-    padding: 0em 0.2em 0em 0.2em;
-}
-
-pre.code {
-    color: black;
-    padding: 1em 1em 1em 1em;
-    margin: 0 0 0 0;
-
-    border: 1px solid #557799;
-    border-left: 8px solid #557799;
-
-    background-color: #f3f3f3;
-    display: block;
-    white-space: pre;
-    overflow: auto;
-}
-
-pre.code .ln { color: grey; } /* line numbers */
-pre.code .comment, code .comment { color: #004488; }
-pre.code .keyword, code .keyword { color: #003399; font-weight: bold; }
-pre.code .keyword.type, code .keyword.type { color: #aa3300; }
-pre.code .operator, code .operator { color: #000066; }
-pre.code .punctuation, code .punctuation { color: #000066; font-weight: bold; }
-pre.code .literal.string, code .literal.string { color: #ff5500; }
-pre.code .literal.number, code .literal.number { color: #ff5500; font-weight: bold; }
-pre.code .name.builtin, code .name.builtin { color: #352B84 }
-pre.code .deleted, code .deleted { background-color: #DEB0A1}
-pre.code .inserted, code .inserted { background-color: #A3D289}
-
-img {
-    display: block;
-    border: 1px dotted #557799;
-    margin: auto;
-}
-
-img.feed {
-    display: inline;
-    border: none;
-    vertical-align: middle;
-}
diff --git a/src/examples/06_braille.utf8.txt.rst b/src/examples/06_braille.utf8.txt.rst
deleted file mode 100644 (file)
index 5ede72d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-⠠⠁⠇⠇⠀⠓⠥⠍⠁⠝⠀⠃⠑⠊⠝⠛⠎⠀⠁⠗⠑⠀⠃⠕⠗⠝⠀⠋⠗⠑⠑⠀⠁⠝⠙⠀⠑⠟⠥⠁⠇⠀⠊⠝⠀⠙⠊⠛⠝⠊⠞⠽⠀⠁⠝⠙⠀⠗⠊⠛⠓⠞⠎⠲⠀
-⠠⠞⠓⠑⠽⠀⠁⠗⠑⠀⠑⠝⠙⠕⠺⠑⠙⠀⠺⠊⠞⠓⠀⠗⠑⠁⠎⠕⠝⠀⠁⠝⠙⠀⠉⠕⠝⠎⠉⠊⠑⠝⠉⠑⠀⠁⠝⠙⠀⠎⠓⠕⠥⠇⠙⠀⠁⠉⠞⠀⠞⠕⠺⠁⠗⠙⠎⠀
-⠕⠝⠑⠀⠁⠝⠕⠞⠓⠑⠗⠀⠊⠝⠀⠁⠀⠎⠏⠊⠗⠊⠞⠀⠕⠋⠀⠃⠗⠕⠞⠓⠑⠗⠓⠕⠕⠙⠲
-
index 7d5b6ac311a6fd5b9295fdd849f6697d423ef759..d79c638a467355770628db9d80712b6edde2b0fa 100644 (file)
@@ -1,8 +1,6 @@
 Recognizing integers: the sentinel method
 -----------------------------------------
 
-.. include:: home.rst
-
 This example is very simple, yet practical.
 We assume that the input is small (fits in one continuous piece of memory).
 We also assume that some characters never occur in well-formed input (but may occur in ill-formed input).
@@ -14,11 +12,11 @@ and tries to match each argument against one of the four patterns:
 binary, octal, decimal and hexadecimal integer literals.
 The numbers are not *parsed* (their numeric value is not retrieved), they are merely *recognized*.
 
-`[01_recognizing_integers.re] <01_recognizing_integers.re>`_
+:download:`[01_recognizing_integers.re] <01_recognizing_integers.re.txt>`
 
-.. include:: 01_recognizing_integers.re
-    :code: cpp
-    :number-lines:
+.. literalinclude:: 01_recognizing_integers.re.txt
+    :language: cpp
+    :linenos:
 
 A couple of things should be noted:
 
index 426e0519396b100a8a867d5780e37f86bd764e1c..60b03c5a991ced8756f224ad3a5084ad47fb22e2 100644 (file)
@@ -1,8 +1,6 @@
 Recognizing strings: the need for YYMAXFILL
 -------------------------------------------
 
-.. include:: home.rst
-
 This example is about recognizing strings.
 Strings (in generic sense) are different from other kinds of lexemes: they can contain *arbitrary* characters.
 It makes them a way more difficult to lex: unlike `Recognizing integers: the sentinel method <example_01.html>`_ example,
@@ -40,11 +38,11 @@ Common hack is to pad input with a few fake characters that **do not form a vali
 The length of padding depends on the maximal argument to ``YYFILL``
 (this value is called ``YYMAXFILL`` and can be generated using ``/*!max:re2c*/`` directive).
 
-`[02_recognizing_strings.re] <02_recognizing_strings.re>`_
+:download:`[02_recognizing_strings.re] <02_recognizing_strings.re.txt>`
 
-.. include:: 02_recognizing_strings.re
-    :code: cpp
-    :number-lines:
+.. literalinclude:: 02_recognizing_strings.re.txt
+    :language: cpp
+    :linenos:
 
 Notes:
 
index 4e8e33625c42d16a11d64ba3fd66ca5d37853af0..fa86d5401e10ff54df4cc6012d6158e08864844a 100644 (file)
@@ -1,8 +1,6 @@
 Arbitrary large input and YYFILL
 --------------------------------
 
-.. include:: home.rst
-
 In this example we suppose that input cannot be mapped in memory at once:
 either it's too large or its size cannot be determined in advance.
 The usual thing to do in such case is to allocate a buffer and lex input in chunks that fit into buffer.
@@ -72,11 +70,11 @@ It can be used as boundary in ``YYFILL``.
 Our example program reads ``stdin`` in chunks of 16 bytes (in real word buffer size is usually ~4Kb)
 and tries to lex numbers separated by newlines.
 
-`[03_arbitrary_large_input.re] <03_arbitrary_large_input.re>`_
+:download:`[03_arbitrary_large_input.re] <03_arbitrary_large_input.re.txt>`
 
-.. include:: 03_arbitrary_large_input.re
-    :code: cpp
-    :number-lines:
+.. literalinclude:: 03_arbitrary_large_input.re.txt
+    :language: cpp
+    :linenos:
 
 Notes:
 
index eabad615ebaa2ecd37dd3829cabf7015c58280bc..f26f59ba6cacfb091a3d25b43e18ad4fb420b535 100644 (file)
@@ -1,19 +1,17 @@
 Parsing integers (multiple re2c blocks)
 ---------------------------------------
 
-.. include:: home.rst
-
 This example is based on `Recognizing integers: the sentinel method <example_01.html>`_ example,
 only now integer literals are parsed rather than simply recognized.
 Parsing integers is simple: one can easily do it by hand.
 However, re2c-generated code *does* look like a simple handwritten parser:
 a couple of dereferences and conditional jumps. No overhead. ``:)``
 
-`[04_parsing_integers_blocks.re] <04_parsing_integers_blocks.re>`_
+:download:`[04_parsing_integers_blocks.re] <04_parsing_integers_blocks.re.txt>`
 
-.. include:: 04_parsing_integers_blocks.re
-    :code: cpp
-    :number-lines:
+.. literalinclude:: 04_parsing_integers_blocks.re.txt
+    :language: cpp
+    :linenos:
 
 Notes:
 
index 8738d75c0c9504a6b9c91ef42185f27fc84e3e47..3e6f87c60a6438f3d515e349d20b8cf137a56d1d 100644 (file)
@@ -1,17 +1,15 @@
 Parsing integers (conditions)
 -----------------------------
 
-.. include:: home.rst
-
 This example does exactly the same as `Parsing integers (multiple re2c blocks) <example_04.html>`_ example,
 but in a slightly different manner: it uses re2c conditions instead of blocks.
 Conditions allow to encode multiple interconnected lexers within a single re2c block.
 
-`[05_parsing_integers_conditions.re] <05_parsing_integers_conditions.re>`_
+:download:`[05_parsing_integers_conditions.re] <05_parsing_integers_conditions.re.txt>`
 
-.. include:: 05_parsing_integers_conditions.re
-    :code: cpp
-    :number-lines:
+.. literalinclude:: 05_parsing_integers_conditions.re.txt
+    :language: cpp
+    :linenos:
 
 Notes:
 
index 9098a0674be9c9205852b3eea59640b9842963a3..b39511c33b0d6f885b407a8510604e870296ab83 100644 (file)
@@ -1,8 +1,6 @@
 Braille patterns (encodings)
 ----------------------------
 
-.. include:: home.rst
-
 This example is about encoding support in re2c.
 It's a partial decoder from Grade-1 (uncontracted) Unicode English Braille to plain English.
 The input may be encoded in UTF-8, UTF-16, UTF-32 or UCS-2:
@@ -14,7 +12,7 @@ Here is a message out of the void:
 
 .. include:: 06_braille.utf8.txt
 
-It appears to be UTF-8 encoded `[06_braille.utf8.txt] <06_braille.utf8.txt.html>`_.
+It appears to be UTF-8 encoded :download:`[06_braille.utf8.txt] <06_braille.utf8.txt>`.
 Convert it into UTF-16, UTF-32 or UCS-2:
 
 .. code-block:: bash
@@ -32,11 +30,11 @@ and some other, which we omit for simplicity (as well as a few ambiguous punctua
 Grade-2 Braille allows contractions; they obey complex rules (like those of a natural language)
 and are much harder to implement.
 
-`[06_braille.re] <06_braille.re>`_
+:download:`[06_braille.re] <06_braille.re.txt>`
 
-.. include:: 06_braille.re
-    :code: cpp
-    :number-lines:
+.. literalinclude:: 06_braille.re.txt
+    :language: cpp
+    :linenos:
 
 Notes:
 
index 76b6bd01c8b6f1b7f543407a998fa10b1a50ec78..3c5cdc46076074dd022b31da4590d7a1b48b79e1 100644 (file)
@@ -1,8 +1,6 @@
 C++98 lexer
 -----------
 
-.. include:: home.rst
-
 This is an example of a big real-world re2c program: C++98 lexer.
 It confirms to the C++98 standard (except for a couple of hacks to simulate preprocessor).
 All nontrivial lexemes (integers, floating-point constants, strings and character literals)
@@ -10,11 +8,11 @@ are parsed (not only recognized): numeric literals are converted to numbers, str
 Some additional checks described in standard (e.g. overflows in integer literals) are also done.
 In fact, C++ is an easy language to lex: unlike many other languages, lexer can proceed without feedback from parser.
 
-`[07_cxx98.re] <07_cxx98.re>`_
+:download:`[07_cxx98.re] <07_cxx98.re.txt>`
 
-.. include:: 07_cxx98.re
-    :code: cpp
-    :number-lines:
+.. literalinclude:: 07_cxx98.re.txt
+    :language: cpp
+    :linenos:
 
 Notes:
 
index 720e70b68b88f0d70e9b625408cb28ccfd6f6359..1d86326119db30c1a0125b7125b79e21abc20377 100644 (file)
@@ -2,17 +2,16 @@
 Examples
 ========
 
-.. include:: ../home.rst
+.. toctree::
+    :hidden:
 
-★
-
-* `Recognizing integers: the sentinel method   <example_01.html>`_
-* `Recognizing strings: the need for YYMAXFILL <example_02.html>`_
-* `Arbitrary large input and YYFILL            <example_03.html>`_
-* `Parsing integers (multiple re2c blocks)     <example_04.html>`_
-* `Parsing integers (conditions)               <example_05.html>`_
-* `Braille patterns (encodings)                <example_06.html>`_
-* `C++98 lexer                                 <example_07.html>`_
+    Recognizing integers: the sentinel method   <example_01>
+    Recognizing strings: the need for YYMAXFILL <example_02>
+    Arbitrary large input and YYFILL            <example_03>
+    Parsing integers (multiple re2c blocks)     <example_04>
+    Parsing integers (conditions)               <example_05>
+    Braille patterns (encodings)                <example_06>
+    C++98 lexer                                 <example_07>
 
 All examples are written in C++-98.
 `Do let me know <skvadik@gmail.com>`_ if you notice any obvious lies and errors.
diff --git a/src/examples/home.rst b/src/examples/home.rst
deleted file mode 100644 (file)
index da92baf..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-.. |[examples_home]| replace:: [home]
-.. _[examples_home]: ../index.html
-.. header:: |[examples_home]|_ `[Examples] <examples.html>`_
-.. footer:: |[examples_home]|_ `[Examples] <examples.html>`_
diff --git a/src/home.rst b/src/home.rst
deleted file mode 100644 (file)
index eccd374..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-.. header:: `[home] <../index.html>`_
-.. footer:: `[home] <../index.html>`_
index 704be066faf89a1ce04c560b2de386c2421a037c..67c5875954982e662482ce7c4764eb88cb46cb79 100644 (file)
@@ -2,35 +2,90 @@
 re2c
 ====
 
-re2c is a lexer generator for C/C++.
-The generated code is fast (direct-coded DFA, as good as handwritten)
-and flexible (easy to embed into existing environment).
+.. toctree::
+    :hidden:
 
---------------------------------------------------------------------------------
+    About <about/about>
+    Install <install/install>
+    Manual <manual/manual>
+    Examples <examples/examples>
+    News <news/news>
 
-★ `About    <about/about.html>`_
 
-★ `Install  <install/install.html>`_
+re2c is a lexer generator for C/C++.
+It has two key features:
 
-★ `Manual   <manual/manual.html>`_
+* Very fast lexers. The generated code is like a carefully tuned hand-crafted C/C++ lexer.
+  It's because re2c generates minimalistic hard-coded DFA
+  (as opposed to full-featured table based lexers).
 
-★ `Examples <examples/examples.html>`_
+* Very flexible lexers. The generated code can be wired into virtually any environment.
+  Instead of exposing a traditional API, re2c gives you access to its internals,
+  so that you can mess with the guts of your lexer as much as you need.
+  Of course, this can lead to all sorts of bad things.
+  With great flexibility comes great responsibility. ;)
+  Be sure to take a look at `examples <examples/examples.html>`_,
+  they cover a lot of real-world cases and
+  shed some light on dark corners of re2c API.
 
-★ `News <news/news.html>`_ |feed|
 
-.. |feed| image:: feed/feed.png
-    :target: feed/atom.xml
-    :class:  feed
-    :width:  25px
 
---------------------------------------------------------------------------------
+Bugs & feedback
+---------------
 
 Please send feedback to `re2c-devel <re2c-devel@lists.sourceforge.net>`_ and
 `re2c-general <re2c-general@lists.sourceforge.net>`_ mailing lists
+(search `mail archieves <https://sourceforge.net/p/re2c/mailman/>`_ for old threads)
 or `report a bug <https://github.com/skvadrik/re2c/issues>`_.
-Consider adding your lexer to re2c test suite: real-world tests are the best.
-Feel free to strip out all non-re2c code if you must keep it secret.
-In return re2c will not break your code. ``:)``
-Contributors welcome!
+
+Note that re2c is hosted both on `github <https://github.com/skvadrik/re2c>`_
+and on `sourceforge <https://sourceforge.net/p/re2c>`_ for redundancy.
+Currently github serves as main repository, bugtracker and binary hosting.
+Sourceforge is used as backup repository and to host mail
+(so please don't send bugs or feedback to sourceforge).
+
+
+News & updates
+--------------
+
+.. |feed| image:: _static/feed/feed.png
+    :target: _static/feed/atom.xml
+    :class:  feed
+    :width:  2em
+
+Subscribe to receive latest news and updates: |feed|
+
+
+
+Projects that use re2c
+----------------------
+
+* `PHP <http://php.net/>`_ (general-purpose scripting language)
+* `ninja <https://ninja-build.org/>`_ (a small build system with a focus on speed)
+* `yasm <http://yasm.tortall.net/>`_ (assembler)
+* `spamasassin <https://spamassassin.apache.org/>`_ (anti-spam platform)
+* `BLR-CAD <http://brlcad.org/>`_ (cross-platform solid modeling system)
+* ... last but not least, `re2c <http://re2c.org>`_
+
+This list is by no means complete;
+these are only the most well-known and open source projects.
+
+
+
+Contribute
+----------
+
+Contributions come in various forms:
+
+* Tests: a very easy and valuable contribution is to add your lexer to re2c test suite.
+  Real-world tests are the best.
+  Feel free to strip out all non-re2c code if you must keep it secret.
+  In return re2c will not break your code (re2c developers strive to never break existing tests).
+
+* Ideas: new features and new ways to use re2c.
+
+* Development: bugfixes, features, ports to other languages.
+
+Everyone is welcome!
 
 
index 5ed45c664b9eca7db997e9ece0dbbd042cc89611..d5b5a345ffb7e8bd19c5deb0f254acfc8ba385e7 100644 (file)
@@ -2,8 +2,8 @@
 Install
 =======
 
-.. include:: ../home.rst
-.. include:: ../contents.rst
+.. toctree::
+    :hidden:
 
 Download
 ========
@@ -18,6 +18,10 @@ Tarballs
 * `re2c-0.13.6.tar.gz <https://github.com/skvadrik/re2c/releases/download/0.13.6/re2c-0.13.6.tar.gz>`_
 * `re2c-0.13.5.tar.gz <http://sourceforge.net/projects/re2c/files/re2c/0.13.5/re2c-0.13.5.tar.gz/download>`_
 
+You can find other releases `here <https://sourceforge.net/projects/re2c/files/old/>`_
+(but be aware that they are hidden for a good reason:
+most of them contain bugs that have been fixed in the next minor release).
+
 Sources
 -------
 
index b12a2b1065cf5ac1963451989b1b49fb77569993..bbaae4be9ecf72059e1303cddebb5ba02f210fc8 100644 (file)
@@ -1,7 +1,8 @@
 Conditions
 ----------
 
-.. include:: ../home.rst
+.. toctree::
+    :hidden:
 
 You can preceed regular expressions with a list of condition names when
 using the ``-c`` switch. In this case ``re2c`` generates scanner blocks for
index c3167a5e258b361a1aed29cbb2b6936fdb312516..7cbbb86d687202fc51db91a1d8873a3f5cb15b23 100644 (file)
@@ -1,21 +1,21 @@
 .dot
 ----
 
-.. include:: ../home.rst
+.. toctree::
+    :hidden:
 
 With ``-D, --emit-dot`` option re2c does not generate C/C++ code.
 Instead, it dumps the generated DFA in `DOT format <https://en.wikipedia.org/wiki/DOT_%28graph_description_language%29>`_.
 One can convert this dump to an image of DFA using `graphviz <http://www.graphviz.org/>`_ or another library.
 
-Say we want a picture of DFA that accepts any UTF-8 code point:
+Say we want a picture of DFA that accepts any UTF-8 code point, ``utf8_any.re``:
 
-.. include:: utf8_any.re
-    :code: cpp
-    :number-lines:
+.. literalinclude:: utf8_any.re.txt
+    :language: cpp
 
 Generate and render :
 
-.. code-block::
+.. code-block:: none
 
     $ re2c -D8 -o utf8_any.dot utf8_any.re
     $ dot -Tpng -o utf8_any.png utf8_any.dot
@@ -31,27 +31,26 @@ binds actions, applies basic code deduplication.
 During the transformations it splits certain states and adds lambda transitions.
 Lambda transitions correspond to the unlabeled edges on the picture.
 
-A real-world example (JSON lexer, all non-re2c code stripped out):
+A real-world example (JSON lexer, all non-re2c code stripped out), ``php_json.re``:
 
-.. include:: php_json.re
-    :code: cpp
-    :number-lines:
+.. literalinclude:: php_json.re.txt
+    :language: cpp
 
 Generate .dot file:
 
-.. code-block::
+.. code-block:: none
 
     $ re2c -Dc -o php_json.dot php_json.re
 
 Render with ```dot -Gratio=0.3 -Tpng -o php_json_dot.png php_json.dot```:
 
 .. image:: php_json_dot.png
-    :width: 80%
+    :width: 100%
 
 Render with ```neato -Elen=4 -Tpng -o php_json_neato.png php_json.dot```:
 
 .. image:: php_json_neato.png
-    :width: 50%
+    :width: 70%
 
 The generated graph is sometimes very large and requires careful tuning of rendering paratemeters.
 
index 7e59e3d6c0f2599cf04fd300010f4d8f6758ca4b..66dc945d088c8dde8f9a268738289f8edf23deb7 100644 (file)
@@ -1,7 +1,8 @@
 Encodings
 ---------
 
-.. include:: ../home.rst
+.. toctree::
+    :hidden:
 
 ``re2c`` supports the following encodings: ASCII (default), EBCDIC (``-e``),
 UCS-2 (``-w``), UTF-16 (``-x``), UTF-32 (``-u``) and UTF-8 (``-8``).
index 8a4a59f8f446a05435a1c5409ded664d1e7404d0..3d8831019fd63f6c85cdf1bf8d4b405a2e4bc0f3 100644 (file)
@@ -2,15 +2,14 @@
 Features
 ========
 
-.. include:: ../home.rst
-
-★
-
-* `Conditions     <conditions/conditions.html>`_
-* `State          <state/state.html>`_
-* `Reuse          <reuse/reuse.html>`_
-* `Encodings      <encodings/encodings.html>`_
-* `Generic API    <generic_api/generic_api.html>`_
-* `Skeleton       <skeleton/skeleton.html>`_
-* `.dot           <dot/dot.html>`_
+.. toctree::
+    :hidden:
+
+    Conditions     <conditions/conditions>
+    State          <state/state>
+    Reuse          <reuse/reuse>
+    Encodings      <encodings/encodings>
+    Generic API    <generic_api/generic_api>
+    Skeleton       <skeleton/skeleton>
+    .dot           <dot/dot>
 
index 930ee835e770ea371a6f35689fab5cdf0a4baf58..9c082c4904915ad9e270f04b42de781f4541c3d2 100644 (file)
@@ -1,7 +1,8 @@
 Generic API
 -----------
 
-.. include:: ../home.rst
+.. toctree::
+    :hidden:
 
 ``re2c`` usually operates on input using pointer-like primitives
 ``YYCURSOR``, ``YYMARKER``, ``YYCTXMARKER`` and ``YYLIMIT``.
diff --git a/src/manual/features/home.rst b/src/manual/features/home.rst
deleted file mode 100644 (file)
index ba039a4..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-.. |[manual_features_home]| replace:: [home]
-.. _[manual_features_home]: ../../../index.html
-.. header:: |[manual_features_home]|_ `[Manual] <../../manual.html>`_ `[Features] <../features.html>`_
-.. footer:: |[manual_features_home]|_ `[Manual] <../../manual.html>`_ `[Features] <../features.html>`_
index d9c1c5615ed384eacf1a9b8cca686ddca8593b64..4817311ee5ec3e6c1200f1801b696fd5d5a00533 100644 (file)
@@ -1,8 +1,6 @@
 Reuse
 -----
 
-.. include:: ../home.rst
-
 Reuse mode is controlled by ``-r --reusable`` option.
 Allows reuse of scanner definitions with ``/*!use:re2c */`` after ``/*!rules:re2c */``.
 In this mode no ``/*!re2c */`` block and exactly one ``/*!rules:re2c */`` must be present.
index 781d7bccea5e73427f71e288496ea94dfb59989c..94e473035590e09bd4efc5c110d883e6663d4928 100644 (file)
@@ -1,23 +1,22 @@
 Example
 ~~~~~~~
 
-`[hex2.re] <hex2.re>`_
+:download:`[hex2.re] <hex2.re.txt>`
 
-.. include:: hex2.re
-    :code: c
-    :number-lines:
+.. literalinclude:: hex2.re.txt
+    :language: c
 
 Here is a very simple program (it tries to match two-digit hexadecimal numbers).
 We can see the generated DFA using ```re2c -D hex2.re | dot -Gratio=0.5 -Tpng -o example.png```:
 
 .. image:: example.png
-    :width: 40%
+    :width: 50%
 
 Given this program, ```re2c -S -o example.c hex2.re``` generates three files:
 ``example.c`` (main program), ``example.c.line4.input`` (input data) and ``example.c.line4.keys`` (expected match results).
 First, let's look at the generated strings:
 
-`[example.c.line4.input] <example.c.line4.input>`_
+:download:`[example.c.line4.input] <example.c.line4.input>`
 
 .. code-block:: bash
 
@@ -59,7 +58,7 @@ Byte sequences correspond to the paths in DFA.
 All strings are glued together, so it's hard to tell where is the end of one string and the beginning of another.
 For that re2c generates keys:
 
-`[example.c.line4.keys] <example.c.line4.keys>`_
+:download:`[example.c.line4.keys] <example.c.line4.keys>`
 
 .. code-block:: bash
 
@@ -114,11 +113,11 @@ In our case each triplet occupies three bytes.
 
 And finally, the program itself:
 
-`[example.c] <example.c>`_
+:download:`[example.c] <example.c.txt>`
 
-.. include:: example.c
-    :code: c
-    :number-lines:
+.. literalinclude:: example.c.txt
+    :language: c
+    :linenos:
 
 re2c generated two auxilary functions: ``read_file`` and ``action_line4``.
 ``read_file`` is used to map ``.input`` and ``.keys`` files into memory (this function is shared between all lexers).
index cb450afcf0410ad6890e243549486a6952155cd5..559084a9a565bc6438473b20ca1b88c49afb7cd8 100644 (file)
@@ -77,7 +77,7 @@ One special case of failure is caused by undefined control flow in the generated
 Suppose, for example, that we forgot to handle default case in the example above:
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /*!re2c
         [0-9a-fA-F]{2} {}
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from src/manual/features/skeleton/gen.sh
rename to src/manual/features/skeleton/gen.sh.txt
index 3ecf0554da46d647dd83137adac402777d7afde6..5ea511352a60948aafcfcd90132a8a3452f491cf 100644 (file)
@@ -27,7 +27,6 @@ The algorithm's implementation is limited by ~1Gb of edges and consumes constant
 We can study the algorithm simply alternating repetition counter in the example above:
 
 .. code-block:: cpp
-    :number-lines:
 
     /*!re2c
         *              {}
@@ -38,21 +37,21 @@ Each increment of the repetition counter adds 256 new edges the DFA.
 Compare the following pictures of DFA with one, two and three repetitions:
 
 .. image:: example_next.png
-    :width: 70%
+    :width: 80%
 
 We will use a simple script that dumps re2c source file,
 generates skeleton program and measures the size of ``.input`` and ``.keys`` files:
 
-`[gen.sh] <gen.sh>`_
+:download:`[gen.sh] <gen.sh.txt>`
 
-.. include:: gen.sh
-    :code: bash
-    :number-lines:
+.. literalinclude:: gen.sh.txt
+    :language: bash
+    :linenos:
 
 Script runs in a loop and expects two arguments:
 lower and upped bounds of the iteration counter.
 
-.. code-block::
+.. code-block:: none
 
     $ ./gen.sh 1 16
          iters     edges     input      keys
index 8ef14ab39d3bdb944c054eeb2fef2fce6a6b7f3d..10ab25475b0b75aab3b712f3711e739d8056f71d 100644 (file)
@@ -1,9 +1,8 @@
 Skeleton
 --------
 
-.. include:: ../home.rst
-.. include:: ../../../contents.rst
-
+.. toctree::
+    :hidden:
 
 With ``-S, --skeleton`` option re2c ignores all non-re2c code and generates a self-contained C program
 that can be further compiled and executed.
index b29ad2bca1e098570637bf1d9243fe406ed903e7..4b0dfe415f0b302f2e632415370ed99f3b7d2b6e 100644 (file)
@@ -1,7 +1,8 @@
 State
 -----
 
-.. include:: ../home.rst
+.. toctree::
+    :hidden:
 
 When the ``-f`` flag is specified, ``re2c`` generates a scanner that can
 store its current state, return to the caller, and later resume
diff --git a/src/manual/home.rst b/src/manual/home.rst
deleted file mode 100644 (file)
index 50b01e9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-.. |[manual_home]| replace:: [home]
-.. _[manual_home]: ../../index.html
-.. header:: |[manual_home]|_ `[Manual] <../manual.html>`_
-.. footer:: |[manual_home]|_ `[Manual] <../manual.html>`_
index f8fa7d0c7086a22d2de2be080037666fc5c5f850..c61769492bfabc695b32cb870d5dc9f282028812 100644 (file)
@@ -2,12 +2,11 @@
 Manual
 ======
 
-.. include:: ../home.rst
+.. toctree::
+    :hidden:
 
-★
-
-* `Options   <options/options.html>`_
-* `Warnings  <warnings/warnings.html>`_
-* `Syntax    <syntax/syntax.html>`_
-* `Features  <features/features.html>`_
+    Options <options/options>
+    Warnings <warnings/warnings>
+    Syntax <syntax/syntax>
+    Features <features/features>
 
diff --git a/src/manual/options/home.rst b/src/manual/options/home.rst
deleted file mode 100644 (file)
index 56b7b5c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-.. |[manual_warnings_home]| replace:: [home]
-.. _[manual_warnings_home]: ../../index.html
-.. header:: |[manual_warnings_home]|_ `[Manual] <../manual.html>`_ `[Options] <options.html>`_
-.. footer:: |[manual_warnings_home]|_ `[Manual] <../manual.html>`_ `[Options] <options.html>`_
index bdc109743981258b6f709c4bc6eac7ebb328df38..c8a68e97732275f0d0b5e517edb92704092d0100 100644 (file)
@@ -2,7 +2,8 @@
 Options
 =======
 
-.. include:: ../home.rst
+.. toctree::
+    :hidden:
 
 .. include:: options_list.rst
 
index ef13ff53ea882386d1ac3a4f9fe130f32c5d1fab..8db39d4013929b2557d1aeb40da64f10423cc355 100644 (file)
@@ -2,10 +2,8 @@
 Syntax
 ======
 
-.. include:: ../home.rst
-.. include:: ../../contents.rst
-
-
+.. toctree::
+    :hidden:
 
 Code for ``re2c`` consists of a set of `rules`_, `definitions`_ and
 `configurations`_.
index 11f663d5f29ea71d8f56898a7541747a6a3653e0..17aad40525de6a430e4a77e05a7c865e6f32a610 100644 (file)
@@ -17,7 +17,7 @@ Almost occasionally I found a real-world program that does use fixed condition n
 Here is the carcass of this program:
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     #define NORMAL 0
     #define PRE_RAW 1
index 1707185c8bb427719b4d0f79ca2fda3dff52b648..cb6e91b3778cf8fd7c61f4ee38151378236e7f6e 100644 (file)
@@ -8,16 +8,16 @@ Anything else is an error.
 Nothing special, except that instead of generating condition names with ``/*!types:re2c*/`` directive
 or ``-t, --type-header`` option we hardcoded them manually:
 
-`[wcondition_order.re] <wcondition_order.re>`_
+:download:`[wcondition_order.re] <wcondition_order.re.txt>`
 
-.. include:: wcondition_order.re
-    :code: cpp
-    :number-lines:
+.. literalinclude:: wcondition_order.re.txt
+    :language: cpp
+    :linenos:
 
 Condition order is controlled by ``REVERSED_CONDITION_ORDER`` define.
 Let's compile and run it:
 
-.. code-block::
+.. code-block:: none
 
     $ re2c -c -o example.c -Wcondition-order wcondition_order.re
     $
@@ -32,7 +32,7 @@ Let's compile and run it:
 Everything works fine: we get ``aaaa,bbb!`` in both cases.
 However, if we use ``-s`` re2c option, lexer becomes sensitive to condition order:
 
-.. code-block::
+.. code-block:: none
 
     $ re2c -cs -o example.c -Wcondition-order wcondition_order.re
     re2c: warning: line 31: looks like you use hardcoded numbers instead of autogenerated condition names: better add
index 26c29fe26ef6068156e0285fec1168548d45b663..7a78aee4be43f8d4edcca63d5e862aeb576f2be2 100644 (file)
@@ -1,8 +1,8 @@
 [-Wcondition-order]
 -------------------
 
-.. include:: ../home.rst
-.. include:: ../../../contents.rst
+.. toctree::
+    :hidden:
 
 .. include:: simple_example.rst
 .. include:: how_it_works.rst
index 465b358b956cbaf4acaeb09c930455c16ecc8eaa..d78ea8ed187005e1a18ce800feef9a07ecf5880a 100644 (file)
@@ -1,7 +1,8 @@
 [-Wempty-character-class]
 --------------------------
 
-.. include:: ../home.rst
+.. toctree::
+    :hidden:
 
 This warning is complementary to ``--empty-class`` option.
 The option expects a single argument, one of the following:
@@ -21,7 +22,7 @@ who are not aware of ``--empty-class`` option.
 Note that empty character class can be constructed in many ways:
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /*!re2c
         []                        { return 0; }
@@ -34,7 +35,7 @@ Note that empty character class can be constructed in many ways:
 Given this code, ```re2c -i -Wempty-character-class``` generates:
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /* Generated by re2c 0.14.1.dev on Wed Nov 11 11:42:00 2015*/
     
@@ -45,7 +46,7 @@ Given this code, ```re2c -i -Wempty-character-class``` generates:
 
 And warns:
 
-.. code-block::
+.. code-block:: none
 
     re2c: warning: line 2: empty character class [-Wempty-character-class]
     re2c: warning: line 3: empty character class [-Wempty-character-class]
diff --git a/src/manual/warnings/home.rst b/src/manual/warnings/home.rst
deleted file mode 100644 (file)
index c430723..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-.. |[manual_warnings_home]| replace:: [home]
-.. _[manual_warnings_home]: ../../../index.html
-.. header:: |[manual_warnings_home]|_ `[Manual] <../../manual.html>`_ `[Warnings] <../warnings.html>`_
-.. footer:: |[manual_warnings_home]|_ `[Manual] <../../manual.html>`_ `[Warnings] <../warnings.html>`_
index beebf8345f4510bc170a4e77cba39997e96d176f..690b86e139210dd6bfe5f8f3209546f84b9bfc29 100644 (file)
@@ -10,7 +10,7 @@ Typos in definitions
 Here is the skeleton of REXX lexer (the very lexer which motivated Peter to write re2c ``:)``).
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /*!re2c
         all    = [\000-\377];
@@ -154,7 +154,7 @@ Here is the skeleton of REXX lexer (the very lexer which motivated Peter to writ
 
 ```re2c -Wmatch-empty-string``` warns:
 
-.. code-block::
+.. code-block:: none
 
     re2c: warning: line 133: rule matches empty string [-Wmatch-empty-string]
 
@@ -171,11 +171,9 @@ Sure, it's just a typo and the author meant ``symchr+``.
 Skipping uninteresting stuff
 ............................
 
-Like spaces.
-One often needs to skip variable number of them:
+One often needs to skip variable number of, say, spaces:
 
 .. code-block:: cpp
-    :number-lines:
 
     /*!re2c
         TABS_AND_SPACES = [ \t]*;
@@ -184,7 +182,6 @@ One often needs to skip variable number of them:
 This definition is ok when used inside of another (non-nullable) rule:
 
 .. code-block:: cpp
-    :number-lines:
 
     /*!re2c
         TABS_AND_SPACES = [ \t]*;
index 6b5f5588c8ab5b10c324060e7ae5a2b03482a462..2c00865332e4fe839d0b89f357711ac27a4e6499 100644 (file)
@@ -4,11 +4,11 @@ A simple example
 ``[-Wmatch-empty-string]`` warns when a rule is nullable (matches empty string).
 It was intended to prevent hitting eternal loop in cases like this:
 
-`[wmatch_empty_string.re] <wmatch_empty_string.re>`_
+:download:`[wmatch_empty_string.re] <wmatch_empty_string.re.txt>`
 
-.. include:: wmatch_empty_string.re
-    :code: cpp
-    :number-lines:
+.. literalinclude:: wmatch_empty_string.re.txt
+    :language: cpp
+    :linenos:
 
 The program loops over its arguments (the outer ``for`` loop)
 and tries to lex each argument (the inner ``for`` loop).
@@ -16,7 +16,7 @@ Lexer stops when all input has been consumed and it sees the terminating ``NULL`
 Arguments must consist of lowercase letters only.
 Generate, compile and run:
 
-.. code-block::
+.. code-block:: none
 
     $ re2c -o example.c -Wmatch-empty-string wmatch_empty_string.re
     re2c: warning: line 11: rule matches empty string [-Wmatch-empty-string]
index 6b94f00af7af0aadddbec1ae09596b3f4ffd9b9c..1ccc5631bffb208616b9c093e28e0922fa54fb2c 100644 (file)
@@ -1,8 +1,8 @@
 [-Wmatch-empty-string]
 --------------------------
 
-.. include:: ../home.rst
-.. include:: ../../../contents.rst
+.. toctree::
+    :hidden:
 
 .. include:: simple_example.rst
 .. include:: false_alarm.rst
index 2efefd624de5d7457938b60ae50f7372b310683d..743b11a515c4b21b768d33e39a66a8f1c04399b2 100644 (file)
@@ -1,7 +1,8 @@
 [-Wswapped-range]
 --------------------------
 
-.. include:: ../home.rst
+.. toctree::
+    :hidden:
 
 This warning is very simple.
 It warns you in cases when character class contains a range which lower bound is greater than upper bound.
@@ -9,7 +10,7 @@ For some strange reason re2c never considered it an error:
 it simply swaps range bounds and goes on.
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /*!re2c
         *     { return "*"; }
@@ -19,7 +20,7 @@ it simply swaps range bounds and goes on.
 Given this code, ```re2c -i -Wswapped-range``` generates the following:
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /* Generated by re2c 0.14.1.dev on Tue Nov 10 22:07:31 2015*/
     
@@ -48,7 +49,7 @@ Given this code, ```re2c -i -Wswapped-range``` generates the following:
 
 And reports a warning:
 
-.. code-block::
+.. code-block:: none
 
     re2c: warning: line 3: range lower bound (0x61) is greater than upper bound (0x5A), swapping [-Wswapped-range]
 
index d2ad81378f4c393193b8706a2ec9609609adcf90..93ae29b28c8be3bca92338468b8bc79eb2ec2689 100644 (file)
@@ -5,7 +5,6 @@ When the the world was young and re2c didn't have default rule ``*`` (that is, b
 everyone used ``[^]`` as default rule:
 
 .. code-block:: cpp
-    :number-lines:
 
     /*!re2c
         // ... normal rules ...
@@ -29,7 +28,7 @@ In variable-width encodings it consumes variable number of code units and may no
 The example above compiles without warnings with any fixed-width encoding (ASCII by default).
 However, with UTF-8 encoding ```re2c -i8 -Wundefined-control-flow``` says:
 
-.. code-block::
+.. code-block:: none
 
     re2c: warning: line 4: control flow is undefined for strings that match 
             '[\x80-\xC1\xF5-\xFF]'
@@ -48,7 +47,7 @@ One would expect that with UTF-16 (another variable-width encoding) re2c will al
 This is because by default re2c treats Unicode surrogates as normal code points (for backwards compatibility reasons).
 If we tell re2c to exclude surrogates, ```re2c -ix --encoding-policy fail -Wundefined-control-flow``` will warn:
 
-.. code-block::
+.. code-block:: none
 
     re2c: warning: line 4: control flow is undefined for strings that match 
             '[\xDC00-\xDFFF]'
index fc4479848e2ee5609c6d6ba956d91e61095b0d13..bd5380f4a746a928f71f0fb099da3b8d65006d5d 100644 (file)
@@ -4,7 +4,7 @@ A simple example
 Say, we want to match ``'a'``:
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /*!re2c
         "a" { return 'a'; }
@@ -13,7 +13,7 @@ Say, we want to match ``'a'``:
 ```re2c -i -Wundefined-control-flow```:
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /* Generated by re2c 0.14.1.dev on Thu Nov  5 14:35:46 2015*/
     
@@ -34,14 +34,14 @@ Say, we want to match ``'a'``:
 Clearly this is not what we want: this code matches any letter, not only ``'a'``.
 re2c grumbles something about undefined control flow and says that default ``*`` rule won't hurt:
 
-.. code-block::
+.. code-block:: none
 
     re2c: warning: line 3: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use default rule '*' [-Wundefined-control-flow]
 
 Let's add it:
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /*!re2c
         *   { return '*'; }
@@ -51,7 +51,7 @@ Let's add it:
 Now that's better:
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /* Generated by re2c 0.14.1.dev on Thu Nov  5 14:35:08 2015*/
     
index 3f2600e7de9356d67ce1983f9fe506c0fca8bfdf..5f580760568eb258001a85c2943d056008edb121 100644 (file)
@@ -1,8 +1,8 @@
 [-Wundefined-control-flow]
 --------------------------
 
-.. include:: ../home.rst
-.. include:: ../../../contents.rst
+.. toctree::
+    :hidden:
 
 .. include:: simple_example.rst
 .. include:: default_vs_any.rst
index e6e7793b302659711bec19586736aa3abf2c7ee3..d0cce36c9917258376e42ba7bed042752483c38b 100644 (file)
@@ -4,7 +4,7 @@ Infinite rules
 A rule may be unreachable all by itself, without being shadowed by other rules:
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /*!re2c
         [^]* { return "greeedy"; }
@@ -14,7 +14,7 @@ This rule is so greedy that it never stops.
 It will continue eating input until ``YYFILL`` finally fails (```re2c -i -Wunreachable-rules```):
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /* Generated by re2c 0.14.1.dev on Fri Nov  6 21:36:56 2015*/
     
@@ -35,7 +35,7 @@ lexer will loop until segfault or another disaster forces its untimely shutdown
 (unless you use ``--input-api custom`` and do some magic to stop it).
 And re2c warns us:
 
-.. code-block::
+.. code-block:: none
 
     re2c: warning: line 2: unreachable rule  [-Wunreachable-rules]
 
index 8dd0932a39da196536dcf947ec5fe5c90a825fc5..abd705b35b71e8a9695e3d6771c9bbb5547fc861 100644 (file)
@@ -8,7 +8,7 @@ However, in some cases the warning is quite interesting.
 Here is an example of a real-world lexer (all the non-re2c code has beed removed):
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /*!re2c
         re2c:yyfill:check = 0;
@@ -68,7 +68,7 @@ Here is an example of a real-world lexer (all the non-re2c code has beed removed
 
 ```re2c -cF -Wunreachable-rules``` says:
 
-.. code-block::
+.. code-block:: none
 
     re2c: warning: line 54: unreachable rule in condition 'ST_DOUBLE_QUOTES' (shadowed by rules at lines 47, 48) [-Wunreachable-rules]
     re2c: warning: line 49: unreachable rule in condition 'ST_OFFSET' (shadowed by rule at line 45) [-Wunreachable-rules]
@@ -79,13 +79,13 @@ Here is an example of a real-world lexer (all the non-re2c code has beed removed
 The interesting part is the unreachable rule on line 49 in conditions ``ST_OFFSET`` and ``ST_SECTION_VALUE``.
 The rule is ``{WHITESPACE}``:
 
-.. code-block::
+.. code-block:: none
 
     WHITESPACE [ \t]+
 
 re2c claims that it is shadowed by the rule on line 45, which is ``{SECTION_VALUE_CHARS}+``:
 
-.. code-block::
+.. code-block:: none
 
     ANY_CHAR            (.|[\n\t])
     LITERAL_DOLLAR      ("$"([^{\000]|("\\"{ANY_CHAR})))
index 2ac4866ee930fc49062f0efb968bcdaeea8b9624..11533238c318d2d0e7b79f3d83cf7da6be442472 100644 (file)
@@ -2,7 +2,7 @@ A simple example
 ~~~~~~~~~~~~~~~~
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /*!re2c
         ""          { return ""; }
@@ -15,7 +15,7 @@ A simple example
 
 Given this strange code, ```re2c -i -Wunreachable-rules``` says:
 
-.. code-block::
+.. code-block:: none
 
     re2c: warning: line 2: unreachable rule (shadowed by rules at lines 4, 6) [-Wunreachable-rules]
     re2c: warning: line 5: unreachable rule (shadowed by rule at line 4) [-Wunreachable-rules]
@@ -24,7 +24,7 @@ Given this strange code, ```re2c -i -Wunreachable-rules``` says:
 A look at the generated code suggests that re2c was right:
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /* Generated by re2c 0.14.1.dev on Fri Nov  6 15:21:36 2015*/
     
index e88082bb8ee4f41517debf7c197f64808455a42f..3240c9cc20daf8f984daac5b4e0edc8924042a9e 100644 (file)
@@ -1,8 +1,8 @@
 [-Wunreachable-rules]
 --------------------------
 
-.. include:: ../home.rst
-.. include:: ../../../contents.rst
+.. toctree::
+    :hidden:
 
 .. include:: simple_example.rst
 .. include:: infinite_rules.rst
index 91f01eed4c3ca607ac8b80cafb8f4db94cf272fb..840bcdea0288597b8cf160af7027de71eeee5f55 100644 (file)
@@ -2,7 +2,7 @@ A simple example
 ~~~~~~~~~~~~~~~~
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /*!re2c
         *                        {}
@@ -13,7 +13,7 @@ A simple example
 
 Given this code, ```re2c -Wuseless-escape``` reports a bunch of warnings:
 
-.. code-block::
+.. code-block:: none
 
     re2c: warning: line 3: column 11: escape has no effect: '\A' [-Wuseless-escape]
     re2c: warning: line 3: column 15: escape has no effect: '\'' [-Wuseless-escape]
@@ -37,7 +37,7 @@ Useless escapes are ignored: the escaped symbol is treated as not escaped (``\A`
 The above example should be fixed as follows:
 
 .. code-block:: cpp
-    :number-lines:
+    :linenos:
 
     /*!re2c
         *                    {}
index 56d2a4d05c152a284fe852ce1a9d38351a69e31e..28821d73d109d2253c2740a067fdc7c94a09c4c9 100644 (file)
@@ -1,8 +1,8 @@
 [-Wuseless-escape]
 --------------------------
 
-.. include:: ../home.rst
-.. include:: ../../../contents.rst
+.. toctree::
+    :hidden:
 
 .. include:: simple_example.rst
 .. include:: how_it_works.rst
index d450b997c8e160ba9ce6f01479ec5c0684621ffa..54f328dcee3cf1f225dfdb8d93dcfe6a1e2a6fa4 100644 (file)
@@ -2,17 +2,16 @@
 Warnings
 ========
 
-.. include:: ../home.rst
+.. toctree::
+    :hidden:
 
-★
-
-* `[-Wundefined-control-flow] <undefined_control_flow/wundefined_control_flow.html>`_
-* `[-Wunreachable-rules]      <unreachable_rules/wunreachable_rules.html>`_
-* `[-Wcondition-order]        <condition_order/wcondition_order.html>`_
-* `[-Wuseless-escape]         <useless_escape/wuseless_escape.html>`_
-* `[-Wswapped-range]          <swapped_range/wswapped_range.html>`_
-* `[-Wempty-character-class]  <empty_character_class/wempty_character_class.html>`_
-* `[-Wmatch-empty-string]     <match_empty_string/wmatch_empty_string.html>`_
+    [-Wundefined-control-flow] <undefined_control_flow/wundefined_control_flow>
+    [-Wunreachable-rules]      <unreachable_rules/wunreachable_rules>
+    [-Wcondition-order]        <condition_order/wcondition_order>
+    [-Wuseless-escape]         <useless_escape/wuseless_escape>
+    [-Wswapped-range]          <swapped_range/wswapped_range>
+    [-Wempty-character-class]  <empty_character_class/wempty_character_class>
+    [-Wmatch-empty-string]     <match_empty_string/wmatch_empty_string>
 
 .. include:: warnings_general.rst
 
index eb416e1753d62e55bcf9afacd75727dd6b9e1965..38eedef242b597bf01671c94fd9ba37b208d0cc2 100644 (file)
@@ -2,8 +2,8 @@
 Changelog
 =========
 
-.. include:: ../home.rst
-.. include:: ../../contents.rst
+.. toctree::
+    :hidden:
 
 .. include:: 0_16.rst
 .. include:: 0_15.rst
diff --git a/src/news/home.rst b/src/news/home.rst
deleted file mode 100644 (file)
index 9e9bcf7..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-.. |[news_home]| replace:: [home]
-.. _[news_home]: ../../index.html
-.. header:: |[news_home]|_ `[News] <../news.html>`_
-.. footer:: |[news_home]|_ `[News] <../news.html>`_
index 604e2a1c8c975cdd3cd5a2d6c94a900f7cb6104e..1a946b8a2e5a1ba200d0ba254a63e974092fe305 100644 (file)
@@ -2,14 +2,13 @@
 News
 ====
 
-.. include:: ../home.rst
-
-★
-
-* `Release 0.16 <release_notes/0_16.html>`_
-* `Release 0.15.3 <release_notes/0_15_3.html>`_
-* `Release 0.15.2 <release_notes/0_15_2.html>`_
-* `Release 0.15.1 <release_notes/0_15_1.html>`_
-* `Release 0.15 <release_notes/0_15.html>`_
-* `Changelog <changelog/changelog.html>`_
+.. toctree::
+    :hidden:
+
+    Release 0.16 <release_notes/0_16>
+    Release 0.15.3 <release_notes/0_15_3>
+    Release 0.15.2 <release_notes/0_15_2>
+    Release 0.15.1 <release_notes/0_15_1>
+    Release 0.15 <release_notes/0_15>
+    Changelog <changelog/changelog>
 
index c4b79fa04939c212074e04d0a467d41405a95466..9a803c261897fde08cd5ff5f8ed3dcfafdac63a2 100644 (file)
@@ -2,8 +2,6 @@
 Release 0.15
 ============
 
-.. include:: ../home.rst
-
 This release started out in spring 2015 as a relatively simple code cleanup.
 
 I focused on the following problem: re2c used to repeat the whole generation process multiple times.
index cae7148782c5156f36466fb3ab45ade67d1cfa99..bfef85af1048fa1467de703190a5c47fa85d7929 100644 (file)
@@ -2,9 +2,6 @@
 Release 0.15.1
 ==============
 
-.. include:: ../home.rst
-
-
 This release fixes an error in the testing script:
 it used locale-sensitive ``sort`` utility,
 which resulted in different order of files on different platforms.
index bd235652a66967489b27f28e0c1fb405ec9867d6..4aa1bab2d307df5635f6b79d9a932498f5a6428f 100644 (file)
@@ -2,9 +2,6 @@
 Release 0.15.2
 ==============
 
-.. include:: ../home.rst
-
-
 This release fixes a bug in build system (`reported <https://bugs.gentoo.org/show_bug.cgi?id=566620>`_ on Gentoo bugtracker).
 Fix adds missing dependency (lexer depends on bison-generated header).
 It seems that the dependency has always been missing, build order just happened to be correct.
index fcc56be541f0b6d75b07829a010f3cca2e52e627..58577a5986f135bdd15d3d250ab439fbd3803cc4 100644 (file)
@@ -2,9 +2,6 @@
 Release 0.15.3
 ==============
 
-.. include:: ../home.rst
-
-
 This release fixes multiple build-time and run-time failures on OS X, FreeBSD and Windows.
 Most of the problems were reported and fixed by Oleksii Taran (on OS X)
 and Sergei Trofimovich (on FreeBSD and Windows).
index a5f7f6fcab3c4212c13300a2ada5b2ddc1c703ba..a0212f5e45e03b65f73f606d2466c7535b2e6e66 100644 (file)
@@ -2,8 +2,6 @@
 Release 0.16
 ==============
 
-.. include:: ../home.rst
-
 This release adds a very important step in the process of code generation:
 minimization of the underlying DFA (deterministic finite automaton).
 Simply speaking, this means that re2c now generates less code
diff --git a/src/template.html b/src/template.html
deleted file mode 100644 (file)
index 4d5e4d9..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-%(head_prefix)s
-%(head)s
-<link rel="stylesheet" type="text/css" href="/css/default.css" />
-<link rel="alternate" type="application/atom+xml" href="/feed/atom.xml" title="Atom 1.0" />
-<link rel="icon" href="/favicon.ico" />
-%(body_prefix)s
-%(body_pre_docinfo)s
-%(docinfo)s
-%(body)s
-%(body_suffix)s
diff --git a/src/theme-re2c/static/pygments.css b/src/theme-re2c/static/pygments.css
new file mode 100644 (file)
index 0000000..d15cfbe
--- /dev/null
@@ -0,0 +1,72 @@
+
+.highlighttable td.code {  width: 100%; }
+
+.linenos {
+    color: darkgray;
+    font-size: 14px; /* must be in sync with .highlight */
+}
+
+.highlight {
+    border: 1px solid darkgray;
+    border-left: 4px solid darkgray;
+    padding: 0 1em 0 1em;
+    background-color: aliceblue;
+    display: block;
+    overflow: auto;
+    font-size: 14px; /* must be in sync with .linenos */
+    color: dimgray;
+}
+
+.highlight .c  { color: rosybrown; } /* Comment           */
+.highlight .cm { color: rosybrown; } /* Comment.Multiline */
+.highlight .c1 { color: rosybrown; } /* Comment.Single    */
+.highlight .cp { color: rosybrown; } /* Comment.Preproc   */
+
+.highlight .k  { color: steelblue;    } /* Keyword      */
+.highlight .kt { color: midnightblue; } /* Keyword.Type */
+
+.highlight .m  { color: slategray; } /* Literal.Number */
+.highlight .mf { color: slategray; } /* Literal.Number.Float */
+.highlight .mh { color: slategray; } /* Literal.Number.Hex */
+.highlight .mi { color: slategray; } /* Literal.Number.Integer */
+.highlight .mo { color: slategray; } /* Literal.Number.Oct */
+.highlight .il { color: slategray; } /* Literal.Number.Integer.Long */
+
+.highlight .s  { color: lightsalmon; } /* Literal.String */
+.highlight .sb { color: lightsalmon; } /* Literal.String.Backtick */
+.highlight .sc { color: lightsalmon; } /* Literal.String.Char */
+.highlight .sd { color: lightsalmon; } /* Literal.String.Doc */
+.highlight .s2 { color: lightsalmon; } /* Literal.String.Double */
+.highlight .se { color: lightsalmon; } /* Literal.String.Escape */
+.highlight .sh { color: lightsalmon; } /* Literal.String.Heredoc */
+.highlight .si { color: lightsalmon; } /* Literal.String.Interpol */
+.highlight .sx { color: lightsalmon; } /* Literal.String.Other */
+.highlight .sr { color: lightsalmon; } /* Literal.String.Regex */
+.highlight .s1 { color: lightsalmon; } /* Literal.String.Single */
+.highlight .ss { color: lightsalmon; } /* Literal.String.Symbol */
+
+/*.highlight .o  { } /* Operator */
+/*.highlight .ow { } /* Operator.Word */
+
+/*.highlight .ge { } /* Generic.Emph */
+
+/*.highlight .gd { } /* Generic.Deleted  */
+/*.highlight .gi { } /* Generic.Inserted */
+
+/*.highlight .na { } /* Name.Attribute */
+/*.highlight .nb { } /* Name.Builtin */
+/*.highlight .nc { } /* Name.Class */
+/*.highlight .no { } /* Name.Constant */
+/*.highlight .nd { } /* Name.Decorator */
+/*.highlight .ni { } /* Name.Entity */
+/*.highlight .ne { } /* Name.Exception */
+/*.highlight .nf { } /* Name.Function */
+/*.highlight .nl { } /* Name.Label */
+/*.highlight .nn { } /* Name.Namespace */
+/*.highlight .nt { } /* Name.Tag */
+/*.highlight .nv { } /* Name.Variable */
+/*.highlight .bp { } /* Name.Builtin.Pseudo */
+/*.highlight .vc { } /* Name.Variable.Class */
+/*.highlight .vg { } /* Name.Variable.Global */
+/*.highlight .vi { } /* Name.Variable.Instance */
+
diff --git a/src/theme-re2c/static/theme-re2c.css b/src/theme-re2c/static/theme-re2c.css
new file mode 100644 (file)
index 0000000..8d9a948
--- /dev/null
@@ -0,0 +1,118 @@
+
+
+
+body {
+    font-family: sans-serif;
+    margin: 0;
+}
+
+
+
+div.document {
+    margin: 0 0 0 20%;
+    padding: 1em;
+    text-align: justify;
+    color: darkslategray;
+}
+div.document a { color: steelblue; }
+div.document h1,
+div.document h2,
+div.document h3,
+div.document h4,
+div.document h5,
+div.document h6 {
+    font-weight: normal;
+    padding: 1em 0 0 0;
+}
+div.document h1 { text-align: center; }
+div.document h2 { border-bottom: 1px solid; }
+div.document h3 { border-bottom: 1px dotted; }
+div.document table, tr, td, th {
+    border: none;
+    padding: 0em 0.2em 0em 0.2em;
+}
+div.document img {
+    display: block;
+    border: 1px dotted;
+    margin: auto;
+}
+
+div.document img.feed {
+    display: inline;
+    border: none;
+    width: 2em;
+    vertical-align: middle;
+}
+div.document code {
+    font-size: 14px;
+    padding: 1px;
+    border: 1px solid gainsboro;
+    background-color: aliceblue;
+}
+/* :download: role; should look like a normal link rather than inline code block */
+div.document a code.download {
+    font-family: sans;
+    font-size: 1em;
+    padding: none;
+    border: none;
+    background-color: transparent;
+}
+
+
+div.footer {
+    margin: 0 0 0 20%;
+    padding: 1em;
+    float: right;
+    font-style: italic;
+    color: gainsboro;
+}
+
+
+
+div.sphinxsidebar {
+    border-right: 1px solid darkgray;
+    width: 20%;
+    text-align: left;
+    position: fixed;
+    background-color: gainsboro;
+    overflow: auto;
+    height: 100%;
+    color: midnightblue;
+}
+div.sphinxsidebar a { color: midnightblue; }
+div.sphinxsidebarwrapper { padding: 1em; }
+div.sphinxsidebarwrapper ul {
+    list-style-type: disc;
+    padding: 0 0 0 1em;
+    font-size: 0.95em;
+    color: darkgray;
+}
+div.sphinxsidebarwrapper h1,
+div.sphinxsidebarwrapper h2,
+div.sphinxsidebarwrapper h3,
+div.sphinxsidebarwrapper h4,
+div.sphinxsidebarwrapper h5,
+div.sphinxsidebarwrapper h6 {
+    padding: 0 0 0.1em 0;
+    border-bottom: 1px solid;
+}
+div.sphinxsidebarwrapper div.re2c-logo {
+    background-color: silver;
+    font-family: Courier;
+    font-size: 1.5em;
+    text-align: center;
+    border: 1px solid darkgray;
+    overflow: hidden;
+}
+div.re2c-toc-local {
+    padding: 0.5em;
+    background-color: linen;
+    border: 1px solid darkgray;
+    overflow: auto;
+}
+
+
+
+.headerlink { display: none; }
+
+a:focus { outline: none; }
diff --git a/src/theme-re2c/theme.conf b/src/theme-re2c/theme.conf
new file mode 100644 (file)
index 0000000..0e04c2e
--- /dev/null
@@ -0,0 +1,3 @@
+[theme]
+inherit = basic
+stylesheet = theme-re2c.css