- Apr 29, 2021
-
-
Arnaud Ferraris authored
This commit enables the generation and display of the ToC on all pages where it's relevant due to the content size. More pages could have been included but left aside due to inconsistent use of heading levels leading to rendering/visual glitches. The pages' content has not been modified, except for the "Terms of use" page which included a manually-generated ToC. Signed-off-by:
Arnaud Ferraris <arnaud.ferraris@collabora.com>
-
- Jul 29, 2020
-
-
After moving the documents from designs.a.o to www.a.o, there were quite a few links from the designs.a.o docs pointing to wiki.a.o and quite a few links from www.a.o pointing to designs.a.o. Replace these links with Hugo ref shortcodes to avoid hammering the redirects. This was achieved with the following script: ``` import os import re import sys import toml from urllib.parse import urlparse def get_aliases(filename): #print("%s: " % filename) with open(filename, 'r') as file: contents = file.read() if not contents[0:3] == "+++": return if "_index.md" in filename: filename = filename.strip(".") else: filename = filename.split("/")[-1] data = toml.loads(contents.split("+++")[1]) if not "aliases" in data.keys(): return for alias in data["aliases"]: if "/old-wiki/" in alias: wiki_aliases[alias.replace("/old-wiki/", "/")] = filename if "/old-designs/" in alias: # We're dropping the per-release links from designs.a.o, so match on shorter path design_aliases[alias.replace("/old-designs/latest/", "/")] = filename def fix_link(url): link = url.group('link') url = urlparse(link) if url.netloc == "wiki.apertis.org": if url.path in wiki_aliases.keys(): url = url._replace(scheme="") url = url._replace(netloc="") url = url._replace(path=wiki_aliases[url.path]) link = " {{< ref \"%s\" >}} " % url.geturl() if url.netloc == "designs.apertis.org": # We're dropping the per-release links from designs.a.o, so match on shorter path path = "/%s" % url.path.split('/', 2)[-1] print(path) if path in design_aliases.keys(): url = url._replace(scheme="") url = url._replace(netloc="") url = url._replace(path=design_aliases[path]) link = " {{< ref \"%s\" >}} " % url.geturl() return "](%s)" % link def fix_ref(url): link = url.group('link') url = urlparse(link) if url.netloc == "wiki.apertis.org": if url.path in wiki_aliases.keys(): url = url._replace(scheme="") url = url._replace(netloc="") url = url._replace(path=wiki_aliases[url.path]) link = " {{< ref \"%s\" >}} " % url.geturl() if url.netloc == "designs.apertis.org": # We're dropping the per-release links from designs.a.o, so match on shorter path path = "/%s" % url.path.split('/', 2)[-1] print(path) if path in design_aliases.keys(): url = url._replace(scheme="") url = url._replace(netloc="") url = url._replace(path=design_aliases[path]) link = " {{< ref \"%s\" >}} " % url.geturl() return "]: %s" % link def correct_links(filename): #print("%s: " % filename) with open(filename, 'r+') as file: contents = file.read() if not contents[0:3] == "+++": return fm = contents.split("+++")[1] doc = contents.split("+++",2)[2] # Hotdoc allows empty links like `[](url)` pattern = re.compile("\]\((?P<link>.*?)\)") doc = pattern.sub(fix_link, doc) pattern = re.compile("\]: (?P<link>.*)") doc = pattern.sub(fix_ref, doc) file.seek(0) file.truncate() file.write("+++") file.write(fm) file.write("+++") file.write(doc) wiki_aliases = {} design_aliases = {} for root, dirs, files in os.walk(sys.argv[1]): for file in files: if ".md" in file: get_aliases("%s/%s" %(root, file)) print("wiki_aliases:") print(wiki_aliases) print("design_aliases:") print(design_aliases) for root, dirs, files in os.walk(sys.argv[1]): for file in files: if ".md" in file: correct_links("%s/%s" %(root, file)) ``` Signed-off-by:
Martyn Welch <martyn.welch@collabora.com>
-
- Jul 24, 2020
-
-
More of the guides still seem relevant and good information. Tweak the formatting and move these to guides. Signed-off-by:
Martyn Welch <martyn.welch@collabora.com>
-
- Jul 13, 2020
-
-
These documents can be moved to guides more or less as they are. Signed-off-by:
Martyn Welch <martyn.welch@collabora.com>
-
- Mar 30, 2020
-
-
Martyn Welch authored
Many of the document titles contain directory names and/or are missing spacing between words. This has a number of effects: - It gives users a bad impression of the quality of the information on the website - It makes it harder for external search engines to catalog the contents of the website in a meaningful way - Reduces the effectiveness of any local searching that we implement Do an initial quick pass on the titles to make them more legible. Signed-off-by:
Martyn Welch <martyn.welch@collabora.com>
-
- Feb 12, 2020
-
-
Martyn Welch authored
The contribution process on designs.apertis.org currently has a section on API review. This process doesn't fit with the focus of that document (namely upstream contributions), so move it to the API documentation. Signed-off-by:
Martyn Welch <martyn.welch@collabora.com>
-
- Jan 16, 2020
-
-
Martyn Welch authored
So as to transition relatively seemlessly to the new site, we can use the Hugo Alias functionality to put a number of HTML redirects in place to translate between `/old-wiki/<original_link>` and the new page location. We are hoping to combine this with URL rewriting on wiki.apertis.org to redirect requests for pages formerly served there into the redirect structure. Signed-off-by:
Martyn Welch <martyn.welch@collabora.com>
-
- Jan 15, 2020
-
-
Martyn Welch authored
The "fragment" key is a key specific to the syna theme that we aren't likely to be using. Remove it from the markdown. Signed-off-by:
Martyn Welch <martyn.welch@collabora.com>
-
- Jan 14, 2020
-
-
Martyn Welch authored
The conversion script has been improved to handle links better. This commit updates the content to the latest conversion. Signed-off-by:
Martyn Welch <martyn.welch@collabora.com>
-
Martyn Welch authored
Add latest scripted conversion of wiki pages and move to simple Hugo theme. Signed-off-by:
Martyn Welch <martyn.welch@collabora.com>
-
- Nov 22, 2019
-
-
Martyn Welch authored
Signed-off-by:
Martyn Welch <martyn.welch@collabora.com>
-