Skip to content

Commit

Permalink
Small additions and cleanups to #3 (#10)
Browse files Browse the repository at this point in the history
* Add test function for correct link and source structure

Issue: #3

* Introduce liquid link tag where appropriate

Issue: #3

* Fix PlantUML version information

Issue: #3

* Extend README to describe more extension points

Issue: #3

* Fix name in the main navigation but use "Standard Libraries" everywhere else

Issue: #3

* Add missing direct access from home page

Issue: #3

* Use Jekyll's own tags for highlighting

Issue: #3

* Fix indentation in generated site

Issue: #3

* Fix merge mistake

Issue: #3
  • Loading branch information
johthor authored Nov 12, 2024
1 parent a63594c commit 4e01ae1
Show file tree
Hide file tree
Showing 14 changed files with 110 additions and 47 deletions.
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
# Welcome to PlantUML themes Gallery

Here are the scripts to make an autogenerated PlantUML themes Gallery.
These are the scripts and Jekyll data collections used to autogenerate the PlantUML Themes Gallery.

New themes [could be pushed here](https://github.com/plantuml/plantuml/tree/master/themes).
If you want to add a new theme to the gallery,
go to [PlantUML "official" themes](https://github.com/plantuml/plantuml/tree/master/themes) and add it there.
After that, add a new document to the [local themes collection directory](/collections/_themes) describing your theme.
For now, only the themes directly packaged with PlantUML are supported.

And the sources of the [PlantUML themes Gallery](https://the-lum.github.io/puml-themes-gallery/)
For adding a new skin to the gallery,
the steps are nearly the same
but replace `theme` with `skin` e.g. go to[PlantUML skins](https://github.com/plantuml/plantuml/tree/master/skin)
and add a new document to the [local skins collection directory](/collections/_skins).

If instead you want to add a new diagram type, you will only need to add local files.
First, add a diagram description PUML file to the [local diagrams input directory](/collections/_diagrams/input).
And second, add a corresponding document to the [local diagrams collection directory](/collections/_diagrams).

Adding another [PlantUML Standard Library](https://github.com/plantuml/plantuml-stdlib) based diagram requires the same steps
as adding a new diagram.
But again replace `diagram` with `stdlib`
and add the new files inside the [local stdlibs collection directory](/collections/_stdlibs).


> :information_source: When adding a new collection document to any of the collections above,
always follow the structure of other documents already present in that collection.
When adding new PUML diagram descriptions don't add any `!theme` or `skin` declarations yourself
as those will be added automatically.

All the sources of the [PlantUML themes Gallery](https://the-lum.github.io/puml-themes-gallery/)
2 changes: 1 addition & 1 deletion _data/mainNavigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
#- name: Diagrams Gallery
# kind: diagrams
# link: /diagrams/gallery.html
- name: Standard Libs Overview
- name: StdLibs Overview
kind: stdlibs
link: /stdlibs/index.html
11 changes: 5 additions & 6 deletions _layouts/diagram.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ <h3>Diagram Code</h3>

This diagram was created from the following PlantUML code:

<pre>
<code class="language-puml">
{% include_relative input/{{ page.name }}.puml %}
</code>
</pre>
{% capture my_code %}{% include_relative input/{{ page.name }}.puml %}{% endcapture %}
{% highlight plantuml %}
{{ my_code | strip }}
{% endhighlight %}

<h3>Available Themes</h3>

Expand All @@ -39,4 +38,4 @@ <h4 id="{{ skin.name }}">{{ page.display_name }} shown in {{ skin.display_name }

{% include figure.html theme=skin diagram=page url=url %}

{% endfor %}
{% endfor %}
4 changes: 2 additions & 2 deletions _layouts/stdlib.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ <h2>{{ page.display_name }}</h2>

{{ content }}

<h3>Sdtlib Diagram Code</h3>
<h3>Standard Library Diagram Code</h3>

This diagram was created from the following PlantUML code:

{% capture my_code %}{% include_relative input/{{ page.name }}.puml %}{% endcapture %}
{% highlight plantuml %}
{{ my_code | strip }}
{{ my_code | strip }}
{% endhighlight %}

<h3>Available Themes</h3>
Expand Down
72 changes: 54 additions & 18 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,55 @@
layout: default
---
## Welcome to the PlantUML Themes Gallery
{: .no_toc}

🚧 _Under construction with first public release the 2021-10-31 (using PlantUML, smetana, SVG,...)_ 🚧
🚧 _Under construction with first public release the 2021-10-31 (using PlantUML, smetana, SVG, ...)_ 🚧

Don't hesitate to post questions/remarks on the [discussion page](https://github.com/The-Lum/puml-themes-gallery/discussions).

---

Context:

- Layout: smetana
- Output image format: SVG
- PlantUML version: {% include_relative lib/plantuml-tag.md %}
- **Layout:** smetana
- **Output image format:** SVG
{% include_relative lib/plantuml-versions.md %}

**Direct Access to Specific Pages:**

* TOC seed list
{:toc}

### Overview Pages
{: .no_toc}

View all the themes

* [Themes Overview](themes/index.html)
* [View all themes in an image gallery](themes/gallery.html)
* [View all themes in a table](themes/table.html)
* [View all themes in a big list _(classic approach)_](themes/list.html)
* [Themes Overview]({% link pages/themes/index.md %})
* [View all themes in an image gallery]({% link pages/themes/gallery.md %})
* [View all themes in a table]({% link pages/themes/table.md %})
* [View all themes in a big list _(classic approach)_]({% link pages/themes/list.md %})

View all the diagrams
View all the skins

* [Diagrams Overview](diagrams/index.html)
* [View all diagrams in an image gallery](diagrams/gallery.html)
* [View all diagrams in a table](diagrams/table.html)
* [View all diagrams in a big list _(classic approach)_](diagrams/list.html)
* [Skins Overview]({% link pages/skins/index.md %})
* [View all skins in an image gallery]({% link pages/skins/gallery.md %})
* [View all skins in a table]({% link pages/skins/table.md %})
* [View all skins in a big list _(classic approach)_]({% link pages/skins/list.md %})

View all the skins
View all the diagrams

* [Diagrams Overview]({% link pages/diagrams/index.md %})
* [View all diagrams in an image gallery]({% link pages/diagrams/gallery.md %})
* [View all diagrams in a table]({% link pages/diagrams/table.md %})
* [View all diagrams in a big list _(classic approach)_]({% link pages/diagrams/list.md %})

View all the standard libraries

* [Skins Overview](skins/index.html)
* [View all skins in an image gallery](skins/gallery.html)
* [View all skins in a table](skins/table.html)
* [View all skins in a big list _(classic approach)_](skins/list.html)
* [Standard Libraries Overview]({% link pages/stdlibs/index.md %})
* [View all standard libraries in an image gallery]({% link pages/stdlibs/gallery.md %})
* [View all standard libraries in a table]({% link pages/stdlibs/table.md %})
* [View all standard libraries in a big list _(classic approach)_]({% link pages/stdlibs/list.md %})

### Theme-Specific Pages

Expand All @@ -49,6 +63,17 @@ Or jump directly to any of the pages dedicated to each theme.

{% endfor %}

### Skin-Specific Pages

Or jump directly to any of the pages dedicated to each skin.

{% for skin in site.skins %}

* Go to [{{ skin.display_name }}]({{ skin.url | relative_url }}) page
{{ skin.excerpt }}

{% endfor %}

### Diagram-Specific Pages

Or jump directly to any of the pages dedicated to each diagram.
Expand All @@ -59,3 +84,14 @@ Or jump directly to any of the pages dedicated to each diagram.
{{ diagram.excerpt }}

{% endfor %}

### Standard Library-Specific Pages

Or jump directly to any of the pages dedicated to each standard library.

{% for stdlib in site.stdlibs %}

* Go to [{{ stdlib.display_name }}]({{ stdlib.url | relative_url }}) page
{{ stdlib.excerpt }}

{% endfor %}
1 change: 0 additions & 1 deletion lib/plantuml-tag.md

This file was deleted.

1 change: 1 addition & 0 deletions lib/plantuml-versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- **PlantUML version:** 1.2024.8beta7 (Unknown compile time)
4 changes: 2 additions & 2 deletions pages/stdlibs/gallery.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
permalink: /stdlibs/gallery.html
---
## Stdlibs Gallery
## Standard Libraries Gallery
{: .no_toc}

{% include secondaryNavigation.html %}

**Stdlibs on this Page:**
**Standard Libraries on this Page:**

* TOC seed list
{:toc}
Expand Down
4 changes: 2 additions & 2 deletions pages/stdlibs/index.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
permalink: /stdlibs/index.html
---
## Stdlibs Overview
## Standard Libraries Overview
{: .no_toc}

{% include secondaryNavigation.html %}

**Stdlibs on this Page:**
**Standard Libraries on this Page:**

* TOC seed list
{:toc}
Expand Down
4 changes: 2 additions & 2 deletions pages/stdlibs/list.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
permalink: /stdlibs/list.html
---
## List of all the stdlibs
## List of all the Standard Libraries
{: .no_toc}

{% include secondaryNavigation.html %}

**Stdlibs on this Page:**
**Standard Libraries on this Page:**

* TOC seed list
{:toc}
Expand Down
2 changes: 1 addition & 1 deletion pages/stdlibs/table.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
permalink: /stdlibs/table.html
---
## Stdlibs Table View
## Standard Libraries Table View

{% include secondaryNavigation.html %}

Expand Down
12 changes: 10 additions & 2 deletions script/github-pages.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

strContains() { case $1 in *$2* ) return 0;; *) return 1;; esac ;}

build() {
JEKYLL_ENV=production bundle exec jekyll build
}
Expand All @@ -10,6 +8,16 @@ serve() {
bundle exec jekyll serve --livereload --incremental --baseurl=""
}

test() {
PAGES_REPO_NWO=The-Lum/puml-themes-gallery JEKYLL_ENV=production bundle exec jekyll build --baseurl="/fizzbuzz"

echo "Found bad links:"
grep -r --exclude='*.svg' 'href=' _site | grep -v -e 'href="http' -e 'href="/fizzbuzz' -e 'markdown-toc' > findings.txt

echo "Found bad image sources:"
grep -r --exclude='*.svg' 'src=' _site | grep -v -e 'src="/fizzbuzz' -e 'src="//html5'
}

clean() {
bundle exec jekyll clean
}
Expand Down
7 changes: 2 additions & 5 deletions script/update_lib.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#!/bin/bash

mkdir -p lib
#rm lib/plantuml.jar
#curl -L https://sourceforge.net/projects/plantuml/files/plantuml.jar/download -o lib/plantuml.jar

tag=$(curl -s https://api.github.com/repos/plantuml/plantuml/releases/latest | jq -r '.tag_name')
echo -n $tag > lib/plantuml-tag.md
curl "https://github.com/plantuml/plantuml/releases/download/${tag}/plantuml-${tag#v}.jar" -L -o lib/plantuml.jar

#java -jar lib/plantuml.jar -version > lib/README.md
java -jar lib/plantuml.jar -version | grep -e 'PlantUML version' -e 'Dot version:' | sed -E 's/([^:]+)version:?(.+)/- **\1version:**\2/' > lib/plantuml-versions.md
echo "::notice title=PlantUML version:: $(head -n 1 lib/plantuml-versions.md)"
5 changes: 3 additions & 2 deletions script/update_lib_with_snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

mkdir -p lib
curl "https://github.com/plantuml/plantuml/releases/download/snapshot/plantuml-SNAPSHOT.jar" -L -o lib/plantuml.jar
java -jar lib/plantuml.jar -version | head -1 > lib/plantuml-tag.md
echo "::notice title=PlantUML version:: $(cat lib/plantuml-tag.md)"

java -jar lib/plantuml.jar -version | grep -e 'PlantUML version' -e 'Dot version:' | sed -E 's/([^:]+)version:?(.+)/- **\1version:**\2/' > lib/plantuml-versions.md
echo "::notice title=PlantUML version:: $(head -n 1 lib/plantuml-versions.md)"

0 comments on commit 4e01ae1

Please sign in to comment.