p5doc
p5.js diagram within rustdoc
Example
This crate introduces a proc-macro #[p5doc::p5doc]
, which converts p5doc
inline code in Markdown into a HTML flagment with p5.js script:
#[cfg_attr(doc, p5doc::p5doc)]
/// Some function!
///
/// Before
///
/// ```p5doc:200x100
/// background(220);
/// ellipse(50,50,80,80);
/// ```
///
/// After
///
pub fn some() {}
This will be displayed as following:
See the document on GitHub Pages and its code.
License
© 2023 Toshiki Teramura (@termoshtt)
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.