Skip to content

Commit 3cabb5a

Browse files
authored
Merge pull request #1700 from Conengmo/documentation-project
Documentation project
2 parents 5c5de55 + 15b6a0a commit 3cabb5a

File tree

91 files changed

+5445
-520
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+5445
-520
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,23 @@ jobs:
3232
shell: bash -l {0}
3333
run: |
3434
set -e
35-
cp examples/Quickstart.ipynb docs/quickstart.ipynb
3635
pushd docs
3736
make clean html linkcheck
3837
popd
3938
40-
- name: GitHub Pages action
39+
- name: Publish to Github Pages on main
40+
if: ${{ github.ref == 'refs/heads/main' }}
41+
uses: peaceiris/actions-gh-pages@v3
42+
with:
43+
github_token: ${{ secrets.GITHUB_TOKEN }}
44+
publish_dir: docs/_build/html/
45+
destination_dir: latest
46+
keep_files: false
47+
48+
- name: Publish to Github Pages on release
4149
if: ${{ github.event_name == 'release' }}
4250
uses: peaceiris/actions-gh-pages@v3
4351
with:
4452
github_token: ${{ secrets.GITHUB_TOKEN }}
4553
publish_dir: docs/_build/html/
54+
destination_dir: ${{ github.ref_name }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.pytest_cache
55
build/
66
dist/
7+
docs/index.html
78
docs/_build/
89
docs/quickstart.ipynb
910
examples/results/*

docs/_static/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.bd-content {
2+
flex-grow: 1;
3+
max-width: 100%;
4+
}

docs/_static/flask_example.py

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
""" flask_example.py
2+
3+
Required packages:
4+
- flask
5+
- folium
6+
7+
Usage:
8+
9+
Start the flask server by running:
10+
11+
$ python flask_example.py
12+
13+
And then head to http://127.0.0.1:5000/ in your browser to see the map displayed
14+
15+
"""
16+
17+
from flask import Flask, render_template_string
18+
19+
import folium
20+
21+
app = Flask(__name__)
22+
23+
24+
@app.route("/")
25+
def fullscreen():
26+
"""Simple example of a fullscreen map."""
27+
m = folium.Map()
28+
return m.get_root().render()
29+
30+
31+
@app.route("/iframe")
32+
def iframe():
33+
"""Embed a map as an iframe on a page."""
34+
m = folium.Map()
35+
36+
# set the iframe width and height
37+
m.get_root().width = "800px"
38+
m.get_root().height = "600px"
39+
iframe = m.get_root()._repr_html_()
40+
41+
return render_template_string(
42+
"""
43+
<!DOCTYPE html>
44+
<html>
45+
<head></head>
46+
<body>
47+
<h1>Using an iframe</h1>
48+
{{ iframe|safe }}
49+
</body>
50+
</html>
51+
""",
52+
iframe=iframe,
53+
)
54+
55+
56+
@app.route("/components")
57+
def components():
58+
"""Extract map components and put those on a page."""
59+
m = folium.Map(
60+
width=800,
61+
height=600,
62+
)
63+
64+
m.get_root().render()
65+
header = m.get_root().header.render()
66+
body_html = m.get_root().html.render()
67+
script = m.get_root().script.render()
68+
69+
return render_template_string(
70+
"""
71+
<!DOCTYPE html>
72+
<html>
73+
<head>
74+
{{ header|safe }}
75+
</head>
76+
<body>
77+
<h1>Using components</h1>
78+
{{ body_html|safe }}
79+
<script>
80+
{{ script|safe }}
81+
</script>
82+
</body>
83+
</html>
84+
""",
85+
header=header,
86+
body_html=body_html,
87+
script=script,
88+
)
89+
90+
91+
if __name__ == "__main__":
92+
app.run(debug=True)

docs/_static/switcher.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[
2+
{
3+
"version": "v0.14.0 (stable)",
4+
"url": "https://python-visualization.github.io/folium/version-v0.14.0/"
5+
},
6+
{
7+
"version": "v0.12.1",
8+
"url": "https://python-visualization.github.io/folium/version-v0.12.1/"
9+
},
10+
{
11+
"version": "v0.12.0",
12+
"url": "https://python-visualization.github.io/folium/version-v0.12.0/"
13+
},
14+
{
15+
"version": "v0.11.0",
16+
"url": "https://python-visualization.github.io/folium/version-v0.11.0/"
17+
},
18+
{
19+
"version": "v0.10.1",
20+
"url": "https://python-visualization.github.io/folium/version-v0.10.1/"
21+
},
22+
{
23+
"version": "v0.10.0",
24+
"url": "https://python-visualization.github.io/folium/version-v0.10.0/"
25+
},
26+
{
27+
"version": "v0.9.1",
28+
"url": "https://python-visualization.github.io/folium/version-v0.9.1/"
29+
},
30+
{
31+
"version": "v0.9.0",
32+
"url": "https://python-visualization.github.io/folium/version-v0.9.0/"
33+
},
34+
{
35+
"version": "v0.8.3",
36+
"url": "https://python-visualization.github.io/folium/version-v0.8.3/"
37+
},
38+
{
39+
"version": "v0.8.2",
40+
"url": "https://python-visualization.github.io/folium/version-v0.8.2/"
41+
},
42+
{
43+
"version": "v0.8.1",
44+
"url": "https://python-visualization.github.io/folium/version-v0.8.1/"
45+
}
46+
]

docs/_templates/version.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!-- This will display the version of the docs -->
2+
Folium version {{ version }}

docs/_themes/f6/NEWS.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/_themes/f6/layout.html

Lines changed: 0 additions & 30 deletions
This file was deleted.

docs/_themes/f6/static/brillant.png

-85 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)