Skip to content

Commit

Permalink
Merge branch 'master' of github.com:xresloader/xresloader-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
owent committed Sep 20, 2019
2 parents 1cd75ee + 42e516d commit 78336f2
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 23 deletions.
8 changes: 8 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
LICENSE
=======

![知识共享许可协议](https://i.creativecommons.org/l/by-sa/4.0/88x31.png)

本文档采用 [知识共享署名-相同方式共享 4.0 国际许可协议](https://creativecommons.org/licenses/by-sa/4.0/) 进行许可。

本许可协议授权之外的使用权限可以从 https://www.owent.net/about 处获得。
22 changes: 22 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2019 OWenT

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@ help:

.PHONY: help Makefile

# COPY_FILES = $(SOURCEDIR)/LICENSE.txt $(SOURCEDIR)/LICENSE.md
#
# all: $(COPY_FILES)
#
# $(SOURCEDIR)/LICENSE.txt: LICENSE.txt
# $(SOURCEDIR)/LICENSE.md: LICENSE.md
#
# $(SOURCEDIR)/%:
# cp -f $< $@

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
%: Makefile # COPY_FILES
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# xresloader-docs

本仓库是转表工具链 [xresloader](https://github.com/xresloader/) 的文档源码,即: https://xresloader.atframe.work

## LICENSE

See [LICENSE.md](LICENSE.md)
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
setuptools>=41.2.0
recommonmark>=0.6.0
sphinx>=2.2.0
sphinx-autobuild>=0.7.1
sphinx-rtd-theme>=0.3.0
recommonmark>=0.4.0
sphinx-readable-theme>=1.3.0
readthedocs-sphinx-ext>=0.5.9
sphinx-markdown>=1.0.2
# NOTE: switched to custom branch until https://github.com/dreamhost/sphinxcontrib-fulltoc/issues/10 is fixed
# sphinxcontrib-fulltoc>=1.2.0
# git+https://github.com/eli-collins/sphinxcontrib-fulltoc.git
22 changes: 22 additions & 0 deletions source/LICENSE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
LICENSE
=======

LICENSE - 文档
---------------------------------------------

.. image:: https://i.creativecommons.org/l/by-sa/4.0/88x31.png
:alt: 知识共享署名-相同方式共享 4.0 国际许可协议
:target: https://creativecommons.org/licenses/by-sa/4.0/

本文档采用 `知识共享署名-相同方式共享 4.0 国际许可协议 <https://creativecommons.org/licenses/by-sa/4.0>`_ 进行许可。

本许可协议授权之外的使用权限可以从 https://www.owent.net/about 处获得。

LICENSE - xresloader
---------------------------------------------

.. _xresloader: https://github.com/xresloader

`xresloader`_ 采用 The MIT License (MIT)

.. include:: ../LICENSE.txt
24 changes: 15 additions & 9 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'recommonmark',
# standard sphinx extensions
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
Expand All @@ -67,10 +68,11 @@
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
#source_suffix = ['.rst', '.md']
#add_source_suffix('.rst', 'restructuredtext')
#add_source_suffix('.md', 'markdown')
# source_suffix = '.rst'
source_suffix = {
'.rst': 'restructuredtext',
'.txt': 'markdown',
'.md': 'markdown',
}

#source_parsers = {
# '.md': CommonMarkParser,
Expand Down Expand Up @@ -121,6 +123,10 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

html_css_files = ['css/custom.css']

html_js_files = []

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
Expand Down Expand Up @@ -230,9 +236,9 @@


# custom styles
def setup(app):
app.add_stylesheet('css/custom.css') # may also be an URL
app.add_source_suffix('.rst', 'restructuredtext')
app.add_source_suffix('.md', 'markdown')
app.add_source_parser(CommonMarkParser)
# def setup(app):
# app.add_stylesheet('css/custom.css') # may also be an URL
# app.add_source_suffix('.rst', 'restructuredtext')
# app.add_source_suffix('.md', 'markdown')
# app.add_source_parser(CommonMarkParser)

1 change: 1 addition & 0 deletions source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ xresloader文档
.. toctree::
:caption: 其他

LICENSE
about

..
Expand Down
5 changes: 3 additions & 2 deletions source/sample/xresconv_conf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
<xresloader_path desc="xresloader地址,相对于当前xml的目录">../target/xresloader-1.4.3.jar</xresloader_path>

<proto desc="协议类型,对应xresloader的-p选项">protobuf</proto>
<output_type desc="输出类型,对应xresloader的-t选项">json</output_type>
<output_type desc="输出类型,-t选项,支持多个同时配置多种输出">bin</output_type>
<output_type desc="多种输出时可以额外定义某个节点的重命名规则" rename="/(?i)\.bin$/\.json/">json</output_type>
<proto_file desc="协议描述文件,对应xresloader的-f选项">proto_v3/kind.pb</proto_file>

<output_dir desc="输出目录,对应xresloader的-o选项"></output_dir>
<data_src_dir desc="数据源(Excel查找)目录,对应xresloader的-d选项"></data_src_dir>
<data_version desc="数据版本号,对应xresloader的--data-version选项,留空则自动生成">1.0.0.0</data_version>

<rename desc="重命名规则,正则表达式:/搜索模式/替换内容/,对应xresloader的-n选项">/(?i)\.bin$/\.json/</rename>
<rename desc="重命名规则,正则表达式:/搜索模式/替换内容/,对应xresloader的-n选项, 如果在output_type里设置了rename,以output_type里的rename为准,否则使用这里的全局配置" placeholder="/(?i)\.bin$/\.json/"></rename>

<!-- java_option标签是传递给java -jar的java选项 -->
<java_option desc="java附加选项">这里的选项会在运行xresloader-*.jar时附加到java控制参数列表中</java_option>
Expand Down
24 changes: 14 additions & 10 deletions source/users/xresconv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ GUI批量转表工具的特殊事件
.. code-block:: javascript
{
work_dir: "工作目录",
work_dir: "工作目录(要求版本>=2.2.0)",
configure_file: "载入的配置文件路径(要求版本>=2.2.0)",
item_data: {
id: "条目ID",
file: "数据源文件",
Expand All @@ -66,7 +67,10 @@ GUI批量转表工具的特殊事件
desc: "描述信息",
scheme_data: {"元数据Key": "元数据Value"}
},
configure_file: "载入的配置文件路径"
alert_warning: function(content, title, options) {}, // (要求版本>=2.2.0) 警告弹框, options 结构是 {yes: 点击是按钮回调, no: 点击否按钮回调, on_close: 关闭后回调}
alert_error: function(content, title) {}, // (要求版本>=2.2.0) 错误弹框
log_info: function (content) {}, // (要求版本>=2.2.0) 打印info日志
log_error: function (content) {} // (要求版本>=2.2.0) 打印info日志
}
这个结构。在 GUI工具 `xresconv-gui`_ 显示每个条目的时候会运行这个函数并传入上述结构,在函数里我们可以通过改变 ``name`` 和 ``desc`` 来改变 GUI工具 `xresconv-gui`_ 工具的显示内容。
Expand All @@ -81,18 +85,18 @@ GUI批量转表工具的特殊事件
{
work_dir: "执行xresloader的工作目录",
configure_file: "载入的配置文件路径",
configure_file: "载入的配置文件路径(要求版本>=2.2.0)",
xresloader_path: "xresloader目录",
global_options: {"全局选项": "VALUE"},
selected_nodes: ["选中要执行转表的节点集合"],
run_seq: "执行序号",
alert_warning: function(content, title, options) {}, // 警告弹框, options 结构是 {yes: 点击是按钮回调, no: 点击否按钮回调, on_close: 关闭后回调}
alert_error: function(content, title) {}, // 错误弹框
log_info: function (content) {}, // 打印info日志
log_error: function (content) {}, // 打印info日志
resolve: function (value) {}, // 通知上层执行结束,相当于Promise的resolve
reject: function(reason) {}, // 通知上层执行失败,相当于Promise的reject
require: function (name) {} // 相当于 nodejs的 require(name) 用于导入nodejs 模块
alert_warning: function(content, title, options) {}, // 警告弹框, options 结构是 {yes: 点击是按钮回调, no: 点击否按钮回调, on_close: 关闭后回调}
alert_error: function(content, title) {}, // 错误弹框
log_info: function (content) {}, // 打印info日志
log_error: function (content) {}, // 打印info日志
resolve: function (value) {}, // 通知上层执行结束,相当于Promise的resolve
reject: function(reason) {}, // 通知上层执行失败,相当于Promise的reject
require: function (name) {} // 相当于 nodejs的 require(name) 用于导入nodejs 模块
}
在 `批量转表配置模板仓库-xresconv-conf <xresconv-conf>`_ 中的 ``sample.xml`` 文件中也有示例。

0 comments on commit 78336f2

Please sign in to comment.