$ composer create-project laravel/laravel=4.2 foo --prefer-dist建立 Laravel 4 的最後版本
$ composer create-project laravel/laravel foo ~4.0 --prefer-dist
$ composer create-project laravel/laravel=4.2 foo --prefer-dist建立 Laravel 4 的最後版本
$ composer create-project laravel/laravel foo ~4.0 --prefer-dist
$ pip install jieba安裝正體中文的擴充套件
$ git clone https://github.com/enhao/sphinx.ext.search.zh_TW.git _extension修改專案目錄下的 conf.py
# 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('_extension'))
...
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['search-zh_TW']
...
# 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 = 'zh_TW'
# A dictionary with options for the search language support, empty by default.
# Now only 'ja' uses this config value
html_search_options = {'dict': '_extension/dict/zh.dict'}
sphinx.ext.search.zh_TW 的字典檔是用結巴中文分詞的 dict.txt.big
,不設定 html_search_options 的話,會使用結巴中文分詞的預設字典會顯示為...
#include <stdio.h>
int main(void)
{
printf("hello, world\n");
return 0;
}
如果不要顯示行號常用的程式語言...
| Brush name | Brush aliases |
|---|---|
| Bash/shell | bash, shell |
| C++ | cpp, c |
| CSS | css |
| Diff | diff, patch |
| JavaScript | js, jscript, javascript |
| Java | java |
| Perl | perl, pl |
| PHP | php |
| Plain Text | plain, text |
| Python | py, python |
| Ruby | rails, ror, ruby |
| Scala | scala |
| SQL | sql |
| XML | xml, xhtml, xslt, html, xhtml |
#include <errno.h> /* errno */
#include <arpa/inet.h> /* htonl */
#include <netinet/in.h> /* in_addr_t */
/**
* @param start start IP adress in host byte order
* @param end end IP address in host byte order
* @param addr_cb callback
* @param data callback argument.
* @return If failed, between_addr() returns -1. Otherwise, retrun a value from callback
*/
int between_addr(uint32_t start, uint32_t end, int (*addr_cb)(in_add_t, const void *), void *data)
{
int ret = -1;
uint32_t addr, limit;
if (!addr_cb) {
errno = EINVAL;
return ret;
}
addr = start < end ? start : end;
limit = start > end ? end : start;
for (; addr < limit; addr++) {
ret = addr_cb(htonl(addr), data);
if (!ret)
break;
}
return ret;
}
...
# 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 = 'ja'
# A dictionary with options for the search language support, empty by default.
# Now only 'ja' uses this config value
html_search_options = {'type': 'default'}
$ make html $ ls _build doctrees html而在 _build 下會產生快取的目錄 doctrees
$ sphinx-build -d _build/doctrees . /usr/local/nginx/html其中 -d 是指定快取的目錄,/usr/local/nginx/html 是匯出的目錄
...
language = 'zh_TW'
...
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
'papersize': 'a4paper',
# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',
'classoptions': ',english',
'inputenc': '',
'utf8extra': '',
# Additional stuff for the LaTeX preamble.
'preamble': '''
\usepackage{xeCJK}
\setCJKmainfont[BoldFont=Heiti TC, ItalicFont=STKaiti]{Heiti TC} % 設定中日韓字型
\setCJKmonofont[Scale=0.8]{Courier New} % 設定中日韓等寬字型
\XeTeXlinebreaklocale "zh" % 設定斷行演算法為中文
\XeTeXlinebreakskip = 0pt plus 1pt % 設定中文字距與英文字距
''',
# Latex figure (float) alignment
#'figure_align': 'htbp',
}
字型可以參考網頁中英文字型(font-family)跨平台設定最佳化或檢視系統已安裝的字型$fc-list :lang=zh-tw匯出 PDF
$ make latex $ cd _build/latex $ xelatex *.tex