This repository contains scripts and examples demonstrating how to import static files and documentation from various sources into your project using bun
and custom scripts.
Run the examples using the provided shell script:
./run-examples.sh
Make sure you have bun installed before running the script.
Import a subset of Gutenberg documentation focused on data basics:
bun index.js \
git https://github.com/WordPress/gutenberg.git \
--branch=trunk \
--path-in-repo=docs/how-to-guides/data-basics/ \
--media-url=https://developer.wordpress.org/files/ \
--media-url=https://raw.githubusercontent.com/WordPress/gutenberg/HEAD/docs/ \
--source-site-url=https://developer.wordpress.org/block-editor/how-to-guides/data-basics/ \
--additional-site-urls=https://developer.wordpress.org/docs/how-to-guides/data-basics/
Import the complete Gutenberg documentation:
bun index.js \
git https://github.com/WordPress/gutenberg.git \
--branch=trunk \
--path-in-repo=docs/ \
--media-url=https://developer.wordpress.org/files/ \
--media-url=https://raw.githubusercontent.com/WordPress/gutenberg/HEAD/docs/ \
--source-site-url=https://developer.wordpress.org/block-editor/ \
--additional-site-urls=https://developer.wordpress.org/docs/
Import content from Adam's blog using a crawler:
bun examples/create-wp-site/index.js crawler https://adamadam.blog
Commentary:
- Content import well, including media files and internal links:
- Known issues:
- HTML to Block markup conversion needs improvement.
- Header and footer are included in each page.
Import accessibility testing content from a WordPress XML export:
bun index.js wxr https://raw.githubusercontent.com/wpaccessibility/a11y-theme-unit-test/master/a11y-theme-unit-test-data.xml
Import standard WordPress theme unit test data:
bun index.js wxr https://raw.githubusercontent.com/WordPress/theme-test-data/master/themeunittestdata.wordpress.xml
Import content from an EPUB file:
bun index.js epub https://github.com/IDPF/epub3-samples/releases/download/20230704/childrens-literature.epub
Import Gutenberg documentation from a local repository checkout:
bun index.js path ../../../gutenberg/docs/how-to-guides/
Import documentation from the WordPress Playground project:
bun index.js \
git https://github.com/WordPress/wordpress-playground.git \
--branch=trunk \
--path-in-repo=packages/docs/site/docs/blueprints/ \
--media-url=https://wordpress.github.io/wordpress-playground/ \
--source-site-url=https://wordpress.github.io/
Import Bootstrap 5.3 documentation:
bun index.js \
git https://github.com/twbs/bootstrap.git \
--branch=gh-pages \
--path-in-repo=docs/5.3/ \
--media-url=https://getbootstrap.com/docs/5.3/ \
--source-site-url=https://getbootstrap.com/docs/5.3/ \
--additional-site-urls=https://getbootstrap.com/docs/
Import Laravel documentation:
bun index.js \
git https://github.com/laravel/docs.git \
--path-in-repo=/ \
--branch=12.x \
--source-site-url=https://laravel.com/docs/
Import internal documentation from the CPython repository:
bun index.js \
git https://github.com/python/cpython.git \
--branch=main \
--path-in-repo=InternalDocs/ \
--source-site-url=https://raw.githubusercontent.com/python/cpython/refs/heads/main/InternalDocs/
Import content from the Fullstack GraphQL book repository:
bun index.js \
git https://github.com/GraphQLCollege/fullstack-graphql.git \
--branch=master \
--path-in-repo=manuscript/ \
--source-site-url=https://raw.githubusercontent.com/GraphQLCollege/fullstack-graphql/refs/heads/master/manuscript/
Import content from the CPP WASM book repository:
bun index.js \
git https://github.com/3dgen/cppwasm-book.git \
--branch=master \
--path-in-repo=en/ \
--source-site-url=https://raw.githubusercontent.com/3dgen/cppwasm-book/refs/heads/master/en/
This project is open-source and available under the GPLv2.1 License.