-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
generate-docs.sh
executable file
·55 lines (41 loc) · 2.57 KB
/
generate-docs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
# Clean out folders to remove deprecated files.
rm -rf ./content/*
rm -rf ./docs/*
# Copy static content.
cp -a ./content-static/. ./content/
# Copy current docs from timber repository to this repository.
cp -a ../timber/docs/. ./content/
################################################################################
# Contributing guide.
################################################################################
mkdir -p ./content/v2/contributing
# Copy contributing guide.
cp -a ../timber/CONTRIBUTING.md ./content/v2/contributing/contributing.md
# Remove first line.
sed -i '' -e 1d ./content/v2/contributing/contributing.md
# Add front matter.
echo -e "---\ntitle: \"Contributing to Timber\"\nlayout: \"page\"\n---" | cat - ./content/v2/contributing/contributing.md > ./content/v2/contributing/contributing-tmp.md && mv ./content/v2/contributing/contributing-tmp.md ./content/v2/contributing/contributing.md
################################################################################
# Integration docs.
################################################################################
# mkdir -p ./content/integrations/woocommerce
# mkdir -p ./_data/integrations/woocommerce
# cp -a ../timber-integration-woocommerce/docs/ ./content/integrations/woocommerce/
################################################################################
# Build reference docs from PHP files.
################################################################################
# Main reference
./vendor/bin/teak generate:class-reference ../timber/src --output ./content/v2/reference --front_matter_style=YAML
# WooCommerce integration
# ./vendor/bin/teak generate:class-reference ../timber-integration-woocommerce/src --output ./content/integrations/woocommerce/reference --front_matter_style=YAML
################################################################################
# Build hook documentation.
################################################################################
# Main hooks
./vendor/bin/teak generate:hook-reference ../timber/src --output ./content/v2/hooks --hook_type="filter" --hook_prefix="timber" --front_matter_style="YAML" --class_reference_path="/docs/reference"
./vendor/bin/teak generate:hook-reference ../timber/src --output ./content/v2/hooks --hook_type="action" --hook_prefix="timber" --front_matter_style="YAML" --class_reference_path="/docs/reference"
################################################################################
# Sitemap
################################################################################
cp ./sitemap.xml.njk ./content/