Skip to content
Framework

Publishing

publish_structure()

Publish the project's folder tree to Framework Cloud, with notes on its paths.

::

fw.publish_structure(notes={"R/": "Reusable functions", "README.md": "Start here"},
                     highlight="README.md")

Usage

publish_structure(
    path: str | Path | Sequence[str | Path] | None = None,
    *,
    depth: int | None = None,
    exclude: str | Sequence[str] | None = None,
    notes: Mapping[str, str] | None = None,
    open: str | Sequence[str] | None = None,
    highlight: str | Sequence[str] | None = None,
    ignored: str = 'rules',
    slug: str | None = None,
    title: str | None = None,
    description: str | None = None,
    visibility: str | None = None,
    password: str | None = None,
    collection: str | int | None = None,
    share_unlisted: bool = False,
    to: str | None = None,
    include_private: bool = False,
    display: Mapping[str, bool] | None = None,
) -> str | list[str]

Arguments

Name Type Default Description
path str | Path | Sequence[str | Path] | None None

A folder, or a list of folders, relative to the project root. Several folders publish as one tree named for the project. Default: the project root.

depth int | None None

Levels to list. Folders below it publish as stubs with a file count.

exclude str | Sequence[str] | None None

Globs, as .gitignore writes them, for paths to leave out entirely.

notes Mapping[str, str] | None None

Notes by path, up to 500 characters each, such as {"R/": "Reusable functions"}. A path not in the tree is an error.

open str | Sequence[str] | None None

Folders that start open in an embed. Default: the top level.

highlight str | Sequence[str] | None None

Paths drawn as highlighted.

ignored str 'rules'

"rules" publishes ignored paths as stubs and groups with their rules; "hide" leaves them out. Private stubs show either way, unless the private folder is ignored too.

slug str | None None

Artifact slug. Default: structure, or structure-<folder> for a subfolder.

title str | None None

Artifact title. Default: <root> structure.

description str | None None

Artifact description.

visibility str | None None

"public", "unlisted", or "private". Default: a new artifact is unlisted and an existing one keeps its setting.

password str | None None

Password required to view the tree.

collection str | int | None None

Project collection ID or slug.

share_unlisted bool False

Allow collection readers to see an unlisted tree.

to str | None None

A configured destination name, or "cloud".

include_private bool False

Publish without asking about private folders.

display Mapping[str, bool] | None None

What embeds of the tree show, on Framework Cloud: title, description, notes, and ignored. description starts off and the rest start on. True shows an item and False hides it; settings left out keep their value.

Value

The artifact's URL. On Framework Cloud it is a Published string with embed_link, the link to share and embed, and artifact_url, the artifact's page for its owner.

Details

Framework prints the tree as it publishes, then uploads it. Ignored names never publish: an ignored folder is a stub with its rule and a file count, and ignored files are one row per folder and rule, with a count. A private folder (private, ..._private, or a settings folder marked private) is a stub with a file count. .git/ is left out. structure() shows the tree with the ignored names, and uploads nothing.

Search guides and reference for R, Python, Stata, the CLI, and Framework Cloud.