Code Monkey home page Code Monkey logo

twig-docs-cn's Introduction

Twig 2.X中文文档

根据Google机译和自己的理解翻译的Twig 2.X的文档

限于有限的水平:

  • 英语一般,仅能尽可能将原语句翻译明确,但中文下的语句可能不够通顺。
  • 非程序猿、设计狮,翻译的术语可能有些变味,已经尽量避免,并整理出术语对译。
  • Twig水平有限,有些不确定的句子没有翻译。
  • 时间有限,仅翻译当下本人会用上的章节,其余回头再译(一般情况下是回不了头的)。
  • 每次修改、调整本文档时,都会顺手同步官方的文档。

同步记录

  • 2.X
    • 1e04274f34e9f80894865a1478e72b363e19179b(2022-02-04)
    • c8020aa5d848fcb934b047d85304544b174a95a7(2018-10-12)

未译章节

  • advanced.rst
  • recipesrst
  • tags/embed.rst
  • tags/extends.rst

术语约定

  • Application:应用
  • Literal:字面值
  • Loader:加载器
  • Escaper:转义器
  • Profiler:分析器
  • Optimizer:优化器
  • Subscript:下标
  • Statement:语句、声明
  • Item:单元
  • Filter:过滤器
  • Tag:标签
  • Named argument:具名实参
  • Block:区块
  • Context:上下文、语境
  • Skeleton:骨架
  • Override:重写、复写
  • Ealuate:评估
  • Scope:作用域
  • Horizontal reuse:横向重用
  • Escape:转义
  • Auto-escaping:自动转义
  • Hash:散列、哈希
  • String interpolation:字符串插值
  • Modifier:修改器
  • Environment:环境
  • Deprecate:弃用、不推荐使用
  • Lexer:词法分析器
  • Policy:策略

构建文档

原本临时使用了Doctrine ORM文档的主题,但未修改主题本身。因为官方在2020/11/5c9328ad613a171dd3c084ad9ab8aadcb853009ea 提交上才引入了:DOCtor-RST config + Sphinx build + GithubActions。

Docker

# 进入文档目录
$ cd twig-docs-cn
# 构建Docker镜像
# 因为有不少依赖,所以不能使用Sphinx官方的镜像
$ docker build -t twig:sphinx .
# 运行新生成的Docker镜像,并生成HTML文档
$ docker run --rm -v $(pwd):/docs twig:sphinx make html

Dockerfile修改

因为官方的Sphinx环境有一个依赖需要访问Github,所以在 Dockerfile 中加了代理环境配置。

如果不需要代理:可以将 Dockerfile 中的以 ENV 开头的行删除,去掉代理。

如果需要代理:修改 ENV MY_PROXY_URL= 中的地址为自己的地址。现在的docker.for.mac.host.internal 是macOS下Docker访问本地的地址。

本机环境

# 进入文档目录
$ cd twig-docs-cn
# 安装相关依赖
$ python3 -m pip install --no-cache-dir -r .requirements.txt
# 生成HTML文档
$ make html

额外需要安装Git,同时保证能连同Github,有一个依赖需要克隆Github项目。

生成的文档在 twig-docs-cn/__build/html 目录

资源

twig-docs-cn's People

Contributors

fmalee avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.