MAAS_BRANCH=trunk
lxc launch ubuntu:16.04 maas
lxc exec maas -- apt update
lxc exec maas -- apt install -y bzr build-essential
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python3 | |
| """ | |
| A command-line tool for uploading assets to the assets server. | |
| The only dependency is `requests`: | |
| $ pip install requests | |
| $ wget https://gist.githubusercontent.com/nottrobin/bad4d1b8f880bbb23ed10f5457d976bc/raw/707305dbd616dc46f38d0524e2f6248415173f57/upload-assets.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| isSubset = function(subset, superset) { | |
| for (var index = 0; index < subset.length; index++) { | |
| var item = subset[index]; | |
| var isInSet = false; | |
| if ( | |
| ('contains' in superset && !superset.contains(item)) || | |
| (! 'contains' in superset && superset.indexOf(item) == -1) | |
| ) { | |
| return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python3 | |
| """ | |
| A script to reformat the existing vanilla-framework documentation | |
| (at present: https://github.com/ubuntudesign/vanilla-framework/tree/c3c4d20094da10dff2fe0bf7d52f4a56ecafeaf4/docs) | |
| to be built with documentation-builder. | |
| """ | |
| from glob import glob | |
| import frontmatter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env bash | |
| set -euo pipefail | |
| _usage() { | |
| echo " | |
| Usage: | |
| git-force-clone -b branch remote_url destination_path | |
| Example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env bash | |
| # Find templates | |
| ack 'href="(?!http|ftp)[^"]+/([\?\#"].*)?"' templates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| A script to be run in the `templates` directory of https://github.com/ubuntudesign/www.ubuntu.com | |
| It will find and remove template includes (_*.html) that aren't mentioned in any other templates. | |
| """ | |
| from os import path, remove | |
| import glob | |
| import re | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import frontmatter # https://pypi.org/project/python-frontmatter/ | |
| import markdown # https://pypi.org/project/markdown/ | |
| def parse_markdown(filepath): | |
| markdown_parser = markdown.Markdown(extensions=markdown_extensions) | |
| file_parts = frontmatter.load(filepath) | |
| return { | |
| 'html': markdown_parser.convert(file_parts.content), | |
| 'metadata': file_parts.metadata |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This will convert MultiMarkdown metadata at the top of markdown files | |
| # (http://fletcher.github.io/MultiMarkdown-5/metadata.html) | |
| # into the YAML Frontmatter format used by Jekyll and GitHub | |
| # (https://jekyllrb.com/docs/frontmatter/) | |
| # E.g.: | |
| # | |
| # # my-file.md | |
| # 1. Title: MAAS | Metal As A Service | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir docs-build | |
| pip3 install ubuntudesign.documentation-builder | |
| documentation-builder --destination-folder docs-build --source-repository https://github.com/CanonicalLtd/maas-docs.git | |
| cd docs-build/en | |
| xdg-open index.html # Look at the wonderful HTML documents |