{"id":13623665,"url":"https://github.com/cmbrose/github-docs-to-wiki","last_synced_at":"2025-04-08T04:07:36.370Z","repository":{"id":52186560,"uuid":"325144801","full_name":"cmbrose/github-docs-to-wiki","owner":"cmbrose","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-09T17:10:30.000Z","size":33,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-14T13:33:12.673Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmbrose.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-29T00:11:44.000Z","updated_at":"2024-09-11T14:18:01.000Z","dependencies_parsed_at":"2024-10-05T19:33:22.746Z","dependency_job_id":"f6699b5c-d5fb-4648-a1ba-03d0888d922c","html_url":"https://github.com/cmbrose/github-docs-to-wiki","commit_stats":{"total_commits":29,"total_committers":5,"mean_commits":5.8,"dds":0.2068965517241379,"last_synced_commit":"e8858cfe1bdf651e51fb1e3165c5a8f1727a3ccc"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":"ebekker/pwsh-github-action-base","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmbrose%2Fgithub-docs-to-wiki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmbrose%2Fgithub-docs-to-wiki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmbrose%2Fgithub-docs-to-wiki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmbrose%2Fgithub-docs-to-wiki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmbrose","download_url":"https://codeload.github.com/cmbrose/github-docs-to-wiki/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773719,"owners_count":20993634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:01:34.321Z","updated_at":"2025-04-08T04:07:36.349Z","avatar_url":"https://github.com/cmbrose.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# github-docs-to-wiki\nSyncs markdown documentation files in a repo to its wiki\n\n## Usage\n\n| Name | Usage | Required? |\n| - | - | - |\n| githubToken | A GitHub PAT with Repo access. Note: This cannot be the `GITHUB_TOKEN` secret as that is scoped to the source repo, but the wiki is a separate repo | Yes |\n| defaultBranch | Specifies the default branch name to use for converted absolute links | No, default is the output of `git branch --show-current` |\n| rootDocsFolder | Relative path within the repo to the root documentation folder | No, default is the repo's root |\n| convertRootReadmeToHomePage | If true, the `README.md` file at the root of the repo will be renamed to `Home.md` in the wiki so that it is used as the wiki homepage | No, default is false |\n| useHeaderForWikiName | If true, will extract the top-line header (denoted by a single `#`) and use that as the wiki page's name. Note: if this results in a name collision the sync will fail | No, default is false and wiki names will be the relative path to the file with `/` converted to `__` (e.g. `path/to/doc.md` becomes `path__to_doc.md`) |\n| customWikiFileHeaderFormat | If set, inserts a header at the top of each wiki file with the given format\u003cbr/\u003eSupports the following format subsitutions:\u003cbr/\u003e- `{sourceFileLink}`: the absolute url to the source file in the repo | No, default will not add a header |\n| customCommitMessageFormat | If set, uses the given format for the commit message to the wiki. Useful to correlate changes to the source.\u003cbr/\u003eSupports the following format subsitutions:\u003cbr/\u003e- `{commitMessage}`: the latest commit message for HEAD\u003cbr/\u003e- `{shaFull}`: the full SHA of HEAD\u003cbr/\u003e- `{shaShort}`: the short SHA of HEAD | No, default is `\"Sync Files\"` |\n\n## How it works\n\n1. Clone the wiki repo, delete all existing files\n2. The root directory is recursively scanned for documentation files (using `*.md`)\n   1. For each file, all links are extracted and checked for conversion\n      1. If a link is already absolute, do nothing\n      2. If a link is to another `.md` file within the docs path, convert the link to point to a wiki page\n      3. Else, convert the link to an absolute Url pointing to a file in the repo\n   2. If `useHeaderForWikiName` is set, check the file for a header and, if present, remove that line and set the wiki name accordingly\n   3. Otherwise set the wiki name as the path to the file with `/` converted to `__`\n   4. Output the new content to the wiki\n3. Scan the wiki directory and update any links where the name was overridden in `2.ii`\n4. Commit and push the wiki files\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmbrose%2Fgithub-docs-to-wiki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmbrose%2Fgithub-docs-to-wiki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmbrose%2Fgithub-docs-to-wiki/lists"}