Skip to content

Commit

Permalink
ci(workflow): include some tutorials to bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
ccamel committed Dec 18, 2023
1 parent 1663772 commit d37d1a2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/generate-doc-bundles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
sources:
- "docs/tutorials/**/*.md"
- "docs/nodes/**/*.md"
- name: "tutorial"
sources:
- "docs/tutorials/keplr-1.mdx"
- "docs/tutorials/cli-1.mdx"
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand All @@ -50,8 +54,8 @@ jobs:
import frontmatter
import justext
sources = json.loads(os.environ["SOURCES"])
output_filename = f"{os.environ["BUNDLE"]}-bundle.md"
sources = json.loads(os.environ['SOURCES'])
output_filename = f"{os.environ['BUNDLE']}-bundle.md"
print(f"⚡️ Generating {output_filename}")
with open(output_filename, "a") as output_file:
Expand All @@ -63,11 +67,11 @@ jobs:
print(f"🔁 merging {file_path}")
with open(file_path, "r") as input_file:
_, content = frontmatter.parse(input_file.read())
paragraphs = justext.justext(content, justext.get_stoplist("English"))
for paragraph in paragraphs:
if not paragraph.is_boilerplate:
output_file.write(paragraph.text)
output_file.write("\n")
output_file.write(paragraph.text)
output_file.write("\n")
output_file.write("\n")
print(f"📦 bundle {output_filename} generated")
Expand Down

0 comments on commit d37d1a2

Please sign in to comment.