Skip to main content

Examples of code includes for Dev.to

· One min read

My GitHub site is built with Docusaurus 2 and usually shows code snippets. Since I build to my GitHub site but want to repost to Dev.to and other platforms from RSS feeds, I need the code snippets to work with the minimal amount of manual intervention and corrections after I import the blog post into Dev.to.

If the code snippet is inside the blog post as text, the Dev.to rss feed import mangles the code snippet syntax, which requires manual fix up which is time-consuming and a step I have to remember.

Using @saucelabs/theme-github-codeblock

I found the saucelabs code block on the unofficial Docusaurus features.

JavaScript reference: js

client-end/src/index.js
loading...

Json reference: json

package.json
loading...

Bash reference: bash

scripts/addition.sh
loading...

Text reference: text

notes/Learning-DataLake/Neal.txt
loading...

Rust: reference: rs

src/main.rs
loading...

Yaml

examples/mono-app-workflow.yml
loading...