Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
blueswen committed Aug 10, 2022
1 parent 54672c5 commit 05d64c2
Show file tree
Hide file tree
Showing 17 changed files with 890 additions and 29 deletions.
26 changes: 26 additions & 0 deletions demo-mkdocs/docs/disable/image.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
You can disable lightbox of images separately by adding ```off-glb``` class through markdown_extensions ```attr_list```. Enable ```attr_list``` via ```mkdocs.yml```:

```yaml
markdown_extensions:
- attr_list
```
Check more detail about ```attr_list``` on the [official document](https://python-markdown.github.io/extensions/attr_list/).

## Demo

The first image's lightbox is disabled.

```markdown
![Lanyu, Taiwan](../images/gallery/blueswen-lanyu.jpeg){ .off-glb }
Lanyu, Taiwan. Credit: Blueswen
![Obertraun, Austria](../images/gallery/blueswen-obertraun.jpeg)
Obertraun, Austria. Credit: Blueswen
```

![Lanyu, Taiwan](../images/gallery/blueswen-lanyu.jpeg){ .off-glb }
Lanyu, Taiwan. Credit: Blueswen

![Obertraun, Austria](../images/gallery/blueswen-obertraun.jpeg)
Obertraun, Austria. Credit: Blueswen
34 changes: 34 additions & 0 deletions demo-mkdocs/docs/disable/page.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
glightbox: false
---

You can disable lightbox of all images on a specific page by adding page metadata ```glightbox: false``` through markdown_extensions ```meta```. Enable ```meta``` via ```mkdocs.yml```:

```yaml
markdown_extensions:
- meta
```
Check more detail about ```meta``` on the [official document](https://python-markdown.github.io/extensions/meta_data/).

## Demo

All images' lightbox are disabled on this page.

```markdown
---
glightbox: false
---
![Lanyu, Taiwan](../images/gallery/blueswen-lanyu.jpeg)
Lanyu, Taiwan. Credit: Blueswen
![Obertraun, Austria](../images/gallery/blueswen-obertraun.jpeg)
Obertraun, Austria. Credit: Blueswen
```

![Lanyu, Taiwan](../images/gallery/blueswen-lanyu.jpeg)
Lanyu, Taiwan. Credit: Blueswen

![Obertraun, Austria](../images/gallery/blueswen-obertraun.jpeg)
Obertraun, Austria. Credit: Blueswen
8 changes: 5 additions & 3 deletions demo-mkdocs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GLightbox is a pure javascript lightbox library with mobile support.
## Dependency

1. Python Package
1. beautifulsoup4==4.11.1
1. beautifulsoup4>=4.11.1
2. GLightbox javascript file and css file
1. GLightbox==3.2.0

Expand All @@ -19,7 +19,7 @@ GLightbox is a pure javascript lightbox library with mobile support.
pip install mkdocs-glightbox
```

2. Add ```glightbox``` plugin in to your mkdocs.yml plugins sections:
2. Add ```glightbox``` plugin to your mkdocs.yml plugins sections:

```yaml
plugins:
Expand Down Expand Up @@ -52,9 +52,11 @@ GLightbox is a pure javascript lightbox library with mobile support.

Check more options information on [GLightbox Docs](https://github.com/biati-digital/glightbox#lightbox-options).

4. For more flexibility, you can disable lightbox by a [specific image](./disable/image.md) or a [specific page](./disable/page.md).

## Demo

Click image to try lightbox and enjoy the view of Taiwan.
Click the image to try lightbox and enjoy the view of Taiwan.

![Sunset over Taipei City](./images/thomas-tucker-sunset-over-taipei-city.jpg)
Sunset over Taipei City. Credit: [Thomas Tucker](https://unsplash.com/photos/au3CYbd7vCU)
Expand Down
5 changes: 5 additions & 0 deletions demo-mkdocs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ markdown_extensions:
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- attr_list
- meta

plugins:
- glightbox
Expand All @@ -54,3 +56,6 @@ nav:
- Sea: taiwan/sea.md
- Mountain: taiwan/mountain.md
- Gallery: gallery.md
- More Flexibility:
- Disable by image: disable/image.md
- Disable by page: disable/page.md
91 changes: 88 additions & 3 deletions docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@


<link rel="icon" href="/blueswen/mkdocs-glightbox/assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.3.0, mkdocs-material-8.3.9+insiders-4.20.1">
<meta name="generator" content="mkdocs-1.3.0, mkdocs-material-8.3.9+insiders-4.21.0">



<title>MkDocs GLightbox</title>



<link rel="stylesheet" href="/blueswen/mkdocs-glightbox/assets/stylesheets/main.19db47b7.min.css">
<link rel="stylesheet" href="/blueswen/mkdocs-glightbox/assets/stylesheets/main.846d444e.min.css">


<link rel="stylesheet" href="/blueswen/mkdocs-glightbox/assets/stylesheets/palette.cbb835fc.min.css">
Expand Down Expand Up @@ -82,6 +82,10 @@







<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
Expand Down Expand Up @@ -346,6 +350,87 @@















<li class="md-nav__item md-nav__item--nested">



<input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" >


<label class="md-nav__link" for="__nav_4">


<span class="md-ellipsis">
More Flexibility
</span>

<span class="md-nav__icon md-icon"></span>
</label>

<nav class="md-nav" aria-label="More Flexibility" data-md-level="1">
<label class="md-nav__title" for="__nav_4">
<span class="md-nav__icon md-icon"></span>
More Flexibility
</label>
<ul class="md-nav__list" data-md-scrollfix>






<li class="md-nav__item">
<a href="/blueswen/mkdocs-glightbox/disable/image/" class="md-nav__link">


<span class="md-ellipsis">
Disable by image
</span>

</a>
</li>









<li class="md-nav__item">
<a href="/blueswen/mkdocs-glightbox/disable/page/" class="md-nav__link">


<span class="md-ellipsis">
Disable by page
</span>

</a>
</li>




</ul>
</nav>

</li>



</ul>
</nav>
</div>
Expand Down Expand Up @@ -393,7 +478,7 @@ <h1>404 - Not found</h1>
<script id="__config" type="application/json">{"base": "/blueswen/mkdocs-glightbox/", "features": ["toc.integrate"], "search": "/blueswen/mkdocs-glightbox/assets/javascripts/workers/search.720157f5.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.config.lang": "en", "search.config.pipeline": "stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version.title": "Select version"}}</script>


<script src="/blueswen/mkdocs-glightbox/assets/javascripts/bundle.5e3df397.min.js"></script>
<script src="/blueswen/mkdocs-glightbox/assets/javascripts/bundle.15234abc.min.js"></script>


</body>
Expand Down
3 changes: 3 additions & 0 deletions docs/assets/javascripts/bundle.15234abc.min.js

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions docs/assets/javascripts/bundle.5e3df397.min.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/stylesheets/main.19db47b7.min.css

This file was deleted.

1 change: 1 addition & 0 deletions docs/assets/stylesheets/main.846d444e.min.css

Large diffs are not rendered by default.

Loading

0 comments on commit 05d64c2

Please sign in to comment.