Skip to content

Instantly share code, notes, and snippets.

@sogaiu
Last active March 1, 2024 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sogaiu/c73a6ad5e7af02ef53238de4709eaf74 to your computer and use it in GitHub Desktop.
Save sogaiu/c73a6ad5e7af02ef53238de4709eaf74 to your computer and use it in GitHub Desktop.
mendoza questions
  • how does :order work and can non-integers be used? based on mendoza/sitemap.janet, it seems like non-integers should be usable.

  • the watching seems a bit flaky -- i.e. making changes to .mdz files doesn't always appear to lead to regenerated content. at least with fswatch. inotifywait seemed to give better results. not sure if watchful would be better in some cases...eye works on windows and it seems to claim portability so that might be one path toward cross-platformness. though perhaps these remarks are more geared toward what janet-lang.org's repository might provide.

  • what do various files do?

    • mdz - cli with various subcommand (e.g. build, clean, server, watch, etc.)
    • mendoza/init.janet - connects other pieces and provides the init, clean, serve, build, and watch functions -- it's what mdz imports
    • mendoza/markup.janet - provides markup, a function that parses mendoza markup, evals, and returns doc tree
    • mendoza/render.janet - provides render, a function that renders to html (janet buffer)
    • mendoza/syntax.janet - provides span, a function that does syntax highlighting
    • mendoza/sitemap.janet - provides create, a function to generate a sitemap (janet table)
    • mendoza/static.janet - static asset management (add-file and copy-to-site functions)
    • mendoza/template.janet - provides template, a function that compiles a template string into a function
    • mendoza/template-env.janet - provides multiple functions for use in templates (dom-find, find-tag, find-section, static-file, relative-url)
    • mendoza/watch-cache.janet - cache, allows unloading of imported modules ('add and clean functions)
  • which pieces interact with the watch-cache?

    • mendoza/init.janet - clean
    • mendoza/markup.janet - add via add-loader
    • mendoza/static.janet - imports but doesn't appear to use
    • mendoza/syntax.janet - add via add-loader
    • mendoza/template.janet - add via template-loader
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment