Skip to content

Commit

Permalink
Merge pull request #260 from nfdi4plants/image-index
Browse files Browse the repository at this point in the history
Image index
  • Loading branch information
Brilator authored Sep 26, 2023
2 parents 7980404 + 9cf33aa commit 221d1bd
Show file tree
Hide file tree
Showing 5 changed files with 574 additions and 90 deletions.
43 changes: 43 additions & 0 deletions src/docs/img/_ImageIndex-crawler.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Image Index crawler
layout: none
date: 2023-09-26
author:
- name: Dominik Brilhaus
github: https://github.com/brilator
orcid: https://orcid.org/0000-0001-9021-3197
---

Note, this is just a quick and dirty crawler to list all images and add them to the _ImageIndex.md

# Crawl images and add to _imageIndex.md

```bash
cd src/docs/img
```

```bash

find . -type f > .tmp_all-files
grep -v '.pptx' .tmp_all-files > .tmp_all-images-only
sed 's|^./|/docs/img/|g' .tmp_all-images-only > .tmp_all-images-absolute

rm -f _test.md

while IFS= read -r img;
do
if [ $(grep -c "$img" _ImageIndex.md) -eq 0 ]
then

echo '<a href="'$img'" target="_blank"><img src="'$img'" width="50px" alt="'$img'"/></a> | <a href="'$img'" target="_blank">https://nfdi4plants.org/nfdi4plants.knowledgebase'$img'</a> | | ' >> _ImageIndex.md
fi
done < .tmp_all-images-absolute

rm .tmp_all-*


grep -v "_ImageIndex" _ImageIndex.md > tmpfile && mv tmpfile _ImageIndex.md
grep -v ".DS_Store" _ImageIndex.md > tmpfile && mv tmpfile _ImageIndex.md


```
Loading

0 comments on commit 221d1bd

Please sign in to comment.