8000 Add `--index-titles` flag to `panel serve` to allow customizing names in the index page cards for multi-page apps and update documentation by dalthviz · Pull Request #7916 · holoviz/panel · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add --index-titles flag to panel serve to allow customizing names in the index page cards for multi-page apps and update documentation #7916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 15, 2025

Conversation

dalthviz
Copy link
Contributor
@dalthviz dalthviz commented May 13, 2025

This adds a new --index-titles flag to the panel serve command to pass a custom mapping of titles for multi-page apps index card items (--index-titles <page slug>=<custom title>). This also changes the base index.html template to be able to use the values passed as titles via the new flag.

A preview:

  • Without custom titles:
panel serve untitled0.py untitled1.py
  • With custom titles:
panel serve untitled0.py untitled1.py --index-titles /untitled0=titled0 /untitled1=titled1

index_titles

Note:

Currently, the changes to the base index template done in this PR cause the items variable passed to become a list of tuples. Not totally sure if the template variables definitions should try to ensure some backwards compatibility. If that is the case, using a list of tuples could be changed to, for example, pass the titles as a new variable.

Fixes #7863
Related to #5128

Copy link
codecov bot commented May 13, 2025

Codecov Report

Attention: Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 86.11%. Comparing base (8116454) to head (172f007).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
panel/config.py 75.00% 1 Missing ⚠️
panel/io/server.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7916      +/-   ##
==========================================
- Coverage   87.10%   86.11%   -1.00%     
==========================================
  Files         346      346              
  Lines       53133    53213      +80     
==========================================
- Hits        46283    45822     -461     
- Misses       6850     7391     +541     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hoxbro
Copy link
Member
hoxbro commented May 14, 2025

Would making the argument more specific, like --index-titles, make sense?

@philippjfr
Copy link
Member

I'd also be in favor of --index-titles and the titles config parameter should probably be a dictionary that defines the title per endpoint.

@dalthviz
Copy link
Contributor Author

Thank you for the feedback! Pushed a couple of commits that should address the comments but let me know if something else is needed!

Copy link
Member
@philippjfr philippjfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go 🚀

Really appreciate all your contributions recently @dalthviz.

@philippjfr philippjfr enabled auto-merge (squash) May 15, 2025 08:24
@hoxbro hoxbro changed the title Add --titles flag to panel serve to allow customizing names in the index page cards for multi-page apps and update documentation Add --index-titles flag to panel serve to allow customizing names in the index page cards for multi-page apps and update documentation May 15, 2025
@hoxbro hoxbro disabled auto-merge May 15, 2025 09:22
@hoxbro hoxbro merged commit 176c502 into holoviz:main May 15, 2025
45 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow customizing names in the index page cards when serving a multi-page app
3 participants
0