Skip to content

Commit 458b62c

Browse files
authored
Merge branch 'main' into tintou/use_submodule
2 parents 2bc767a + 8c35013 commit 458b62c

File tree

15 files changed

+90
-67
lines changed

15 files changed

+90
-67
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
submodules: true
2323

2424
- name: Use Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@v3
25+
uses: actions/setup-node@v4
2626
with:
2727
node-version: ${{ matrix.node-version }}
2828

.github/workflows/publish.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ jobs:
2222
run: |
2323
export DEBIAN_FRONTEND=noninteractive
2424
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
25-
sudo apt-get update -y
26-
sudo apt-get install -y --no-install-recommends software-properties-common
25+
sudo apt-get update -qq
26+
sudo apt-get install -qq --no-install-recommends software-properties-common
2727
sudo add-apt-repository -y ppa:vala-team/daily
28-
sudo apt-get update -y
28+
sudo apt-get update -qq
29+
curl -O https://repo.manticoresearch.com/manticore-repo.noarch.deb
30+
sudo dpkg -i manticore-repo.noarch.deb
31+
sudo apt-get update -qq
2932
sudo apt-get install \
30-
-y \
33+
-qq \
3134
--no-install-recommends \
3235
gcc \
3336
libgee-0.8-dev \
@@ -36,14 +39,15 @@ jobs:
3639
libvaladoc-0.58-dev \
3740
php \
3841
php-curl \
39-
sphinxsearch \
4042
unzip \
4143
valac \
4244
valadoc \
4345
wget \
4446
xsltproc \
4547
make \
46-
nodejs
48+
nodejs \
49+
manticore \
50+
manticore-extra
4751
4852
- name: Build the documentation
4953
run: |

Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@
22
## Builds valadoc and serves it with a basic PHP server
33

44
# Cleanup and publish
5-
FROM php:apache-buster
5+
FROM php:apache-bookworm
66

77
ENV DEBIAN_FRONTEND=noninteractive
88

99
# Install sphinxsearch for search index
1010
RUN apt-get update -qq && apt-get install \
1111
-qq \
1212
--no-install-recommends \
13-
sphinxsearch
13+
wget
14+
RUN wget https://repo.manticoresearch.com/manticore-repo.noarch.deb
15+
RUN dpkg -i manticore-repo.noarch.deb
16+
RUN apt-get update -qq && apt-get install \
17+
-qq \
18+
--no-install-recommends \
19+
manticore manticore-extra
20+
RUN mkdir -p /var/run/manticore
1421

1522
# Install the mysqli extension
1623
RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,19 @@ to install the devhelp books in your system. Now launch Devhelp and use them!
7272
Searching
7373
=========
7474

75-
For a more complete experience, you will need to install `sphinxsearch` and `xsltproc`.
75+
For a more complete experience, you will need to install [manticore](https://manticoresearch.com/install/) and `xsltproc`.
7676

7777
On elementary OS or Ubuntu run:
7878
```bash
79-
sudo apt install sphinxsearch xsltproc
79+
sudo apt install xsltproc
8080
```
8181

8282
The run the following command to generate search indexes:
8383
```bash
8484
make serve-search
8585
```
8686

87-
This will (eventually!) start a sphinx daemon on port `51413`.
87+
This will (eventually!) start a manticore daemon on port `51413`.
8888

8989

9090
Add New Packages

data/index.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ function get_title ($page) {
6161
<meta property="og:type" content="website">
6262
<title><?php echo get_title ($page); ?></title>
6363
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400%7CDroid+Serif:400%7CRoboto+Mono:400,500,700,400italic">
64-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
6564
<link rel="stylesheet" href="/styles/main.css" type="text/css">
6665
<link rel="apple-touch-icon" href="/images/icon.png">
6766
<link rel="shortcut icon" href="/images/favicon.ico">
@@ -79,9 +78,13 @@ function get_title ($page) {
7978
</form>
8079
<a class="title" href="/index.htm"><img alt="Valadoc" src="/images/logo.svg"/></a>
8180
<ul>
82-
<li><a href="https://vala.dev/" target="_blank" title="Vala Official Website"><i class="fa fa-home"></i></a>
83-
<li><a href="https://www.reddit.com/r/vala/" target="_blank" title="reddit"><i class="fa fa-reddit"></i></a>
84-
<li><a href="/markup.htm" title="Markup Info"><i class="fa fa-info-circle"></i></a>
81+
<li><a href="https://vala.dev/" target="_blank" title="Vala Official Website"><svg xmlns="http://www.w3.org/2000/svg" width="1.27em" height="1em" viewBox="0 0 1664 1312"><path fill="currentColor" d="M1408 768v480q0 26-19 45t-45 19H960V928H704v384H320q-26 0-45-19t-19-45V768q0-1 .5-3t.5-3l575-474l575 474q1 2 1 6m223-69l-62 74q-8 9-21 11h-3q-13 0-21-7L832 200L140 777q-12 8-24 7q-13-2-21-11l-62-74q-8-10-7-23.5T37 654L756 55q32-26 76-26t76 26l244 204V64q0-14 9-23t23-9h192q14 0 23 9t9 23v408l219 182q10 8 11 21.5t-7 23.5"/></svg></a>
82+
<li><a href="https://discourse.gnome.org/tag/vala" target="_blank" title="Discourse (Forums)"><svg xmlns="http://www.w3.org/2000/svg" width="0.88em" height="1em" viewBox="0 0 448 512"><path fill="currentColor" d="M225.9 32C103.3 32 0 130.5 0 252.1C0 256 .1 480 .1 480l225.8-.2c122.7 0 222.1-102.3 222.1-223.9C448 134.3 348.6 32 225.9 32M224 384c-19.4 0-37.9-4.3-54.4-12.1L88.5 392l22.9-75c-9.8-18.1-15.4-38.9-15.4-61c0-70.7 57.3-128 128-128s128 57.3 128 128s-57.3 128-128 128"/></svg></a>
83+
<li><a href="https://matrix.to/#/#vala:gnome.org" target="_blank" title="Matrix"><svg xmlns="http://www.w3.org/2000/svg" width="1.13em" height="1em" viewBox="0 0 1728 1536"><path fill="currentColor" d="m959 896l64-256H769l-64 256zm768-504l-56 224q-7 24-31 24h-327l-64 256h311q15 0 25 12q10 14 6 28l-56 224q-5 24-31 24h-327l-81 328q-7 24-31 24H841q-16 0-26-12q-9-12-6-28l78-312H633l-81 328q-7 24-31 24H296q-15 0-25-12q-9-12-6-28l78-312H32q-15 0-25-12q-9-12-6-28l56-224q7-24 31-24h327l64-256H168q-15 0-25-12q-10-14-6-28l56-224q5-24 31-24h327l81-328q7-24 32-24h224q15 0 25 12q9 12 6 28l-78 312h254l81-328q7-24 32-24h224q15 0 25 12q9 12 6 28l-78 312h311q15 0 25 12q9 12 6 28"/></svg></a>
84+
<li><a href="https://discord.gg/YFAzjSVHt7" target="_blank" title="Discord"><svg xmlns="http://www.w3.org/2000/svg" width="1.25em" height="1em" viewBox="0 0 640 512"><path fill="currentColor" d="M524.531 69.836a1.5 1.5 0 0 0-.764-.7A485.065 485.065 0 0 0 404.081 32.03a1.816 1.816 0 0 0-1.923.91a337.461 337.461 0 0 0-14.9 30.6a447.848 447.848 0 0 0-134.426 0a309.541 309.541 0 0 0-15.135-30.6a1.89 1.89 0 0 0-1.924-.91a483.689 483.689 0 0 0-119.688 37.107a1.712 1.712 0 0 0-.788.676C39.068 183.651 18.186 294.69 28.43 404.354a2.016 2.016 0 0 0 .765 1.375a487.666 487.666 0 0 0 146.825 74.189a1.9 1.9 0 0 0 2.063-.676A348.2 348.2 0 0 0 208.12 430.4a1.86 1.86 0 0 0-1.019-2.588a321.173 321.173 0 0 1-45.868-21.853a1.885 1.885 0 0 1-.185-3.126a251.047 251.047 0 0 0 9.109-7.137a1.819 1.819 0 0 1 1.9-.256c96.229 43.917 200.41 43.917 295.5 0a1.812 1.812 0 0 1 1.924.233a234.533 234.533 0 0 0 9.132 7.16a1.884 1.884 0 0 1-.162 3.126a301.407 301.407 0 0 1-45.89 21.83a1.875 1.875 0 0 0-1 2.611a391.055 391.055 0 0 0 30.014 48.815a1.864 1.864 0 0 0 2.063.7A486.048 486.048 0 0 0 610.7 405.729a1.882 1.882 0 0 0 .765-1.352c12.264-126.783-20.532-236.912-86.934-334.541M222.491 337.58c-28.972 0-52.844-26.587-52.844-59.239s23.409-59.241 52.844-59.241c29.665 0 53.306 26.82 52.843 59.239c0 32.654-23.41 59.241-52.843 59.241m195.38 0c-28.971 0-52.843-26.587-52.843-59.239s23.409-59.241 52.843-59.241c29.667 0 53.307 26.82 52.844 59.239c0 32.654-23.177 59.241-52.844 59.241"/></svg></a>
85+
<li><a href="https://mastodon.social/@vala_lang" target="_blank" title="Mastodon"><svg xmlns="http://www.w3.org/2000/svg" width="0.88em" height="1em" viewBox="0 0 448 512"><path fill="currentColor" d="M433 179.11c0-97.2-63.71-125.7-63.71-125.7c-62.52-28.7-228.56-28.4-290.48 0c0 0-63.72 28.5-63.72 125.7c0 115.7-6.6 259.4 105.63 289.1c40.51 10.7 75.32 13 103.33 11.4c50.81-2.8 79.32-18.1 79.32-18.1l-1.7-36.9s-36.31 11.4-77.12 10.1c-40.41-1.4-83-4.4-89.63-54a102.54 102.54 0 0 1-.9-13.9c85.63 20.9 158.65 9.1 178.75 6.7c56.12-6.7 105-41.3 111.23-72.9c9.8-49.8 9-121.5 9-121.5m-75.12 125.2h-46.63v-114.2c0-49.7-64-51.6-64 6.9v62.5h-46.33V197c0-58.5-64-56.6-64-6.9v114.2H90.19c0-122.1-5.2-147.9 18.41-175c25.9-28.9 79.82-30.8 103.83 6.1l11.6 19.5l11.6-19.5c24.11-37.1 78.12-34.8 103.83-6.1c23.71 27.3 18.4 53 18.4 175z"/></svg></a>
86+
<li><a href="https://www.reddit.com/r/vala/" target="_blank" title="Reddit"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 1792 1792"><path fill="currentColor" d="M1095 1167q16 16 0 31q-62 62-199 62t-199-62q-16-15 0-31q6-6 15-6t15 6q48 49 169 49q120 0 169-49q6-6 15-6t15 6M788 986q0 37-26 63t-63 26t-63.5-26t-26.5-63q0-38 26.5-64t63.5-26t63 26.5t26 63.5m395 0q0 37-26.5 63t-63.5 26t-63-26t-26-63t26-63.5t63-26.5t63.5 26t26.5 64m251-120q0-49-35-84t-85-35t-86 36q-130-90-311-96l63-283l200 45q0 37 26 63t63 26t63.5-26.5T1359 448t-26.5-63.5T1269 358q-54 0-80 50l-221-49q-19-5-25 16l-69 312q-180 7-309 97q-35-37-87-37q-50 0-85 35t-35 84q0 35 18.5 64t49.5 44q-6 27-6 56q0 142 140 243t337 101q198 0 338-101t140-243q0-32-7-57q30-15 48-43.5t18-63.5m358 30q0 182-71 348t-191 286t-286 191t-348 71t-348-71t-286-191t-191-286T0 896t71-348t191-286T548 71T896 0t348 71t286 191t191 286t71 348"/></svg></a>
87+
<li><a href="/markup.htm" title="Markup Info"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 1536 1536"><path fill="currentColor" d="M1024 1248v-160q0-14-9-23t-23-9h-96V544q0-14-9-23t-23-9H544q-14 0-23 9t-9 23v160q0 14 9 23t23 9h96v320h-96q-14 0-23 9t-9 23v160q0 14 9 23t23 9h448q14 0 23-9t9-23M896 352V192q0-14-9-23t-23-9H672q-14 0-23 9t-9 23v160q0 14 9 23t23 9h192q14 0 23-9t9-23m640 416q0 209-103 385.5T1153.5 1433T768 1536t-385.5-103T103 1153.5T0 768t103-385.5T382.5 103T768 0t385.5 103T1433 382.5T1536 768"/></svg></a>
8588
</ul>
8689
</nav>
8790
<div id="sidebar">

data/scripts/valadoc.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ document.addEventListener('DOMContentLoaded', () => {
178178
// We run a search when the value changes, after a given delay
179179
html.searchField.addEventListener('keyup', evt => {
180180
// only if the pressed key isn't up/down arrow, because we use them to select next/previous search result and not to trigger search
181-
if (evt.keyCode !== 40 && evt.keyCode !== 38) {
181+
if (evt.key !== "ArrowUp" && evt.key !== "ArrowDown") {
182182
updateSearch()
183183
}
184184
})
@@ -196,22 +196,22 @@ document.addEventListener('DOMContentLoaded', () => {
196196

197197
// register some useful shortcuts
198198
document.addEventListener('keyup', evt => {
199-
switch (evt.keyCode) {
200-
case 27: // echap
199+
switch (evt.key) {
200+
case "Escape": // Esc key
201201
if (html.searchField === document.activeElement) {
202202
html.searchField.value = ''
203203
updateSearch()
204204
}
205205
break
206-
case 38: // up arrrow
206+
case "ArrowUp": // up arrrow
207207
// if we are focusing a search result, but not the first...
208208
if (html.searchFocused && html.searchFocused.previousElementSibling != null) {
209209
html.searchFocused.className = html.searchFocused.className.replace(' search-selected', '')
210210
html.searchFocused = html.searchFocused.previousElementSibling
211211
html.searchFocused.className = html.searchFocused.className + ' search-selected'
212212
}
213213
break
214-
case 40: // down arrow
214+
case "ArrowDown": // down arrow
215215
// if we are focusing a search result, but not the last...
216216
if (html.searchFocused && html.searchFocused.nextElementSibling != null) {
217217
html.searchFocused.className = html.searchFocused.className.replace(' search-selected', '')
@@ -226,12 +226,13 @@ document.addEventListener('DOMContentLoaded', () => {
226226
html.searchFocused.className = html.searchFocused.className + ' search-selected'
227227
}
228228
break
229-
case 13: // enter
229+
case "Enter": // enter
230230
if (html.searchFocused) { // if we have a search item selected, we load its page
231231
loadPage(html.searchFocused.children[0])(evt)
232232
}
233233
break
234-
case 17: // ctrl
234+
case "Control": // ctrl
235+
case "/": // the "/" key
235236
html.searchField.focus() // we focus the search
236237
break
237238
}

data/search.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ function escapestring($str) {
4141
}
4242
}
4343
$query = implode (" ", $tokens);
44+
if ( empty($query) ) {
45+
echo '<span class="search-name">No results found.</span>';
46+
exit();
47+
}
4448
if ($trimmedquery[0] == '.') {
4549
$query = ". << ".$query;
4650
}
@@ -78,6 +82,9 @@ function escapestring($str) {
7882
if (!($q = $mysqli->query($qq)))
7983
die("Query failed: (" . $mysqli->errno . ") " . $mysqli->error);
8084

85+
if ( $q->num_rows === 0 )
86+
echo '<span class="search-name">No results found.</span>';
87+
8188
while ($row = $q->fetch_assoc()) {
8289
$splitted = explode ("/", $row["path"]);
8390
$pkg = $splitted[1];

docker-server.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22

3-
cd /opt/valadoc && searchd
3+
cd /opt/valadoc && searchd -c /opt/valadoc/sphinx.conf
44
apache2-foreground

documentation/champlain-0.12/Champlain-0.12.valadoc.metadata

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

documentation/champlain-gtk-0.12/GtkChamplain-0.12.valadoc.metadata

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

0 commit comments

Comments
 (0)