From 9fe3cf0b0466474d5d337c31391dba4828ddee78 Mon Sep 17 00:00:00 2001 From: Mouse <937279156@qq.com> Date: Tue, 30 Oct 2018 23:20:19 +0800 Subject: [PATCH] Update to use mkdocs --- .gitignore | 3 +- Makefile | 20 ----- make.bat | 36 -------- mkdocs.yml | 38 ++++++++ requirements.txt | 3 +- source/.vscode/settings.json | 3 - source/conf.py | 169 ----------------------------------- source/index.md | 35 ++++++++ source/index.rst | 62 ------------- 9 files changed, 77 insertions(+), 292 deletions(-) delete mode 100644 Makefile delete mode 100644 make.bat create mode 100644 mkdocs.yml delete mode 100644 source/.vscode/settings.json delete mode 100644 source/conf.py create mode 100644 source/index.md delete mode 100644 source/index.rst diff --git a/.gitignore b/.gitignore index d163863..3162c20 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -build/ \ No newline at end of file +build/ +/source/.vscode diff --git a/Makefile b/Makefile deleted file mode 100644 index 74dfa01..0000000 --- a/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -SPHINXPROJ = lwjglbook-CN-Translation -SOURCEDIR = source -BUILDDIR = build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/make.bat b/make.bat deleted file mode 100644 index e1be01c..0000000 --- a/make.bat +++ /dev/null @@ -1,36 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=source -set BUILDDIR=build -set SPHINXPROJ=lwjglbook-CN-Translation - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% - -:end -popd diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..9395daa --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,38 @@ +site_name: Lwjglbook中文翻译 +site_author: Mouse0w0 +site_copyright: '2018, Mouse0w0' + +repo_url: https://github.com/Mouse0w0/lwjglbook-CN-Translation + +nav: +- 事前准备(First Steps): '01-first-steps.md' +- 游戏循环(The Game Loop): '02-the-game-loop.md' +- 坐标简介(A brief about coordinates): '03-a-brief-about-coordinates.md' +- 渲染(Rendering): '04-rendering.md' +- 更多关于渲染的事情(More on Rendering): '05-more-on-rendering.md' +- 变换(Transformations): '06-transformations.md' +- 纹理(Textures): '07-textures.md' +- 摄像机(Camera): '08-camera.md' +- 加载更复杂的模型(Loading more complex models): '09-loading-more-complex-models.md' +- 要有光(Let there be light): '10-let-there-be-light.md' +- 要有更多的光(Let there be even more light): '11-let-there-be-even-more-light.md' +- 游戏HUD(Game HUD): '12-game-hud.md' +- 天空盒与一些优化 (Sky Box and some optimizations): '13-sky-box-and-some-optimizations.md' +- 高度图(Height Maps): '14-height-maps.md' +- 地形碰撞 (Terrain Collisions): '15-terrain-collisions.md' +- 雾 (Fog): '16-fog.md' +- 法线贴图(Normal Mapping): '17-normal-mapping.md' + +docs_dir: source + +theme: readthedocs + +extra_javascript: + - https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML + +markdown_extensions: + - admonition + - extra + - toc + - mdx_math: + enable_dollar_delimiter: true \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 52b04f2..8034852 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -sphinx_rtd_theme \ No newline at end of file +pymdown-extensions +python-markdown-math \ No newline at end of file diff --git a/source/.vscode/settings.json b/source/.vscode/settings.json deleted file mode 100644 index 6e57044..0000000 --- a/source/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "restructuredtext.confPath": "d:\\Workspace\\lwjglbook-CN-Translation\\source" -} \ No newline at end of file diff --git a/source/conf.py b/source/conf.py deleted file mode 100644 index 67250bc..0000000 --- a/source/conf.py +++ /dev/null @@ -1,169 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Configuration file for the Sphinx documentation builder. -# -# This file does only contain a selection of the most common options. For a -# full list see the documentation: -# http://www.sphinx-doc.org/en/master/config - -# -- Path setup -------------------------------------------------------------- - -# 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. -# -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) -import sphinx_rtd_theme - -from recommonmark.parser import CommonMarkParser - -source_parsers = { - '.md': CommonMarkParser, -} - -# -- Project information ----------------------------------------------------- - -project = 'lwjglbook-CN-Translation' -copyright = '2018, Mouse0w0' -author = 'Mouse0w0' - -# The short X.Y version -version = '' -# The full version, including alpha/beta/rc tags -release = '' - - -# -- 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.githubpages', -] - -# 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', '.md'] - -# The master toctree document. -master_doc = 'index' - -# 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 = 'zh_CN' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This pattern also affects html_static_path and html_extra_path . -exclude_patterns = [] - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -highlight_language = 'javascript' - - -# -- 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 = 'sphinx_rtd_theme' - -# 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 = {} - -html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] - -# 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'] - -# Custom sidebar templates, must be a dictionary that maps document names -# to template names. -# -# The default sidebars (for documents that don't match any pattern) are -# defined by theme itself. Builtin themes are using these templates by -# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', -# 'searchbox.html']``. -# -# html_sidebars = {} - - -# -- Options for HTMLHelp output --------------------------------------------- - -# Output file base name for HTML help builder. -htmlhelp_basename = 'lwjglbook-CN-Translationdoc' - - -# -- 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, 'lwjglbook-CN-Translation.tex', 'lwjglbook-CN-Translation Documentation', - 'Mouse0w0', 'manual'), -] - - -# -- 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, 'lwjglbook-cn-translation', 'lwjglbook-CN-Translation Documentation', - [author], 1) -] - - -# -- 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, 'lwjglbook-CN-Translation', 'lwjglbook-CN-Translation Documentation', - author, 'lwjglbook-CN-Translation', 'One line description of project.', - 'Miscellaneous'), -] - - -# -- Extension configuration ------------------------------------------------- \ No newline at end of file diff --git a/source/index.md b/source/index.md new file mode 100644 index 0000000..39016b5 --- /dev/null +++ b/source/index.md @@ -0,0 +1,35 @@ +# 《用LWJGL 3开发3D游戏(3D Game Development with LWJGL 3)》中文翻译 +[![Documentation Status](https://readthedocs.org/projects/lwjglbook-cn-translation/badge/?version=latest)](http://lwjglbook-cn-translation.readthedocs.io/zh_CN/latest/?badge=latest) +## 本书原介绍 +这本在线电子书主要讲解使用LWJGL 3库开发3D游戏。 + +LWJGL是一个Java库,提供了访问OpenGL、OpenAL和OpenCL的接口。这个库可以在使用高性能的OpenGL的同时,使用Java语言开发。 + +我最初的目标是学习使用OpenGL开发3D游戏所涉及的技术。所需资料都可在网上找到,但是没有人将其整理,有时很难找到,甚至有些资料不完整或存在误导。 + +我开始收集一些资料,编写一些示例,并决定以电子书的形式整理这些资料。 + +## 源代码 + +本书中所有的源码示例均上传至[GitHub](https://github.com/lwjglgamedev/lwjglbook). + +本书英文原文地址[GitBook](https://legacy.gitbook.com/book/lwjglgamedev/3d-game-development-with-lwjgl/details) [GitHub](https://github.com/lwjglgamedev/lwjglbook-bookcontents). + +## 许可证 + +知识共享许可协议
本作品采用知识共享署名-相同方式共享 4.0 国际许可协议进行许可。 + +所有的源代码的许可协议均为 [Apache v2.0](https://www.apache.org/licenses/LICENSE-2.0 "Apache v2.0") + +## 原作者 +Antonio Hernández Bejarano + +## 支持作者 + +如果你喜欢这本书,请Star并且分享它。如果你想捐助作者,你可以通过下面的按钮捐助: +[![Paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5MH9AA9TPQQBN) + +或者你更喜欢用比特币: 1Kwe78faWarzGTsWXtdGvjjbS9RmW1j3nb. + +## 译者的话 +本书是本人为了学习LWJGL 3而翻译的,由于本人的能力有限,如有不正确的地方,欢迎各位指正。 diff --git a/source/index.rst b/source/index.rst deleted file mode 100644 index 2f34910..0000000 --- a/source/index.rst +++ /dev/null @@ -1,62 +0,0 @@ -《用LWJGL 3开发3D游戏(3D Game Development with LWJGL 3)》中文翻译 -==== - -.. toctree:: - :maxdepth: 1 - :caption: 目录 - - 01-first-steps - 02-the-game-loop - 03-a-brief-about-coordinates - 04-rendering - 05-more-on-rendering - 06-transformations - 07-textures - 08-camera - 09-loading-more-complex-models - 10-let-there-be-light - 11-let-there-be-even-more-light - 12-game-hud - 13-sky-box-and-some-optimizations - 14-height-maps - 15-terrain-collisions - 16-fog - 17-normal-mapping - -本书原介绍 -**** -这本在线电子书主要讲解使用LWJGL 3库开发3D游戏。 - -LWJGL是一个Java库,提供了访问OpenGL、OpenAL和OpenCL的接口。这个库可以在使用高性能的OpenGL的同时,使用Java语言开发。 - -我最初的目标是学习使用OpenGL开发3D游戏所涉及的技术。所需资料都可在网上找到,但是没有人将其整理,有时很难找到,甚至有些资料不完整或存在误导。 - -我开始收集一些资料,编写一些示例,并决定以电子书的形式整理这些资料。 - -源代码 -**** -本书中所有的源码示例均上传至 `GitHub `_ - -本书英文原文地址 `GitBook `_ `GitHub `_. - -许可证 -**** -本作品采用 `知识共享署名-相同方式共享 4.0 国际许可协议 `_ 进行许可。 - -所有的源代码的许可协议均为 `Apache v2.0 `_ - -原作者 -**** -Antonio Hernández Bejarano - -支持作者 -**** -如果你喜欢这本书,请Star并且分享它。如果你想捐助作者,你可以通过下面的按钮捐助: -`PayPal `_ - -或者你更喜欢用比特币: 1Kwe78faWarzGTsWXtdGvjjbS9RmW1j3nb. - -译者的话 -**** -本书是本人为了学习LWJGL 3而翻译的,由于本人的能力有限,如有不正确的地方,欢迎各位指正。 -