Skip to content

Commit

Permalink
Add Location section to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 30, 2020
1 parent e9de60f commit e6f68ac
Showing 1 changed file with 38 additions and 7 deletions.
45 changes: 38 additions & 7 deletions examples/user_guide/Deploy_and_Export.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,8 @@
"pn.serve({'markdown': '# This is a Panel app', 'json': pn.pane.JSON({'abc': 123})})\n",
"```\n",
"\n",
"The ``pn.serve`` function accepts the same arguments as the `show` method."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The ``pn.serve`` function accepts the same arguments as the `show` method.\n",
"\n",
"\n",
"\n",
"## Launching a server on the commandline\n",
Expand Down Expand Up @@ -332,6 +327,42 @@
"\n",
"This mechanism may be used to modify the behavior of an app dependending on parameters provided in the URL. \n",
"\n",
"#### Cookies\n",
"\n",
"The `panel.state.cookies` will allow accessing the cookies stored in the browser and on the bokeh server.\n",
"\n",
"#### Headers\n",
"\n",
"The `panel.state.headers` will allow accessing the HTTP headers stored in the browser and on the bokeh server.\n",
"\n",
"#### Location\n",
"\n",
"When starting a server session Panel will attach a `Location` component which can be accessed using `pn.state.location`. The `Location` component servers a number of functions:\n",
"\n",
"- Navigation between pages via ``pathname``\n",
"- Sharing (parts of) the page state in the url as ``search`` parameters for bookmarking and sharing.\n",
"- Navigating to subsections of the page via the ``hash_`` parameter.\n",
"\n",
"##### Core\n",
"\n",
"* **``pathname``** (string): pathname part of the url, e.g. '/user_guide/Interact.html'.\n",
"* **``search``** (string): search part of the url e.g. '?color=blue'.\n",
"* **``hash_``** (string): hash part of the url e.g. '#interact'.\n",
"* **``reload``** (bool): Whether or not to reload the page when the url is updated.\n",
" - For independent apps this should be set to True. \n",
" - For integrated or single page apps this should be set to False.\n",
"\n",
"##### Readonly\n",
"\n",
"* **``href``** (string): The full url, e.g. 'https://panel.holoviz.org/user_guide/Interact.html:80?color=blue#interact'.\n",
"* **``protocol``** (string): protocol part of the url, e.g. 'http:' or 'https:'\n",
"* **``port``** (string): port number, e.g. '80'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Accessing the Bokeh model\n",
"\n",
"Since Panel is built on top of Bokeh, all Panel objects can easily be converted to a Bokeh model. The ``get_root`` method returns a model representing the contents of a Panel:"
Expand Down

0 comments on commit e6f68ac

Please sign in to comment.