From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4927F138335 for ; Thu, 19 Dec 2019 21:02:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E688CE0943; Thu, 19 Dec 2019 21:02:47 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CDE2DE091F for ; Thu, 19 Dec 2019 21:02:47 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A2A8B34DA39 for ; Thu, 19 Dec 2019 21:02:46 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 290D8901 for ; Thu, 19 Dec 2019 21:02:44 +0000 (UTC) From: "Göktürk Yüksek" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Göktürk Yüksek" Message-ID: <1576788780.e01e6ccbdecf369c6f6c0d9da800ebea2e264f96.gokturk@gentoo> Subject: [gentoo-commits] proj/devmanual:master commit in: / X-VCS-Repository: proj/devmanual X-VCS-Files: Makefile search_index.py X-VCS-Directories: / X-VCS-Committer: gokturk X-VCS-Committer-Name: Göktürk Yüksek X-VCS-Revision: e01e6ccbdecf369c6f6c0d9da800ebea2e264f96 X-VCS-Branch: master Date: Thu, 19 Dec 2019 21:02:44 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b19665a3-d02b-4f32-9fcf-7d46253cc499 X-Archives-Hash: 7a6dfd5f322f9eb5e0c6ebe2b3e7afd8 commit: e01e6ccbdecf369c6f6c0d9da800ebea2e264f96 Author: Alice Ferrazzi gentoo org> AuthorDate: Fri Nov 15 12:29:29 2019 +0000 Commit: Göktürk Yüksek gentoo org> CommitDate: Thu Dec 19 20:53:00 2019 +0000 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=e01e6ccb Fix make all URL relative to root directory Signed-off-by: Alice Ferrazzi gentoo.org> Signed-off-by: Göktürk Yüksek gentoo.org> Makefile | 3 +-- search_index.py | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4a52cc0..343234b 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,7 @@ prereq: exit 1; } index: - @echo -n "var documents = " > documents.js - @./search_index.py text.xml >> documents.js + @./search_index.py text.xml > documents.js %.png : %.svg convert $< $@ diff --git a/search_index.py b/search_index.py index 2ab79f1..3226775 100755 --- a/search_index.py +++ b/search_index.py @@ -8,7 +8,9 @@ import xml.etree.ElementTree as ET xmlFile = sys.argv[1] documents = [] +url_root = 'https://devmanual.gentoo.org/' +print('var documents = ', end = '') for path, dirs, files in os.walk('.'): if xmlFile in files: tree = ET.parse(path + '/' + xmlFile) @@ -17,7 +19,7 @@ for path, dirs, files in os.walk('.'): try: documents.append({"name": chapter.find('title').text, "text": chapter.find('body').find('p').text, - "url": path }) + "url": url_root + path[+2:] }) except: pass if '.git' in dirs: