Skip to content

Commit

Permalink
Add demo docs (#2246)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin authored Feb 3, 2023
1 parent 81e54d1 commit cd431d8
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
[submodule "content-modules/opentelemetry-specification"]
path = content-modules/opentelemetry-specification
url = https://github.com/open-telemetry/opentelemetry-specification.git
[submodule "content-modules/opentelemetry-demo"]
path = content-modules/opentelemetry-demo
url = https://github.com/open-telemetry/opentelemetry-demo
1 change: 1 addition & 0 deletions content-modules/opentelemetry-demo
Submodule opentelemetry-demo added at 4b8bb4
4 changes: 4 additions & 0 deletions hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ params:
github_repo: https://github.com/open-telemetry/opentelemetry.io
github_branch: main
gcs_engine_id: bde3d634eca9cd335
# The following mermaid config can be dropped after we update Docsy to v0.6.0 or later
mermaid: { enable: true }

## Social media image path, such as Open Graph's og:image
#
Expand Down Expand Up @@ -169,6 +171,8 @@ services:

module:
mounts:
- source: tmp/demo/docs
target: content/docs/demo
- source: tmp/specification
target: content/docs/reference/specification
- source: content/en
Expand Down
9 changes: 9 additions & 0 deletions scripts/adjust-spec-pages.pl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ ()
next;
}

# SPECIFICATION custom processing

s|\(https://github.com/open-telemetry/opentelemetry-specification\)|(/docs/reference/specification/)|;
s|\.\./semantic_conventions/README.md|$semConvRef| if $ARGV =~ /overview/;

Expand Down Expand Up @@ -105,5 +107,12 @@ ()
# Make website-local page references local:
s|https://opentelemetry.io/|/|g;

# DEMO DOCS custom processing

s|\./(services/\w+)\.md|$1/|g if $ARGV =~ /demo.docs._index/;
s/#demo-screenshots/./;
s|(/vendors/)|/ecosystem$1|g;
s|(\.\.\/)+(src/)|https://github.com/open-telemetry/opentelemetry-demo/blob/main/$2|g if $ARGV =~ /demo.docs/;

print;
}
22 changes: 21 additions & 1 deletion scripts/cp-spec-pages.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env bash

BASE_DIR=$(dirname $0)
DEST_BASE=tmp

SPEC=content-modules/opentelemetry-specification/specification
DEST=tmp/specification
DEST=$DEST_BASE/specification

rm -Rf $DEST
mkdir -p $DEST
Expand All @@ -16,3 +18,21 @@ FILES=$(find $DEST -name "*.md")
$BASE_DIR/adjust-spec-pages.pl $FILES

echo "Specification pages copied and processed."

# Demo docs

SRC=content-modules/opentelemetry-demo/docs
DEST=$DEST_BASE/demo/docs

rm -Rf $DEST
mkdir -p $DEST
cp -R $SRC/* $DEST/

find $DEST/ -name "README.md" -exec sh -c 'f="{}"; mv -- "$f" "${f%README.md}_index.md"' \;

# To exclude a file use, e.g.: -not -path '*/some-path/_index.md'
FILES=$(find $DEST -name "*.md")

$BASE_DIR/adjust-spec-pages.pl $FILES

echo "Demo doc pages copied and processed."

0 comments on commit cd431d8

Please sign in to comment.