Skip to content

Commit e04f4a2

Browse files
committed
doc: add migration guide
1 parent 4ce8f89 commit e04f4a2

File tree

4 files changed

+78
-1
lines changed

4 files changed

+78
-1
lines changed

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Contribute to CppDoc
2+
3+
## Migrate a page from cppreference to CppDoc
4+
5+
We're now in the process of migrating contents from [cppreference] to CppDoc. Please checkout our [migration guide](https://cppdoc.cc/development/migration) for guidelines.
6+
7+
## Report a documentation bug
8+
9+
We use GitHub issues to track documentation bugs. To report a bug, please [opening a new GitHub issue](https://github.com/cppdoc-cc/cppdoc/issues/new).
10+
11+
## Add new content
12+
13+
> [!NOTE]
14+
> Incomplete.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ You can report a bug or request a new feature by [opening a new GitHub issue](ht
3636

3737
If you have made some changes, you can [open a new GitHub pull request](https://github.com/cppdoc-cc/cppdoc/compare).
3838

39+
For more information on contributing to CppDoc, please refer to our [contribution guide](./CONTRIBUTING.md).
40+
3941
## License
4042

4143
The content of the documentation is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International license](./LICENSE.CC-BY-SA-4.0) and the [GNU Free Documentation License](./LICENSE.GFDL). The underlying source code used to process, format, and display that content is licensed under the [MIT license](./LICENSE.MIT).
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
label: Development Guideline
2-
order: 2
2+
order: 3
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Migration Guide
3+
sidebar:
4+
order: 2
5+
---
6+
7+
import { Aside } from "@astrojs/starlight/components";
8+
9+
We're now in the process of migrating pages from [cppreference] to CppDoc. To start, check out our live-updated [migration progress document](https://github.com/cppdoc-cc/cppdoc/blob/migrate-progress/CPPREF_MIGRATE_PROGRESS.md) on GitHub. This document lists all pages on cppreference and their migration status. Choose a page that has not been migrated yet, and you could start migrating it.
10+
11+
[cppreference]: https://en.cppreference.com/index.html
12+
13+
## Migrate a page manually
14+
15+
Once you selected a cppreference page to migrate, check out the file [`slug_map.json`](https://github.com/cppdoc-cc/cppdoc/blob/main/migrate/slug_map.json), which provides a mapping from cppreference slugs to CppDoc slugs, to find the slug of the corresponding page in CppDoc. This file is rather large, you could use your browser's search function to locate the entry for the cppreference page you want to migrate.
16+
17+
For example, if the cppreference page you want to migrate is `cpp/concepts/integral`, you could find the following entry in `slug_map.json` related to the page:
18+
19+
```json
20+
{
21+
"cppref": "cpp/concepts/integral",
22+
"cppdoc": "cpp/library/concepts/integral"
23+
}
24+
```
25+
26+
So the slug of the migrated CppDoc page should be `cpp/library/concepts/integral`. This is where you should create the new CppDoc page.
27+
28+
<Aside type="tip">
29+
Contact the community if either:
30+
- You cannot find an entry in `slug_map.json` for your selected cppreference page.
31+
- The entry in `slug_map.json` says the CppDoc slug is `null`.
32+
- You think the CppDoc slug recorded in `slug_map.json` is not appropriate for some reasons.
33+
</Aside>
34+
35+
After determining the CppDoc slug of the migrated page, you could create the page and start migrating page contents from cppreference to CppDoc. Please follow our documentation convention during migration. Check out our [development guideline](./guide) for more guidelines.
36+
37+
When everything is finished, [create a pull request](https://github.com/cppdoc-cc/cppdoc/compare) to submit your changes. The community will review your changes and provide feedback. If everything goes well, your changes will be merged and deployed to the live website immediately after merge.
38+
39+
## Migrate a page with the help of an AI agent
40+
41+
To make our life easier, we have an experimental AI agent that could help you migrate a page. Its usage is completely optional.
42+
43+
The agent is embedded into the GitHub actions pipeline. It grabs a cppreference page you specified, try hard to rewrite it in CppDoc convention, and eventually creates a pull request. Once the pull request is opened, you and other members in the community could review it and make further changes on it.
44+
45+
<Aside type="note">
46+
AI agent is far from perfect and in most occassions its output must be changed further to meet our standards. The agent may also output complete garbage, in which case you have to either re-run the agent or migrate the page by hand.
47+
</Aside>
48+
49+
<Aside type="tip">
50+
AI agent works best when the size of the page is relatively small and similar pages have already been migrated before. If you're migrating a large page, or similar content on the page has not been migrated before, the quality of the agent output could drop dramastically. In such cases we recommend migrate the page by hand.
51+
</Aside>
52+
53+
To start, select a cppreference page which has not been migrated in the [migration progress document](https://github.com/cppdoc-cc/cppdoc/blob/migrate-progress/CPPREF_MIGRATE_PROGRESS.md).
54+
55+
Then click the "create" link in the "CppDoc Link" table column. This will take you to a pre-filled "new GitHub issue" page. The new issue's title is the URL to the cppreference page, and the new issue has an issue label `migrate-cppref-page`. After filling in any descriptive text for the new issue, click the "Create" button to create the issue.
56+
57+
Creation of the new issue will trigger the execution of an GitHub Action workflow. The workflow will invoke the AI agent to migrate the page. After the agent finishes, it will automatically create a draft pull request with the migrated page. Review the migrated content, make any necessary changes, and mark the pull request ready when done. The community will review your changes and provide feedback. If everything goes well, your changes will be merged and deployed to the live website immediately after merge.
58+
59+
<Aside type="tip">
60+
If you cannot edit the pull request created by the agent, contact community members for acquiring write access to the CppDoc repository.
61+
</Aside>

0 commit comments

Comments
 (0)