Skip to content

Commit 18d1532

Browse files
committedJul 14, 2012
initial commit with file structure according to CakePHP's docs.
0 parents  commit 18d1532

File tree

6 files changed

+408
-0
lines changed

6 files changed

+408
-0
lines changed
 

‎.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.pyc
2+
build/*
3+
*/_build/*
4+
.DS_Store

‎Makefile

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# MakeFile for building all the docs at once.
2+
# Inspired by the Makefile used by bazaar.
3+
# http://bazaar.launchpad.net/~bzr-pqm/bzr/2.3/
4+
5+
PYTHON = python
6+
7+
.PHONY: all clean html latexpdf epub htmlhelp
8+
9+
# Dependencies to perform before running other builds.
10+
SPHINX_DEPENDENCIES = \
11+
en/Makefile
12+
13+
# Copy-paste the english Makefile everwhere its needed.
14+
%/Makefile : en/Makefile
15+
$(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
16+
17+
# Make the HTML version of the documentation with correctly nested language folders.
18+
html: $(SPHINX_DEPENDENCIES)
19+
cd en && make html LANG=en
20+
21+
htmlhelp: $(SPHINX_DEPENDENCIES)
22+
cd en && make htmlhelp LANG=en
23+
24+
epub: $(SPHINX_DEPENDENCIES)
25+
cd en && make epub LANG=en
26+
27+
latexpdf: $(SPHINX_DEPENDENCIES)
28+
cd en && make latexpdf LANG=en
29+
30+
clean:
31+
rm -rf build/*

‎README.mdown

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Croogo Experimental Docs
2+
=========================
3+
4+
This documentation will hopefully one day replace the existing wiki. Hopefully enabling community contributions and enabling multiple format documentation generation.
5+
6+
Requirements
7+
------------
8+
9+
You can read all of the documentation within as its just in plain text files, marked up with ReST text formatting. To build the documentation you'll need the following:
10+
11+
* Make
12+
* Python
13+
* Sphinx
14+
* PhpDomain for sphinx
15+
16+
You can install sphinx using:
17+
18+
easy_install sphinx
19+
20+
You can install the phpdomain using:
21+
22+
easy_install sphinxcontrib-phpdomain
23+
24+
Building the documentation
25+
--------------------------
26+
27+
After installing the require packages you can build the documentation using `Make`
28+
29+
make html
30+
31+
This will generate all the documentation in an html form. Other output such as 'epub', 'pdf' and 'htmlhelp' are not fully complete at this time.
32+
33+
After making changes to the documentation, you can build the html version of the docs by using `make html` again. This will build only the html files that have had changes made to them.
34+
35+
36+
Contributing
37+
------------
38+
39+
Contributing to the documentation is pretty simple. There are currently a number of outstanding issues that need to be addressed. We've tried to flag these with `.. todo::` where possible. To see all the outstanding todo's add the following to your `config/all.py`
40+
41+
todo_include_todos = True
42+
43+
After rebuilding the html content, you should see a list of existing todo items at the bottom of the table of contents.
44+
45+
You are also welcome to make and suggestions for new content as commits in a github fork. Please make any totally new sections in a separate branch. This makes changes far easier to integrate later on.
46+
47+
Translations
48+
------------
49+
50+
Contributing translations requires that you make a new directory using the two letter name for your language. As content is translated, directories mirroring the english content should be created with localized content.
51+
52+

‎config/__init__.py

Whitespace-only changes.

‎config/all.py

+283
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,283 @@
1+
# Global configuration information used across all the
2+
# translations of documentation.
3+
#
4+
5+
# -- General configuration -----------------------------------------------------
6+
7+
# If your documentation needs a minimal Sphinx version, state it here.
8+
#needs_sphinx = '1.0'
9+
10+
# Add any Sphinx extension module names here, as strings. They can be extensions
11+
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
12+
extensions = [
13+
'sphinx.ext.todo',
14+
'sphinxcontrib.phpdomain',
15+
'config.cakei18n'
16+
]
17+
18+
# Add any paths that contain templates here, relative to this directory.
19+
# templates_path = []
20+
21+
# The suffix of source filenames.
22+
source_suffix = '.rst'
23+
24+
# The encoding of source files.
25+
#source_encoding = 'utf-8-sig'
26+
27+
# The master toctree document.
28+
master_doc = 'contents'
29+
30+
# General information about the project.
31+
project = u'Croogo Docs'
32+
copyright = u'2012'
33+
34+
# The version info for the project you're documenting, acts as replacement for
35+
# |version| and |release|, also used in various other places throughout the
36+
# built documents.
37+
#
38+
# The short X.Y version.
39+
version = '1.4'
40+
41+
# The full version, including alpha/beta/rc tags.
42+
release = '1.4.2'
43+
44+
# There are two options for replacing |today|: either, you set today to some
45+
# non-false value, then it is used:
46+
#today = ''
47+
# Else, today_fmt is used as the format for a strftime call.
48+
#today_fmt = '%B %d, %Y'
49+
50+
# List of patterns, relative to source directory, that match files and
51+
# directories to ignore when looking for source files.
52+
exclude_patterns = ['themes']
53+
54+
# The reST default role (used for this markup: `text`) to use for all documents.
55+
#default_role = None
56+
57+
# If true, '()' will be appended to :func: etc. cross-reference text.
58+
#add_function_parentheses = True
59+
60+
# If true, the current module name will be prepended to all description
61+
# unit titles (such as .. function::).
62+
#add_module_names = True
63+
64+
# If true, sectionauthor and moduleauthor directives will be shown in the
65+
# output. They are ignored by default.
66+
#show_authors = False
67+
68+
# The name of the Pygments (syntax highlighting) style to use.
69+
pygments_style = 'sphinx'
70+
71+
# A list of ignored prefixes for module index sorting.
72+
#modindex_common_prefix = []
73+
74+
highlight_language = 'php'
75+
76+
77+
# -- Options for HTML output ---------------------------------------------------
78+
79+
# The theme to use for HTML and HTML Help pages. See the documentation for
80+
# a list of builtin themes.
81+
html_theme = 'croogo'
82+
83+
# Theme options are theme-specific and customize the look and feel of a theme
84+
# further. For a list of options available for each theme, see the
85+
# documentation.
86+
#html_theme_options = {}
87+
88+
# Add any paths that contain custom themes here, relative to this directory.
89+
html_theme_path = ['../themes']
90+
91+
# The name for this set of Sphinx documents. If None, it defaults to
92+
# "<project> v<release> documentation".
93+
#html_title = None
94+
95+
# A shorter title for the navigation bar. Default is the same as html_title.
96+
#html_short_title = None
97+
html_short_title = u'Croogo Docs 1.4'
98+
99+
# The name of an image file (relative to this directory) to place at the top
100+
# of the sidebar.
101+
#html_logo = None
102+
103+
# The name of an image file (within the static path) to use as favicon of the
104+
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
105+
# pixels large.
106+
#html_favicon = None
107+
108+
# Add any paths that contain custom static files (such as style sheets) here,
109+
# relative to this directory. They are copied after the builtin static files,
110+
# so a file named "default.css" will overwrite the builtin "default.css".
111+
html_static_path = []
112+
113+
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
114+
# using the given strftime format.
115+
#html_last_updated_fmt = '%b %d, %Y'
116+
117+
# If true, SmartyPants will be used to convert quotes and dashes to
118+
# typographically correct entities.
119+
#html_use_smartypants = True
120+
121+
# Custom sidebar templates, maps document names to template names.
122+
html_sidebars = {
123+
'**' : ['globaltoc.html']
124+
}
125+
126+
# Additional templates that should be rendered to pages, maps page names to
127+
# template names.
128+
#html_additional_pages = {}
129+
130+
# If false, no module index is generated.
131+
#html_domain_indices = True
132+
133+
# If false, no index is generated.
134+
#html_use_index = True
135+
136+
# If true, the index is split into individual pages for each letter.
137+
#html_split_index = False
138+
139+
# If true, links to the reST sources are added to the pages.
140+
#html_show_sourcelink = True
141+
142+
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
143+
#html_show_sphinx = True
144+
145+
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
146+
#html_show_copyright = True
147+
148+
# If true, an OpenSearch description file will be output, and all pages will
149+
# contain a <link> tag referring to it. The value of this option must be the
150+
# base URL from which the finished HTML is served.
151+
#html_use_opensearch = ''
152+
153+
# This is the file name suffix for HTML files (e.g. ".xhtml").
154+
#html_file_suffix = None
155+
156+
# Output file base name for HTML help builder.
157+
htmlhelp_basename = 'CroogoDocs'
158+
159+
160+
# -- Options for LaTeX output --------------------------------------------------
161+
162+
# The paper size ('letter' or 'a4').
163+
#latex_paper_size = 'letter'
164+
165+
# The font size ('10pt', '11pt' or '12pt').
166+
latex_font_size = '11pt'
167+
168+
# Grouping the document tree into LaTeX files. List of tuples
169+
# (source start file, target name, title, author, documentclass [howto/manual]).
170+
latex_documents = [
171+
('pdf-contents', 'CroogoDocs.tex', u'Croogo Documentation',
172+
u'Croogo Community', 'manual'),
173+
]
174+
175+
# The name of an image file (relative to this directory) to place at the top of
176+
# the title page.
177+
latex_logo = '../themes/croogo/static/pdf-logo.png'
178+
179+
# For "manual" documents, if this is true, then toplevel headings are parts,
180+
# not chapters.
181+
#latex_use_parts = False
182+
183+
# If true, show page references after internal links.
184+
# latex_show_pagerefs = True
185+
186+
# If true, show URL addresses after external links.
187+
latex_show_urls = 'footnote'
188+
189+
# Additional stuff for the LaTeX preamble.
190+
#latex_preamble = ''
191+
192+
# Documents to append as an appendix to all manuals.
193+
#latex_appendices = []
194+
195+
# If false, no module index is generated.
196+
# latex_domain_indices = True
197+
198+
199+
preamb = ur'''
200+
% Custom colors.
201+
\definecolor{ChapterColor}{RGB}{201,36,52}
202+
\definecolor{TitleColor}{RGB}{0,0,0}
203+
204+
% No section numbering
205+
\setcounter{secnumdepth}{0}
206+
207+
% Make chapter titles red.
208+
\ChNameVar{\color{TitleColor}\Large}
209+
\ChNumVar{\color{TitleColor}\Large}
210+
\ChTitleVar{\color{ChapterColor}\Huge\sf}
211+
212+
% link colors
213+
\definecolor{InnerLinkColor}{RGB}{65,114,130}
214+
\definecolor{OuterLinkColor}{RGB}{0,61,76}
215+
216+
% background and border for code examples.
217+
\definecolor{VerbatimColor}{RGB}{242,242,242}
218+
\definecolor{VerbatimBorderColor}{RGB}{230,230,230}
219+
'''
220+
221+
latex_elements ={
222+
'preamble': preamb,
223+
'fncychap': '\\usepackage[Sonny]{fncychap}'
224+
}
225+
226+
227+
# -- Options for manual page output --------------------------------------------
228+
229+
# One entry per manual page. List of tuples
230+
# (source start file, name, description, authors, manual section).
231+
man_pages = [
232+
('index', 'croogodocs', u'Croogo Documentation',
233+
[u'Croogo'], 1)
234+
]
235+
236+
237+
# -- Options for Epub output ---------------------------------------------------
238+
239+
# Bibliographic Dublin Core info.
240+
epub_title = u'Croogo Docs'
241+
epub_author = u'Croogo.'
242+
epub_publisher = u'Croogo.'
243+
epub_copyright = u'2012, Croogo.'
244+
245+
epub_theme = 'croogo-epub'
246+
247+
# The language of the text. It defaults to the language option
248+
# or en if the language is not set.
249+
#epub_language = ''
250+
251+
# The scheme of the identifier. Typical schemes are ISBN or URL.
252+
#epub_scheme = ''
253+
254+
# The unique identifier of the text. This can be a ISBN number
255+
# or the project homepage.
256+
#epub_identifier = ''
257+
258+
# A unique identification for the text.
259+
#epub_uid = ''
260+
261+
# HTML files that should be inserted before the pages created by sphinx.
262+
# The format is a list of tuples containing the path and title.
263+
#epub_pre_files = []
264+
265+
# HTML files shat should be inserted after the pages created by sphinx.
266+
# The format is a list of tuples containing the path and title.
267+
#epub_post_files = []
268+
269+
# A list of files that should not be packed into the epub file.
270+
epub_exclude_files = [
271+
'index.html',
272+
'pdf-contents.html',
273+
'search.html',
274+
]
275+
276+
# The depth of the table of contents in toc.ncx.
277+
epub_tocdepth = 2
278+
279+
# Allow duplicate toc entries.
280+
epub_tocdup = False
281+
282+
# Languages available.
283+
languages = ['en']

‎config/cakei18n.py

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import os
2+
from sphinx.util.osutil import SEP
3+
"""
4+
CakePHP i18n extension.
5+
6+
A simple sphinx extension for adding
7+
i18n links to other sub doc projects.
8+
"""
9+
10+
def setup(app):
11+
app.connect('html-page-context', append_template_ctx)
12+
app.add_config_value('languages', [], '')
13+
return app
14+
15+
def append_template_ctx(app, pagename, templatename, ctx, event_arg):
16+
def lang_link(lang, path):
17+
"""
18+
Generates links to other language docs.
19+
"""
20+
dots = []
21+
for p in path.split(SEP):
22+
dots.append('..')
23+
return SEP.join(dots) + SEP + lang + SEP + path + app.builder.link_suffix
24+
25+
def has_lang(lang, path):
26+
"""
27+
Check to see if a language file exists for a given path/RST doc.:
28+
"""
29+
possible = '..' + SEP + lang + SEP + path + app.config.source_suffix
30+
full_path = os.path.realpath(os.path.join(os.getcwd(), possible))
31+
32+
return os.path.isfile(full_path)
33+
34+
ctx['lang_link'] = lang_link
35+
ctx['has_lang'] = has_lang
36+
37+
ctx['languages'] = app.config.languages
38+
ctx['language'] = app.config.language

0 commit comments

Comments
 (0)
Please sign in to comment.