Create a table of contents for your documentation.
为您的文档创建目录。
Mark your posts with multiple tags so you don’t have to duplicate posts to create a new version of your documentation when you have a version upgrade.
使用多个标签标记您的帖子,这样,在您进行版本升级时,无需重复帖子即可创建新版本的文档。
Put your posts in categories to order your documentation into chapters.
将您的帖子归类,以将文档整理到各章中。
Optionally use a custom field for fine-grained control over the order of your posts.
(可选)使用自定义字段来精细控制帖子的顺序。 p>
Shortcode
简码 h4>
In a page or post where you would like to display a table of contents enter the following shortcode.
在您要显示目录的页面或帖子中,输入以下简码。
[documentation-contents tag=”v1.16″ parentcat=”server”]
[documentation-contents tag =“ v1.16” parentcat =“ server”] p>
The above shortcode is used to display the page here.
上面的短代码用于在此处显示页面。
The tag specifies the tag that you have used to mark the version of your software.
标记指定用于标记软件版本的标记。
The parentcat is optional.
父母猫是可选的。
If you don’t specify it, the software will first look for a default parent category set in your Options and will finally just default to all.
如果未指定,则该软件将首先在“选项”中查找默认的父类别,最后将默认为所有。 p>
Mark versions of your software using Tags
使用标签标记软件版本 h4>
Use the WordPress tag feature to tag your post with the different version of software that it applies too.
使用WordPress标记功能,也可以使用它所适用的不同版本的软件来标记您的帖子。
You can tag the same post with multiple versions so that you don’t have to duplicate content.
您可以使用多个版本标记同一个帖子,从而不必重复内容。 p>
Organize your documentation into chapters using Catagories
使用目录将您的文档组织成章节 h4>
By marking your post as being in a category, that is the chapter that it will end up in. Your Table of Contents will use Category names as chapter headings.
通过将帖子标记为一个类别(即该类别的结尾),您的目录将使用类别名称作为章节标题。
WordPress allows you to create categories with sub-categories.
WordPress允许您创建带有子类别的类别。
You can use this feature to host documentation for different things in the same place.
您可以使用此功能在同一位置托管有关不同内容的文档。
See screenshots for an example.
有关示例,请参见屏幕截图。
You then mark the parent (top-level) category in the shortcode e.g.
然后,您可以在短代码中标记父(顶级)类别,例如 p>
[documentation-contents tag="v1.16" parentcat="server"] [documentation-contents标签=“ v1.16” parentcat =“服务器”][documentation-contents tag="v1.16" parentcat="mobile"]
[documentation-contents tag =“ v1.16” parentcat =“ mobile”]
code> pre>
You can set a default parent category in Options.
您可以在“选项”中设置默认的父类别。
If you do this, you could skip the parentcat option in the shortcode.
如果这样做,可以跳过简码中的parentcat选项。 p>
Use a custom field for fine-grained control over the order in which lessons appear.
使用自定义字段对课程的显示顺序进行精细控制。 h4>
In the absence of a custom field, the posts will just be displayed in alphabetical order.
在没有自定义字段的情况下,帖子只会按字母顺序显示。 p>
However, I don’t find that its a good idea to use numbers in my post title to specify order.
但是,我发现在帖子标题中使用数字来指定顺序并不是一个好主意。
Because a lesson can be used over and over again for multiple versions then you’re not always guaranteed that the first number you give it is going to be the right one.
由于课程可以一次又一次地用于多个版本,因此您不一定总能保证所给的第一个数字是正确的。
So, in the options (see below) you can specify a custom field.
因此,您可以在选项(参见下文)中指定一个自定义字段。
Once you start with custom fields, you can’t go back.
一旦开始使用自定义字段,就无法返回。
All posts that you want to show up in your documentation must have this custom field.
您要显示在文档中的所有帖子都必须具有此自定义字段。
I use “lesson_order” as my custom field and as I'm starting out I use 10, 20, 30, 40 etc. That means that if I add an extra lesson later, I can make it 31 or 32 and I won't
我使用“ lesson_order”作为自定义字段,开始时使用的是10、20、30、40等。这意味着,如果以后再添加一堂课,我可以将其设为31或32,而我不会
have to change anything else and it'll work just fine.
必须更改其他任何内容,它就可以正常工作。 p>
Options
选项 h4>
Under the administration dashboard, Settings, you’ll find a page Documentation Contents.
在管理控制台的“设置”下,您会找到一个页面“文档目录”。
See screenshots.
参见屏幕截图。 p>
Contents Header is used as a custom prefix, so if you don't want it to say “Table of Contents for xxx” it can say “Documentation for xxx” or anything else you want.
Contents Header em>用作自定义前缀,因此,如果您不希望它说“ xxx的目录”,则可以说“ xxx的文档”或您想要的其他任何内容。 p>
Default Category is used to specify a default parent category, to save you typing out parentcat=”xxx” in each shortcode that you use.
默认类别 em>用于指定默认的父类别,以免您在使用的每个短代码中键入parentcat =“ xxx”。 p>Specify order with Custom Field. If this is not set, then posts will be listed in alphabetical order.
使用“自定义字段”指定顺序。 em>如果未设置,则帖子将按字母顺序列出。If you do set it, then you will need to mark all your posts with this custom field in order for them to be displayed.
如果您设置了它,那么您将需要使用此自定义字段标记所有帖子,以便显示它们。
Troubleshooting
故障排除 p>