doc_generator.rs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //! The docs generator takes in the `docs` folder and creates a neat, statically-renderer webpage.
  2. //! These docs are used to generate the public-facing doc content, showcasing Dioxus' abiltity to
  3. //! be used in custom static rendering pipelines.
  4. //!
  5. //! We use pulldown_cmark as the markdown parser, but instead of outputting html directly, we output
  6. //! VNodes to be used in conjuction with our custom templates.
  7. use dioxus::core::prelude::*;
  8. use pulldown_cmark::{Options, Parser};
  9. fn main() {
  10. let gen_dir = "../docs/";
  11. let site: FC<()> = |_| {
  12. html! {
  13. <html>
  14. <head>
  15. </head>
  16. <body>
  17. </body>
  18. </html>
  19. }
  20. };
  21. }
  22. static Homepage: FC<()> = |_| {
  23. html! {<div> </div>}
  24. };
  25. static DocPage: FC<()> = |_| {
  26. html! {<div> </div>}
  27. };
  28. // struct StaticSiteCfg {
  29. // gen_dir: &'static str,
  30. // homepage_template: fn() -> VNode,
  31. // page_template: fn(page: &'static str) -> VNode,
  32. // }
  33. // impl StaticSiteCfg {
  34. // fn render(self) -> anyhow::Result<VNode> {
  35. // let StaticSiteCfg { .. } = self;
  36. // // Set up options and parser. Strikethroughs are not part of the CommonMark standard
  37. // // and we therefore must enable it explicitly.
  38. // let mut options = Options::empty();
  39. // options.insert(Options::ENABLE_STRIKETHROUGH);
  40. // let parser = Parser::new_ext(markdown_input, options);
  41. // //
  42. // Ok(html! {<div> </div>})
  43. // }
  44. // }