Skip to content

Commit fe52cea

Browse files
committed
Document building from remote repository
1 parent 269ea6b commit fe52cea

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

user_guide/13-building.qmd

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,56 @@ The `_site/` subdirectory contains the final HTML output. This is the directory
108108

109109
Everything outside of `_site/` is intermediate Quarto source. You generally do not need to inspect these files, but they can be useful for debugging rendering issues.
110110

111+
## Building from a Remote Repository {#from-repo}
112+
113+
The `--from-repo` flag lets you build documentation for any Git-hosted package without cloning it yourself. Great Docs handles the entire workflow: cloning the repository, creating an isolated virtual environment, installing the package and its dependencies, running the full build pipeline, and copying the finished site to a local directory.
114+
115+
```{.bash filename="Terminal"}
116+
great-docs build --from-repo https://github.com/owner/package.git
117+
```
118+
119+
The built site is copied to `./great-docs/_site/` by default. Use `--output-dir` to put it somewhere else:
120+
121+
```{.bash filename="Terminal"}
122+
great-docs build --from-repo https://github.com/owner/package.git --output-dir /tmp/my-site
123+
```
124+
125+
### Branch or Tag
126+
127+
By default the repository's default branch is cloned. Use `--branch` to check out a specific branch or tag:
128+
129+
```{.bash filename="Terminal"}
130+
great-docs build --from-repo https://github.com/owner/package.git --branch v2.0.0
131+
```
132+
133+
### Clone Depth
134+
135+
Great Docs inspects the target project's `great-docs.yml` to decide how much Git history to fetch. If the project uses multi-version docs or page dates, a full clone is performed automatically. Otherwise a lightweight tag-only clone is used.
136+
137+
Use `--shallow` to force a minimal `--depth 1` clone. This is the fastest option but disables versioned documentation and page dates:
138+
139+
```{.bash filename="Terminal"}
140+
great-docs build --from-repo https://github.com/owner/package.git --shallow
141+
```
142+
143+
### Previewing After Build
144+
145+
Add `--preview` to start a local server and open the site in your browser as soon as the build finishes:
146+
147+
```{.bash filename="Terminal"}
148+
great-docs build --from-repo https://github.com/owner/package.git --preview
149+
```
150+
151+
### Previewing a Previously Built Site
152+
153+
If you have already built a site with `--from-repo` (or received a site directory from someone else), use `great-docs preview --site-dir` to serve it without any project context:
154+
155+
```{.bash filename="Terminal"}
156+
great-docs preview --site-dir /tmp/my-site
157+
```
158+
159+
This starts the same local HTTP server and opens your browser, just like the regular `great-docs preview` command.
160+
111161
## Using the Python API
112162

113163
In addition to the CLI, you can drive the build programmatically:

0 commit comments

Comments
 (0)