แก้ไข

แชร์ผ่าน


Add and edit wiki pages

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

You can add a title and content to a page, after the wiki Git repository is provisioned for your team project. There's a side-by-side edit and preview experience where you can edit the page and preview the content as you go.

While you author pages using Markdown format, you can also use the format pane for rich-text formatting and inserting images, attachments, and links.

Wiki home page

As you edit the page, save it by entering Ctrl+S. To save with a custom revision message, select next to Save. For more shortcuts, see Keyboard shortcuts to manage wiki pages.

Save page with a custom message

Wiki command-line tools

Commands Description
az devops wiki show Open a wiki
az devops wiki page show Get the content of a page or open a page
az devops wiki page create Add a new page
az devops wiki page update Edit a page
az devops wiki page delete Delete a page

Note

To add or edit pages to a wiki that you've published from a Git repository, see Publish a Git repository to a wiki. This article addresses how to add and edit pages of a wiki that you've provisioned for a team project.

Prerequisites

  • Have a provisioned wiki.
  • Be a member of the team project as a Contributor to add or update wiki pages.
  • Have Basic access level to edit the project wiki.

Open the Wiki

You can open and view a wiki page for your project.

Connect to your project using a supported web browser and choose Wiki.

Screenshot showing highlighted Wiki menu selection.

If you need to switch your team project, choose Azure DevOps to browse all team projects and teams.

Add a wiki page

To add another page, choose New page. Or, to add a subpage, open the context menu of an existing page and select Add subpage.

Specify a unique title of 235 characters or less. Page titles are case-sensitive. For other title restrictions, see Wiki Git repository files and file structure, File naming conventions.

Screenshot of first wiki page.

You can also use keyboard shortcuts to add a new page by pressing n or add a subpage by pressing c. For a complete list of keyboard shortcuts, see Keyboard shortcuts to manage wiki pages.

Wiki page title naming restrictions

Each wiki page corresponds to a file within the wiki Git repo. Names you assign to a wiki page title must conform to the following restrictions.

Restriction type Restriction
File name The fully qualified page path shouldn't exceed 235 characters.
Uniqueness Page titles are case sensitive and must be unique within the wiki hierarchy.
Special characters - Must not contain any Unicode control characters or surrogate characters.
- Must not contain the following printable characters: / \ #.
- Must not start or end with a period ..
File size Must not exceed the maximum of 18 MB.
Attachment file size Must not exceed the maximum of 19 MB.

Special characters in Wiki page titles

You can specify page titles which contain one or more of these special characters : < > * ? | -. For example, you can name a Markdown file as "FAQ?" or "Set-up guide". The characters have the following URI encoded strings:

Character Encoded string
: %3A
< %3C
> %3E
* %2A
? %3F
| %7C
- %2D
" %22

Edit and delete wiki pages

To edit an existing wiki page, open the page and select Edit, or open the context menu and select Edit. You can also use keyboard shortcut e to go to the edit of the current page quickly. For more information about specific editing functions, see Use Markdown guidance.

For code wikis, you can edit a page in the side-by-side editor, using the markdown toolbar to create your content. This experience is identical to the process in a project wiki. You can also edit wiki pages in the Repos hub also by using the option, Edit in Repos.

Screenshot of Edit wiki page.

Select Edit in Repos to create a branch and continue editing. The Edit in Repos button is available only for code wikis that have branch policies enabled. If you don't see the button, it might be because your wiki isn't a code wiki or branch policies aren't enabled. For more information on branch policies, see Branch policies and settings.

To delete a page, open the context menu from the tree or the one inside the page and select Delete. Confirm the delete in the dialog that opens.

Note

When you delete a wiki page, you also delete all its metadata and any subpages within its hierarchy.

Reorder a wiki page

You can reorder pages within the wiki tree view to have pages appear in the order and hierarchy you want. You can drag-and-drop a page title in the tree view to do the following operations:

  • Change the parent-child relationship of a page.
  • Change the order of the page within the hierarchy.

Note

Moving a page in the hierarchy might break links from other pages. You can manually fix these links after moving the page. Reordering a page within the hierarchy does not affect page links.

To manually fix a broken link after moving a page in the hierarchy, follow these steps:

  1. Identify broken links:
    • Go to the pages that originally linked to the moved page.
    • Look for broken links, which might appear as errors or missing content.
  2. Edit the linking page: Open the page with the broken link in edit mode.
  3. Update the link:
    • Locate the broken link in the content.
    • Update the link to point to the new location of the moved page, which typically involves changing the URL or path in the link.
  4. Save changes: Save the changes to the page to apply the updated link.
  5. Verify the fix: Go to the updated link to ensure it correctly points to the moved page.

Example

If you moved a page from /docs/old-path/page.md to /docs/new-path/page.md, you'd do the following steps:

  1. Find the broken link in the content, such as Link to Page.
  2. Edit the link to the new path: Link to Page.
  3. Save the changes and verify that the link now correctly points to the new location.

Use keyboard shortcuts to reorder pages

You can also use keyboard shortcuts to reorder pages. Select a page and press CTRL + UP ARROW or CTRL + DOWN ARROW to change page orders. To change the parent-child relationship of a page, open its context menu and select Move. The Move page dialog opens. Select a parent page under which you can move the current page.

Screenshot showing moving a wiki page in the hierarchy.

For a complete list of keyboard shortcuts, see Keyboard shortcuts to manage wiki pages.

Make a page the wiki home page

By default, the first page you add when you create a wiki is set as the wiki home page. You can change your wiki homepage if another page becomes more relevant by dragging and dropping the page to the top of the tree.

Next steps