fw_publish
Publish a figure, table, document, or estimation results
fw_publish publishes one file: a figure, a table, a rendered HTML document with its name_files folder, or any other file. Each publish adds a version and keeps the earlier ones.
fw_publish, estimates publishes the current estimation results as a model: a coefficient table with standard errors, test statistics, p-values, and confidence intervals, plus fit statistics. Framework Cloud and the offline reader show it like a model published from R or Python.
Usage
fw_publish filename [, options]
fw_publish, estimates [options level(#) saving(filename [, replace])]
Options
| Name | Default | Description |
|---|---|---|
| filename |
The file to publish. Leave it out with |
|
| estimates |
Publishes the current estimation results as a model. |
|
| slug(string) |
The artifact's name in its link. The default comes from the file name. |
|
| title(string) |
The title readers see. |
|
| description(string) |
A short description. |
|
| to(destination) |
|
|
| visibility(string) |
|
|
| private |
Short for |
|
| includeprivate |
Confirms files with "private" in their path. |
|
| kind(string) |
Overrides the detected kind, such as |
|
| level(#) | c(level) |
The confidence level, with |
| saving(filename [, replace]) |
Keeps a copy of the model document, with |
Value
r(url): the published link, when the destination has oner(location): the published folder, for folder destinationsr(version): the version numberr(version_url): the link to this versionr(destination): the destination namer(driver):cloud,folder,github, ors3r(backend):core,cli, orpythonr(slug): the artifact namer(file): the file that was published; withestimates, thesaving()copy, else empty
Every backend sets these results. A result is empty when the destination does not report it.
Destinations
Without to(), fw_publish uses publish.default in the project settings, then Framework Cloud. Named destinations live in the settings under publish.destinations. A folder destination needs a path, so to(folder) alone stops with an error.
Stata publishes to folders and to Framework Cloud itself. GitHub Pages and S3 need fw or framework-py; see fw_set. Framework Cloud uploads use the project token in the project's .env file.
Estimation commands
regress, logit, logistic, probit, poisson, nbreg, glm, mixed, stcox, and ivregress map to Framework's model types with the right family, link, and ratio label. Other commands with e(b) and e(V) publish a generic coefficient table.
Estimates stay on the model scale. _cons becomes (Intercept). Base and omitted factor levels are left out. mixed adds a random-effects table for independent, identity, exchangeable, and unstructured covariance. nbreg reports alpha or delta as a fit statistic. Other free parameters, such as tobit's var(e.y), go in an ancillary table, without a test where Stata shows none.
Private paths
A file whose full path contains "private", in any case, needs confirmation. Interactive Stata asks. Batch mode stops with error 198 until you add the includeprivate option. R, Python, and fw follow the same rule. The private option sets visibility, not this confirmation.
With estimates, the rule checks the file the data in memory came from: the last fw_use or fw_save, or c(filename) when a plain use or save has loaded another file since. Results fit to data from a path with "private" in it need the same confirmation.
Examples
A figure Not run
graph export "$fw_outputs_figures/price.png", replace
fw_publish "$fw_outputs_figures/price.png", title("Price and mileage")
A model to a named destination Not run
sysuse auto, clear
regress price mpg weight
fw_publish, estimates slug(price-model) to(lab)