dontdrinkandroot / gitki-bundle
Symfony Bundle,让您轻松将基于 git 的维基集成到项目中
v0.2.0
2018-02-28 13:58 UTC
Requires
- php: >=7.1
- cpliakas/git-wrapper: ^1.2
- dontdrinkandroot/utils: 0.4.*,>=0.4.3
- league/commonmark: ^0.17
- symfony/asset: ^3.3
- symfony/finder: ^3.3
- symfony/form: ^3.3
- symfony/framework-bundle: ^3.3
- symfony/templating: ^3.3
- symfony/translation: ^3.3
- symfony/twig-bridge: ^3.3
- symfony/twig-bundle: ^3.3
- symfony/validator: ^3.3
- webuni/commonmark-table-extension: ^0.8
Requires (Dev)
- elasticsearch/elasticsearch: ^5.0
- liip/functional-test-bundle: ^1.7
- phpunit/phpunit: ^5.0
- scrutinizer/ocular: ^1.1
- symfony/console: ^3.3
- symfony/css-selector: ^3.3
- symfony/dom-crawler: ^3.3
- symfony/security-bundle: ^3.3
Suggests
- braincrafted/bootstrap-bundle: Style forms in a bootstrap compatible style
- elasticsearch/elasticsearch: Include this if you want the wiki to be searchable
This package is auto-updated.
Last update: 2024-09-03 22:00:57 UTC
README
关于
Symfony Bundle,让您轻松将基于 git 的维基集成到项目中。
此项目目前处于 alpha 状态。它正在运行,但变化频繁。
功能
- 基于 Git
- 完全集成的 Markdown 支持(commonmark)
- 可选的 Elasticsearch 集成
- 最小配置
- 易于扩展
- 易于集成
安装
使用 composer 安装
composer require dontdrinkandroot/gitki-bundle
在您的项目的 app/AppKernel.php
文件中添加以下行以启用此包
// app/AppKernel.php class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Dontdrinkandroot\GitkiBundle\DdrGitkiBundle(), ); // ... } }
要在此项目中使用此包,传递给包的 User 类必须实现 Dontdrinkandroot\GitkiBundle\Model\GitUserInterface
。幸运的是,这与 FOSUserBundle 兼容。
配置
在 app/config/config.yml
中配置此包。至少需要仓库路径,该路径必须指向一个由 web 服务器初始化且可读/可写的 git 仓库。
# Default configuration for extension with alias: "ddr_gitki"
ddr_gitki:
# The path to the git repository containing the wiki files. Must end with slash.
repository_path: ~ # Required
# When enabled breadcrumbs are shown for easy navigation
show_breadcrumbs: true
# When enabled the files and folders of the containing directory are shown while viewing a file
show_directory_contents: true
# Markdown specific configuration
markdown:
# When disabled all html content is escaped
allow_html: false
toc:
# Show the table of contents
enabled: true
# Max depth of the table of contents
max_level: 3
# Configure elasticsearch integration
elasticsearch:
index_name: ~ # Required
host: localhost
port: 9200
# Maps user roles to internal roles
roles:
# Is allowed to view content
watcher: IS_AUTHENTICATED_ANONYMOUSLY
# Is allowed to edit content
committer: ROLE_USER
admin: ROLE_ADMIN
# The file names that are used as a directory index. Searched in the order defined.
index_files:
# Defaults:
- index.md
- README.md
- index.txt
- README.txt
将路由添加到 app/config/routing.yml
ddr_gitki_base:
resource: "@DdrGitkiBundle/Resources/config/routing.yml"
prefix: /wiki
开发
在本地 Docker 中运行 Elasticsearch
docker run -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.16.3