Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hrbrmstr/ohq2quarto
Save an Observable HQ Notebook to a Quarto project
https://github.com/hrbrmstr/ohq2quarto
observable-notebook observablehq quarto rust
Last synced: 11 days ago
JSON representation
Save an Observable HQ Notebook to a Quarto project
- Host: GitHub
- URL: https://github.com/hrbrmstr/ohq2quarto
- Owner: hrbrmstr
- License: mit
- Created: 2022-08-19T19:11:18.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-07T10:41:20.000Z (about 2 years ago)
- Last Synced: 2024-10-12T21:24:03.253Z (27 days ago)
- Topics: observable-notebook, observablehq, quarto, rust
- Language: Rust
- Homepage:
- Size: 122 KB
- Stars: 27
- Watchers: 3
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-quarto - ohq2quarto - A Rust-based command line utility to turn any [ObservableHQ](https://observablehq.com/) notebook into a Quarto project. (Libraries/Packages/Scripts)
README
# ohq2quarto
Save an [Observable HQ](https://observablehq.com) Notebook to a [Quarto](https://quarto.org/) project.
Given an Observable Notebook reference (full URL or `@user/slug`) and an output directory, this utility will make a Quarto project directory, build `qmd` & `_quarto.yml` files and download all `FileAttachment`s.
## TODO
- [ ] [Handle Collections](https://github.com/hrbrmstr/ohq2quarto/issues/2)
- [ ] [Make this a lib+bin](https://github.com/hrbrmstr/ohq2quarto/issues/3)
- [ ] [Publish on crates.io](https://github.com/hrbrmstr/ohq2quarto/issues/4)## Getting `ohq2quarto`
The [releases](https://github.com/hrbrmstr/ohq2quarto/releases) section has pre-built binaries for Linux (x86\_64 & arm64), Windows and macOS (which is also a signed universal binary).
DIY folks can:
```shell
$ cargo install --git https://github.com/hrbrmstr/ohq2quarto --branch batman # install it (~/.cargo/bin/ohq2quarto)
```### Building/Using
```shell
$ cargo build # build it after cloning
```````shell
$ cargo run -- --ohq-ref @hrbrmstr/just-one-more-thing --output-dir ./examples --verbose # run it after cloning
Finished dev [unoptimized + debuginfo] target(s) in 0.08s
Running `target/debug/ohq2quarto --ohq-ref '@hrbrmstr/just-one-more-thing' --output-dir ./examples --verbose`
Title: Just One More Thing
Slug: just-one-more-thing
Author(s): boB Rudis
Copyright: Copyright 2022 boB Rudis
License: "mit"
Observable: https://observablehq.com/@hrbrmstr/just-one-more-thing$ tree examples
├── _quarto.yml
├── columbo_data.csv
└── just-one-more-thing.qmd$ head -16 examples/just-one-more-thing.qmd
---
title: 'Just One More Thing'
author: 'boB Rudis'
format: html
echo: false
observable: 'https://observablehq.com/@hrbrmstr/just-one-more-thing'
---```{ojs}
md`# Just One More Thing`
``````{ojs}
md`This week, Chris Holmes tweeted something super dangerous:`
```
```````shell
$ cargo run -- --help
Finished dev [unoptimized + debuginfo] target(s) in 0.08s
Running `target/debug/ohq2quarto --help`
ohq2quarto 0.1.0
boB Rudis (@hrbrmstr)
Given an Observable Notebook reference, create a Quarto project with all FileAttachmentsUSAGE:
ohq2quarto [OPTIONS] --ohq-ref --output-dirOPTIONS:
--echo turn cell echo on in the Quarto document (default is to not
echo)
--filename optional filename for the main Quarto document (will be taken
from the slug in `ohq_ref`; e.g. "just-the-facts" from the
example param)
-h, --help Print help information
--ohq-ref an Observable notebook short reference
("@hrbrmstr/just-the-facts") or a full URL
--output-dir directory to place Quarto project and files (will be created if
it does not exist)
-V, --version Print version information
--verbose Print Notebook metadata during processing
```