From d8487e0c32846a7507a8d71c4b6a724d340250bd Mon Sep 17 00:00:00 2001 From: Cesar de la Vega Date: Thu, 1 Dec 2022 18:40:00 +0100 Subject: [PATCH 1/2] add embed code action --- .github/workflows/rdme-docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/rdme-docs.yml b/.github/workflows/rdme-docs.yml index 311860ef..450c8390 100644 --- a/.github/workflows/rdme-docs.yml +++ b/.github/workflows/rdme-docs.yml @@ -17,6 +17,9 @@ jobs: - name: Check out repo 📚 uses: actions/checkout@v3 + - name: Markdown Embed Code From File + uses: tokusumi/markdown-embed-code@v1.0.0 + - name: Run `docs` command 🚀 uses: readmeio/rdme@v8 with: From a5043c587d4ba069028152256d2ea53553e5a598 Mon Sep 17 00:00:00 2001 From: Cesar de la Vega Date: Thu, 1 Dec 2022 18:50:13 +0100 Subject: [PATCH 2/2] markdown embed code --- .github/workflows/rdme-docs.yml | 5 ++++- docs/test_snippets_sync_from_github.md | 6 +----- src/sample.swift | 6 ++++++ 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 src/sample.swift diff --git a/.github/workflows/rdme-docs.yml b/.github/workflows/rdme-docs.yml index 450c8390..0bc933c6 100644 --- a/.github/workflows/rdme-docs.yml +++ b/.github/workflows/rdme-docs.yml @@ -8,7 +8,7 @@ on: # This workflow will run every time you push code to the following branch: `main` # Check out GitHub's docs for more info on configuring this: # https://docs.github.com/actions/using-workflows/events-that-trigger-workflows - - main + - add-action-embed-code jobs: rdme-docs: @@ -19,6 +19,9 @@ jobs: - name: Markdown Embed Code From File uses: tokusumi/markdown-embed-code@v1.0.0 + with: + token: ${{ secrets.REPO_TOKEN }} + markdown: "docs/test_snippets_sync_from_github.md" - name: Run `docs` command 🚀 uses: readmeio/rdme@v8 diff --git a/docs/test_snippets_sync_from_github.md b/docs/test_snippets_sync_from_github.md index 6b57b73f..362eb445 100644 --- a/docs/test_snippets_sync_from_github.md +++ b/docs/test_snippets_sync_from_github.md @@ -9,12 +9,8 @@ hidden: true This was synced from GitHub actions when merging to main +```swift:../src/sample.py [4-6] -```swift -// some swift code here -class Foo { - let bar: Bar -} ``` ```kotlin // here goes the kotlin equivalent diff --git a/src/sample.swift b/src/sample.swift new file mode 100644 index 00000000..d44e5061 --- /dev/null +++ b/src/sample.swift @@ -0,0 +1,6 @@ +import Foundation + +// some swift code here +class Foo { + let bar: Bar +} \ No newline at end of file