|
| 1 | +# Update imported docs |
| 2 | + |
| 3 | +This script updates the target files generated from other repos listed in the <config.yml> file, which is specified as the command line argument. |
| 4 | + |
| 5 | +## Requirements |
| 6 | + |
| 7 | +Imported docs must follow these guidelines: |
| 8 | + |
| 9 | +1. Be listed somewhere in the `/_data/imported.yml` table of contents file. |
| 10 | +1. Have `title` defined in the front matter. For example: |
| 11 | + |
| 12 | + ``` |
| 13 | + --- |
| 14 | + title: Title Displayed in Table of Contents |
| 15 | + --- |
| 16 | + |
| 17 | + Rest of the .md file... |
| 18 | + ``` |
| 19 | +
|
| 20 | +1. Adhere to the [Documentation Style Guide](/docs/home/contribute/style-guide/). |
| 21 | +
|
| 22 | +## Usage |
| 23 | +
|
| 24 | +From within this directory, run the following command: |
| 25 | +
|
| 26 | +``` |
| 27 | +./update-imported-docs <config.yaml> |
| 28 | +``` |
| 29 | +
|
| 30 | +The output should look similar to the following: |
| 31 | +
|
| 32 | +``` |
| 33 | +Website root directory: /Users/someuser/git/kubernetes-website |
| 34 | + |
| 35 | + * * * |
| 36 | + |
| 37 | +Cloning repo "community"... |
| 38 | + |
| 39 | + * * * |
| 40 | + |
| 41 | +Docs imported! Run 'git add .' 'git commit -m <comment>' and 'git push' to upload them. |
| 42 | +``` |
| 43 | +
|
| 44 | +## Config file format |
| 45 | +
|
| 46 | +Each config file may contain multiple repos, which will be imported together. You should modify the corresponding `update-imported-docs/<config.yml>` file to reflect the desired `src` and `dst` paths. |
| 47 | +
|
| 48 | +You may also create new config files for different groups of documents to import. The following is an example of the YAML file format: |
| 49 | +
|
| 50 | +``` |
| 51 | +repos: |
| 52 | +- name: kubernetes #tmp directory name |
| 53 | + remote: https://github.com/kubernetes/kubernetes.git |
| 54 | + branch: release-1.9 |
| 55 | + generate-command: hack/generate-docs.sh #optional command to run |
| 56 | + files: |
| 57 | + - src: docs/admin/cloud-controller-manager.md |
| 58 | + dst: docs/reference/generated/cloud-controller-manager.md |
| 59 | + - src: docs/admin/kube-apiserver.md |
| 60 | + dst: docs/reference/generated/kube-apiserver.md |
| 61 | +- name: community #tmp directory name |
| 62 | + remote: https://github.com/kubernetes/community.git |
| 63 | + branch: master |
| 64 | + files: |
| 65 | + - src: contributors/devel/README.md |
| 66 | + dst: docs/imported/community/devel.md |
| 67 | + - src: contributors/guide/README.md |
| 68 | + dst: docs/imported/community/guide.md |
| 69 | +``` |
| 70 | +
|
| 71 | +Note: `generate-command` is an optional entry, which can be used to run a given command to auto-generate the docs from within that repo. |
0 commit comments