09 Publishing - domain-centric/documentation_builder GitHub Wiki
You need to publish the generated files to make them available for reading on web pages. The following paragraphs will explain how.
The generated documentation files will become directly available:
- on https://github.com: by committing and pushing the files to GitHub using
git commit
andgit push
commands - on https://pub.dev: by publishing your project to PubDev using
dart pub publish
orflutter pub publish
commands
Before you can publish the Wiki files to GitHub, you must first clone the Wiki pages into your local project. You only have to do this the first time:
- Create a Wiki page on your github project:
- Open in browser:
https://github.com/<user_name>/<repository_name>/wiki
- Click New Page button
- Edit page (add some dummy title and text)
- Click Save page
- Open in browser:
- Clone the Wiki page project to your local drive:
- Open the command line and go to the folder where your IDE stores your project folders (e.g.: C:\Users\myName\AndroidStudioProjects)
- Enter command:
git clone https://github.com/<user_name>/<repository_name>.wiki.git
(you can also find the clone url on the bottom right of the github Wiki pages) - This will create a local repository and folder: ../<repository_name>.wiki (next to your project folder)
- Now remove all the wiki pages in the cloned wiki project, because some might no longer exist.
- Copy the generated wiki files to the cloned wiki project.
- Commit the local wiki project to GitHub:
- Open the command Line
- Go into the ../<project_name>.wiki folder (next to your project folder)
- Enter commands:
git add .
git commit -m "Generated by documentation_builder"
git push
- A pop up page may appear for authorization
Most of the steps above could be automated with help of GitHub workflow script that is executed every time the generated files of a project are pushed: On a remote server the script will:
- Clone the wiki page project
- Remove all wiki page files in the wiki page project
- Copy the generated files to the wiki pages project
- Git add, commit and push the wiki pages project
See the workflow script for this project for inspiration in: .github/workflows/publish-wiki.yml