Skip to content
Snippets Groups Projects
  1. Feb 02, 2021
  2. Jan 30, 2021
  3. Jan 24, 2021
  4. Jan 23, 2021
  5. Jan 22, 2021
  6. Dec 17, 2020
  7. Dec 02, 2020
  8. Oct 22, 2020
    • Martyn Welch's avatar
      Split out persistent workspace into separate guide, remove design · bdeb597b
      Martyn Welch authored and Emanuele Aina's avatar Emanuele Aina committed
      
      The persistent workspace documentation is currently in the SDK usage document.
      The usage document covers some very basic usage, whilst the persistent
      workspace is a little bit more of an advanced topic. Split it out into its own
      document and move both to guides.
      
      Additionally the design document is still present for the persistent workspace
      feature. This is now redundant since the design has been implemented. Move the
      limited amount of pertanent information from the design document to the guide
      and remove the design document to avoid confusion.
      
      Signed-off-by: default avatarMartyn Welch <martyn.welch@collabora.com>
      bdeb597b
  9. Oct 13, 2020
  10. Oct 12, 2020
  11. Sep 23, 2020
  12. Sep 22, 2020
  13. Sep 03, 2020
    • Martyn Welch's avatar
      Update and classify a batch of design documents · 786fb549
      Martyn Welch authored and Emanuele Aina's avatar Emanuele Aina committed
      
      The design documents imported from designs.apertis.org need to be
      classified and moved into the structure implemented for documents on the
      new website. The content of the documents also need minor edits to ensure
      a good look and feel as well as the addition of notes to explain the
      context of some documents (such as noting that certain concept documents
      have been implemented since they were written and when that occurred).
      
      This commit contains conversion of an initial batch of design documents.
      
      Signed-off-by: default avatarMartyn Welch <martyn.welch@collabora.com>
      786fb549
    • Martyn Welch's avatar
      Fix creation dates · a98cb03f
      Martyn Welch authored and Emanuele Aina's avatar Emanuele Aina committed
      
      Got out of step whilst adding creation dates to designs and failed to test
      properly. A stray space is stopping the dates from being parsed. Remove
      the space.
      
      Signed-off-by: default avatarMartyn Welch <martyn.welch@collabora.com>
      a98cb03f
  14. Aug 27, 2020
  15. Aug 26, 2020
  16. Aug 06, 2020
  17. Aug 05, 2020
  18. Jul 29, 2020
    • Martyn Welch's avatar
      Fix up broken links · c7250de9
      Martyn Welch authored and Emanuele Aina's avatar Emanuele Aina committed
      
      A number of broken links didn't match the patterns used for automated
      replacement. Fix up those that can be manually.
      
      Signed-off-by: default avatarMartyn Welch <martyn.welch@collabora.com>
      c7250de9
    • Martyn Welch's avatar
      Updating old links · ee26b8cf
      Martyn Welch authored and Emanuele Aina's avatar Emanuele Aina committed
      
      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: default avatarMartyn Welch <martyn.welch@collabora.com>
      ee26b8cf
    • Martyn Welch's avatar
      Minor tidy up of designs · e26083c0
      Martyn Welch authored and Emanuele Aina's avatar Emanuele Aina committed
      
      A number of broken links remained after scripted conversion and a
      number of spurious code blocks were found in the docs. Clean these up
      so that the documents render correctly.
      
      Signed-off-by: default avatarMartyn Welch <martyn.welch@collabora.com>
      e26083c0
    • Martyn Welch's avatar
      Fix links in imported designs · af5a2a88
      Martyn Welch authored and Emanuele Aina's avatar Emanuele Aina committed
      
      A lot of the links in the imported designs are broken:
      
      - HotDoc allowed a `[][link]` format that Hugo doesn't understand
      - HotDoc allowed relative links without text, which Hugo doesn't handle
      - The location of the images and other media has changed
      - The format used for internal page references has is different
      
      Additionally, fix up touched links to other Apertis pages to use the
      Hugo "ref" shortcode, which reduces the risk of leaving hanging links.
      
      Conversion completed with the following python script:
      
      ```
      
      import os
      import re
      import sys
      
      def url_munge(match):
          url = match.group('url').strip('.')
          if url[0] != "/":
              url = "/%s" % url
          url = url.replace("media", "images")
          link = ("![](%s)" % url)
      
          return link
      
      def link_munge(match):
          link = match.group('link')
          new = link.replace("(", "")
          new = new.replace(")", "")
          new = new.replace("`", "")
          new = new.replace("?", "")
          new = new.replace(":", "")
          new = new.replace(",", "")
          new = new.replace("–", "")
          new = new.replace("“", "")
          new = new.replace("”", "")
          new = new.replace(".", "")
          new = new.replace(" ", "-")
          new = new.lower()
          new = (" [%s]( {{< ref \"#%s\" >}} )" % (link, new))
      
          return new
      
      def link_munge_2(match):
          link = match.group('link')
          new = link.replace("#", "")
          new = new.replace("-", " ")
          new = new.replace(".md", "")
          if not "http" in link:
              link = " {{< ref \"%s\" >}} " % link
      
          new = ("[%s](%s)" % (new, link))
      
          return new
      
      for filename in os.listdir(sys.argv[1]):
          #print("%s: " % filename)
          with open(filename, 'r+') as file:
              contents = file.read()
      
              # Hotdoc uses `[][Internal Title]` for internal links whilst Hugo uses `[](#internal-title)`
              pattern = re.compile("\[\]\[(?P<link>.*?)\]")
              contents = pattern.sub(link_munge, contents)
      
              # Hotdoc allows empty links like `[](url)`
              pattern = re.compile("[^!]\[\]\((?P<link>.*?)\)")
              contents = pattern.sub(link_munge_2, contents)
      
              # Media links not working
              pattern = re.compile("!\[\]\((?P<url>.*?)\)")
              contents = pattern.sub(url_munge, contents)
      
              file.seek(0)
              file.truncate()
      
              file.write(contents)
      
      ```
      
      Signed-off-by: default avatarMartyn Welch <martyn.welch@collabora.com>
      af5a2a88
    • Martyn Welch's avatar
      Unbreak page because of spurious code block deliminator · 35d4de00
      Martyn Welch authored and Emanuele Aina's avatar Emanuele Aina committed
      
      Signed-off-by: default avatarMartyn Welch <martyn.welch@collabora.com>
      35d4de00
Loading