Skip to content

Commit edb874b

Browse files
committed
Add LLDB website and documentation in reStructuredText for Sphinx
The current LLDB website is written in HTML which is hard to maintain. We have quite a bit of HTML code checked in which can make it hard to differentiate between documentation written by us and documentation generated by a tool. In line with the other LLVM projects, I propose generating the documentation with Sphix. I think text/rst files provide a lower barrier for new or casual contributors to fix or update. This patch adds a copy of the LLDB website and documentation in reStructuredText. It also adds a new ninja target `docs-lldb-html` when -DLLVM_ENABLE_SPHINX:BOOL is enabled. This is the first step in having the website and documentation being generated from the repository, rather than having the output checked-in under the www folder. During the hopefully short transition period, please also update the reStructuredText files when modifying the website. Differential revision: https://reviews.llvm.org/D55376 llvm-svn: 352644
1 parent 042f770 commit edb874b

24 files changed

+7657
-1
lines changed

lldb/docs/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
include(FindDoxygen)
32

43
if(DOXYGEN_FOUND)
@@ -39,3 +38,12 @@ if(EPYDOC_EXECUTABLE)
3938
COMMENT "Generating LLDB Python API reference with epydoc" VERBATIM
4039
)
4140
endif(EPYDOC_EXECUTABLE)
41+
42+
if (LLVM_ENABLE_SPHINX)
43+
include(AddSphinxTarget)
44+
if (SPHINX_FOUND)
45+
if (${SPHINX_OUTPUT_HTML})
46+
add_sphinx_target(html lldb)
47+
endif()
48+
endif()
49+
endif()

lldb/docs/_static/lldb.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
table.mapping {
2+
width: 100%;
3+
}
4+
5+
table.mapping td {
6+
width: 50%;
7+
padding: 5px;
8+
}
9+
10+
table.mapping td.hed {
11+
background: #606060;
12+
color: white;
13+
text-align: left;
14+
border-bottom: 2px #fff solid;
15+
font-weight: bold;
16+
}
17+
18+
table.mapping td.header {
19+
background: #eee;
20+
}
21+
22+
table.mapping td.content {
23+
font-family: monospace;
24+
padding-bottom: 15px;
25+
}
26+

lldb/docs/conf.py

Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# LLDB documentation build configuration file, created by
4+
# sphinx-quickstart on Sun Dec 9 20:01:55 2012.
5+
#
6+
# This file is execfile()d with the current directory set to its containing dir.
7+
#
8+
# Note that not all possible configuration values are present in this
9+
# autogenerated file.
10+
#
11+
# All configuration values have a default; values that are commented out
12+
# serve to show the default.
13+
14+
import sys, os
15+
from datetime import date
16+
17+
# If extensions (or modules to document with autodoc) are in another directory,
18+
# add these directories to sys.path here. If the directory is relative to the
19+
# documentation root, use os.path.abspath to make it absolute, like shown here.
20+
#sys.path.insert(0, os.path.abspath('.'))
21+
22+
# -- General configuration -----------------------------------------------------
23+
24+
# If your documentation needs a minimal Sphinx version, state it here.
25+
#needs_sphinx = '1.0'
26+
27+
# Add any Sphinx extension module names here, as strings. They can be extensions
28+
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
29+
extensions = ['sphinx.ext.todo', 'sphinx.ext.mathjax', 'sphinx.ext.intersphinx']
30+
31+
# Add any paths that contain templates here, relative to this directory.
32+
templates_path = ['_templates']
33+
34+
# The suffix of source filenames.
35+
source_suffix = '.rst'
36+
37+
# The encoding of source files.
38+
#source_encoding = 'utf-8-sig'
39+
40+
# The master toctree document.
41+
master_doc = 'index'
42+
43+
# General information about the project.
44+
project = u'LLDB'
45+
copyright = u'2007-%d, The LLDB Team' % date.today().year
46+
47+
# The version info for the project you're documenting, acts as replacement for
48+
# |version| and |release|, also used in various other places throughout the
49+
# built documents.
50+
#
51+
# The short version.
52+
version = '8'
53+
# The full version, including alpha/beta/rc tags.
54+
release = '8'
55+
56+
# The language for content autogenerated by Sphinx. Refer to documentation
57+
# for a list of supported languages.
58+
#language = None
59+
60+
# There are two options for replacing |today|: either, you set today to some
61+
# non-false value, then it is used:
62+
#today = ''
63+
# Else, today_fmt is used as the format for a strftime call.
64+
#today_fmt = '%B %d, %Y'
65+
66+
# List of patterns, relative to source directory, that match files and
67+
# directories to ignore when looking for source files.
68+
exclude_patterns = ['_build', 'analyzer']
69+
70+
# The reST default role (used for this markup: `text`) to use for all documents.
71+
#default_role = None
72+
73+
# If true, '()' will be appended to :func: etc. cross-reference text.
74+
#add_function_parentheses = True
75+
76+
# If true, the current module name will be prepended to all description
77+
# unit titles (such as .. function::).
78+
#add_module_names = True
79+
80+
# If true, sectionauthor and moduleauthor directives will be shown in the
81+
# output. They are ignored by default.
82+
#show_authors = False
83+
84+
# The name of the Pygments (syntax highlighting) style to use.
85+
pygments_style = 'friendly'
86+
87+
# A list of ignored prefixes for module index sorting.
88+
#modindex_common_prefix = []
89+
90+
91+
# -- Options for HTML output ---------------------------------------------------
92+
93+
# The theme to use for HTML and HTML Help pages. See the documentation for
94+
# a list of builtin themes.
95+
html_theme = 'haiku'
96+
97+
# Theme options are theme-specific and customize the look and feel of a theme
98+
# further. For a list of options available for each theme, see the
99+
# documentation.
100+
#html_theme_options = {}
101+
102+
# Add any paths that contain custom themes here, relative to this directory.
103+
#html_theme_path = []
104+
105+
# The name for this set of Sphinx documents. If None, it defaults to
106+
# "<project> v<release> documentation".
107+
#html_title = None
108+
109+
# A shorter title for the navigation bar. Default is the same as html_title.
110+
#html_short_title = None
111+
112+
# The name of an image file (relative to this directory) to place at the top
113+
# of the sidebar.
114+
#html_logo = None
115+
116+
# The name of an image file (within the static path) to use as favicon of the
117+
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
118+
# pixels large.
119+
#html_favicon = None
120+
121+
# Add any paths that contain custom static files (such as style sheets) here,
122+
# relative to this directory. They are copied after the builtin static files,
123+
# so a file named "default.css" will overwrite the builtin "default.css".
124+
html_static_path = ['_static']
125+
126+
html_context = {
127+
'css_files': [
128+
'_static/lldb.css'
129+
],
130+
}
131+
132+
133+
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
134+
# using the given strftime format.
135+
#html_last_updated_fmt = '%b %d, %Y'
136+
137+
# If true, SmartyPants will be used to convert quotes and dashes to
138+
# typographically correct entities.
139+
#html_use_smartypants = True
140+
141+
# Custom sidebar templates, maps document names to template names.
142+
#html_sidebars = {}
143+
144+
# Additional templates that should be rendered to pages, maps page names to
145+
# template names.
146+
#html_additional_pages = {}
147+
148+
# If false, no module index is generated.
149+
#html_domain_indices = True
150+
151+
# If false, no index is generated.
152+
#html_use_index = True
153+
154+
# If true, the index is split into individual pages for each letter.
155+
#html_split_index = False
156+
157+
# If true, links to the reST sources are added to the pages.
158+
#html_show_sourcelink = True
159+
160+
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
161+
#html_show_sphinx = True
162+
163+
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
164+
#html_show_copyright = True
165+
166+
# If true, an OpenSearch description file will be output, and all pages will
167+
# contain a <link> tag referring to it. The value of this option must be the
168+
# base URL from which the finished HTML is served.
169+
#html_use_opensearch = ''
170+
171+
# This is the file name suffix for HTML files (e.g. ".xhtml").
172+
#html_file_suffix = None
173+
174+
# Output file base name for HTML help builder.
175+
htmlhelp_basename = 'LLDBdoc'
176+
177+
178+
# -- Options for LaTeX output --------------------------------------------------
179+
180+
latex_elements = {
181+
# The paper size ('letterpaper' or 'a4paper').
182+
#'papersize': 'letterpaper',
183+
184+
# The font size ('10pt', '11pt' or '12pt').
185+
#'pointsize': '10pt',
186+
187+
# Additional stuff for the LaTeX preamble.
188+
#'preamble': '',
189+
}
190+
191+
# Grouping the document tree into LaTeX files. List of tuples
192+
# (source start file, target name, title, author, documentclass [howto/manual]).
193+
latex_documents = [
194+
('index', 'LLDB.tex', u'LLDB Documentation',
195+
u'The LLDB Team', 'manual'),
196+
]
197+
198+
# The name of an image file (relative to this directory) to place at the top of
199+
# the title page.
200+
#latex_logo = None
201+
202+
# For "manual" documents, if this is true, then toplevel headings are parts,
203+
# not chapters.
204+
#latex_use_parts = False
205+
206+
# If true, show page references after internal links.
207+
#latex_show_pagerefs = False
208+
209+
# If true, show URL addresses after external links.
210+
#latex_show_urls = False
211+
212+
# Documents to append as an appendix to all manuals.
213+
#latex_appendices = []
214+
215+
# If false, no module index is generated.
216+
#latex_domain_indices = True
217+
218+
219+
# -- Options for manual page output --------------------------------------------
220+
221+
# One entry per manual page. List of tuples
222+
# (source start file, name, description, authors, manual section).
223+
man_pages = []
224+
225+
# If true, show URL addresses after external links.
226+
#man_show_urls = False
227+
228+
229+
# -- Options for Texinfo output ------------------------------------------------
230+
231+
# Grouping the document tree into Texinfo files. List of tuples
232+
# (source start file, target name, title, author,
233+
# dir menu entry, description, category)
234+
texinfo_documents = [
235+
('index', 'LLDB', u'LLDB Documentation',
236+
u'The LLDB Team', 'LLDB', 'One line description of project.',
237+
'Miscellaneous'),
238+
]
239+
240+
# Documents to append as an appendix to all manuals.
241+
#texinfo_appendices = []
242+
243+
# If false, no module index is generated.
244+
#texinfo_domain_indices = True
245+
246+
# How to display URL addresses: 'footnote', 'no', or 'inline'.
247+
#texinfo_show_urls = 'footnote'

lldb/docs/index.rst

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
.. title:: Welcome to LLDB's documentation!
2+
3+
LLDB
4+
====
5+
6+
LLDB is a next generation, high-performance debugger. It is built as a set of
7+
reusable components which highly leverage existing libraries in the larger LLVM
8+
Project, such as the Clang expression parser and LLVM disassembler.
9+
10+
LLDB is the default debugger in Xcode on Mac OS X and supports debugging C,
11+
Objective-C and C++ on the desktop and iOS devices and simulator.
12+
13+
All of the code in the LLDB project is available under the standard
14+
`LLVM License <http://llvm.org/docs/DeveloperPolicy.html#copyright-license-and-patents>`__,
15+
an open source "BSD-style" license.
16+
17+
18+
Goals & Status
19+
==============
20+
21+
.. toctree::
22+
:maxdepth: 1
23+
24+
status/about
25+
status/goals
26+
status/features
27+
status/status
28+
status/projects
29+
30+
Use & Extension
31+
===============
32+
33+
.. toctree::
34+
:maxdepth: 1
35+
36+
use/tutorial
37+
use/map
38+
use/formatting
39+
use/variable
40+
use/symbolication
41+
use/symbols
42+
use/python
43+
use/remote
44+
use/troubleshooting
45+
use/architecture
46+
47+
Resources
48+
=========
49+
50+
.. toctree::
51+
:maxdepth: 1
52+
53+
resources/download
54+
resources/build
55+
resources/test
56+
resources/sbapi
57+
resources/external
58+
59+
Indices and tables
60+
==================
61+
62+
* :ref:`genindex`
63+
* :ref:`search`

0 commit comments

Comments
 (0)