Skip to content

[Feature]: Create shiny.app_dir() #1900

Open
@schloerke

Description

@schloerke

Category

Other

Scope

Quality of Life

Problem

Knowing where a Shiny application is running is quite difficult.

Some situations, we know where the app.py file is. Others, we do not.

It would be nice to have access to the "application directory" for things like bookmarking or finding files relatively.

Solution

I'd like for shiny.app_dir() to a function that returns a directory.

This directory is defined as the first value of:

  • The value of SHINY_APP_DIR sys environ
  • The parent directory of the input file being processed
  • The current working directory.

Todo:

  • App.app_dir should be initialized to the value of app_dir().
  • Add the "show notification and update clipboard" method to session.bookmark

Alternatives (Optional)

  • Just use the current working directory.

This fails for multiple app applications.

Example (Optional)

Impact (Optional)

No response

Contribution? (Optional)

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions