summaryrefslogtreecommitdiffstats
path: root/plugins/generate-list.sh
blob: c77cab0a119498d05dcd747678eec078f8eb33e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
# SPDX-FileCopyrightText: 2020 Sébastien Wilmet <swilmet@gnome.org>
# SPDX-License-Identifier: GPL-3.0-or-later

# This script generates a Markdown file with the names and descriptions of all
# official gedit plugins.

write_list_for_plugins_dir() {
	plugins_dir=$1

	for plugin_desktop_file in `find "$plugins_dir" -name '*.plugin.desktop*'`
	do
		name=`grep -P '^Name=' "$plugin_desktop_file" | cut -d'=' -f2`
		echo -n "- **$name** - "

		desc=`grep -P '^Description=' "$plugin_desktop_file" | cut -d'=' -f2`
		echo "*$desc*"
	done | sort
}

write_content() {
	echo 'gedit plugins'
	echo '============='
	echo
	echo 'Core plugins'
	echo '------------'
	echo
	echo 'Plugins that are distributed with gedit itself.'
	echo

	write_list_for_plugins_dir '.'

	echo
	echo 'gedit-plugins package'
	echo '---------------------'
	echo
	echo 'The gedit-plugins package contains useful plugins that are (most'
	echo 'of the time) too specific to be distributed with gedit itself.'
	echo

	write_list_for_plugins_dir '../../gedit-plugins/plugins'
}

write_content > list-of-gedit-plugins.md