Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A set of common tools to build documentation sites for plugins

NotificationsYou must be signed in to change notification settings

cakephp/docs-builder

Repository files navigation

This repository provides common tools for building documentation sites forplugins maintained by the CakePHP team. This build tooling isnot meant forcommunity plugins.

Building docs with these tools

To use these tools your plugin should create a docker image based onmarkstory/cakephp-docs-builder. It should add your plugin's docs to/data/docs and then use the tools provided in the base image to build the siteusing sphinx. An example of this is:

# Generate the HTML output.FROM markstory/cakephp-docs-builder as builderCOPY docs /data/docsRUN cd /data/docs-builder && \# In the future repeat website for each version  make website SOURCE=/data/docs DEST=/data/website/1.1# Build a small nginx container with just the static site in it.FROM nginx:1.15-alpineCOPY --from=builder /data/website /data/websiteCOPY --from=builder /data/docs-builder/nginx.conf /etc/nginx/conf.d/default.conf# Move each version into placeRUN mv /data/website/1.1/html/ /usr/share/nginx/html/1.1

Your plugin's docs will need to define a minimal sphinx configuration. You'llneed at least the following:

  • Anindex.rst that builds atoctree for all documents.
  • Aconf.py file that configures sphinx.

An exampleconf.py is as follows:

# Global configuration information used across all the# translations of documentation.## Import the base theme configurationfromcakephpsphinx.config.allimport*# The version info for the project you're documenting, acts as replacement for# |version| and |release|, also used in various other places throughout the# built documents.## The full version, including alpha/beta/rc tags.release='1.1'# The search index version. This needs to match# the INDEX_PREFIX variable used when `make populate-index` is called.search_version='authorization-11'# The marketing display name for the book.version_name=''# Project name shown in the black header barproject='CakePHP Authorization'# Other versions that display in the version picker menu.version_list= [    {'name':'1.1','number':'1.1','title':'1.1.x','current':True},]# Languages available.languages= ['en']# The GitHub branch name for this version of the docs# for edit links to point at.branch='master'# Current version being builtversion='1.1'# Language in use for this directory.language='en'

What these tools build

After defining a docker file for your plugin you and building the image, you'llget the following:

  • A static HTML site built with sphinx, using the cakephp-sphinxtheme
  • Nginx serving out of/var/www/html.
  • Dokku configuration for re-indexing content after the app starts up.

Adding a translation to a plugin's docs

The languages offered by a plugin are stored in a few places and each needs tobe updated separately:

  • Theconf.py file contains alanguages list.
  • Each translation needs to setlanguage in its configuration file.
  • Thedocs.Dockerfile in your plugin needs to passLANGS to each make taskindocs-builder that is called.
  • You need to update the jenkins deploy scripts in this repository to passLANGS when rebuilding elasticsearch indexes.
  • Update build jobs in jenkins.

Pushing update of this project's docker image

When you make changes to either cakephp/cakephpsphinx or this repository youneed to publish a new docker image and update the cakephp server.

  1. Go to theproject actions
  2. Run theBuild and publish images workflow.

This will build new images and publish them to ghcr.io. Once new imageshave been published they need to be pulled onto the cakephp.org server

ssh apps.cakephp.orgdocker pull ghcr.io/cakephp/docs-builderdocker pull ghcr.io/cakephp/docs-builder:runtime

About

A set of common tools to build documentation sites for plugins

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

[8]ページ先頭

©2009-2025 Movatter.jp