├── .gitignore ├── CODEOWNERS ├── LICENSE.txt ├── README.md ├── build_for_docssite.sh └── gruntydocs.yml /.gitignore: -------------------------------------------------------------------------------- 1 | generated 2 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @josh-padnick @robmorgan @eak12913 2 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Gruntwork, Inc. All rights reserved. 2 | info@gruntwork.io 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # A Table of Contents for All Gruntwork Code 2 | 3 | **THIS REPO IS NOW DEPRECATED** 4 | 5 | Instead, please visit: 6 | 7 | - [Gruntwork Infrastructure as Code Library](https://gruntwork.io/infrastructure-as-code-library/) for a high-level overview of our Infrastructure as Code Library. 8 | - [Gruntwork Repo Browser](https://gruntwork.io/repos) to browse the repos in the Gruntwork Infrastructure as Code Library. 9 | 10 | For more information, see [How to use the Gruntwork Infrastructure as Code Library 11 | ](https://gruntwork.io/guides/foundations/how-to-use-gruntwork-infrastructure-as-code-library/). 12 | -------------------------------------------------------------------------------- /build_for_docssite.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script prepares the README for use in the docs site. The main thing it does is remove the title and replace it 4 | # with a frontmatter. 5 | # 6 | 7 | function create_artifact { 8 | local -r target_file="$1" 9 | local -r target_dir="$(dirname $target_file)" 10 | 11 | mkdir -p "$target_dir" 12 | cp ./README.md "$target_file" 13 | } 14 | 15 | function replace_header { 16 | local -r infile="$1" 17 | 18 | local -r frontmatter='---\ 19 | title: "Gruntwork IaC Library Catalog"\ 20 | date: __DATE__\ 21 | origin: "https:\/\/github.com\/gruntwork-io\/toc\/blob\/master\/README.md"\ 22 | tags: ["terraform"]\ 23 | ---' 24 | 25 | sed -i'' -e "1 s/^.*$/$frontmatter/g" "$infile" 26 | sed -i'' -e "s/__DATE__/$(get_last_commit_date)/g" "$infile" 27 | } 28 | 29 | function get_last_commit_date { 30 | # We use python to get the date of the last commit in the format YYYY-MM-DD. This works by getting the timestamp of 31 | # the last commit using `git log -1`, and then converting to the desired output format. 32 | python -c "import time; print(time.strftime('%Y-%m-%d', time.localtime($(git log -1 --format="%at"))))" 33 | } 34 | 35 | function clean_outfolder { 36 | local -r target_file="$1" 37 | local -r target_dir="$(dirname $target_file)" 38 | local -r abs_target_dir="$(realpath $target_dir)" 39 | 40 | # Remove anything that is not markdown 41 | find "$abs_target_dir" -type f -not -name "*.md" -delete 42 | } 43 | 44 | function build_for_docssite { 45 | local -r target_file="$1" 46 | 47 | create_artifact "$target_file" 48 | replace_header "$target_file" 49 | clean_outfolder "$target_file" 50 | } 51 | 52 | build_for_docssite ./generated/introduction/library-catalog/index.md 53 | -------------------------------------------------------------------------------- /gruntydocs.yml: -------------------------------------------------------------------------------- 1 | # What command to run to generate the docs. 2 | builder: ./build_for_docssite.sh 3 | # Where the target files live. These will be pulled in verbatim to /content in the docs repo. 4 | targets: 5 | - ./generated 6 | --------------------------------------------------------------------------------